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'))); return $form; }
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_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; }