public function execute(HTTPRequestCustom $request)
 {
     parent::load_lang($request);
     $this->build_form();
     if ($this->submit->has_been_submited()) {
         $this->handle_form();
     }
     return $this->create_response();
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->check_authorizations();
     $this->build_form($request);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->save();
         $this->redirect();
     }
     $this->tpl->put_all(array('FORM' => $this->form->display(), 'C_TINYMCE_EDITOR' => AppContext::get_current_user()->get_editor() == 'TinyMCE'));
     return $this->build_response($this->tpl);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->check_authorizations();
     $this->build_form($request);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $id = $this->save();
         AppContext::get_response()->redirect(GuestbookUrlBuilder::home($this->is_new_message ? 1 : $this->form->get_value('page'), $id));
     }
     $this->view->put('FORM', $this->form->display());
     return $this->generate_response($this->view);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->build_form();
     $tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->save();
         $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('message.success.config', 'status-messages-common'), MessageHelper::SUCCESS, 5));
     }
     $tpl->put('FORM', $this->form->display());
     return $this->build_response($tpl);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->build_form();
     $tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->handle_submit();
         $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('process.success', 'status-messages-common'), MessageHelper::SUCCESS, 5));
     }
     $tpl->put('FORM', $this->form->display());
     return new AdminCacheMenuDisplayResponse($tpl, $this->lang['syndication_cache']);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->check_authorizations();
     $this->build_form($request);
     $tpl = new StringTemplate('# INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->save();
     }
     $tpl->put('FORM', $this->form->display());
     return $this->generate_response($tpl);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->build_form();
     $tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->save();
         $this->form->get_field_by_id('database_tables_optimization_day')->set_hidden(!$this->config->is_database_tables_optimization_enabled());
         $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('message.success.config', 'status-messages-common'), MessageHelper::SUCCESS, 5));
     }
     $tpl->put('FORM', $this->form->display());
     return new AdminDatabaseDisplayResponse($tpl, $this->lang['module_config_title']);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->build_form();
     $tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->save();
         $this->form->get_field_by_id('display_descriptions_to_guests')->set_hidden($this->config->get_category_display_type() == DownloadConfig::DISPLAY_ALL_CONTENT);
         $this->form->get_field_by_id('notation_scale')->set_hidden(!$this->config->is_notation_enabled());
         $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('message.success.config', 'status-messages-common'), MessageHelper::SUCCESS, 5));
     }
     $tpl->put('FORM', $this->form->display());
     return new AdminDownloadDisplayResponse($tpl, $this->lang['module_config_title']);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->build_form();
     $tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->save();
         $this->form->get_field_by_id('birthday_color')->set_hidden(!$this->config->is_members_birthday_enabled());
         $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('message.success.config', 'status-messages-common'), MessageHelper::SUCCESS, 5));
     }
     //Display the form on the template
     $tpl->put('FORM', $this->form->display());
     //Display the generated page
     return new AdminCalendarDisplayResponse($tpl, $this->lang['module_config_title']);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $form = $this->build_form();
     if ($this->submit_button->has_been_submited() || $this->preview_button->has_been_submited()) {
         if ($form->validate()) {
             $this->view->put_all(array('C_RESULT' => true, 'TEXT' => $form->get_value('text'), 'MAIL' => $form->get_value('mail'), 'WEB' => $form->get_value('siteweb'), 'AGE' => $form->get_value('age'), 'MULTI_LINE_TEXT' => $form->get_value('multi_line_text'), 'RICH_TEXT' => $form->get_value('rich_text'), 'RADIO' => $form->get_value('radio')->get_label(), 'CHECKBOX' => var_export($form->get_value('checkbox'), true), 'SELECT' => $form->get_value('select')->get_label(), 'HIDDEN' => $form->get_value('hidden'), 'DATE' => $form->get_value('date')->format(Date::FORMAT_DAY_MONTH_YEAR), 'DATE_TIME' => $form->get_value('date_time')->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE), 'H_T_TEXT_FIELD' => $form->get_value('alone'), 'C_PREVIEW' => $this->preview_button->has_been_submited()));
             $file = $form->get_value('file');
             if ($file !== null) {
                 $this->view->put_all(array('FILE' => $file->get_name() . ' - ' . $file->get_size() . 'b - ' . $file->get_mime_type()));
             }
         }
     }
     $this->view->put('form', $form->display());
     return $this->generate_response();
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->build_form($request);
     $tpl = new StringTemplate('# INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->set_properties();
         $this->save();
         if ($this->is_new_category) {
             AppContext::get_response()->redirect($this->get_categories_management_url(), StringVars::replace_vars($this->get_success_message(), array('name' => $this->get_category()->get_name())));
         } else {
             AppContext::get_response()->redirect($this->form->get_value('referrer') ? $this->form->get_value('referrer') : $this->get_categories_management_url(), StringVars::replace_vars($this->get_success_message(), array('name' => $this->get_category()->get_name())));
         }
     }
     $tpl->put('FORM', $this->form->display());
     return $this->generate_response($tpl);
 }
 public function execute(HTTPRequestCustom $request)
 {
     AppContext::get_session()->csrf_get_protect();
     $this->init();
     $this->get_event($request);
     $this->check_authorizations();
     $tpl = new StringTemplate('# INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->event->belongs_to_a_serie()) {
         $this->build_form($request);
     }
     if ($this->event->belongs_to_a_serie() && $this->submit_button->has_been_submited() && $this->form->validate() || !$this->event->belongs_to_a_serie()) {
         $this->delete_event($this->event->belongs_to_a_serie() ? $this->form->get_value('delete_serie')->get_raw_value() : false);
         $this->redirect($request);
     }
     $tpl->put('FORM', $this->form->display());
     return $this->generate_response($tpl);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     $this->build_form();
     $tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $this->save();
         $this->form->get_field_by_id('max_messages_number')->set_hidden(!$this->config->is_max_messages_number_enabled());
         $this->form->get_field_by_id('max_links_number_per_message')->set_hidden(!$this->config->is_max_links_number_per_message_enabled());
         $this->form->get_field_by_id('forbidden_formatting_tags')->set_selected_options($this->config->get_forbidden_formatting_tags());
         $this->form->get_field_by_id('refresh_delay')->set_hidden(!$this->config->is_automatic_refresh_enabled());
         $this->form->get_field_by_id('shout_max_messages_number')->set_hidden(!$this->config->is_shout_max_messages_number_enabled());
         $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('message.success.config', 'status-messages-common'), MessageHelper::SUCCESS, 5));
     }
     $tpl->put('FORM', $this->form->display());
     return new AdminShoutboxDisplayResponse($tpl, $this->lang['module_config_title']);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init($request);
     if (!$this->get_parameter_items_exists()) {
         $this->delete_parameter_in_config();
         AppContext::get_response()->redirect(BugtrackerUrlBuilder::configuration());
     }
     $this->build_form();
     $tpl = new StringTemplate('# INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         if ($this->form->get_value('delete_parameter_and_content')) {
             $this->delete_parameter_and_bugs();
         } else {
             $other_id = $this->form->get_value('move_into_another')->get_raw_value();
             $this->move_into_another($other_id);
         }
         $this->delete_parameter_in_config();
         AppContext::get_response()->redirect(BugtrackerUrlBuilder::configuration());
     }
     $tpl->put('FORM', $this->form->display());
     return new AdminBugtrackerDisplayResponse($tpl, $this->lang['config.delete_parameter.' . $this->parameter]);
 }
 public function execute(HTTPRequestCustom $request)
 {
     $this->init();
     try {
         $category = $this->get_category();
     } catch (CategoryNotFoundException $e) {
         $controller = PHPBoostErrors::unexisting_page();
         DispatchManager::redirect($controller);
     }
     $childrens = $this->get_category_childrens($category);
     if (empty($childrens) && !$this->get_category_items_exists($category)) {
         $this->get_categories_manager()->delete($this->get_category()->get_id());
         AppContext::get_response()->redirect($this->get_categories_management_url(), StringVars::replace_vars($this->get_success_message(), array('name' => $this->get_category()->get_name())));
     }
     $this->build_form();
     $tpl = new StringTemplate('# INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         if ($this->form->get_value('delete_category_and_content')) {
             $this->get_categories_manager()->delete($this->get_category()->get_id());
             foreach ($childrens as $id => $category) {
                 $this->get_categories_manager()->delete($id);
             }
         } else {
             $id_parent = $this->form->get_value('move_in_other_cat')->get_raw_value();
             $this->get_categories_manager()->move_items_into_another($category, $id_parent);
             $childrens = $this->get_category_childrens($category, false);
             foreach ($childrens as $id => $category) {
                 $this->get_categories_manager()->move_into_another($category, $id_parent);
             }
             $this->get_categories_manager()->delete($this->get_category()->get_id());
         }
         AppContext::get_response()->redirect($this->get_categories_management_url(), StringVars::replace_vars($this->get_success_message(), array('name' => $this->get_category()->get_name())));
     }
     $tpl->put('FORM', $this->form->display());
     return $this->generate_response($tpl);
 }