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


PHP HTMLForm::field_is_disabled方法代码示例

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


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

示例1: 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

示例2: 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

示例3: save

 private function save()
 {
     $this->config->set_database_tables_optimization_enabled($this->form->get_value('database_tables_optimization_enabled'));
     if (!$this->form->field_is_disabled('database_tables_optimization_day')) {
         $this->config->set_database_tables_optimization_day($this->form->get_value('database_tables_optimization_day')->get_raw_value());
     }
     DatabaseConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:8,代码来源:AdminDatabaseConfigController.class.php

示例4: save

 private function save()
 {
     $field = $this->get_field();
     $fields = $this->config->get_fields();
     if ($field->is_deletable()) {
         $field->set_field_name(ContactField::rewrite_field_name($this->form->get_value('name')));
     }
     $field->set_name($this->form->get_value('name'));
     $field->set_description($this->form->get_value('description'));
     if (!$this->form->field_is_disabled('field_type')) {
         $field->set_field_type($this->form->get_value('field_type')->get_raw_value());
     }
     if (!$field->is_readonly() && !$this->form->field_is_disabled('regex_type')) {
         $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', '');
         }
         $field->set_regex($regex);
     }
     if (!$this->form->field_is_disabled('field_required')) {
         if ((bool) $this->form->get_value('field_required')) {
             $field->required();
         } else {
             $field->not_required();
         }
     }
     if (!$this->form->field_is_disabled('possible_values')) {
         $field->set_possible_values($this->form->get_value('possible_values'));
     }
     if (!$this->form->field_is_disabled('default_value_small')) {
         $field->set_default_value($this->form->get_value('default_value_small'));
     }
     if (!$this->form->field_is_disabled('default_value_medium')) {
         $field->set_default_value($this->form->get_value('default_value_medium'));
     }
     if (!$this->form->field_is_disabled('display')) {
         if ((bool) $this->form->get_value('display')) {
             $field->displayed();
         } else {
             $field->not_displayed();
         }
     }
     if (!$this->form->field_is_disabled('authorizations')) {
         $field->set_authorization($this->form->get_value('authorizations', $field->get_authorization())->build_auth_array());
     }
     $fields[!empty($this->id) ? $this->id : count($this->config->get_fields()) + 1] = $field->get_properties();
     $this->config->set_fields($fields);
     ContactConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:49,代码来源:AdminContactFieldFormController.class.php

示例5: save

 private function save()
 {
     $this->user_account_config->set_registration_enabled($this->form->get_value('members_activation'));
     if (!$this->form->field_is_disabled('type_activation_members')) {
         $this->user_account_config->set_member_accounts_validation_method($this->form->get_value('type_activation_members')->get_raw_value());
     }
     if (!$this->form->field_is_disabled('unactivated_accounts_timeout')) {
         $this->user_account_config->set_unactivated_accounts_timeout($this->form->get_value('unactivated_accounts_timeout'));
     }
     $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();
     }
     $this->user_account_config->set_avatar_upload_enabled($this->form->get_value('upload_avatar_server'));
     $this->user_account_config->set_default_avatar_name_enabled($this->form->get_value('default_avatar_activation'));
     $this->user_account_config->set_avatar_auto_resizing_enabled($this->form->get_value('activation_resize_avatar'));
     $this->user_account_config->set_default_avatar_name($this->form->get_value('default_avatar_link'));
     $this->user_account_config->set_max_avatar_width($this->form->get_value('maximal_width_avatar'));
     $this->user_account_config->set_max_avatar_height($this->form->get_value('maximal_height_avatar'));
     $this->user_account_config->set_max_avatar_weight($this->form->get_value('maximal_weight_avatar'));
     $this->user_account_config->set_auth_read_members($this->form->get_value('authorizations')->build_auth_array());
     $this->user_account_config->set_welcome_message($this->form->get_value('welcome_message_contents'));
     $this->user_account_config->set_registration_agreement($this->form->get_value('registration_agreement'));
     UserAccountsConfig::save();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:46,代码来源:AdminMemberConfigController.class.php

示例6: save

 protected function save()
 {
     if ($this->is_apc_available()) {
         if ($this->form->get_value('enable_apc')) {
             DataStoreFactory::set_apc_enabled(true);
         } else {
             DataStoreFactory::set_apc_enabled(false);
         }
     }
     if ($this->form->get_value('enable_css_cache')) {
         $this->css_cache_config->enable();
     } else {
         $this->css_cache_config->disable();
     }
     if (!$this->form->field_is_disabled('level_css_cache')) {
         $this->css_cache_config->set_optimization_level($this->form->get_value('level_css_cache')->get_raw_value());
     }
     CSSCacheConfig::save();
     AppContext::get_cache_service()->clear_css_cache();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:20,代码来源:AdminCacheConfigController.class.php

示例7: save

 private function save()
 {
     $now = new Date();
     $pm_recipients_list = array();
     $send_pm = true;
     $versions = array_reverse($this->config->get_versions_fix(), true);
     $status = $this->form->get_value('status')->get_raw_value();
     if (count($versions)) {
         if (!$this->form->field_is_disabled('fixed_in')) {
             $fixed_in = $this->form->get_value('fixed_in')->get_raw_value() ? $this->form->get_value('fixed_in')->get_raw_value() : 0;
             if ($fixed_in != $this->bug->get_fixed_in()) {
                 //Bug history update
                 BugtrackerService::add_history(array('bug_id' => $this->bug->get_id(), 'updater_id' => $this->current_user->get_id(), 'update_date' => $now->get_timestamp(), 'updated_field' => 'fixed_in', 'old_value' => $this->bug->get_fixed_in(), 'new_value' => $fixed_in));
                 $this->bug->set_fixed_in($fixed_in);
             }
         } else {
             if (in_array($status, array(Bug::NEW_BUG, Bug::REJECTED))) {
                 $this->bug->set_fixed_in(0);
             }
         }
     }
     if (!$this->form->field_is_disabled('assigned_to')) {
         $assigned_to = $this->form->get_value('assigned_to');
         $assigned_to_id = UserService::user_exists("WHERE display_name = :display_name", array('display_name' => $assigned_to));
         if ($this->bug->get_assigned_to_id()) {
             $old_user_assigned_id = UserService::user_exists("WHERE user_id = :user_id", array('user_id' => $this->bug->get_assigned_to_id()));
             $old_user_assigned = !empty($old_user_assigned_id) ? UserService::get_user($old_user_assigned_id) : 0;
         } else {
             $old_user_assigned = 0;
         }
         $new_user_assigned = !empty($assigned_to) && !empty($assigned_to_id) ? UserService::get_user($assigned_to_id) : 0;
         $new_assigned_to_id = !empty($new_user_assigned) ? $new_user_assigned->get_id() : 0;
         if ($new_assigned_to_id != $this->bug->get_assigned_to_id()) {
             //Bug history update
             BugtrackerService::add_history(array('bug_id' => $this->bug->get_id(), 'updater_id' => $this->current_user->get_id(), 'update_date' => $now->get_timestamp(), 'updated_field' => 'assigned_to_id', 'old_value' => $old_user_assigned ? $old_user_assigned->get_display_name() : $this->lang['notice.no_one'], 'new_value' => $new_user_assigned ? $new_user_assigned->get_display_name() : $this->lang['notice.no_one']));
             //Bug update
             $this->bug->set_assigned_to_id($new_assigned_to_id);
             //The PM will only be sent to the assigned user
             if ($new_assigned_to_id != $this->current_user->get_id()) {
                 $pm_recipients_list[] = $new_assigned_to_id;
             } else {
                 $send_pm = false;
             }
         }
     }
     if ($status != $this->bug->get_status()) {
         //Bug history update
         BugtrackerService::add_history(array('bug_id' => $this->bug->get_id(), 'updater_id' => $this->current_user->get_id(), 'update_date' => $now->get_timestamp(), 'updated_field' => 'status', 'old_value' => $this->bug->get_status(), 'new_value' => $status));
         //Bug update
         $this->bug->set_status($status);
         if ($this->bug->is_fixed() || $this->bug->is_rejected()) {
             $this->bug->set_fix_date($now);
         } else {
             $this->bug->set_fix_date(0);
         }
     }
     BugtrackerService::update($this->bug);
     Feed::clear_cache('bugtracker');
     switch ($status) {
         case Bug::IN_PROGRESS:
             $is_pm_enabled = $this->config->are_pm_in_progress_enabled();
             break;
         case Bug::PENDING:
             $is_pm_enabled = $this->config->are_pm_pending_enabled();
             break;
         case Bug::ASSIGNED:
             $is_pm_enabled = $this->config->are_pm_assign_enabled();
             break;
         case Bug::FIXED:
             $is_pm_enabled = $this->config->are_pm_fix_enabled();
             break;
         case Bug::REOPEN:
             $is_pm_enabled = $this->config->are_pm_reopen_enabled();
             break;
         case Bug::REJECTED:
             $is_pm_enabled = $this->config->are_pm_reject_enabled();
             break;
         default:
             $is_pm_enabled = false;
             break;
     }
     //Add comment if needed
     $comment = $this->form->get_value('comments_message', '');
     if (!empty($comment)) {
         $comments_topic = new BugtrackerCommentsTopic();
         $comments_topic->set_id_in_module($this->bug->get_id());
         $comments_topic->set_url(BugtrackerUrlBuilder::detail($this->bug->get_id() . '-' . $this->bug->get_rewrited_title()));
         CommentsManager::add_comment($comments_topic->get_module_id(), $comments_topic->get_id_in_module(), $comments_topic->get_topic_identifier(), $comments_topic->get_path(), $comment);
         //New line in the bug history
         BugtrackerService::add_history(array('bug_id' => $this->bug->get_id(), 'updater_id' => $this->current_user->get_id(), 'update_date' => $now->get_timestamp(), 'change_comment' => $this->lang['notice.new_comment']));
     }
     //Send PM with comment to updaters if the option is enabled
     if (!$this->bug->is_new() && $this->config->are_pm_enabled() && $is_pm_enabled && $send_pm) {
         BugtrackerPMService::send_PM_to_updaters($status, $this->bug->get_id(), $comment, $pm_recipients_list);
     }
     if (in_array($status, array(Bug::NEW_BUG, Bug::REOPEN, Bug::REJECTED, Bug::FIXED)) && $this->config->are_admin_alerts_enabled() && in_array($this->bug->get_severity(), $this->config->get_admin_alerts_levels())) {
         $alerts = AdministratorAlertService::find_by_criteria($this->bug->get_id(), 'bugtracker');
         if (!empty($alerts)) {
             $alert = $alerts[0];
             if ($this->bug->is_new() || $this->bug->is_reopen()) {
//.........这里部分代码省略.........
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:101,代码来源:BugtrackerChangeBugStatusController.class.php


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