Exemplo n.º 1
0
 protected function _getForm($page = null)
 {
     $formOptions = array('type' => 'simple_pages_page', 'hasPublicPage' => true);
     if ($page && $page->exists()) {
         $formOptions['record'] = $page;
     }
     $form = new Omeka_Form_Admin($formOptions);
     $form->addElementToEditGroup('text', 'title', array('id' => 'simple-pages-title', 'value' => $page->title, 'label' => __('Title'), 'description' => __('Name and heading for the page (required)'), 'required' => true));
     $form->addElementToEditGroup('text', 'slug', array('id' => 'simple-pages-slug', 'value' => $page->slug, 'label' => __('Slug'), 'description' => __('The slug is the part of the URL for this page. A slug ' . 'will be created automatically from the title if one is ' . 'not entered. Letters, numbers, underscores, dashes, and ' . 'forward slashes are allowed.')));
     $form->addElementToEditGroup('checkbox', 'use_tiny_mce', array('id' => 'simple-pages-use-tiny-mce', 'checked' => $page->use_tiny_mce, 'values' => array(1, 0), 'label' => __('Use HTML editor?'), 'description' => __('Check this to add an HTML editor bar for easily creating HTML.')));
     $form->addElementToEditGroup('textarea', 'text', array('id' => 'simple-pages-text', 'cols' => 50, 'rows' => 25, 'value' => $page->text, 'label' => __('Text'), 'description' => __('Add content for page. This field supports shortcodes. For a list of available shortcodes, refer to the <a target=_blank href="http://omeka.org/codex/Shortcodes">Omeka Codex</a>.')));
     $form->addElementToSaveGroup('select', 'parent_id', array('id' => 'simple-pages-parent-id', 'multiOptions' => simple_pages_get_parent_options($page), 'value' => $page->parent_id, 'label' => __('Parent'), 'description' => __('The parent page')));
     $form->addElementToSaveGroup('text', 'order', array('value' => $page->order, 'label' => __('Order'), 'description' => __('The order of the page relative to the other pages with ' . 'the same parent')));
     $form->addElementToSaveGroup('checkbox', 'is_published', array('id' => 'simple_pages_is_published', 'values' => array(1, 0), 'checked' => $page->is_published, 'label' => __('Publish this page?'), 'description' => __('Checking this box will make the page public')));
     if (class_exists('Omeka_Form_Element_SessionCsrfToken')) {
         $form->addElement('sessionCsrfToken', 'csrf_token');
     }
     return $form;
 }
 private function _getForm()
 {
     $form = new Omeka_Form_Admin(array('type' => 'contribution_settings'));
     $form->addElementToEditGroup('text', 'contribution_page_path', array('label' => __('Contribution Slug'), 'description' => __('Relative path from the Omeka root to the desired location for the contribution form. If left blank, the default path will be named &#8220;contribution.&#8221;'), 'filters' => array(array('StringTrim', '/\\\\s'))));
     $form->addElementToEditGroup('text', 'contribution_email_sender', array('label' => __('Contribution Confirmation Email'), 'description' => __('An email message will be sent to each contributor from this address confirming that they submitted a contribution to this website. Leave blank if you do not want an email sent.'), 'validators' => array('EmailAddress')));
     $form->addElementToEditGroup('textarea', 'contribution_email_recipients', array('label' => __('New Contribution Notification Emails'), 'description' => __('An email message will be sent to each address here whenever a new item is contributed. Leave blank if you do not want anyone to be alerted of contributions by email.'), 'attribs' => array('rows' => '5')));
     $form->addElementToEditGroup('textarea', 'contribution_consent_text', array('label' => __('Text of Terms of Service'), 'description' => __('The text of the legal disclaimer to which contributors will agree.'), 'attribs' => array('class' => 'html-editor', 'rows' => '15')));
     $form->addElementToEditGroup('checkbox', 'contribution_simple', array('label' => __("Use 'Simple' Options"), 'description' => __("This will require an email address from contributors, and create a guest user from that information. If those users want to use the account, they will have to request a new password for the account. If you want to collect additional information about contributors, you cannot use the simple option. See <a href='http://omeka.org/codex/Plugins/Contribution_2.0'>documentation</a> for details. ")), array('checked' => (bool) get_option('contribution_simple') ? 'checked' : ''));
     $form->addElementToEditGroup('textarea', 'contribution_email', array('label' => __("Email text to send to contributors"), 'description' => __("Email text to send to contributors when they submit an item. A link to their contribution will be appended. If using the 'Simple' option, we recommend that you notify contributors that a guest user account has been created for them, and what they gain by confirming their account."), 'attribs' => array('class' => 'html-editor', 'rows' => '15')));
     $collections = get_db()->getTable('Collection')->findPairsForSelectForm();
     $collections = array('' => __('Do not put contributions in any collection')) + $collections;
     $form->addElementToEditGroup('select', 'contribution_collection_id', array('label' => __('Contribution Collection'), 'description' => __('The collection to which contributions will be added. Changes here will only affect new contributions.'), 'multiOptions' => $collections));
     $types = get_db()->getTable('ContributionType')->findPairsForSelectForm();
     $types = array('' => __('No default type')) + $types;
     $form->addElementToEditGroup('select', 'contribution_default_type', array('label' => __('Default Contribution Type'), 'description' => __('The type that will be chosen for contributors by default.'), 'multiOptions' => $types));
     if (plugin_is_active('UserProfiles')) {
         $profileTypes = $this->_helper->db->getTable('UserProfilesType')->findPairsForSelectForm();
         $form->addElementToEditGroup('select', 'contribution_user_profile_type', array('label' => __('Choose a profile type for contributors'), 'description' => __('Configure the profile type under User Profiles'), 'multiOptions' => array('' => __("None")) + $profileTypes));
     }
     return $form;
 }
