コード例 #1
0
 private function save()
 {
     $this->config->set_items_number_per_page($this->form->get_value('items_number_per_page'));
     if ($this->form->get_value('max_messages_number_enabled')) {
         $this->config->enable_max_messages_number();
         $this->config->set_max_messages_number($this->form->get_value('max_messages_number'));
     } else {
         $this->config->disable_max_messages_number();
     }
     $this->config->set_max_messages_number($this->form->get_value('max_messages_number'));
     if ($this->form->get_value('max_links_number_per_message_enabled')) {
         $this->config->enable_max_links_number_per_message();
         $this->config->set_max_links_number_per_message($this->form->get_value('max_links_number_per_message'));
     } else {
         $this->config->disable_max_links_number_per_message();
     }
     $forbidden_formatting_tags = array();
     foreach ($this->form->get_value('forbidden_formatting_tags') as $field => $option) {
         $forbidden_formatting_tags[] = $option->get_raw_value();
     }
     $this->config->set_forbidden_formatting_tags($forbidden_formatting_tags);
     if ($this->form->get_value('automatic_refresh_enabled')) {
         $this->config->enable_automatic_refresh();
         $this->config->set_refresh_delay($this->form->get_value('refresh_delay') * 60000);
     } else {
         $this->config->disable_automatic_refresh();
     }
     if ($this->form->get_value('date_displayed')) {
         $this->config->display_date();
     } else {
         $this->config->hide_date();
     }
     if ($this->form->get_value('shout_max_messages_number_enabled')) {
         $this->config->enable_shout_max_messages_number();
         $this->config->set_shout_max_messages_number($this->form->get_value('shout_max_messages_number'));
     } else {
         $this->config->disable_shout_max_messages_number();
     }
     if (ModulesManager::is_module_installed('BBCode')) {
         if ($this->form->get_value('shout_bbcode_enabled')) {
             $this->config->enable_shout_bbcode();
         } else {
             $this->config->disable_shout_bbcode();
         }
     }
     if ($this->form->get_value('validation_onkeypress_enter_enabled')) {
         $this->config->enable_validation_onkeypress_enter();
     } else {
         $this->config->disable_validation_onkeypress_enter();
     }
     $this->config->set_authorizations($this->form->get_value('authorizations')->build_auth_array());
     ShoutboxConfig::save();
 }