value: // key: name of the field // value is an array of parameters to define the field: // type: is required! and must be one of the following: // text: usual text field // checkbox: shows checkbox returns value // select: creates a selection list (drop down) // if a the parameter 'valueList' is set (to an array of strings) // it will be shown. // if it is not set, the list will be generated from the index // therefore the field name must match an index field // (if not an error will appear) // suggest: a field that provides suggestion on the input the user makes // number: creates a number field, where the user can choose integers. // it is recommended to define 'min' and 'max' in the 'config' array // deactivated: the field will not be writable // hideable: set to 'true' if the field can be added by the user on demand // config: is an array of attributes for the elements // e.g. 'size' or 'maxlength' // e.g. 'familyName' =>['type'=>'text', 'config'=>[size'=>45,'maxlength'=>45)) // (this will end up in a field like this: // ) // alt: if you have a group of fields, that have to be chosen one of them exclusively. // create a field in the field declaration section for each but only one in the // field definition section with the default selection and put the names of the // others in the 'alt' parameter see: familyName // TODO do we need or want this static??? public $knownLParams = [ 'country', 'geneticlocus', 'continent', 'sea', 'ocean', 'sampletype', 'collectioncode', 'institutioncode', 'indexHerbarorium' ]; public $knownParams = [ 'fullScientificName', 'genusName', 'speciesName', 'kingdom', 'sequenceaccessionIdentifier', 'unitID', 'locality', 'collectors', 'collectornumber', 'institution', 'voucherCol', 'collectionYearFrom', 'collectionYearTo', 'latitudeTo', 'latitudeFrom', 'longitudeTo', 'longitudeFrom', 'cites', 'hasImage', 'hasTypestatus', 'sampleavailability', 'institutioncode', 'collectioncode', 'preparationtype', 'ipen', 'unitaccessionnumber', 'accessionStatus', 'identifiedBy' ]; public $_parameters = [ 'fullScientificName' => [ 'type' => 'suggest', 'config' => [ 'size' => 45, 'maxlength' => 150, 'name' => 'fullScientificName' ], 'class' => 'test', 'name' => 'Scientific name' ], 'country' => [ 'type' => 'suggest', 'config' => [ 'size' => 285, 'maxlength' => 150, 'name' => 'country' ], 'name' => 'Country' ], 'locality' => [ 'type' => 'text', 'name' => 'Locality', 'config' => [ 'size' => 45, 'maxlength' => 150, 'name' => 'locality' ], // 'hideable' => 'true' ], 'collectors' => [ 'type' => 'text', 'name' => 'Collector(s)', 'config' => [ 'size' => 45, 'maxlength' => 150, 'name' => 'collectors' ] ] // 'hideable' => 'true' , 'collectornumber' => [ 'type' => 'text', 'name' => "Field or collector number", 'config' => [ 'size' => 45, 'maxlength' => 150, 'name' => 'collectornumber' ], 'hideable' => 'true', ] , 'unitID' => [ 'config' => [ 'size' => 45, 'maxlength' => 150, 'name' => 'unitID' ], 'type' => 'text', // freigeschaltet von Gabi 'name' => 'IPEN No/Specimen ID', // 'hideable' => 'true', ], 'collectionYear' => [ 'type' => 'range', 'config' => [ 'size' => 40, 'width' => '150px', 'name' => 'Collection Year', 'attribute1' => 'collectionYearFrom', 'attribute2' => 'collectionYearTo', 'attribute1value' => 'collectionYearFrom', 'attribute2value' => 'collectionYearTo', 'type' => \kartik\field\FieldRange::INPUT_TEXT ], 'hideable' => 'true', 'name' => 'Collection Year' ], 'continent' => [ 'type' => 'suggest', 'name' => 'Continent', 'config' => [ 'size' => 285, 'maxlength' => 150, 'name' => 'continent' ], 'hideable' => 'true' ], 'coordinates' => [ 'type' => 'range', 'config' => [ 'size' => 40, 'width' => '150px', 'name' => 'Coordinates', 'label' => 'Latitude', 'attribute1' => 'latitudeFrom', 'attribute2' => 'latitudeTo', 'attribute1value' => 'latitudeFrom', 'attribute2value' => 'latitudeTo', 'label2' => 'Longitude', 'attribute3' => 'longitudeFrom', 'attribute4' => 'longitudeTo', 'attribute3value' => 'longitudeFrom', 'attribute4value' => 'longitudeTo', 'type' => \kartik\field\FieldRange::INPUT_TEXT ], 'hideable' => 'true', 'name' => 'Coordinates' ], 'ocean' => [ 'type' => 'suggest', 'name' => 'Ocean', 'config' => [ 'size' => 285, 'maxlength' => 150, 'name' => 'ocean' ], 'hideable' => 'true' ], 'sea' => [ 'type' => 'suggest', 'name' => 'Sea', 'config' => [ 'size' => 285, 'maxlength' => 150, 'name' => 'sea' ], 'hideable' => 'true' ], ]; /* * ----------------- other settings ---------------------------- * *These settings will overwrite the default setting in common/models/CommonSearchForm */ // title of the form: // private $_extendedSearchFormTitle = 'SEARCH'; // private $_previewTitle = 'RESULTS OVERVIEW'; // private $_detailsTitle = 'DETAILS'; // search button text: // private $_extendedSearchButtonLabel = 'Search'; // Rukeia 16-02-2015: Das ist das Search-Button-Label. private $_refineSearchButtonLabel = 'Search'; // private $_newSearchButtonLabel = 'New search'; // private $_saveSearchButtonLabel = 'Save Search'; // Hartebrodt 22-07-15 // private $_searchName; // Hartebrodt 23-07-15: name a search to store it in the database // what string represents if nothing is chosen in the drop down lists // // (technically it leads to everything (*)) // private $_selectionListNonChosen = "---"; // string that is presented in a suggestion list if // the input does not match to any item // private $_sugesstionListNoMatch = "-- no match --"; // default size of fields // - if you don't give a size in the definition area this value will be used // private $_fieldSize = 50; // ------------- getters-------------------------------------- public function getParameters() { return $this->_parameters; } public function getRefineSearchButtonLabel() { return $this->_refineSearchButtonLabel; } // @override /** * Declares customized attribute labels. * If not declared here, an attribute would have a label that is * the same as its name with the first letter in upper case. */ public function attributeLabels() { return [ 'taxonomyId' => 'Taxonomy ID (NCBI)', 'fullScientificName' => 'Scientific name', 'sequenceaccessionIdentifier' => 'Genetic Accession Number', 'geneticlocus' => 'Genetic Locus', 'kingdom' => 'Kingdom', 'hasImage' => 'Image available', 'sampletype' => 'Sample Type', 'preparationType' => 'Preparation Type', 'hasTypestatus' => 'Type Specimen/Strain', 'unitID' => 'IPEN Number/Specimen ID', 'phylumName' => 'Phylum/Division Name', 'continent' => 'Continent', 'sea' => 'Sea', 'locality' => 'Locality', 'collectors' => 'Collector(s)', 'collectornumber' => "Collector's number", 'institution' => 'Repository', 'voucherCol' => 'Voucher collection', 'genBankRecordAvailable' => 'with Genetic Accession Number', 'collectionYear' => 'Collection year', 'coordinates' => 'Coordinates', 'cites' => 'CITES list', 'collectioncode' => 'Collection or subcollection', 'institutioncode' => 'Institution code', 'indexHerbarorium'=>'Index Herbariorum code' ]; } }