function html_query_criterion_list($query, $name, $additional_fields = NULL, $also_render_label = FALSE, $other_options = NULL)
{
    $criterion = $query->criteria_container->get_by_qs_key($name);
    if (is_null($criterion)) {
        return;
    }
    $render_default = $criterion->render_default;
    // NOTE AV - I've turned this back to returning a default value, since page_size needs its
    $current_value = $criterion->get_value($name);
    //$criterion->get_value($name, FALSE);
    $result = '';
    $qc_list = $criterion->get_list($name);
    // a returned string is likely to be referencing a db stored list - which we must fetch. a returned array means the list was defined in the datasource config
    if (is_string($qc_list)) {
        $qc_list = $query->get_list($criterion->get_list($name));
    }
    $use_integer_list_keys = $criterion->use_integer_list_keys;
    $help = $criterion->get_help_text();
    $render_help = TRUE;
    if ($also_render_label) {
        $result .= '<label for="' . $name . '">' . $criterion->label . ':</label>';
    }
    $result .= '<select name="' . $name . '" id="' . $name . '" ';
    if ($other_options) {
        foreach ($other_options as $option_name => $option_value) {
            switch ($option_name) {
                case 'render_default':
                    $render_default = $option_value;
                    break;
                case 'current_value':
                    $current_value = $option_value;
                    break;
                case 'list':
                    $qc_list = $option_value;
                    break;
                case 'use_integer_list_keys':
                    $use_integer_list_keys = $option_value;
                    break;
                case 'render_help':
                    $render_help = $option_value;
                    break;
            }
        }
    }
    if ($additional_fields) {
        foreach ($additional_fields as $field_name => $field_value) {
            $result .= $field_name;
            $result .= '="' . $field_value . '" ';
        }
    }
    $result .= '>';
    $result .= html_options($qc_list, $current_value, $render_default, $use_integer_list_keys);
    $result .= '</select>';
    if ($render_help) {
        $result .= html_query_criterion_help($query, $name);
    }
    return $result;
}
Ejemplo n.º 2
0
?>
    </fieldset>
<? endif /*Basic/Advanced*/?>
    <fieldset class="controlset">
        <ol>
            <li class="years to_the_left solo">
                  <label for ="">Year:</label>
                  <?php 
echo html_query_date_list($QUERY, 'date_start');
?>
                  <label class="label_between">to</label>
                  <?php 
echo html_query_date_list($QUERY, 'date_end');
?>
                  <?php 
echo html_query_criterion_help($QUERY, 'date');
?>
            </li>
            <li>
                <?php 
echo html_query_criterion_list($QUERY, 'category', NULL, TRUE);
?>
            </li>
        </ol>
    </fieldset>
</div>

<? /* Search button and other controls*/?>
<div class="form_rightcol last">
    <fieldset class="submitset"><input type="submit" id="submit" value="Search" />
        <ol>
Ejemplo n.º 3
0
?>
</ol>
<? endif /*Basic/Advanced*/?>
	<input type="submit" id="submit" value="Search" />
</fieldset>


<? /* Dates and other criteria */ ?>

<fieldset>
	<legend>Date range</legend>
	<label for="date_start">Year:</label>
	<?= html_query_criterion_list($QUERY, 'date_start' )?>
	<label for="date_end">to</label>
	<?= html_query_criterion_list($QUERY, 'date_end' )?>
	<?= html_query_criterion_help($QUERY, 'date')?>
	<a href="#" title="Reset date range" class="all-dates js-only" id="year">&laquo;&nbsp;Reset date</a>
</fieldset>
<?php  if ($is_advanced): /*--- Collections ---*/?>
<fieldset>
	<?= html_query_criterion_checkbox($QUERY, 'components', NULL, TRUE)?>
</fieldset>
<?php /*--- Media Types ---*/?>
<fieldset>
	<?= html_query_criterion_checkbox($QUERY, 'facet_media_type', NULL, TRUE)?>
</fieldset>
<?php /*--- Availability ---*/?>
<fieldset>
	<?= html_query_criterion_checkbox($QUERY, 'facet_availability', NULL, TRUE)?>
</fieldset>
<?php /*--- Genre ---*/?>