public function init() { parent::init(); $mappings = $this->_getFiltered('archive_folder_mappings'); $allowLocalPaths = Zend_Registry::get('archive_folder')->local_folders->allow == '1'; $this->setAttrib('id', 'archive-folder'); $this->setMethod('post'); $this->addElement('text', 'uri', array('label' => __('Base URI'), 'description' => __('The base url or path of the folder to expose.') . ' ' . __('If url, the server should allow directory listing.') . ($allowLocalPaths ? '' : ' ' . __('Local paths are forbidden by the administrator.')), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', array('Callback', true, array('callback' => array('ArchiveFolder_Form_Validator', 'validateUri')), 'messages' => array(Zend_Validate_Callback::INVALID_VALUE => __('A url or a path is required to add a folder.')))))); $this->addElement('radio', 'unreferenced_files', array('label' => __('Unreferenced Files'), 'description' => __('This option indicates what to do with files, maybe all of them, that are not referenced inside metadata files ("%s").', implode('", "', array_keys($mappings))), 'value' => get_option('archive_folder_unreferenced_files') ?: 'by_file', 'multiOptions' => array('by_file' => __('One item by file'), 'by_directory' => __('One item by directory'), 'skip' => __("Skip")))); /* $this->addElement('checkbox', 'records_for_files', array( 'label' => __('Files Metadata'), 'description' => __('Create metadata for files, not only for items.') . ' ' . __('Metadata for files may be useless if there is only one file by item.') . ' ' . __('This parameter may be bypassed when a metadata file is directly included in the folder.'), 'value' => true, )); */ $this->addElement('hidden', 'records_for_files', array('value' => true)); $this->addElement('text', 'exclude_extensions', array('label' => __('File extensions to exclude'), 'description' => __('A black-list of extensions (normal or double) to exclude from the source, separated by a space or a comma and without the initial dot.') . ' ' . __('The white-list is the Omeka one, defined in the security page.'))); $this->addElement('checkbox', 'allow_no_extension', array('label' => __('Allow file without extension'), 'description' => __('This option allows to import some specific files and urls.') . ' ' . __('The option "Disable File Upload Validation" in Settings > Security should be set too.'), 'value' => false)); $values = array('' => __('No default item type'), 'default' => __('Default type according to first file of each item')) + get_table_options('ItemType'); $this->addElement('select', 'item_type_id', array('label' => __('Default Item Type'), 'description' => __('Set the item type during import as Omeka Item Type and Dublin Core Type.') . ' ' . __('For the second option (type of the first file), it can be:') . ' ' . __('"Still image" for an item with a single Image, "Text" for an item with multiple image or a pdf, ' . '"Sound" for an audio file, "Moving Image" for a video file and none in all other cases.'), 'multiOptions' => $values, 'value' => '')); $this->addElement('checkbox', 'add_relations', array('label' => __('Add unique identifiers'), 'description' => __('To add unique identifiers allows to link items and files easily and independantly from Omeka.') . ' ' . __('Added identifiers are absolute urls.') . ' ' . __("This option is only usefull when there aren't such identifiers."), 'value' => false)); $this->addElement('text', 'element_delimiter', array('label' => __('Table/Spreadsheet element separator'), 'description' => __('If metadata are available in a table (as Open Document Spreadsheet ods), multiple elements can be set within one cell for the same field.') . ' ' . __('This character or this string, for example the pipe "|", can be used to delimite them.') . ' ' . __('If the delimiter is empty, then the whole text will be used.') . ' ' . __('Anyway, multiple columns can be mapped to the same element and multiple rows can manage multiple values for the same field of the same record.'), 'value' => ArchiveFolder_Mapping_Table::DEFAULT_ELEMENT_DELIMITER)); $this->addElement('text', 'empty_value', array('label' => __('Table/Spreadsheet empty value'), 'description' => __('If metadata are available in a table (as Open Document Spreadsheet ods), an empty cell can be an empty value or no value.') . ' ' . __('To distinct these two cases, an empty value can be replaced by this string (case sensitive).'), 'value' => ArchiveFolder_Mapping_Table::DEFAULT_EMPTY_VALUE)); $this->addElement('textarea', 'extra_parameters', array('label' => __('Add specific parameters'), 'description' => __('Some formats require specific parameters, for example to be used in the xsl sheets.') . ' ' . __('You can specify them here, one by line.'), 'value' => '', 'required' => false, 'rows' => 5, 'placeholder' => __('parameter_1_name = parameter 1 value'), 'filters' => array('StringTrim'), 'validators' => array(array('callback', false, array('callback' => array('ArchiveFolder_Form_Validator', 'validateExtraParameters')), 'messages' => array(Zend_Validate_Callback::INVALID_VALUE => __('Each extra parameter, one by line, should have a name separated from the value with a "=".')))))); $identifierField = get_option('archive_folder_identifier_field'); if (!empty($identifierField) && $identifierField != ArchiveFolder_Importer::IDFIELD_INTERNAL_ID) { $currentIdentifierField = $this->_getElementFromIdentifierField($identifierField); if ($currentIdentifierField) { $identifierField = $currentIdentifierField->id; } } $values = get_table_options('Element', null, array('record_types' => array('All'), 'sort' => 'alphaBySet')); unset($values['']); $values = array(ArchiveFolder_Importer::IDFIELD_NONE => __('No default identifier field'), ArchiveFolder_Importer::IDFIELD_INTERNAL_ID => __('Internal id')) + $values; $this->addElement('select', 'identifier_field', array('label' => __('Identifier field (required)'), 'description' => __('The identifier field is used to simplify the update of records.') . ' ' . __('This is the link between the files in the folder and the records in the Omeka base.') . ' ' . __('The identifier should be set and unique in all records (collections, items, files).') . ' ' . __('This is generally the Dublin Core : Identifier or a specific element.'), 'multiOptions' => $values, 'value' => $identifierField)); $this->addElement('select', 'action', array('label' => __('Action'), 'multiOptions' => label_table_options(array(ArchiveFolder_Importer::ACTION_UPDATE_ELSE_CREATE => __('Update the record if it exists, else create one'), ArchiveFolder_Importer::ACTION_CREATE => __('Create a new record'), ArchiveFolder_Importer::ACTION_UPDATE => __('Update values of specific fields'), ArchiveFolder_Importer::ACTION_ADD => __('Add values to specific fields'), ArchiveFolder_Importer::ACTION_REPLACE => __('Replace values of all fields'), ArchiveFolder_Importer::ACTION_DELETE => __('Delete the record'), ArchiveFolder_Importer::ACTION_SKIP => __('Skip process of the record')), __('No default action')), 'description' => __('The action defines how records and metadara are processed.') . ' ' . __('The record can be created, updated, deleted or skipped.') . ' ' . __('The metadata of an existing record can be updated, appended or replaced.'))); // Parameters for the folder of original files. $this->addDisplayGroup(array('uri'), 'archive_folder_folder', array('legend' => __('Archive Folder URI'))); $this->addDisplayGroup(array('unreferenced_files', 'records_for_files', 'exclude_extensions', 'allow_no_extension', 'item_type_id', 'add_relations'), 'archive_folder_records', array('legend' => __('Archive Folder Records and files'), 'description' => __('Set parameters to create each record from files.') . ' ' . __('Note:') . ' ' . __('An item can have multiple files, and items and files can have different metadata.') . ' ' . __('For example, a record of a book can have each digitalized page attached to it.') . ' ' . __('An object can have multiple pictures under different views or taken by different photographers.') . ' ' . __('In that case, it is recommended to separate the metadata, for example to add data about each page or the different authors of the view.') . ' ' . __("Conversely, an image of a paint, a photography, or a book digitalized as a pdf and e-book files doesn't need to have separate records."))); // Parameters to create each record. $this->addDisplayGroup(array('element_delimiter', 'empty_value'), 'archive_folder_table', array('legend' => __('Tables'), 'description' => __('Set specific parameters for table or spreadsheets.'))); apply_filters('archive_folder_add_parameters', $this); $this->addDisplayGroup(array('extra_parameters'), 'archive_folder_extra_parameters', array('legend' => __('Extra Parameters'))); // Parameters for the folder of original files. $this->addDisplayGroup(array('identifier_field', 'action'), 'archive_folder_process', array('legend' => __('Process'))); $this->applyOmekaStyles(); $this->setAutoApplyOmekaStyles(false); $this->addElement('sessionCsrfToken', 'csrf_token'); $this->addElement('submit', 'submit', array('label' => __('Add folder'), 'class' => 'submit submit-medium', 'decorators' => array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'field'))))); }
/** * Add the "Item Relations" tab to the admin items add/edit page. * * @return array */ public function filterAdminItemsFormTabs($tabs, $args) { $item = $args['item']; $formSelectProperties = get_table_options('ItemRelationsProperty'); $subjectRelations = self::prepareSubjectRelations($item); $objectRelations = self::prepareObjectRelations($item); ob_start(); include 'spoke_relationships_form.php'; $content = ob_get_contents(); ob_end_clean(); $tabs['Item Relations'] = $content; return $tabs; }
/** * Initialize the form. */ public function init() { parent::init(); $this->_columnDelimiter = CsvImport_RowIterator::getDefaultColumnDelimiter(); $this->_enclosure = CsvImport_RowIterator::getDefaultEnclosure(); $this->_elementDelimiter = CsvImport_ColumnMap_Element::getDefaultElementDelimiter(); $this->_tagDelimiter = CsvImport_ColumnMap_Tag::getDefaultTagDelimiter(); $this->_fileDelimiter = CsvImport_ColumnMap_File::getDefaultFileDelimiter(); $this->setAttrib('id', 'csvimport'); $this->setMethod('post'); $this->_addFileElement(); $this->addElement('radio', 'format', array('description' => __('Choose the type of record (the format of your file) you want to import.'), 'multiOptions' => array('Manage' => __('Manage records (import, update, remove)'), 'Report' => __('Omeka CSV Report'), 'Item' => __('Items'), 'File' => __('Files metadata (update)'), 'Mix' => __('Mixed records'), 'Update' => __('Update records')), 'required' => TRUE)); $this->_addColumnDelimiterElement(); $this->_addEnclosureElement(); $this->_addElementDelimiterElement(); $this->_addTagDelimiterElement(); $this->_addFileDelimiterElement(); $identifierField = get_option('csv_import_identifier_field'); if (!empty($identifierField) && $identifierField != 'internal id') { $currentIdentifierField = $this->_getElementFromIdentifierField($identifierField); if ($currentIdentifierField) { $identifierField = $currentIdentifierField->id; } } $values = get_table_options('Element', null, array('record_types' => array('All'), 'sort' => 'alphaBySet')); $values = array('' => __('No default identifier field'), 'internal id' => __('Internal id')) + $values; $this->addElement('select', 'identifier_field', array('label' => __('Identifier field (required)'), 'description' => __('The default identifier should be available for all record types that are currently imported in the file.'), 'multiOptions' => $values, 'value' => $identifierField)); $this->addElement('select', 'action', array('label' => __('Action'), 'multiOptions' => label_table_options(array(CsvImport_ColumnMap_Action::ACTION_UPDATE_ELSE_CREATE => __('Update the record if it exists, else create one'), CsvImport_ColumnMap_Action::ACTION_CREATE => __('Create a new record'), CsvImport_ColumnMap_Action::ACTION_UPDATE => __('Update values of specific fields'), CsvImport_ColumnMap_Action::ACTION_ADD => __('Add values to specific fields'), CsvImport_ColumnMap_Action::ACTION_REPLACE => __('Replace values of all fields'), CsvImport_ColumnMap_Action::ACTION_DELETE => __('Delete the record'), CsvImport_ColumnMap_Action::ACTION_SKIP => __('Skip process of the record')), __('No default action')))); $values = get_table_options('ItemType', __('No default item type')); $this->addElement('select', 'item_type_id', array('label' => __('Item type'), 'multiOptions' => $values)); $values = get_table_options('Collection', __('No default collection')); $this->addElement('select', 'collection_id', array('label' => __('Collection'), 'multiOptions' => $values)); $this->addElement('checkbox', 'records_are_public', array('label' => __('Make records public'), 'description' => __('Check to make records (items or collections) public by default.'))); $this->addElement('checkbox', 'records_are_featured', array('label' => __('Feature records'), 'description' => __('Check to make records (items or collections) featured by default.'))); $this->addElement('checkbox', 'elements_are_html', array('label' => __('Elements are html'), 'description' => __('Set default format of all imported elements as html, else raw text.'), 'value' => get_option('csv_import_html_elements'))); $this->addElement('checkbox', 'create_collections', array('label' => __('Create collections'), 'description' => __("If the collection of an item doesn't exist, it will be created.") . '<br />' . __('Use "Update" to set metadata of a collection.'), 'value' => get_option('csv_import_create_collections'))); $this->addElement('select', 'contains_extra_data', array('label' => __('Contains extra data'), 'description' => __('Other columns can be used as values for non standard data.'), 'multiOptions' => array('no' => __('No, so unrecognized column names will be noticed'), 'manual' => __('Perhaps, so the mapping should be done manually'), 'ignore' => __('Ignore unrecognized column names'), 'yes' => __("Yes, so column names won't be checked")), 'value' => get_option('csv_import_extra_data'))); $this->addElement('checkbox', 'automap_columns', array('label' => __('Automap column names to elements'), 'description' => __('Automatically maps columns to elements based on their column names.') . ' ' . __('The column name must be in the form: {ElementSetName}:{ElementName}'), 'value' => get_option('csv_import_automap_columns'))); $this->addDisplayGroup(array('csv_file', 'format'), 'file_type'); $this->addDisplayGroup(array('column_delimiter_name', 'column_delimiter', 'enclosure_name', 'enclosure', 'element_delimiter_name', 'element_delimiter', 'tag_delimiter_name', 'tag_delimiter', 'file_delimiter_name', 'file_delimiter'), 'csv_format', array('legend' => __('CSV format'), 'description' => __('Set delimiters and enclosure used in the file.'))); $this->addDisplayGroup(array('identifier_field', 'action', 'item_type_id', 'collection_id', 'records_are_public', 'records_are_featured', 'elements_are_html'), 'default_values', array('legend' => __('Default values'), 'description' => __("Set the default values to use when the column doesn't exist."))); $this->addDisplayGroup(array('create_collections', 'contains_extra_data', 'automap_columns'), 'import_features', array('legend' => __('Features to use'), 'description' => __('Set features used to process the file.'))); $submit = $this->createElement('submit', 'submit', array('label' => __('Next'), 'class' => 'submit submit-medium')); $submit->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'csvimportnext')))); $this->addElement($submit); $this->applyOmekaStyles(); $this->setAutoApplyOmekaStyles(false); }
<?php $formStem = $block->getFormStem(); $options = $block->getOptions(); ?> <div class="neatline-id"> <?php echo $this->formLabel("{$formStem}[options][neatline-id]", __('Select a Neatline')); echo $this->formSelect("{$formStem}[options][neatline-id]", @$options['neatline-id'], array(), get_table_options('NeatlineExhibit')); ?> </div>
/** * Initialize the form. */ public function init() { parent::init(); $this->_columnDelimiter = CsvImport_RowIterator::getDefaultColumnDelimiter(); $this->_enclosure = XmlImportPlugin::isFullCsvImport() ? CsvImport_RowIterator::getDefaultEnclosure() : '"'; $this->_elementDelimiter = CsvImport_ColumnMap_Element::getDefaultElementDelimiter(); $this->_tagDelimiter = CsvImport_ColumnMap_Tag::getDefaultTagDelimiter(); $this->_fileDelimiter = CsvImport_ColumnMap_File::getDefaultFileDelimiter(); $this->setName('xmlimport'); $this->setAttrib('id', 'xmlimport'); $this->setMethod('post'); // Radio button for selecting record type. $this->addElement('radio', 'file_import', array('label' => __('How many files do you want to import?'), 'multiOptions' => array('file' => __('One xml file'), 'folder' => __('All xml files in a folder'), 'recursive' => __('All xml files in a folder (recursive)')), 'description' => __('The xsl sheet will create one csv file from this or these xml files and send it to CsvImport.'), 'required' => true, 'value' => 'file')); // One xml file upload. $this->_addFileElement(); // Multiple files. $this->addElement('text', 'xml_folder', array('description' => __('The server should be able to access to this uri.'))); // Helper to manage multiple files. $this->addElement('text', 'format_filename', array('description' => __('The format of the filenames to search (format: "suffix.extension", for example "refnum.xml"; default: ".xml").') . ' ' . __('This is useful especially when folders contains multiple xml files.'), 'value' => get_option('xml_import_format_filename'))); // Radio button for selecting record type. if (XmlImportPlugin::isFullCsvImport()) { $values = array('Manage' => __('Manage records (import, update, remove)'), 'Report' => __('Omeka CSV Report'), 'Item' => __('Items'), 'File' => __('Files metadata (update)'), 'Mix' => __('Mixed records'), 'Update' => __('Update records')); $description = ''; } else { $values = array('Manage' => __('Manage records (import, update, remove) (only if CsvImport full is enabled)'), 'Report' => __('Omeka CSV Report'), 'Item' => __('Items'), 'File' => __('Files metadata (only if CsvImport full is enabled)'), 'Mix' => __('Mixed records (only if CsvImport full is enabled)'), 'Update' => __('Update records (only if CsvImport full is enabled)')); $description = __('Metadata of files cannot be imported and nothing can be updated, because you are using standard Csv Import.'); } $this->addElement('radio', 'format', array('label' => __('Choose the type of record you want to import (according to the xsl sheet below):'), 'description' => $description, 'multiOptions' => $values, 'value' => get_option('xml_import_format'), 'required' => TRUE)); $this->_addColumnDelimiterElement(); if (XmlImportPlugin::isFullCsvImport()) { $this->_addEnclosureElement(); } else { $enclosureElement = new Zend_Form_Element_Hidden('enclosure'); $enclosureElement->setValue($this->_enclosure); $this->addElement($enclosureElement); } $this->_addElementDelimiterElement(); $this->_addTagDelimiterElement(); $this->_addFileDelimiterElement(); $identifierField = get_option('csv_import_identifier_field'); if (!empty($identifierField) && $identifierField != 'internal id') { $currentIdentifierField = $this->_getElementFromIdentifierField($identifierField); if ($currentIdentifierField) { $identifierField = $currentIdentifierField->id; } } $values = get_table_options('Element', null, array('record_types' => array('All'), 'sort' => 'alphaBySet')); $values = array('' => __('No default identifier field'), 'internal id' => __('Internal id')) + $values; $this->addElement('select', 'identifier_field', array('label' => __('Identifier field (required)'), 'description' => __('The default identifier should be available for all record types that are currently imported in the file.'), 'multiOptions' => $values, 'value' => $identifierField)); if (XmlImportPlugin::isFullCsvImport()) { $this->addElement('select', 'action', array('label' => __('Action'), 'multiOptions' => label_table_options(array(CsvImport_ColumnMap_Action::ACTION_UPDATE_ELSE_CREATE => __('Update the record if it exists, else create one'), CsvImport_ColumnMap_Action::ACTION_CREATE => __('Create a new record'), CsvImport_ColumnMap_Action::ACTION_UPDATE => __('Update values of specific fields'), CsvImport_ColumnMap_Action::ACTION_ADD => __('Add values to specific fields'), CsvImport_ColumnMap_Action::ACTION_REPLACE => __('Replace values of all fields'), CsvImport_ColumnMap_Action::ACTION_DELETE => __('Delete the record'), CsvImport_ColumnMap_Action::ACTION_SKIP => __('Skip process of the record')), __('No default action')))); } else { $actionElement = new Zend_Form_Element_Hidden('action'); $actionElement->setValue(false); $this->addElement($actionElement); } $values = get_table_options('ItemType', __('No default item type')); $this->addElement('select', 'item_type_id', array('label' => __('Item type'), 'multiOptions' => $values)); $values = get_table_options('Collection', __('No default collection')); $this->addElement('select', 'collection_id', array('label' => __('Collection'), 'multiOptions' => $values)); $this->addElement('checkbox', 'records_are_public', array('label' => __('Make records public'), 'description' => __('Check to make records (items or collections) public by default.'))); $this->addElement('checkbox', 'records_are_featured', array('label' => __('Feature records'), 'description' => __('Check to make records (items or collections) featured by default.'))); $this->addElement('checkbox', 'elements_are_html', array('label' => __('Elements are html'), 'description' => __('Set default format of all imported elements as html, else raw text.'), 'value' => get_option('csv_import_html_elements'))); if (XmlImportPlugin::isFullCsvImport()) { $this->addElement('checkbox', 'create_collections', array('label' => __('Create collections'), 'description' => __("If the collection of an item doesn't exist, it will be created.") . '<br />' . __('Use "Update" to set metadata of a collection.'), 'value' => get_option('csv_import_create_collections'))); $this->addElement('select', 'contains_extra_data', array('label' => __('Contains extra data'), 'description' => __('Other columns can be used as values for non standard data.'), 'multiOptions' => array('no' => __('No, so unrecognized column names will be noticed'), 'manual' => __('Perhaps, so the mapping should be done manually'), 'ignore' => __('Ignore unrecognized column names'), 'yes' => __("Yes, so column names won't be checked")), 'value' => get_option('csv_import_extra_data'))); } else { $createCollectionsElement = new Zend_Form_Element_Hidden('create_collections'); $createCollectionsElement->setValue(false); $this->addElement($createCollectionsElement); $extraDataElement = new Zend_Form_Element_Hidden('contains_extra_data'); $extraDataElement->setValue('no'); $this->addElement($extraDataElement); } // XSLT Stylesheet. $values = $this->_listDirectory(get_option('xml_import_xsl_directory'), 'xsl'); // Don't return an error if the folder is unavailable, but simply set an // empty list. if ($values === false) { $values = array(); } $this->addElement('select', 'stylesheet', array('label' => __('Xsl sheet'), 'description' => __('The generic xsl sheet is "xml_import_generic_item.xsl". It transforms a flat xml file with multiple records into a csv file with multiple rows to import via "Item" format.'), 'multiOptions' => $values, 'required' => true, 'value' => get_option('xml_import_stylesheet'))); $this->addElement('text', 'stylesheet_parameters', array('label' => __('Add specific parameters to use with this xsl sheet'), 'description' => __('Format: "< parameter_1_name = parameter 1 value >< parameter_2_name = parameter 2 value >"...') . ' ' . __('For generic imports, one important parameter is the name of the node that represents a record.') . ' ' . __('It automatically uses the first level node, but it may be a sub level one.') . ' ' . __('In that case, set it like that: "< node = record_name >".'), 'value' => get_option('xml_import_stylesheet_parameters'))); $this->addDisplayGroup(array('file_import', 'xml_file', 'xml_folder', 'format_filename', 'format'), 'file_type'); $this->addDisplayGroup(array('column_delimiter_name', 'column_delimiter', 'enclosure_name', 'enclosure', 'element_delimiter_name', 'element_delimiter', 'tag_delimiter_name', 'tag_delimiter', 'file_delimiter_name', 'file_delimiter'), 'csv_format', array('legend' => __('CSV format'), 'description' => __('Set delimiters and enclosure used in the file.'))); $this->addDisplayGroup(array('identifier_field', 'action', 'item_type_id', 'collection_id', 'records_are_public', 'records_are_featured', 'elements_are_html'), 'default_values', array('legend' => __('Default values'), 'description' => __("Set the default values to use when the column doesn't exist."))); $this->addDisplayGroup(array('create_collections', 'contains_extra_data'), 'import_features', array('legend' => __('Features to use'), 'description' => __('Set features used to process the file.'))); $this->addDisplayGroup(array('stylesheet', 'stylesheet_parameters'), 'xsl_params', array('legend' => __('XSL transformation'), 'description' => __('Set xslt sheet and optional parameters used to process the file.'))); // Submit button. $submit = $this->createElement('submit', 'submit', array('label' => __('Upload'), 'class' => 'submit submit-medium')); $submit->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'xmlimportupload')))); $this->addElement($submit); $this->applyOmekaStyles(); $this->setAutoApplyOmekaStyles(false); }
<li class="element"> <div class="sortable-item"> <?php echo $this->formSelect($element_id_name, $element_id_value, array('class' => 'existing-element-drop-down'), get_table_options('Element', null, array('element_set_name' => ElementSet::ITEM_TYPE_NAME, 'sort' => 'alpha'))); ?> <?php echo $this->formHidden($element_order_name, $element_order_value, array('class' => 'element-order')); ?> <a href="" class="delete-element"><?php echo __('Remove'); ?> </a> </div> <div class="drawer-contents"></div> </li>
<?php $formStem = $block->getFormStem(); $options = $block->getOptions(); ?> <div class="timeline-id"> <?php echo $this->formLabel($formStem . '[options][timeline-id]', __('Select a timeline')); echo $this->formSelect($formStem . '[options][timeline-id]', @$options['timeline-id'], array(), get_table_options('NeatlineTimeTimeline')); ?> </div>
?> </td> </tr>--> <?php if (is_allowed('Users', 'browse')) { ?> <tr> <td><strong><?php echo $this->formLabel('user-search', __('Search By User')); ?> </strong></td> <td></td> <td> <?php echo $this->formSelect('owner_id', '', array('id' => 'owner_id', "class" => "facet-search-value", "style" => "margin-bottom:0; width:50%"), get_table_options('User')); ?> </td> </tr> <?php } ?> </table> <input id="search-form-submit" type="submit" value="<?php echo __("Search"); ?> " /> </form> </div>
</div> </fieldset> <fieldset id="fieldset-items"><legend><?php echo __('Items'); ?> </legend> <div class="field"> <div class="two columns alpha"> <?php echo $this->formLabel('archive_repertory_item_folder', __('How do you want to name your item folder, if any?')); ?> </div> <div class="five columns omega"> <div class="inputs"> <?php $elementsItem = get_table_options('Element', null, array('record_types' => array('Item', 'All'), 'sort' => 'alphaBySet')); // Remove the "Select Below" label. unset($elementsItem['']); $elementsItem = array('none' => __("Don't add folder"), 'id' => __('Internal item id')) + $elementsItem; echo $this->formSelect('archive_repertory_item_folder', get_option('archive_repertory_item_folder'), array(), $elementsItem); ?> <p class="explanation"> <?php echo __('If you choose to add a folder, Omeka will add subfolders for each item in "files" folders, for example "files/original/unique_identifier/".'); echo ' ' . __('New files will be stored inside them. Old files will be moved when item will be updated.') . '<br />'; echo __("Note that if you choose a non unique name, files will be mixed in the same folder, with higher risk of name collision."); echo ' ' . __('So recommended ids are a specifc metadata, "Dublin Core Identifier", "Internal item id" and eventually "Dublin Core Title".') . '<br />'; echo __('If this identifier does not exists, the Omeka internal item id will be used.'); ?> </p> </div>
public function init() { parent::init(); $oaiIdentifiers = $this->_getFiltered('oai_pmh_static_repository_oai_identifiers'); $mappings = $this->_getFiltered('oai_pmh_static_repository_mappings'); $formats = $this->_getFiltered('oai_pmh_static_repository_formats', 'prefix'); $formatsHarvests = $this->_getFilteredMetadataFormats('oai_pmh_static_repository_formats'); $optionsUpdateMetadata = array('keep' => __('Keep existing'), 'element' => __('By element'), 'strict' => __('Strict copy')); $defaultUpdateMetadata = 'element'; $optionsUpdateFiles = array('keep' => __('Keep existing'), 'deduplicate' => __('Deduplicate'), 'remove' => __('Remove deleted'), 'full' => __('Full update')); $defaultUpdateFiles = 'full'; $allowLocalPaths = Zend_Registry::get('oai_pmh_static_repository')->local_folders->allow == '1'; $this->setAttrib('id', 'oai-pmh-static-repository'); $this->setMethod('post'); $this->addElement('text', 'uri', array('label' => __('Base URI'), 'description' => __('The base url or path of the folder to expose.') . ' ' . __('If url, the server should allow directory listing.') . ($allowLocalPaths ? '' : ' ' . __('Local paths are forbidden by the administrator.')), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', array('Callback', true, array('callback' => array('OaiPmhStaticRepository_Form_Validator', 'validateUri')), 'messages' => array(Zend_Validate_Callback::INVALID_VALUE => __('A url or a path is required to add a folder.')))))); $this->addElement('radio', 'unreferenced_files', array('label' => __('Unreferenced Files'), 'description' => __('This option indicates what to do with files, maybe all of them, that are not referenced inside metadata files ("%s").', implode('", "', array_keys($mappings))), 'value' => get_option('oai_pmh_static_repository_unreferenced_files') ?: 'by_file', 'multiOptions' => array('by_file' => __('One item by file'), 'by_directory' => __('One item by directory'), 'skip' => __("Skip")))); $this->addElement('checkbox', 'records_for_files', array('label' => __('Files Metadata'), 'description' => __('Create metadata for files, not only for items.') . ' ' . __('Metadata for files may be useless if there is only one file by item.') . ' ' . __('If not set, the Dublin Core term "Identifier" will be used to link the item and its files.') . ' ' . __('If set, the Dublin Core term "Relation" or the Qualified Dublin Core term "Requires" will be used.') . ' ' . __('This parameter can be bypassed when a metadata file is directly included in the static repository.'), 'value' => true)); $this->addElement('text', 'exclude_extensions', array('label' => __('File extensions to exclude'), 'description' => __('A black-list of extensions (normal or double) to exclude from the source, separated by a space or a comma and without the initial dot.') . ' ' . __('The white-list is the Omeka one, defined in the security page.'))); $this->addElement('checkbox', 'allow_no_extension', array('label' => __('Allow file without extension'), 'description' => __('This option allows to import some specific files and urls.') . ' ' . __('The option "Disable File Upload Validation" in Settings > Security should be set too.'), 'value' => false)); $values = array('' => __('No default item type'), 'default' => __('Default type according to first file of each item')) + get_table_options('ItemType'); $this->addElement('select', 'item_type_id', array('label' => __('Default Item Type'), 'description' => __('Set the item type during import as Omeka Item Type and Dublin Core Type.') . ' ' . __('For the second option (type of the first file), it can be:') . ' ' . __('"Still image" for an item with a single Image, "Text" for an item with multiple image or a pdf, ' . '"Sound" for an audio file, "Moving Image" for a video file and none in all other cases.'), 'multiOptions' => $values, 'value' => '')); $this->addElement('checkbox', 'add_relations', array('label' => __('Add unique identifiers'), 'description' => __('To add unique identifiers allows to link items and files easily and independantly from Omeka.') . ' ' . __('Added identifiers are absolute urls.') . ' ' . __("This option is only usefull when there aren't such identifiers."), 'value' => false)); $this->addElement('text', 'element_delimiter', array('label' => __('Table/Spreadsheet element separator'), 'description' => __('If metadata are available in a table (as Open Document Spreadsheet ods), multiple elements can be set within one cell for the same field.') . ' ' . __('This character or this string, for example the pipe "|", can be used to delimite them.') . ' ' . __('If the delimiter is empty, then the whole text will be used.') . ' ' . __('Anyway, multiple columns can be mapped to the same element and multiple rows can manage multiple values for the same field of the same record.'), 'value' => '|')); // Only the "short_name" format of identifier allows to do update, // because it's stable and doesn't depend on position in the list of // files, it manages files and files defined by metadata files, and it's // short, as recommended. $this->addElement('hidden', 'oai_identifier_format', array('value' => 'short_name')); /* $this->addElement('select', 'oai_identifier_format', array( 'label' => __('Record Identifier'), 'description' => __('The local identifier of each record should be unique and stable.') . ' ' . __('This is used only for internal purposes.') . ' ' . __('See readme for more info.'), 'multiOptions' => label_table_options($oaiIdentifiers), 'value' => isset($oaiIdentifiers['position_folder']) ? 'position_folder' : null, )); */ $this->addElement('textarea', 'extra_parameters', array('label' => __('Add specific parameters'), 'description' => __('Some formats require specific parameters, for example to be used in the xsl sheets.') . ' ' . __('You can specify them here, one by line.'), 'value' => '', 'required' => false, 'rows' => 5, 'placeholder' => __('parameter_1_name = parameter 1 value'), 'filters' => array('StringTrim'), 'validators' => array(array('callback', false, array('callback' => array('OaiPmhStaticRepository_Form_Validator', 'validateExtraParameters')), 'messages' => array(Zend_Validate_Callback::INVALID_VALUE => __('Each extra parameter, one by line, should have a name separated from the value with a "=".')))))); $this->addElement('text', 'repository_name', array('label' => __('Name of the repository'), 'description' => __('The name is the title of this repository.') . ' ' . __('It should be unique.') . ' ' . __('If not set, the name will be the uri.'))); $this->addElement('text', 'admin_emails', array('label' => __('Administrator(s) Email(s)'), 'description' => __('The email(s) of the administrator(s) of this folder will be displayed in repository.'))); $this->addElement('multiCheckbox', 'metadata_formats', array('label' => __('Metadata Formats'), 'description' => __('Metadata formats exposed by the static repository.'), 'multiOptions' => $formats, 'value' => array('oai_dc', 'doc'))); $this->addElement('checkbox', 'use_dcterms', array('label' => __('Use Dublin Core Terms when possible'), 'description' => __('For formats like "Mets", if files metadata are filled, the process can use "Relation" or "Requires" / "Is Required By" to identify the relation between each item and associated files.'), 'value' => true)); $this->addElement('checkbox', 'repository_remote', array('label' => __('Remote Repository'), 'description' => __('If set, keep original url for the static repository and set Omeka as a simple gateway.') . ' ' . __('If not set, or if files are local, or not available via http/https, Omeka will be the static repository.') . ' ' . __('This option is important, because it is used to set the base url of the repository and the identifier of each record.') . ' ' . __('Local files will be stored in a subfolder of files/repositories.'), 'value' => false)); $this->addElement('text', 'repository_domain', array('label' => __('Domain'))); $this->addElement('text', 'repository_path', array('label' => __('Repository Path'))); $this->addElement('text', 'repository_identifier', array('label' => __('Repository Identifier'), 'description' => __('This identifier should be unique and contain only alphanumeric characters, "-" and "_", without space and without extension.'))); $this->addElement('checkbox', 'oaipmh_gateway', array('label' => __('Add to OAI-PMH gateway'), 'description' => __('Make this repository available internally by the OAI-PMH gateway.') . (plugin_is_active('OaiPmhGateway') ? '' : ' ' . __('This option will be used only if the plugin OAI-PMH Gateway is enabled.')), 'value' => true)); $canHarvest = plugin_is_active('OaiPmhGateway') && plugin_is_active('OaipmhHarvester'); $descriptionCanHarvest = __('This option will be used only if the plugins OAI-PMH Gateway and OAI-PMH Harvester are enabled.'); $this->addElement('checkbox', 'oaipmh_harvest', array('label' => __('Harvest via OAI-PMH'), 'description' => __('Harvest this repository with the OAI-PMH Harvester, via the OAI-PMH Gateway.') . ($canHarvest ? '' : ' ' . $descriptionCanHarvest), 'value' => true)); $this->addElement('select', 'oaipmh_harvest_prefix', array('label' => __('Format used to harvest'), 'description' => __('The "oai_dc" can import only metadata of items.') . ' ' . __('Choose an advanced one as "Mets" to harvest files too.') . ' ' . __('The default "Documents" format allows to import and to update all standard data, properties and extra data.') . ' ' . __('The selected format should be set as a format used by the static repository.') . ($canHarvest ? '' : ' ' . $descriptionCanHarvest), 'multiOptions' => $formatsHarvests, 'value' => isset($formatsHarvests['doc']) ? 'doc' : 'oai_dc')); $this->addElement('select', 'oaipmh_harvest_update_metadata', array('label' => __('Re-harvesting metadata'), 'description' => __('When metadata are updated, old ones may be kept or removed.') . ($canHarvest ? '' : ' ' . $descriptionCanHarvest), 'multiOptions' => $optionsUpdateMetadata, 'value' => $defaultUpdateMetadata)); $this->addElement('select', 'oaipmh_harvest_update_files', array('label' => __('Re-harvesting files'), 'description' => __('When files are updated, duplicates and old ones may be kept or removed.') . ($canHarvest ? '' : ' ' . $descriptionCanHarvest), 'multiOptions' => $optionsUpdateFiles, 'value' => $defaultUpdateFiles)); // Parameters for the folder of original files. $this->addDisplayGroup(array('uri'), 'oai_pmh_static_repository_folder', array('legend' => __('Archive Folder URI'))); // Parameters to create each record. $this->addDisplayGroup(array('unreferenced_files', 'records_for_files', 'exclude_extensions', 'allow_no_extension', 'item_type_id', 'add_relations', 'oai_identifier_format'), 'oai_pmh_static_repository_records', array('legend' => __('Archive Folder Records and files'), 'description' => __('Set parameters to create each record from files.') . ' ' . __('Note:') . ' ' . __('An item can have multiple files, and items and files can have different metadata.') . ' ' . __('For example, a record of a book can have each digitalized page attached to it.') . ' ' . __('An object can have multiple pictures under different views or taken by different photographers.') . ' ' . __('In that case, it is recommended to separate the metadata, for example to add data about each page or the different authors of the view.') . ' ' . __("Conversely, an image of a paint, a photography, or a book digitalized as a pdf and e-book files doesn't need to have separate records."))); // Parameters to create each record. $this->addDisplayGroup(array('element_delimiter'), 'archive_folder_table', array('legend' => __('Tables'), 'description' => __('Set specific parameters for table or spreadsheets.'))); apply_filters('oai_pmh_static_repository_add_parameters', $this); $this->addDisplayGroup(array('extra_parameters'), 'oai_pmh_static_repository_extra_parameters', array('legend' => __('Extra Parameters'))); // Parameters to create the static repository. $this->addDisplayGroup(array('repository_name', 'admin_emails', 'metadata_formats', 'use_dcterms'), 'oai_pmh_static_repository_repository', array('legend' => __('Static Repository'), 'description' => __('Set the generic parameters of the static repository.'))); // Parameters to create the url of the static repository. $this->addDisplayGroup(array('repository_remote', 'repository_domain', 'repository_path', 'repository_identifier'), 'oai_pmh_static_repository_base_url', array('legend' => __('Static Repository Url'), 'description' => __('These advanced options allow to change the url of the static repository, if wished.') . ' ' . __('This url is: "my_domain.com/my_path/to/my_folder_identifier.xml".') . ' ' . __('If not set, parameters will be determined from the uri.'))); // Parameters to harvest. $this->addDisplayGroup(array('oaipmh_gateway', 'oaipmh_harvest', 'oaipmh_harvest_prefix', 'oaipmh_harvest_update_metadata', 'oaipmh_harvest_update_files'), 'oai_pmh_static_repository_harvest', array('legend' => __('Static Repository Harvesting'), 'description' => __('Options for OAI-PMH harvesting (used after the first update).'))); $this->applyOmekaStyles(); $this->setAutoApplyOmekaStyles(false); $this->addElement('sessionCsrfToken', 'csrf_token'); $this->addElement('submit', 'submit', array('label' => __('Create Static Repository'), 'class' => 'submit submit-medium', 'decorators' => array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'field'))))); }
/** * Generates a form select populated by all elements and element sets. * * @param string The NeatlineTime option name. * @return string HTML. */ function neatlinetime_option_select($name = null) { if ($name) { return get_view()->formSelect($name, neatlinetime_get_option($name), array(), get_table_options('Element', null, array('record_types' => array('Item', 'All'), 'sort' => 'alphaBySet'))); } return false; }
<div class="five columns omega inputs"> <?php echo $this->formSelect('collection', @$_REQUEST['collection'], array('id' => 'collection-search'), get_table_options('Collection')); ?> </div> </div> <div id="search-by-type" class="field"> <div class="two columns alpha"> <?php echo $this->formLabel('item-type-search', __('Search By Type')); ?> </div> <div class="five columns omega inputs"> <?php echo $this->formSelect('type', @$_REQUEST['type'], array('id' => 'item-type-search'), get_table_options('ItemType')); ?> </div> </div> <div class="field"> <div class="two columns alpha"> <?php echo $this->formLabel('tag-search', __('Search By Tags')); ?> </div> <div class="five columns omega inputs"> <?php echo $this->formText('tags', @$_REQUEST['tags'], array('size' => '40', 'id' => 'tag-search')); ?> </div>
echo __('Featured'); ?> </label> <?php echo $this->formCheckbox('dropbox-featured'); ?> </div> </div> <div id="collection-form" class="field"> <label for="dropbox-collection-id"><?php echo __('Collection'); ?> </label> <div class="inputs"> <?php echo $this->formSelect('dropbox-collection-id', null, array(), get_table_options('Collection')); ?> </div> </div> <div id="tags-form" class="field"> <label for="dropbox-tags"><?php echo __('Tags'); ?> </label> <div class="inputs"> <?php echo $this->formText('dropbox-tags'); ?> <p class="explanation"><?php echo __('Separate tags with %s', option('tag_delimiter')); ?>
<li class="element"> <div class="sortable-item"> <?php $elementsArray = get_table_options('Element', null, array('sort' => 'alpha', 'item_type_id' => $item_type_id)); echo $this->formSelect($element_id_name, $element_id_value, array('class' => 'existing-element-drop-down'), $elementsArray); echo "<span>" . __("Prompt:") . "</span>"; echo $this->formText($element_prompt_name, $element_prompt_value, array('class' => 'prompt')); ?> <span class='long-text'><?php echo __('Multiple rows'); ?> </span> <?php echo $this->formCheckbox($element_long_name, null); ?> <?php echo $this->formHidden($element_order_name, $element_order_value, array('class' => 'element-order')); ?> <a href="" class="delete-element"><?php echo __('Remove'); ?> </a> </div> <div class="drawer-contents"></div> </li>
'>create an account</a> or <a href='<?php echo url('guest-user/user/login'); ?> '>log in</a> before contributing. You can still leave your identity to site visitors anonymous.</p> <?php } else { ?> <form method="post" action="" enctype="multipart/form-data"> <!--fieldset id="contribution-item-metadata"--><!--EB: modify HTML structure--> <div class="inputs hidden"> <!--EB: add hidden class--> <label for="contribution-type"><?php echo __("What type of item do you want to contribute?"); ?> </label> <?php $options = get_table_options('ContributionType'); ?> <?php $typeId = isset($type) ? $type->id : ''; ?> <?php echo $this->formSelect('contribution_type', $typeId, array('multiple' => false, 'id' => 'contribution-type'), $options); ?> <input type="submit" name="submit-type" id="submit-type" value="Select" /> </div> <!--div id="contribution-type-form"--><!--EB: modify HTML structure--> <?php if (isset($type)) { include 'type-form.php'; } ?>
/** * Get an array to be used in 'select' elements containing all collections. * * @return array $collectionOptions Array of all collections and their * IDs, which will be used to populate a dropdown menu on the main view */ private function _getCollectionOptions() { $options = get_table_options('Collection'); unset($options['']); return array('0' => __('All Collections')) + $options; }
:</label> <?php echo $this->formCheckbox('featured', $item->featured, array(), array('1', '0')); ?> </div> <?php } ?> </div> <!-- end public-featured div --> <div id="collection-form" class="field"> <?php echo $this->formLabel('collection-id', __('Collection')); ?> <div class="inputs"> <?php echo $this->formSelect('collection_id', $item->collection_id, array('id' => 'collection-id'), get_table_options('Collection')); ?> </div> <?php fire_plugin_hook('admin_items_form_collection', array('item' => $item, 'view' => $this)); ?> </div> <!-- end collection-form div --> <?php fire_plugin_hook("admin_items_panel_fields", array('view' => $this, 'record' => $item)); ?> </div> </section> </form> <?php echo foot();
<?php echo $this->formSelect('type', @$_REQUEST['type'], array('id' => 'item-type-search'), get_table_options('ItemType')); ?> </div> </div> <?php if (is_allowed('Users', 'browse')) { ?> <div class="field"> <?php echo $this->formLabel('user-search', __('Search By User')); ?> <div class="inputs"> <?php echo $this->formSelect('user', @$_REQUEST['user'], array('id' => 'user-search'), get_table_options('User')); ?> </div> </div> <?php } ?> </div> <div class="col-md-4"> <div class="field"> <?php echo $this->formLabel('tag-search', __('Search By Tags')); ?> <div class="inputs"> <?php
<div class="two columns alpha"> <label for="scripto_source_element"><?php echo __('Element source used to initialize transcription'); ?> </label> </div> <div class="inputs five columns omega"> <p class="explanation"><?php echo __('A document page is automatically initialized with this element, if available.'); echo ' ' . __('This is helpful when Scripto is used to correct OCR for typescript pages.'); echo ' ' . __('This can be useful to keep track of original source too.'); echo ' ' . __('When the transcription is updated, it is always save into the Scripto:Transcription field.'); ?> </p> <?php echo $this->formSelect('scripto_source_element', $element_id, array(), get_table_options('Element', null, array('record_types' => array('File', 'All'), 'sort' => 'alphaBySet'))); ?> </div> </div> <div class="field"> <div class="two columns alpha"> <label for="scripto_image_viewer"><?php echo __('Image viewer'); ?> </label> </div> <div class="inputs five columns omega"> <p class="explanation"><?php echo __('Select an image viewer to use when transcribing image files. %1$sOpenLayers%2$s ' . 'and %3$sZoom.it%4$s can display JPEG, PNG, GIF, and BMP formats. Zoom.it can ' . 'also display TIFF and ICO formats. By using Zoom.it you awknowledge that ' . 'you have read and agreed to the %5$sMicrosoft Zoom.it Terms of Service%6$s', '<a href="http://openlayers.org/">', '</a>', '<a href="http://zoom.it/">', '</a>', '<a href="http://zoom.it/pages/terms/">', '</a>'); ?>
/** * Form element for advanced search. */ function exhibit_builder_items_search() { $view = get_view(); $html = '<div class="field"><div class="two columns alpha">' . $view->formLabel('exhibit', __('Search by Exhibit')) . '</div><div class="five columns omega inputs">' . $view->formSelect('exhibit', @$_GET['exhibit'], array(), get_table_options('Exhibit')) . '</div></div>'; echo $html; }
<div class="field" id="type-select"> <div class="two columns alpha"> <?php echo $this->formLabel('item-type', __('Item Type')); ?> </div> <div class="inputs five columns omega"> <?php echo $this->formSelect('item_type_id', $item->item_type_id, array('id' => 'item-type'), get_table_options('ItemType')); ?> </div> <input type="submit" name="change_type" id="change_type" value="<?php echo __('Pick this type'); ?> " /> </div> <div id="type-metadata-form"> <?php echo common('change-type', compact('item'), 'items'); ?> </div> <?php fire_plugin_hook('admin_items_form_item_types', array('item' => $item, 'view' => $this));