getId() == $selected) { echo ''; } else { echo ''; } } $options = ob_get_clean(); return ''; } function delivery_countries_select_tag($name, $selected = null) { $basket = sfContext::getInstance()->getUser()->getBasket(); $delivery = stDeliveryFrontend::getInstance($basket); $delivery_countries = $delivery->getDeliveryCountries(true); $options = ''; ob_start(); foreach ($delivery_countries as $country) { if ($country->getId() == $selected) { echo ''; } else { echo ''; } } $options = ob_get_clean(); return ''; } function delivery_parcels_manager_tag($name, ?array $parcels, array $options) { $id = get_id_from_name($name); if (null === $parcels) { $parcels = []; } foreach ($parcels as $index => $value) { $no = $index + 1; $parcels[$index]['reference'] = ' #' . $no; } if (!isset($options['fields'])) { throw new sfException('Opcja "fields" jest wymagana'); } $defaultFields = array( 'reference' => array( 'label' => __('Paczka'), 'type' => 'plain', ), ); $fields = $defaultFields + $options['fields']; unset($options['fields']); $content = st_admin_table_record_manager($name, $fields, $parcels, $options); $content .= " "; return $content; }