$config->set_max_weight(retrieve(POST, 'max_weight', 1024)); $config->set_quality(retrieve(POST, 'quality', 80)); if (retrieve(POST, 'logo_enabled', '')) { $config->enable_logo(); } else { $config->disable_logo(); } $config->set_logo(TextHelper::strprotect(retrieve(POST, 'logo', ''), TextHelper::HTML_PROTECT, TextHelper::ADDSLASHES_NONE)); $config->set_logo_transparency(retrieve(POST, 'logo_transparency', 40)); $config->set_logo_horizontal_distance(retrieve(POST, 'logo_horizontal_distance', 5)); $config->set_logo_vertical_distance(retrieve(POST, 'logo_vertical_distance', 5)); $config->set_categories_number_per_page(retrieve(POST, 'categories_number_per_page', 10)); $config->set_columns_number(retrieve(POST, 'columns_number', 4)); $config->set_pics_number_per_page(retrieve(POST, 'pics_number_per_page', 16)); if (retrieve(POST, 'notation_scale', 5) != $config->get_notation_scale()) { NotationService::update_notation_scale('gallery', $config->get_notation_scale(), retrieve(POST, 'notation_scale', 5)); } $config->set_notation_scale(retrieve(POST, 'notation_scale', 5)); if (retrieve(POST, 'title_enabled', '')) { $config->enable_title(); } else { $config->disable_title(); } if (retrieve(POST, 'comments_enabled', '')) { $config->enable_comments(); } else { $config->disable_comments(); } if (retrieve(POST, 'notation_enabled', '')) { $config->enable_notation(); } else {
private function save() { $this->config->set_number_articles_per_page($this->form->get_value('number_articles_per_page')); if ($this->form->get_value('display_icon_cats')) { $this->config->enable_cats_icon(); $this->config->set_number_cols_display_cats($this->form->get_value('number_cols_display_cats')); } else { $this->config->disable_cats_icon(); } $this->config->set_number_categories_per_page($this->form->get_value('number_categories_per_page')); $this->config->set_number_character_to_cut($this->form->get_value('number_character_to_cut', $this->config->get_number_character_to_cut())); if ($this->form->get_value('notation_enabled')) { $this->config->enable_notation(); $this->config->set_notation_scale($this->form->get_value('notation_scale')); if ($this->form->get_value('notation_scale') != $this->config->get_notation_scale()) { NotationService::update_notation_scale('articles', $this->config->get_notation_scale(), $this->form->get_value('notation_scale')); } } else { $this->config->disable_notation(); } if ($this->form->get_value('comments_enabled')) { $this->config->enable_comments(); } else { $this->config->disable_comments(); } if ($this->form->get_value('display_descriptions_to_guests')) { $this->config->display_descriptions_to_guests(); } else { $this->config->hide_descriptions_to_guests(); } $this->config->set_display_type($this->form->get_value('display_type')->get_raw_value()); $this->config->set_root_category_description($this->form->get_value('root_category_description')); $this->config->set_authorizations($this->form->get_value('authorizations')->build_auth_array()); ArticlesConfig::save(); ArticlesService::get_categories_manager()->regenerate_cache(); }
private function save() { $this->config->set_items_number_per_page($this->form->get_value('items_number_per_page')); $this->config->set_categories_number_per_page($this->form->get_value('categories_number_per_page')); $this->config->set_columns_number_per_line($this->form->get_value('columns_number_per_line')); $this->config->set_category_display_type($this->form->get_value('category_display_type')->get_raw_value()); if ($this->config->get_category_display_type() != DownloadConfig::DISPLAY_ALL_CONTENT) { if ($this->form->get_value('display_descriptions_to_guests')) { $this->config->display_descriptions_to_guests(); } else { $this->config->hide_descriptions_to_guests(); } } if ($this->form->get_value('author_displayed')) { $this->config->display_author(); } else { $this->config->hide_author(); } if ($this->form->get_value('comments_enabled')) { $this->config->enable_comments(); } else { $this->config->disable_comments(); } if ($this->form->get_value('notation_enabled')) { $this->config->enable_notation(); $this->config->set_notation_scale($this->form->get_value('notation_scale')); if ($this->form->get_value('notation_scale') != $this->config->get_notation_scale()) { NotationService::update_notation_scale('download', $this->config->get_notation_scale(), $this->form->get_value('notation_scale')); } } else { $this->config->disable_notation(); } $this->config->set_root_category_description($this->form->get_value('root_category_description')); $this->config->set_sort_type($this->form->get_value('sort_type')->get_raw_value()); $this->config->set_files_number_in_menu($this->form->get_value('files_number_in_menu')); $this->config->set_authorizations($this->form->get_value('authorizations')->build_auth_array()); DownloadConfig::save(); DownloadService::get_categories_manager()->regenerate_cache(); DownloadCache::invalidate(); }
private function save() { $this->config->set_items_number_per_page($this->form->get_value('items_number_per_page')); $this->config->set_categories_number_per_page($this->form->get_value('categories_number_per_page')); $this->config->set_columns_number_per_line($this->form->get_value('columns_number_per_line')); if ($this->form->get_value('author_displayed')) { $this->config->display_author(); } else { $this->config->hide_author(); } if ($this->form->get_value('comments_enabled')) { $this->config->enable_comments(); } else { $this->config->disable_comments(); } if ($this->form->get_value('notation_enabled')) { $this->config->enable_notation(); $this->config->set_notation_scale($this->form->get_value('notation_scale')); if ($this->form->get_value('notation_scale') != $this->config->get_notation_scale()) { NotationService::update_notation_scale('media', $this->config->get_notation_scale(), $this->form->get_value('notation_scale')); } } else { $this->config->disable_notation(); } $this->config->set_max_video_width($this->form->get_value('max_video_width')); $this->config->set_max_video_height($this->form->get_value('max_video_height')); $this->config->set_root_category_description($this->form->get_value('root_category_description')); $this->config->set_root_category_content_type($this->form->get_value('root_category_content_type')->get_raw_value()); $this->config->set_authorizations($this->form->get_value('authorizations')->build_auth_array()); MediaConfig::save(); MediaService::get_categories_manager()->regenerate_cache(); }