* @author Sybille Buers, Gabriele Droege, Patricia Kelbert (BGBM, GGBN/DNA Bank Network) * @version yii 2.0.3 * @package View * @var $this SearchController * @var $model SearchForm * @var $selectionLists - created in the controller * @var $form CActiveForm * @copyright Copyright © 2011 DNA Bank Network http://www.dnabank-network.org *
The contents of this file are subject to the Mozilla Public License Version 1.1 * @filesource * @license http://www.mozilla.org/MPL/ MPL */ use yii\helpers\Html; use yii\jui\Accordion; use ggbn\CreateFormManager; use app\controllers\SearchController; use kartik\field\FieldRange; use kartik\widgets\ActiveForm; use yii\web\View; $this->title = 'Specimen Explorer'; // $this->title = 'Search'; // $this->params ['breadcrumbs'] [] = $this->title; $this->registerJs ( " $('.tabs-search .tab-links a').on('click', function(e) { var currentAttrValue = $(this).attr('href'); // Show/Hide Tabs $(currentAttrValue).show(); $(currentAttrValue).siblings().hide(); // Change/remove current tab to active $(this).parent('li').addClass('active hop').siblings().removeClass('active'); e.preventDefault(); }); $('#searchform-kingdom').change(function() { var kingdom=$('#searchform-kingdom').val(); if (kingdom != '' && kingdom!='---')kingdom='&kingdom='+kingdom; else kingdom=''; var url='/".Yii::$app->params['siteName']."/serverscripts/suggestion-list?listTitle=fullScientificName'+kingdom+'&term=%QUERY'; searchform_fullscientificname_data_1.clear(); searchform_fullscientificname_data_1.remote.url=url; searchform_fullscientificname_data_1.initialize(true); }); ", View::POS_READY ); ?>

extendedSearchFormTitle; ?>

getParameters (); $form = ActiveForm::begin ( [ 'method' => 'get', 'enableClientValidation' => true, 'validateOnSubmit' => true ] ); // this is redundant because it's true by default echo $form->errorSummary ( $model ); echo ""; foreach ( $elements as $key => $param ) { $tohandle = false; foreach ( $param as $k => $toto ) { try { if (isset ( $param ['type'] )) { if (isset ( $param ['hidden'] )) $tohandle = false; else $tohandle = TRUE; $type = $param ['type']; } } catch ( Exception $e ) { } } if ($tohandle) { // 1. preparation for the field generation $htmlOpts = isset ( $param ['config'] ) ? $param ['config'] : array (); // if the field is hideable // it's set not displayed in the first place // and it gets a button to hide it again: if (isset ( $param ['hideable'] ) && $param ['hideable'] == 'true') { $hide_option = "style=\"display:none;\""; $hide_button = "request->baseUrl . "/images/close.png \" parent_name=\"" . $key . "\" class=\"hide_button\" alt=\"close\"/>"; } else { $hide_option = ""; $hide_button = ""; } // use default size if no size is given if (! isset ( $param ['config'] ['size'] )) { $param ['config'] ['size'] = $model->getFieldSize (); } // surround label and fields with div echo "
"; // echo "
"; // 2. label - could be common text label or drop down choice // choose whether the label is a dropdown choice: if (isset ( $param ['alt'] ) && is_array ( $param ['alt'] ) && sizeof ( $param ['alt'] > 0 )) { $altList = array ( $key ) + $param ['alt']; // Yii::info ( "altList : " . implode ( $altList, "\n" ) ); // echo "
"; echo Html::dropDownList ( $key, $key, $altList, $htmlOptions = array ( 'class' => "dropDownLabel", 'id2' => $key ) ); $htmlOpts += array ( "class" => "hasSelectableLabel_" . $key, "id2" => $key ); $alt = true; } else { $altList = null; $form->field ( $model, $key )->label ( $key ); $alt = false; } echo $hide_button; // 3. field itself (different types -depending on $type CreateFormManager::createField ( $this, $model, $form, $key, $param, $selectionLists, $htmlOpts, $selectedValue = NULL, $hide_option, $hide_button ); // if there are alternate fields create them and hide them: if ($alt) { if (isset ( $htmlOpts ['style'] )) { $htmlOpts ['style'] += " display:none;"; } else { $htmlOpts ['style'] = "display:none;"; } foreach ( $altList as $altField ) { unset ( $param ['valueList'] ); CreateFormManager::createField ( $this, $model, $form, $altField, $param, $selectionLists, $htmlOpts, $selectedValue = NULL ); } } echo "
"; } } echo $this->render ( '@common/views/search/mapSearch' ); ?>
"; echo "
"; echo Html::submitButton ( 'Submit', [ 'class' => 'btn btn-success' ] ); echo " "; echo "
"; echo Accordion::widget ( [ 'items' => [ [ 'header' => "Add search field", 'content' => $this->render ( 'searchFieldSelection', [ 'hideable_fields' => $model->getHideableListFields (), 'hidden_elements' => $model->getHideableList () ], true ) ] ], 'options' => [ 'tag' => 'div', 'autoHeight' => false, 'active' => false, 'delay' => '100' ], 'itemOptions' => [ 'tag' => 'div', 'class' => 'balmusette_search' ], 'headerOptions' => [ 'tag' => 'button', 'class' => 'btn btn-success' ] , 'clientOptions' => [ 'collapsible' => true, 'active' => false ] ] ); echo "
"; ActiveForm::end (); ?>