Exemplo n.º 3
0
 protected function _getForm($search = null)
 {
     $formOptions = array('type' => 'catalog_search_search');
     if ($search && $search->exists()) {
         $formOptions['record'] = $search;
     }
     $form = new Omeka_Form_Admin($formOptions);
     $form->addElementToEditGroup('text', 'catalog_name', array('id' => 'catalog-search-catalog-name', 'value' => $search->catalog_name, 'label' => __('Catalog Name'), 'description' => __('The name of the catalog (used as the text of the link)'), 'required' => true));
     $form->addElementToEditGroup('text', 'query_elementtouse', array('id' => 'catalog-element-to-use', 'value' => $search->query_elementtouse, 'label' => __('Element to Use'), 'description' => __('The element that you want to search for (in Zotero array). For instance, Subject, Author, Title, etc.'), 'required' => true));
     $form->addElementToEditGroup('text', 'query_string', array('id' => 'catalog-search-query-string', 'value' => $search->query_string, 'label' => __('Query String'), 'description' => __('The query string is the URL of a search at the catalog, ' . 'with the characters <code>%s</code> replacing the ' . 'search terms. <br/> ' . 'Example: <code>https://www.google.com/search?q=%s</code><br/> ' . 'See <a href="http://chronicle.com/blogs/profhacker/how-to-hack-urls-for-faster-searches-in-your-browser/42304">this ProfHacker post</a> for help.'), 'required' => true));
     $form->addElementToEditGroup('checkbox', 'query_type', array('id' => 'catalog-search-query-type', 'checked' => $search->query_type, 'values' => array(1, 0), 'label' => __('Use simple query?'), 'description' => __('Check this to use simplified query terms for catalogs that ' . 'are finicky or unsophisticated.')));
     $form->addElementToSaveGroup('checkbox', 'display', array('id' => 'catalog-search-display', 'values' => array(1, 0), 'checked' => $search->display, 'label' => __('Display this link?'), 'description' => __('Checking this box will make the link to the catalog ' . 'appear on public item pages.')));
     return $form;
 }