Пример #1
0
 public function resetNavigationAction()
 {
     if (!$this->getRequest()->isPost()) {
         $this->_forward('method-not-allowed', 'error', 'default');
         return;
     }
     $form = $this->_getResetForm();
     if ($form->isValid($_POST)) {
         $nav = array_reverse(Omeka_Navigation::getNavigationOptionValueForInstall(), true);
         set_option(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME, $nav);
         $this->_helper->flashMessenger(__('The navigation settings have been reset.'), 'success');
         $this->_helper->redirector('edit-navigation');
     } else {
         throw new Omeka_Controller_Exception_404();
     }
 }
Пример #2
0
 private function _addOptions()
 {
     $task = new Installer_Task_Options();
     $task->setOptions(array('administrator_email' => $this->_getValue('administrator_email'), 'copyright' => $this->_getValue('copyright'), 'site_title' => $this->_getValue('site_title'), 'author' => $this->_getValue('author'), 'description' => $this->_getValue('description'), 'thumbnail_constraint' => $this->_getValue('thumbnail_constraint'), 'square_thumbnail_constraint' => $this->_getValue('square_thumbnail_constraint'), 'fullsize_constraint' => $this->_getValue('fullsize_constraint'), 'per_page_admin' => $this->_getValue('per_page_admin'), 'per_page_public' => $this->_getValue('per_page_public'), 'show_empty_elements' => $this->_getValue('show_empty_elements'), 'path_to_convert' => $this->_getValue('path_to_convert'), Theme::ADMIN_THEME_OPTION => Installer_Default::DEFAULT_ADMIN_THEME, Theme::PUBLIC_THEME_OPTION => Installer_Default::DEFAULT_PUBLIC_THEME, Omeka_Validate_File_Extension::WHITELIST_OPTION => Omeka_Validate_File_Extension::DEFAULT_WHITELIST, Omeka_Validate_File_MimeType::WHITELIST_OPTION => Omeka_Validate_File_MimeType::DEFAULT_WHITELIST, File::DISABLE_DEFAULT_VALIDATION_OPTION => (string) (!extension_loaded('fileinfo')), Omeka_Db_Migration_Manager::VERSION_OPTION_NAME => OMEKA_VERSION, 'display_system_info' => true, 'html_purifier_is_enabled' => 1, 'html_purifier_allowed_html_elements' => implode(',', Omeka_Filter_HtmlPurifier::getDefaultAllowedHtmlElements()), 'html_purifier_allowed_html_attributes' => implode(',', Omeka_Filter_HtmlPurifier::getDefaultAllowedHtmlAttributes()), 'tag_delimiter' => ',', Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME => Omeka_Navigation::getNavigationOptionValueForInstall(Omeka_Navigation::PUBLIC_NAVIGATION_MAIN_OPTION_NAME), 'search_record_types' => serialize(get_search_record_types()), 'api_enable' => false, 'api_per_page' => 50, 'show_element_set_headings' => 1));
     $task->install($this->_db);
 }