当前位置: 首页>>代码示例>>PHP>>正文


PHP HTMLForm::get_value方法代码示例

本文整理汇总了PHP中HTMLForm::get_value方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLForm::get_value方法的具体用法?PHP HTMLForm::get_value怎么用?PHP HTMLForm::get_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLForm的用法示例。


在下文中一共展示了HTMLForm::get_value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute(HTTPRequestCustom $request)
 {
     $this->load_lang();
     $this->load_config();
     $theme = $request->get_value('theme', 'all');
     if ($theme !== 'all' && !ThemesManager::get_theme_existed($theme)) {
         AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
     }
     $this->build_form($theme);
     $tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
     $tpl->add_lang($this->lang);
     if ($this->submit_button->has_been_submited() && $this->form->validate()) {
         $header_logo = $this->form->get_value('header_logo', null);
         if ($header_logo !== null) {
             $file_type = new FileType(new File($header_logo->get_name()));
             if ($file_type->is_picture()) {
                 $this->save($header_logo, $theme);
                 AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
             } else {
                 $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('process.error', 'status-messages-common'), MessageHelper::ERROR, 4));
             }
         } elseif ($this->form->get_value('use_default_logo')) {
             $this->delete_pictures_saved($theme);
             AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
         } else {
             $tpl->put('MSG', MessageHelper::display(LangLoader::get_message('process.error', 'status-messages-common'), MessageHelper::ERROR, 4));
         }
     }
     $tpl->put('FORM', $this->form->display());
     return new AdminCustomizationDisplayResponse($tpl, $this->lang['customization.interface']);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:AdminCustomizeInterfaceController.class.php

