예제 #1
0
파일: EnumHelper.php 프로젝트: rayku/rayku
/**
* Determines the possible index/value pairs for the given table/field from their
* Peer objects. Sets the selected index to the value in $selected. Returns the
* HTML for a <select> field accordingly.
*/
function enum_values_select_tag($table, $field, $selected = null)
{
    //Load the options
    $options = call_user_func(array($table . 'Peer', 'get' . $field . 's'));
    //Return the select area
    return select_tag(strtolower($table) . '[' . strtolower($field) . ']', options_for_select($options, $selected), array('style' => 'width: 125px'));
}
/**
 * Override of the standard options_for_select, that allows the usage of the 'include_zero_custom' option
 * to insert a custom field returning the 0 value on top of the options
 *
 * @return String
 * @author Guglielmo Celata
 **/
function adv_options_for_select($options = array(), $selected = '', $html_options = array())
{
    $html_options = _parse_attributes($html_options);
    if (is_array($selected)) {
        $selected = array_map('strval', array_values($selected));
    }
    $html = '';
    if ($value = _get_option($html_options, 'include_zero_custom')) {
        $html .= content_tag('option', $value, array('value' => '0')) . "\n";
    } else {
        if ($value = _get_option($html_options, 'include_custom')) {
            $html .= content_tag('option', $value, array('value' => '')) . "\n";
        } else {
            if (_get_option($html_options, 'include_blank')) {
                $html .= content_tag('option', '', array('value' => '')) . "\n";
            }
        }
    }
    foreach ($options as $key => $value) {
        if (is_array($value)) {
            $html .= content_tag('optgroup', options_for_select($value, $selected, $html_options), array('label' => $key)) . "\n";
        } else {
            $option_options = array('value' => $key);
            if (is_array($selected) && in_array(strval($key), $selected, true) || strval($key) == strval($selected)) {
                $option_options['selected'] = 'selected';
            }
            $html .= content_tag('option', $value, $option_options) . "\n";
        }
    }
    return $html;
}
function object_enum_tag($object, $method, $options)
{
    $enumValues = _get_option($options, 'enumValues', array());
    $currentValue = _get_object_value($object, $method);
    $enumValues = array_combine($enumValues, $enumValues);
    return select_tag(_convert_method_to_name($method, $options), options_for_select($enumValues, $currentValue), $options);
}
function options_from_collection_for_select($collection, $valueProp, $textProp, $selected = null)
{
    $set = array();
    foreach ($collection as $entity) {
        $set[$entity->{$textProp}] = $entity->{$valueProp};
    }
    return options_for_select($set, $selected);
}
 public function testOptionsForSelectWithAssociativeArray()
 {
     $this->assertDomEqual(options_for_select(array('Margharita' => '7€', 'Calzone' => '9€', 'Napolitaine' => '8€')), '<option value="7€">Margharita</option>
         <option value="9€">Calzone</option>
         <option value="8€">Napolitaine</option>');
     $this->assertDomEqual(options_for_select(array('Margharita' => '7€', 'Calzone' => '9€', 'Napolitaine' => '8€'), '9€'), '<option value="7€">Margharita</option>
         <option value="9€" selected="selected">Calzone</option>
         <option value="8€">Napolitaine</option>');
     $this->assertDomEqual(options_for_select(array('Margharita' => '7€', 'Calzone' => '9€', 'Napolitaine' => '8€'), array('9€', '8€')), '<option value="7€">Margharita</option>
         <option value="9€" selected="selected">Calzone</option>
         <option value="8€" selected="selected">Napolitaine</option>');
 }
예제 #6
0
파일: form.php 프로젝트: jaz303/php-helpers
function select_box($name, $choices, $selected = null, $options = array())
{
    $options += array('keys' => true, 'multiple' => false, 'groups' => false);
    $options['name'] = $name;
    $ofs_opts = array('groups' => $options['groups'], 'keys' => $options['keys']);
    unset($options['groups']);
    unset($options['keys']);
    if ($options['multiple']) {
        $selected = (array) $selected;
    }
    return tag('select', options_for_select($choices, $selected, $ofs_opts), $options);
}
예제 #7
0
function sf_simple_cms_slot($page, $slot, $default_text = null, $default_type = 'Text')
{
    $context = sfContext::getInstance();
    $request = $context->getRequest();
    $culture = $request->getAttribute('culture');
    $slot_object = $page->getSlot($slot, constant(sfConfig::get('app_sfSimpleCMS_escaping_strategy', 'ESC_RAW')));
    if (!$slot_object) {
        $slot_object = new sfSimpleCMSSlot();
        $slot_object->setType($default_type);
        $slot_object->setCulture($culture);
    }
    $slot_value = $slot_object->getValue();
    $slot_type_name = $slot_object->getType();
    $slot_type_class = 'sfSimpleCMSSlot' . $slot_type_name;
    $slot_type = new $slot_type_class();
    if ($request->getParameter('edit') == 'true' && !$request->getParameter('preview')) {
        echo '<div class="editable_slot" title="' . __('Double-click to edit') . '" id="slot_' . $slot . '" onDblClick="Element.show(\'edit_' . $slot . '\');Element.hide(\'slot_' . $slot . '\');">';
        if ($slot_value) {
            // Get slot value from the slot type object
            echo $slot_type->getSlotValue($slot_object);
        } else {
            // default text
            echo $default_text ? $default_text : sfConfig::get('app_sfSimpleCMS_default_text', __('[add text here]'));
        }
        echo '</div>';
        echo form_remote_tag(array('url' => 'sfSimpleCMS/updateSlot', 'script' => 'true', 'update' => 'slot_' . $slot, 'success' => 'Element.show(\'slot_' . $slot . '\');
                        Element.hide(\'edit_' . $slot . '\');
                       ' . visual_effect('highlight', 'slot_' . $slot)), array('class' => 'edit_slot', 'id' => 'edit_' . $slot, 'style' => 'display:none'));
        echo input_hidden_tag('slug', $page->getSlug(), 'id=edit_path' . $slot);
        echo input_hidden_tag('slot', $slot);
        if (sfConfig::get('app_sfSimpleCMS_use_l10n', false)) {
            echo input_hidden_tag('sf_culture', $slot_object->getCulture());
        }
        // Get slot editor from the slot type object
        echo $slot_type->getSlotEditor($slot_object);
        echo label_for('slot_type', __('Type: '));
        echo select_tag('slot_type', options_for_select(sfConfig::get('app_sfSimpleCMS_slot_types', array('Text' => __('Simple Text'), 'RichText' => __('Rich text'), 'Php' => __('PHP code'), 'Image' => __('Image'), 'Modular' => __('List of partials/components'))), $slot_type_name));
        if ($rich = sfConfig::get('app_sfSimpleCMS_rich_editing', false)) {
            // activate rich text if global rich_editing is true and is the current slot is RichText
            $rich = $slot_type_name == 'RichText';
        }
        echo submit_tag('update', array('onclick' => $rich ? 'tinymceDeactivate()' . ';submitForm(\'edit_' . $slot . '\'); return false' : '', 'class' => 'submit_tag'));
        echo button_to_function('cancel', 'Element.hide(\'edit_' . $slot . '\');Element.show(\'slot_' . $slot . '\');', 'class=submit_tag');
        echo '</form>';
    } else {
        echo $slot_type->getSlotValue($slot_object);
    }
}
예제 #8
0
파일: form.php 프로젝트: boochtek/php-base
function select_date ( $year_name, $month_name, $day_name, $min_year, $max_year, $selected_date = NULL )
{
	$selected = explode('-', $selected_date);

	$years = array_merge(array('Select Year'), range($min_year, $max_year));
	$months = indexed_array(array('Select Month', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'));
	$days = array_merge(array('Select Day'), range(1, 31));

	$year_options = options_for_select($years, $selected[0]);
	$month_options = options_for_select($months, $selected[1]);
	$day_options = options_for_select($days, $selected[2]);

	return "<select id='$year_name' name='$year_name'>$year_options</select>"
	     . "<select id='$month_name' name='$month_name'>$month_options</select>"
	     . "<select id='$day_name' name='$day_name'>$day_options</select>";
}
/**
 * Returns a <selectize> tag populated with all the languages in the world (or almost).
 *
 * The select_language_tag builds off the traditional select_tag function, and is conveniently populated with
 * all the languages in the world (sorted alphabetically). Each option in the list has a two or three character
 * language/culture code for its value and the language's name as its display title.  The country data is
 * retrieved via the sfCultureInfo class, which stores a wide variety of i18n and i10n settings for various
 * countries and cultures throughout the world. Here's an example of an <option> tag generated by the select_country_tag:
 *
 * <samp>
 *  <option value="en">English</option>
 * </samp>
 *
 * <b>Examples:</b>
 * <code>
 *  echo select_language_tag('language', 'de');
 * </code>
 *
 * @param  string $name     field name
 * @param  string $selected selected field values (two or three-character language/culture code)
 * @param  array  $options  additional HTML compliant <select> tag parameters
 *
 * @return string <selectize> tag populated with all the languages in the world.
 * @see select_tag, options_for_select, sfCultureInfo
 */
function object_multiselect_language_tag($name, $selected = null, $options = array())
{
    $c = new sfCultureInfo(sfContext::getInstance()->getUser()->getCulture());
    $languages = $c->getLanguages();
    if ($language_option = _get_option($options, 'languages')) {
        foreach ($languages as $key => $value) {
            if (!in_array($key, $language_option)) {
                unset($languages[$key]);
            }
        }
    }
    asort($languages);
    $option_tags = options_for_select($languages, $selected, $options);
    unset($options['include_blank'], $options['include_custom']);
    return select_tag($name, $option_tags, $options);
}
예제 #10
0
/**
 * Returns a <select> tag populated with all the states in the country.
 *
 * The select_state_tag builds off the traditional select_tag function, and is conveniently populated with 
 * all the states in the default country (sorted alphabetically). Each option in the list has a state code (two-character 
 * for US and Canada) for its value and the state's name as its display title.
 * The options[] array may also contain the following non-html options:
 *   A states[] array containing a list of states to be added in the form array
 * Here's an example of an <option> tag generated by the select_state_tag:
 *
 * <samp>
 *  <option value="NY">New York</option>
 * </samp>
 *
 * <b>Examples:</b>
 * <code>
 *  echo select_state_tag('state', 'NY');
 * </code>
 *
 * @param  string field name 
 * @param  string selected field value (two-character state code)
 * @param  string country (two-character country code)
 * @param  array  additional HTML compliant <select> tag parameters. 
 *                May also include a 'states[]' array containing a list of states to be removed from the list
 *                May also include a 'country' value that will select the states from a country code
 * @return string <select> tag populated with all the states in the default or selected country.
 * @see select_tag, options_for_select
 */
function select_state_tag($name, $value, $options = array())
{
    if (isset($options['country'])) {
        $country = $options['country'];
        unset($options['country']);
    }
    $states = getStates($country);
    if (isset($options['states']) && is_array($options['states'])) {
        foreach ($options['states'] as $key) {
            if (isset($states[$key])) {
                unset($states[$key]);
            }
        }
        unset($options['states']);
    }
    if (isset($options['sort'])) {
        asort($states);
        unset($options['sort']);
    }
    $option_tags = options_for_select($states, $value);
    return select_tag($name, $option_tags, $options);
}
예제 #11
0
파일: form.php 프로젝트: pilaf/yarr
function date_select($name, $value = null, $options = array())
{
    $months = isset($options['months']) ? $options['months'] : array('January' => 1, 'February' => 2, 'March' => 3, 'April' => 4, 'May' => 5, 'June' => 6, 'July' => 7, 'August' => 8, 'September' => 9, 'October' => 10, 'November' => 11, 'December' => 12);
    if (!isset($options['start_year'])) {
        if (isset($value)) {
            $start_year = (int) date('Y', $value) - 10;
        } else {
            $start_year = (int) date('Y') - 10;
        }
    } else {
        $start_year = $options['start_year'];
    }
    $end_year = isset($options['end_year']) ? $options['end_year'] : (int) date('Y');
    $html = '<select name="' . $name . '[m]">';
    $html .= options_for_select($months, (int) (isset($value) ? date('m', $value) : date('m')));
    $html .= '</select> ';
    $html .= '<select name="' . $name . '[d]">';
    $html .= options_for_select(range(1, 31), (int) (isset($value) ? date('d', $value) : date('d')));
    $html .= '</select> ';
    $html .= '<select name="' . $name . '[y]">';
    $html .= options_for_select(range($end_year, $start_year), (int) (isset($value) ? date('Y', $value) : date('Y')));
    $html .= '</select>';
    return $html;
}
예제 #12
0
                <label for="ff_city">City</label>
                <input type="text" class="text" value="<?php 
echo $city;
?>
" id="ff_city" name="city"/>
                <br clear="left"/>
                <label for="ff_state">State</label>
                <input type="text" class="text" value="<?php 
echo $state;
?>
" id="ff_state" name="state"/>
              </div>
              <div>
                <label for="ff_country">Country</label>
                <?php 
echo select_tag('country', options_for_select($countries, $country, array('include_custom' => '- any -')), array('id' => 'ff_country', 'class' => 'text narrow'));
?>
                <br clear="left"/>
                <label for="ff_county">County</label>
                <input type="text" class="text" value="<?php 
echo $county;
?>
" id="ff_county" name="county"/>
              </div>
              <div>
                <div class="location-as">
                  <ul>
                    <li>
                      <input type="checkbox" id="ff_deceased" value="1" <?php 
if ($deceased) {
    echo 'checked="checked"';
예제 #13
0
 /**
  *  Test options_for_select() function
  */
 public function testOptions_for_select_function()
 {
     //  Test choices with none selected
     $this->assertEquals('<option value="0">foo</option>' . "\n" . '<option value="1">bar</option>', options_for_select(array('foo', 'bar')));
     //  Test choices with one selected by key
     $this->assertEquals('<option value="M">mumble</option>' . "\n" . '<option value="G" selected="selected">grumble</option>', options_for_select(array('M' => 'mumble', 'G' => 'grumble'), 'G'));
 }
예제 #14
0
    echo form_error('sf_asset{type}', array('class' => 'form-error-msg'));
    ?>
      <?php 
}
?>
      <?php 
foreach (sfConfig::get('app_sfAssetsLibrary_types', array('image', 'txt', 'archive', 'pdf', 'xls', 'doc', 'ppt')) as $type) {
    ?>
        <?php 
    $options[$type] = $type;
    ?>
      <?php 
}
?>
      <?php 
echo select_tag('sf_asset[type]', options_for_select($options, $sf_asset->getType()));
?>
    </div>
  </div>

  <?php 
include_partial('sfAsset/edit_form_custom', array('sf_asset' => $sf_asset));
?>

</fieldset>

<?php 
include_partial('edit_actions', array('sf_asset' => $sf_asset));
?>

</form>
예제 #15
0
?>
</td>
					<td class='filter'><?php 
echo object_select_tag(isset($filters['CURRICULUM_ID']) ? $filters['CURRICULUM_ID'] : null, null, array('include_blank' => true, 'related_class' => 'Curriculum', 'text_method' => '__toString', 'control_name' => 'filters[CURRICULUM_ID]', 'peer_method' => 'doSelectFiltered'));
?>
</td>
					<td class='filter'><?php 
echo object_select_tag(isset($filters['ACADEMIC_CALENDAR_ID']) ? $filters['ACADEMIC_CALENDAR_ID'] : null, null, array('include_blank' => true, 'related_class' => 'AcademicCalendar', 'text_method' => '__toString', 'control_name' => 'filters[ACADEMIC_CALENDAR_ID]', 'peer_method' => 'doSelectFiltered'));
?>
</td>
					<td class='filter'><?php 
echo object_select_tag(isset($filters['CLASS_GROUP_ID']) ? $filters['CLASS_GROUP_ID'] : null, null, array('include_blank' => true, 'related_class' => 'ClassGroup', 'peer_method' => 'doSelectOrdered', 'control_name' => 'filters[CLASS_GROUP_ID]'));
?>
					</td>
					<td class='filter'><?php 
echo select_tag('filters[STATUS]', options_for_select(array(Student::STATUS_ACTIVE => __('_STUDENT_STATUS_ACTIVE_'), Student::STATUS_INACTIVE => __('_STUDENT_STATUS_INACTIVE_'), Student::STATUS_OVERDUE => __('_STUDENT_STATUS_OVERDUE_'), Student::STATUS_FINAL => __('_STUDENT_STATUS_FINAL_'), Student::STATUS_GRADUATE => __('_STUDENT_STATUS_GRADUATE_')), isset($filters['STATUS']) ? $filters['STATUS'] : null, array('include_blank' => true)));
?>
</td>
				</tr>
			</thead>
			<tbody>
			<?php 
if ($pager->getNbResults() < 1) {
    ?>
				<tr class="list">
					<td colspan="100">
					<div class="no_record"><?php 
    echo __('No record found');
    ?>
</div>
					</td>
예제 #16
0
echo form_tag('#', array("id" => "disegni-decreti-filter", "class" => $active ? 'active' : ''));
?>
  <fieldset class="labels">
    <label for="filter_article">articolo:</label>
    <label for="filter_site">sede:</label>
    <label for="filter_presenter">presentatore:</label>
    <label for="filter_status">status:</label>
  </fieldset>
  <p>filtra per</p>
  <fieldset>
    <?php 
echo select_tag('filter_article', options_for_select($available_articles, $selected_article));
?>
                          
    <?php 
echo select_tag('filter_site', options_for_select($available_sites, $selected_site));
?>

    <?php 
echo select_tag('filter_presenter', options_for_select($available_presenters, $selected_presenter));
?>

    <?php 
echo select_tag('filter_status', options_for_select($available_statuses, $selected_status));
?>

    <?php 
echo submit_image_tag('btn-applica.png', array('id' => 'disegni-decreti-filter-apply', 'alt' => 'applica', 'style' => 'display: none;', 'name' => 'disegni-decreti-filter-apply'));
?>
  </fieldset>
</form>
예제 #17
0
            	<?php 
echo image_tag('indicator.gif');
?>
 Assigning users...
            </p>
          </div>
          
          <div id="task-status-holder">
          <?php 
echo form_remote_tag(array('update' => 'task-' . $task->getUuid() . '-holder', 'url' => 'project/ajaxSetTaskStatus', 'loading' => "Element.show('indicator-" . $task->getUuid() . "-status')", 'complete' => "Element.hide('indicator-" . $task->getUuid() . "-status');" . visual_effect('highlight', 'task-' . $task->getUuid())));
?>
          		<?php 
echo input_hidden_tag('task', $task->getUuid(), array());
?>
          		<?php 
echo select_tag('task-status', options_for_select(array('2' => 'Pending/In Planning', '1' => 'In Progress', '0' => 'Complete'), $task->getStatus()));
?>
          		<?php 
echo submit_tag('go', array());
?>
          	</form>
          </div>
          <div style="height:20px">
            <p id="indicator-<?php 
echo $task->getUuid();
?>
-status" style="display:none">
            	<?php 
echo image_tag('indicator.gif');
?>
 Settings task status...
예제 #18
0
/**
 * Returns a <select> tag populated with all the timezones in the world.
 *
 * The select_timezone_tag builds off the traditional select_tag function, and is conveniently populated with 
 * all the timezones in the world (sorted alphabetically). Each option in the list has a unique timezone identifier 
 * for its value and the timezone's locale as its display title.  The timezone data is retrieved via the sfCultureInfo
 * class, which stores a wide variety of i18n and i10n settings for various countries and cultures throughout the world.
 * Here's an example of an <option> tag generated by the select_timezone_tag:
 *
 * <b>Options:</b>
 * - display - 
 *     identifer         - Display the PHP timezone identifier (e.g. America/Denver)
 *     timezone          - Display the full timezone name (e.g. Mountain Standard Time)
 *     timezone_abbr     - Display the timezone abbreviation (e.g. MST)
 *     timzone_dst       - Display the full timezone name with daylight savings time (e.g. Mountain Daylight Time)
 *     timezone_dst_abbr - Display the timezone abbreviation with daylight savings time (e.g. MDT)
 *     city              - Display the city/region that relates to the timezone (e.g. Denver)
 * 
 * <samp>
 *  <option value="America/Denver">America/Denver</option>
 * </samp>
 *
 * <b>Examples:</b>
 * <code>
 *  echo select_timezone_tag('timezone', 'America/Denver');
 * </code>
 *
 * @param  string $name      field name 
 * @param  string $selected  selected field value (timezone identifier)
 * @param  array  $options   additional HTML compliant <select> tag parameters
 *
 * @return string <select> tag populated with all the timezones in the world.
 * @see select_tag, options_for_select, sfCultureInfo
 */
function select_timezone_tag($name, $selected = null, $options = array())
{
    static $display_keys = array('identifier' => 0, 'timezone' => 1, 'timezone_abbr' => 2, 'timezone_dst' => 3, 'timezone_dst_abbr' => 4, 'city' => 5);
    $display = _get_option($options, 'display', 'identifier');
    $display_key = isset($display_keys[$display]) ? $display_keys[$display] : 0;
    $c = sfCultureInfo::getInstance(sfContext::getInstance()->getUser()->getCulture());
    $timezone_groups = $c->getTimeZones();
    $timezones = array();
    foreach ($timezone_groups as $tz_group) {
        $array_key = isset($tz_group[0]) ? $tz_group[0] : null;
        if (isset($tz_group[$display_key]) and !empty($tz_group[$display_key])) {
            $timezones[$array_key] = $tz_group[$display_key];
        }
    }
    if ($timezone_option = _get_option($options, 'timezones')) {
        $timezones = array_intersect_key($timezones, array_flip((array) $timezone_option));
    }
    // Remove duplicate values
    $timezones = array_unique($timezones);
    asort($timezones);
    $option_tags = options_for_select($timezones, $selected);
    return select_tag($name, $option_tags, $options);
}
예제 #19
0
<fieldset >
  <h2><?php 
echo __('filtros');
?>
</h2>
  
  <div class="form-row">
  <?php 
echo label_for("filters[es_evento]", __('tipo') . ":");
?>
    <div class="content">
    <?php 
$opciones = array('0' => __('tareas'), '1' => __('eventos'));
$tipo_tarea = isset($filters['es_evento']) ? $filters['es_evento'] : null;
$value = select_tag('filters[es_evento]', options_for_select($opciones, $tipo_tarea, array('include_custom' => __('tareas y eventos'))));
echo $value ? $value : "&nbsp";
?>
    </div>
  </div>

  
  <div class="form-row">
    <?php 
echo label_for("filters[estado_tarea]", __('estado tarea') . ":");
?>
    <div class="content">
    <?php 
$opciones = TareaPeer::getAllEstadosTareas();
$html = "";
$html .= "<ul class=\"sf_admin_checklist\">\n";
예제 #20
0
include '../../lib/supplier.class.php';
include '../../lib/lc.class.php';
include '../../lib/lot.class.php';
//// Retrive Stock Group Name
$objStockGroupInfo = new Stock();
$stock = new Stock();
$StockGrpInfo = $objStockGroupInfo->retriveStockGroupUnderInfo();
$StockGrpInfo_options = options_for_select($StockGrpInfo, 'stock_group_name', 'stock_group_name', true);
//// Retrive Stock Unit Name
$unitName = options_for_select($stock->retriveStockUnit(), 'stock_item_unit_name', 'stock_item_unit_name', true);
$Supplier = new Supplier();
$outputSupplierItem = options_for_select($Supplier->retriveSupplierInfo(), 'sup_name', 'sup_name', true);
$LC = new LC();
$outputLC = options_for_select($LC->retriveLcInfo(), 'lc_name', 'lc_name', true);
$Lot = new Lot();
$outputLot = options_for_select($Lot->retriveLotInfo(), 'lot_name', 'lot_name', true);
$StockLocationInfo = $stock->retriveLocation();
$rowStockLocation = count($StockLocationInfo);
/////////////////////////////////
@session_start();
$user_level = $_SESSION[user_level];
?>

<div id="test">
<form  id="CreateStockItem" name="CreateStockItem" method="post"   action="includes/model/raw_item_actions.php"><table width="100%" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td>Name</td>
    <td><input name="stkName" type="text" class="inventori_txtfield" id="stkName"></td>
  </tr>
  <tr>
    <td>Code</td>
예제 #21
0
">
      <input type="hidden" name="filter" value="1"/>
      <div class="missions-available-filter">
        <div class="bg">
          <div class="characteristic_clean">
            <div class="holder">
              <div>
                <label for="ff_miss_ext_id">Mission External ID</label>
                <input type="text" class="text" value="<?php 
echo $miss_ext_id;
?>
" id="ff_miss_ext_id" name="miss_ext_id"/>
                <br clear="left"/>
                <label for="ff_mission_type">Mission Type</label>
                <?php 
echo select_tag('miss_type', options_for_select($types, $miss_type, array('include_custom' => '- any -')), array('id' => 'ff_mission_type', 'class' => 'text'));
?>
              </div>
               <div>
                <label for="ff_miss_date1">Start Date</label>
                <?php 
echo $date_widget->render('miss_date1', $miss_date1);
?>
                <br clear="left"/>
                <label for="ff_miss_date2">End Date</label>
                <?php 
echo $date_widget->render('miss_date2', $miss_date2);
?>
              </div>
               <div>
                <label for="ff_pass_fname">Passenger First Name</label>
예제 #22
0
?>
</span>

<div id="fake_div">

<div id="outing_wizard">

<hr />
<h4><?php 
echo __('Step 1: choose a summit');
?>
</h4>
<div>
<?php 
echo global_form_errors_tag();
echo select_tag('wizard_type', options_for_select(array('summits' => __('Summit:'), 'sites' => __('Site:')), 0));
echo input_tag('summits_name', '', array('size' => '35'));
echo input_tag('sites_name', '', array('size' => '35', 'style' => 'display:none'));
echo javascript_queue("var indicator = \$('#indicator');\n\$('#wizard_type').change(function() {\n  \$('#summits_name, #sites_name').val('').toggle();\n  \$('#wizard_no_route, #wizard_route, #summit_link, #last_ok').hide();\n\n  var summit = \$(this).val() == 'summits';\n  \$('#wizard_routes_hints').toggle(summit);\n  \$('#wizard_sites_hints').toggle(!summit);\n  \n});\n\n\$('#summits_name').c2cAutocomplete({\n  url: '" . url_for('summits/autocomplete') . "',\n  minChars: " . sfConfig::get('app_autocomplete_min_chars') . "\n}).on('itemselect', function(e, item) {\n  indicator.show();\n  \$('#summit_id').val(item.id);\n  \$('#wizard_no_route, .wizard_hints').hide();\n  \$.get('" . url_for('summits/getroutes') . "',\n             'summit_id=' + \$('#summit_id').val() + '&div_name=routes')\n    .always(function() { indicator.hide(); })\n    .done(function(data) {\n      \$('#divRoutes').html(data);\n      \$('#last_ok h4').html(\$('#wizard_routes_hints h4').last().html());\n      \$('#wizard_no_route').hide();\n      \$('#summit_link, #wizard_route, #last_ok').show();\n      C2C.getWizardRouteRatings('routes');\n    })\n    .fail(function(data) {\n      \$('#wizard_route, #wizard_hints, #wizard_route_descr, #last_ok').hide();\n      \$('#summit_link, #wizard_no_route').show();\n      C2C.showFailure(data.responseText);\n    })\n});\n\n\$('#sites_name').c2cAutocomplete({\n  url: '" . url_for('sites/autocomplete') . "',\n  minChars: " . sfConfig::get('app_autocomplete_min_chars') . "\n}).on('itemselect', function(e, item) {\n  \$('.wizard_hints').hide();\n  \$('#last_ok h4').html(\$('#wizard_sites_hints h4').last().html());\n  \$('#last_ok').show();\n  \$('#link').val(item.id);\n});\n");
echo form_tag('outings/wizard');
echo input_hidden_tag('summit_id', '0');
?>
<p id="summit_link" style="display: none">
<a href="#" onclick="window.open('/summits/' + $('#summit_id').val());"><?php 
echo __('Show the summit');
?>
</a>
</p>
<p id="wizard_summit_create" class="wizard_tip"><?php 
echo __('No summit matching your search?') . ' ' . link_to(__('Add your summit'), '@document_edit?module=summits&id=&lang=');
?>
예제 #23
0
<?php

$c = new Criteria();
$c->AddAscendingOrderByColumn(CuentaPeer::NOMBRE);
$cuentas = CuentaPeer::doSelect($c);
$optCuenta[""] = "";
foreach ($cuentas as $cuenta) {
    $optCuenta[$cuenta->getId()] = $cuenta->getNombre();
}
echo select_tag('alumno[fk_cuenta_id]', options_for_select($optCuenta, $alumno->getFkCuentaId()));
예제 #24
0
     echo input_hidden_tag($name, 0);
     echo checkbox_tag($name, 1, $cs_setting->getValue());
     break;
 case 'input':
     echo input_tag($name, $cs_setting->getValue(), 'size=55');
     break;
 case 'textarea':
     echo textarea_tag($name, $cs_setting->getValue());
     break;
 case 'yesno':
     echo 'Yes: ' . radiobutton_tag($name, 1, $cs_setting->getValue());
     echo 'No: ' . radiobutton_tag($name, 0, $cs_setting->getValue() ? false : true);
     break;
 case 'select':
     $options = _parse_attributes($cs_setting->getOptions());
     echo select_tag($name, options_for_select($options, $cs_setting->getValue(), 'include_blank=true'));
     break;
 case 'model':
     $config = _parse_attributes($cs_setting->getOptions());
     $method = $cs_setting->getOption('table_method');
     $method = $method ? $method : 'findAll';
     $options = Doctrine::getTable($cs_setting->getOption('model', true))->{$method}();
     echo select_tag($name, objects_for_select($options, 'getId', '__toString', $cs_setting->getValue()), 'include_blank=true');
     break;
 case 'wysiwyg':
     echo textarea_tag($name, $cs_setting->getvalue(), 'rich=true ' . $cs_setting->getOptions());
     break;
 case 'upload':
     echo $cs_setting->getValue() ? link_to($cs_setting->getValue(), public_path('uploads/setting/' . $cs_setting->getValue())) . '<br />' : '';
     echo input_file_tag($name, $cs_setting->getValue(), $cs_setting->getOptions());
     break;
예제 #25
0
/**
 * Returns a <select> tag populated with all the timezones in the world.
 *
 * The select_timezone_tag builds off the traditional select_tag function, and is conveniently populated with 
 * all the timezones in the world (sorted alphabetically). Each option in the list has a unique timezone identifier 
 * for its value and the timezone's locale as its display title.  The timezone data is retrieved via the sfCultureInfo
 * class, which stores a wide variety of i18n and i10n settings for various countries and cultures throughout the world.
 * Here's an example of an <option> tag generated by the select_timezone_tag:
 *
 * <b>Options:</b>
 * - display - 
 *     identifer         - Display the PHP timezone identifier (e.g. America/Denver)
 *     timezone          - Display the full timezone name (e.g. Mountain Standard Time)
 *     timezone_abbr     - Display the timezone abbreviation (e.g. MST)
 *     timzone_dst       - Display the full timezone name with daylight savings time (e.g. Mountain Daylight Time)
 *     timezone_dst_abbr - Display the timezone abbreviation with daylight savings time (e.g. MDT)
 *     city              - Display the city/region that relates to the timezone (e.g. Denver)
 * 
 * <samp>
 *  <option value="America/Denver">America/Denver</option>
 * </samp>
 *
 * <b>Examples:</b>
 * <code>
 *  echo select_timezone_tag('timezone', 'America/Denver');
 * </code>
 *
 * @param  string field name 
 * @param  string selected field value (timezone identifier)
 * @param  array  additional HTML compliant <select> tag parameters
 * @return string <select> tag populated with all the timezones in the world.
 * @see select_tag, options_for_select, sfCultureInfo
 */
function select_timezone_tag($name, $selected = null, $options = array())
{
    if (!isset($options['display'])) {
        $options['display'] = 'identifier';
    }
    $c = new sfCultureInfo(sfContext::getInstance()->getUser()->getCulture());
    $timezone_groups = $c->getTimeZones();
    $display_key = 0;
    switch ($options['display']) {
        case "identifier":
            $display_key = 0;
            break;
        case "timezone":
            $display_key = 1;
            break;
        case "timezone_abbr":
            $display_key = 2;
            break;
        case "timezone_dst":
            $display_key = 3;
            break;
        case "timezone_dst_abbr":
            $display_key = 4;
            break;
        case "city":
            $display_key = 5;
            break;
        default:
            $display_key = 0;
            break;
    }
    unset($options['display']);
    $timezones = array();
    foreach ($timezone_groups as $tz_group_key => $tz_group) {
        $array_key = null;
        foreach ($tz_group as $tz_key => $tz) {
            if ($tz_key == 0) {
                $array_key = $tz;
            }
            if ($tz_key == $display_key and !empty($tz)) {
                $timezones[$array_key] = $tz;
            }
        }
    }
    if ($timezone_option = _get_option($options, 'timezones')) {
        $diff = array_diff_key($timezones, array_flip((array) $timezone_option));
        foreach ($diff as $key => $v) {
            unset($timezones[$key]);
        }
    }
    // Remove duplicate values
    $timezones = array_unique($timezones);
    asort($timezones);
    $option_tags = options_for_select($timezones, $selected);
    return select_tag($name, $option_tags, $options);
}
예제 #26
0
     function linkTo() {
        var obj = document.getElementById('idDocente');
        location.href = "<?php 
echo url_for('docenteHorario/list', false);
?>
/idDocente/"+obj.options[obj.selectedIndex].value;
     }
	</script>		
<?php 
use_helper('Misc');
echo form_tag('docenteHorario/grabarDocenteHorario', 'onSubmit="selectItem()"');
?>
<div id="sf_admin_container">
<br> 
<h1>Docente  <?php 
echo select_tag('idDocente', options_for_select($optionsDocente, $sf_params->get('idDocente')), 'onChange=linkTo()');
?>
</h1>
<div id="sf_admin_header"></div>
<br>
<div id="sf_admin_container">

<?php 
if (count($aHorario) > 0) {
    ?>
<h2>Horarios Tentativos</h2>
<table cellspacing="0" class="sf_admin_list">
  <thead>
  <tr>
    <th id="sf_admin_list_th_dia">Evento</th>
  </tr>
    echo input_tag('title', '', 'id=topic_title');
    ?>
    <?php 
    if (isset($forum)) {
        ?>
      <?php 
        echo input_hidden_tag('forum_name', $forum->getStrippedName());
        ?>
    <?php 
    } else {
        ?>
      <?php 
        echo label_for('forum', __('Forum', null, 'sfSimpleForum'));
        ?>
      <?php 
        echo select_tag('forum_name', options_for_select(sfSimpleForumForumPeer::getAllAsArray()));
        ?>
    <?php 
    }
    ?>
    
  <?php 
}
?>
  
  <?php 
echo form_error('body');
?>
  <?php 
echo label_for('body', __('Body', null, 'sfSimpleForum'));
?>
예제 #28
0
echo input_hidden_tag('employee_2', $employee_id);
?>

<table class="form">
<tr><td class="form">
	<table class="form_content" width="100%">
	<tbody>
    	<tr>
           <td class='first' width="20%" style="vertical-align:middle;"><label><?php 
echo __('Ditujukan Untuk');
?>
</label></td>
           <td class="first" width="2%" style="text-align:center; vertical-align:middle;">:</td>
		   <td class="first" style="vertical-align:middle;">
		   <?php 
echo select_tag('toward', options_for_select(array('', PublicInformation::STUDENT => __('Siswa'), PublicInformation::EMPLOYEE => __('Guru')), ''));
echo observe_field('toward', array('url' => 'employee_email/loadAttributes', 'update' => 'email_attribute', 'script' => 'true', 'with' => "'toward='+\$('toward').value+'&id='+\$('id').value"));
?>
           </td>
        </tr>
        <tr>
			<td colspan="3" class="first">
				<div id="email_attribute">
					<?php 
if (isset($email_attr_tmpl)) {
    include $email_attr_tmpl;
}
?>
				</div>
			</td>
		</tr>
예제 #29
0
 form-error<?php 
}
?>
">
    <?php 
if ($sf_request->hasError('legajopedagogico{fk_legajocategoria_id}')) {
    ?>
        <?php 
    echo form_error('legajopedagogico{fk_legajocategoria_id}', array('class' => 'form-error-msg'));
    ?>
    <?php 
}
?>

        <?php 
echo select_tag('legajopedagogico[fk_legajocategoria_id]', options_for_select($optionsCategoriaLegajo, $legajo_categoria_id));
?>
   </div>
        
        

</div>

        <div class="form-row">
        <?php 
echo label_for('adjunto', __('Agregar un nuevo adjunto:'));
?>
        <?php 
echo input_file_tag('file');
?>
        <?php 
예제 #30
0
}
?>

		<?php 
if ($oAppCommon->ssButtonTopMenu) {
    include_partial('global/buttonTopMenu');
}
echo jq_form_remote_tag(array('update' => $oAppCommon->ssDivId, 'url' => $oAppCommon->ssLink), array('name' => 'frmSearch', 'id' => 'frmSearch', 'method' => 'post', 'class' => 'fright'));
echo input_hidden_tag('ssSortOn', $oAppCommon->ssSortOn);
echo input_hidden_tag('ssSortBy', $oAppCommon->ssSortBy);
?>
		<div><?php 
echo __("Search By");
?>
&nbsp; <?php 
echo select_tag('ssSearchOption', options_for_select($oAppCommon->aSearchOptions, $sf_params->get('ssSearchOption')), array('tabindex' => 2));
?>
		</div>
		<div class="searchinput"><?php 
echo __('Search For');
?>
&nbsp;<?php 
echo input_tag('ssSearchWord', trim($sf_params->get('ssSearchWord')), array('size' => '20', 'maxlength' => '100', 'tabindex' => 1));
?>
</div>
		<div class="menu padding0"><?php 
echo submit_tag(__('Search'), array('title' => __('Search'), 'tabindex' => 1));
?>
		</div>
		<div class="menu padding0"><?php 
echo link_to(__('Show All'), $oAppCommon->ssLink, array('title' => __('Show All'), 'tabindex' => 1));