示例2: save

 private function save()
 {
     $this->file_upload_config->set_authorization_enable_interface_files($this->form->get_value('authorizations')->build_auth_array());
     $this->file_upload_config->set_maximum_size_upload($this->form->get_value('size_limit') * 1024);
     if ($this->form->get_value('bandwidth_protect')) {
         $this->file_upload_config->set_enable_bandwidth_protect(true);
     } else {
         $this->file_upload_config->set_enable_bandwidth_protect(false);
     }
     $authorized_extensions = $this->form->get_value('authorized_extensions');
     $authorized_extensions = array();
     foreach ($this->form->get_value('authorized_extensions') as $field => $option) {
         $authorized_extensions[] = $option->get_raw_value();
     }
     $extend_extensions = preg_split('`, ?`', trim($this->form->get_value('extend_extensions')));
     if (is_array($extend_extensions)) {
         foreach ($extend_extensions as $extension) {
             //Suppression de tous les caractères interdits dans les extensions
             $extension = str_replace('-', '', Url::encode_rewrite($extension));
             if ($extension != '' && !isset($authorized_extensions[$extension]) && $extension != 'php') {
                 array_push($authorized_extensions, $extension);
             }
         }
     }
     $this->file_upload_config->set_authorized_extensions($authorized_extensions);
     FileUploadConfig::save();
     //Régénération du htaccess.
     HtaccessFileCache::regenerate();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:29,代码来源:AdminFilesConfigController.class.php

示例3: save

 private function save($id)
 {
     $condition = "WHERE id = :id";
     $columns = array('mail' => $this->form->get_value('mail'));
     $parameters = array('id' => $id);
     PersistenceContext::get_querier()->update(NewsletterSetup::$newsletter_table_subscribers, $columns, $condition, $parameters);
     NewsletterStreamsCache::invalidate();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:8,代码来源:NewsletterEditSubscriberController.class.php

示例4: save

 private function save()
 {
     $this->config->set_number_member_displayed($this->form->get_value('number_member_displayed'));
     $this->config->set_number_members_per_page($this->form->get_value('number_members_per_page'));
     $this->config->set_display_order($this->form->get_value('display_order')->get_raw_value());
     $this->config->set_authorizations($this->form->get_value('authorizations')->build_auth_array());
     OnlineConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:8,代码来源:AdminOnlineConfigController.class.php

示例5: save

 private function save()
 {
     $newsletter_config = NewsletterConfig::load();
     $newsletter_config->set_mail_sender($this->form->get_value('mail_sender'));
     $newsletter_config->set_newsletter_name($this->form->get_value('newsletter_name'));
     $newsletter_config->set_authorizations($this->form->get_value('authorizations')->build_auth_array());
     NewsletterConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:8,代码来源:AdminNewsletterConfigController.class.php

示例6: handle_form

 private function handle_form()
 {
     $config = SitemapConfig::load();
     if ($this->form->get_value('enable_sitemap_xml')) {
         $config->enable_sitemap_xml_generation();
         $config->set_sitemap_xml_life_time((int) $this->form->get_value('file_life_time'));
     } else {
         $config->disable_sitemap_xml_generation();
     }
     SitemapConfig::save($config);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:AdminSitemapController.class.php

示例7: get_data

 public function get_data(HTMLForm $form, MemberExtendedField $member_extended_field)
 {
     $field_name = $member_extended_field->get_field_name();
     if ($form->has_field($field_name)) {
         $timestamp = $form->get_value($field_name)->get_timestamp();
         if (!empty($timestamp)) {
             return $form->get_value($field_name)->format(Date::FORMAT_TIMESTAMP);
         }
         return '';
     }
     return '';
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:MemberUserBornExtendedField.class.php

示例8: save

 private function save()
 {
     $this->configuration->set_authorizations($this->form->get_value('authorizations')->build_auth_array());
     $this->configuration->set_number_comments_display($this->form->get_value('number_comments_display'));
     $forbidden_tags = array();
     foreach ($this->form->get_value('forbidden_tags') as $field => $option) {
         $forbidden_tags[] = $option->get_raw_value();
     }
     $this->configuration->set_forbidden_tags($forbidden_tags);
     $this->configuration->set_max_links_comment($this->form->get_value('max_links_comment'));
     $this->configuration->set_order_display_comments($this->form->get_value('order_display_comments')->get_raw_value());
     CommentsConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:13,代码来源:AdminCommentsConfigController.class.php

示例9: save

 private function save()
 {
     $now = new Date();
     $current_user = AppContext::get_current_user();
     if ($this->config->are_pm_enabled() && $this->config->are_pm_delete_enabled()) {
         //Add comment if needed
         $comment = !$this->form->field_is_disabled('comments_message') ? $this->form->get_value('comments_message', '') : '';
         //Send PM with comment to updaters if the option is enabled
         BugtrackerPMService::send_PM_to_updaters('delete', $this->bug->get_id(), $comment);
     }
     //Delete bug
     BugtrackerService::delete("WHERE id=:id", array('id' => $this->bug->get_id()));
     //Delete bug history
     BugtrackerService::delete_history("WHERE bug_id=:id", array('id' => $this->bug->get_id()));
     //Delete comments
     CommentsService::delete_comments_topic_module('bugtracker', $this->bug->get_id());
     //Delete admin alert
     if ($this->config->are_admin_alerts_enabled()) {
         $alerts = AdministratorAlertService::find_by_criteria($this->bug->get_id(), 'bugtracker');
         if (!empty($alerts)) {
             AdministratorAlertService::delete_alert($alerts[0]);
         }
     }
     BugtrackerStatsCache::invalidate();
     Feed::clear_cache('bugtracker');
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:26,代码来源:BugtrackerDeleteBugController.class.php

示例10: save

 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();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:32,代码来源:AdminMediaConfigController.class.php

示例11: save

 private function save($id)
 {
     $extended_field = new ExtendedField();
     $extended_field->set_id($id);
     $extended_field = ExtendedFieldsService::data_field($extended_field);
     $freeze = $extended_field->get_is_freeze();
     if (!$freeze) {
         $extended_field->set_field_name(ExtendedField::rewrite_field_name($this->form->get_value('name', $extended_field->get_field_name())));
         $extended_field->set_field_type($this->form->get_value('field_type', $extended_field->get_field_type())->get_raw_value());
     } else {
         $extended_field->set_field_name(TextHelper::htmlspecialchars($extended_field->get_field_name()));
         $extended_field->set_field_type($extended_field->get_field_type());
     }
     $extended_field->set_name(TextHelper::htmlspecialchars($this->form->get_value('name')));
     $extended_field->set_position(PersistenceContext::get_querier()->get_column_value(DB_TABLE_MEMBER_EXTENDED_FIELDS_LIST, 'MAX(position) + 1', ''));
     $extended_field->set_description(TextHelper::htmlspecialchars($this->form->get_value('description', $extended_field->get_description())));
     if (!$this->form->field_is_disabled('possible_values')) {
         $extended_field->set_possible_values($this->form->get_value('possible_values'));
     }
     if (!$this->form->field_is_disabled('default_value')) {
         $extended_field->set_default_value($this->form->get_value('default_value'));
     }
     $extended_field->set_is_required((bool) $this->form->get_value('field_required'));
     $extended_field->set_display((bool) $this->form->get_value('display'));
     $regex = 0;
     if (!$this->form->field_is_disabled('regex_type')) {
         $regex = is_numeric($this->form->get_value('regex_type', '')->get_raw_value()) ? $this->form->get_value('regex_type', '')->get_raw_value() : $this->form->get_value('regex', '');
     }
     $extended_field->set_regex($regex);
     $extended_field->set_authorization($this->form->get_value('authorizations', $extended_field->get_authorization())->build_auth_array());
     ExtendedFieldsService::update($extended_field);
     return $extended_field;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:33,代码来源:AdminExtendedFieldMemberEditController.class.php

示例12: handle_form

 private function handle_form()
 {
     $installation_services = new InstallationServices();
     $installation_services->configure_website($this->form->get_value('host'), $this->form->get_value('path'), $this->form->get_value('name'), $this->form->get_value('slogan'), $this->form->get_value('description'), $this->form->get_value('timezone')->get_raw_value());
     $this->security_config->set_internal_password_min_length($this->form->get_value('internal_password_min_length'));
     $this->security_config->set_internal_password_strength($this->form->get_value('internal_password_strength')->get_raw_value());
     if ($this->form->get_value('login_and_email_forbidden_in_password')) {
         $this->security_config->forbid_login_and_email_in_password();
     } else {
         $this->security_config->allow_login_and_email_in_password();
     }
     SecurityConfig::save();
     if ($this->server_configuration->has_curl_library()) {
         if ($this->form->get_value('fb_auth_enabled')) {
             $this->authentication_config->enable_fb_auth();
             $this->authentication_config->set_fb_app_id($this->form->get_value('fb_app_id'));
             $this->authentication_config->set_fb_app_key($this->form->get_value('fb_app_key'));
         } else {
             $this->authentication_config->disable_fb_auth();
         }
         if ($this->form->get_value('google_auth_enabled')) {
             $this->authentication_config->enable_google_auth();
             $this->authentication_config->set_google_client_id($this->form->get_value('google_client_id'));
             $this->authentication_config->set_google_client_secret($this->form->get_value('google_client_secret'));
         } else {
             $this->authentication_config->disable_google_auth();
         }
         AuthenticationConfig::save();
     }
     AppContext::get_response()->redirect(InstallUrlBuilder::admin());
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:InstallWebsiteConfigController.class.php

示例13: save

 private function save()
 {
     $has_error = false;
     $registration_pass = $this->user_accounts_config->get_member_accounts_validation_method() == UserAccountsConfig::MAIL_USER_ACCOUNTS_VALIDATION ? KeyGenerator::generate_key(15) : '';
     $user_aprobation = $this->user_accounts_config->get_member_accounts_validation_method() == UserAccountsConfig::AUTOMATIC_USER_ACCOUNTS_VALIDATION;
     $user = new User();
     $user->set_display_name($this->form->get_value('display_name'));
     $user->set_level(User::MEMBER_LEVEL);
     $user->set_email($this->form->get_value('email'));
     $user->set_show_email(!$this->form->get_value('user_hide_mail'));
     $user->set_locale($this->form->get_value('lang')->get_raw_value());
     $user->set_editor($this->form->get_value('text-editor')->get_raw_value());
     $user->set_timezone($this->form->get_value('timezone')->get_raw_value());
     if ($this->form->has_field('theme')) {
         $user->set_theme($this->form->get_value('theme')->get_raw_value());
     }
     $login = $this->form->get_value('email');
     if ($this->form->get_value('custom_login')) {
         $login = $this->form->get_value('login');
     }
     $auth_method = new PHPBoostAuthenticationMethod($login, $this->form->get_value('password'));
     $auth_method->set_association_parameters($user_aprobation, $registration_pass);
     try {
         $user_id = UserService::create($user, $auth_method, $this->member_extended_fields_service);
     } catch (MemberExtendedFieldErrorsMessageException $e) {
         $has_error = true;
         $this->tpl->put('MSG', MessageHelper::display($e->getMessage(), MessageHelper::NOTICE));
     }
     if (!$has_error) {
         UserRegistrationService::send_email_confirmation($user_id, $user->get_email(), $this->form->get_value('display_name'), $login, $this->form->get_value('password'), $registration_pass);
         $this->confirm_registration($user_id);
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:33,代码来源:UserRegistrationController.class.php

示例14: save

 private function save()
 {
     $this->maintain_type = $this->form->get_value('maintain_type')->get_raw_value();
     switch ($this->maintain_type) {
         case 'during':
             $maintain_during = $this->form->get_value('maintain_during')->get_raw_value();
             $this->maintenance_config->enable_maintenance();
             $this->maintenance_config->set_unlimited_maintenance(false);
             $this->maintenance_config->set_end_date(new Date(time() + 5 + $maintain_during, Timezone::SERVER_TIMEZONE));
             break;
         case 'until':
             $this->maintenance_config->enable_maintenance();
             $this->maintenance_config->set_unlimited_maintenance(false);
             $this->maintenance_config->set_end_date($this->form->get_value('maintain_until'));
             break;
         case 'unlimited':
             $this->maintenance_config->enable_maintenance();
             $this->maintenance_config->set_unlimited_maintenance(true);
             break;
         default:
             $this->maintenance_config->disable_maintenance();
             $this->maintenance_config->set_end_date(new Date());
     }
     if ($this->form->get_value('display_duration')) {
         $this->maintenance_config->set_display_duration(true);
         $this->maintenance_config->set_display_duration_for_admin($this->form->get_value('display_duration_for_admin'));
     } else {
         $this->maintenance_config->set_display_duration(false);
     }
     $this->maintenance_config->set_message($this->form->get_value('message'));
     $this->maintenance_config->set_auth($this->form->get_value('authorizations')->build_auth_array());
     MaintenanceConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:33,代码来源:AdminMaintainController.class.php

示例15: save

 private function save()
 {
     $this->config->set_title($this->form->get_value('title'));
     if ($this->form->get_value('informations_enabled')) {
         $this->config->enable_informations();
         $this->config->set_informations($this->form->get_value('informations'));
         $this->config->set_informations_position($this->form->get_value('informations_position')->get_raw_value());
     } else {
         $this->config->disable_informations();
     }
     if ($this->form->get_value('tracking_number_enabled')) {
         $this->config->enable_tracking_number();
         if ($this->form->get_value('date_in_tracking_number_enabled')) {
             $this->config->enable_date_in_tracking_number();
         } else {
             $this->config->disable_date_in_tracking_number();
         }
     } else {
         $this->config->disable_tracking_number();
     }
     if ($this->form->get_value('sender_acknowledgment_enabled')) {
         $this->config->enable_sender_acknowledgment();
     } else {
         $this->config->disable_sender_acknowledgment();
     }
     $this->config->set_authorizations($this->form->get_value('authorizations')->build_auth_array());
     ContactConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:28,代码来源:AdminContactConfigController.class.php


注:本文中的HTMLForm::get_value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。