本文整理汇总了PHP中plugin_config_set函数的典型用法代码示例。如果您正苦于以下问题:PHP plugin_config_set函数的具体用法?PHP plugin_config_set怎么用?PHP plugin_config_set使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了plugin_config_set函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateButton
/**
* Updates a button in the plugin configuration
*
* @param $config
*/
public function updateButton($config)
{
$button = gpc_get_int($config);
if (plugin_config_get($config) != $button) {
plugin_config_set($config, $button);
}
}
示例2: form_security_validate
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
form_security_validate('plugin_format_config_edit');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$f_process_text = gpc_get_int('process_text', ON);
$f_process_urls = gpc_get_int('process_urls', ON);
$f_process_buglinks = gpc_get_int('process_buglinks', ON);
$f_process_vcslinks = gpc_get_int('process_vcslinks', ON);
if (plugin_config_get('process_text') != $f_process_text) {
plugin_config_set('process_text', $f_process_text);
}
if (plugin_config_get('process_urls') != $f_process_urls) {
plugin_config_set('process_urls', $f_process_urls);
}
if (plugin_config_get('process_buglinks') != $f_process_buglinks) {
plugin_config_set('process_buglinks', $f_process_buglinks);
}
if (plugin_config_get('process_vcslinks') != $f_process_vcslinks) {
plugin_config_set('process_vcslinks', $f_process_vcslinks);
}
form_security_purge('plugin_format_config_edit');
print_successful_redirect(plugin_page('config', true));
示例3: gpc_get_string
case 'arial':
case 'verdana':
case 'trebuchet':
case 'verasans':
case 'times':
case 'georgia':
case 'veraserif':
case 'courier':
case 'veramono':
plugin_config_set( 'font', $f_font );
break;
default:
plugin_config_set( 'font', 'arial' );
}
}
if ( current_user_is_administrator() ) {
$f_jpgraph_path = gpc_get_string( 'jpgraph_path', '' );
if ( plugin_config_get( 'jpgraph_path' ) != $f_jpgraph_path ) {
plugin_config_set( 'jpgraph_path', $f_jpgraph_path );
}
}
if ( plugin_config_get( 'jpgraph_antialias' ) != $f_jpgraph_antialias ) {
plugin_config_set( 'jpgraph_antialias', $f_jpgraph_antialias );
}
form_security_purge( 'plugin_graph_config_edit' );
print_successful_redirect( plugin_page( 'config', true ) );
示例4: form_security_validate
<?php
form_security_validate('plugin_format_config_edit');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$f_status_order = gpc_get_string('status_board_order');
if (plugin_config_get('status_board_order') != $f_status_order) {
plugin_config_set('status_board_order', explode(';', $f_status_order));
}
$f_cooldown_period_days = gpc_get_int('cooldown_period_days');
if (plugin_config_get('cooldown_period_days') != $f_cooldown_period_days) {
plugin_config_set('cooldown_period_days', $f_cooldown_period_days);
}
$f_cooldown_period_hours = gpc_get_int('cooldown_period_hours');
if (plugin_config_get('cooldown_period_hours') != $f_cooldown_period_hours) {
plugin_config_set('cooldown_period_hours', $f_cooldown_period_hours);
}
form_security_purge('plugin_format_config_edit');
print_successful_redirect(plugin_page('config_page', true));
示例5: gpc_get_string
$t_email_template = gpc_get_string('email_template', PLUGINS_RELEASEMGT_EMAIL_TEMPLATE_DEFAULT);
$t_download_requires_login = gpc_get_bool('download_requires_login');
plugin_config_set('upload_threshold_level', $t_upload_access_level, NO_USER, $t_project_id);
plugin_config_set('upload_method', $t_upload_method, NO_USER, $t_project_id);
plugin_config_set('disk_dir', $t_disk_dir, NO_USER, $t_project_id);
plugin_config_set('ftp_server', $t_ftp_server, NO_USER, $t_project_id);
plugin_config_set('ftp_user', $t_ftp_user, NO_USER, $t_project_id);
plugin_config_set('ftp_pass', $t_ftp_pass, NO_USER, $t_project_id);
plugin_config_set('file_number', $t_file_number, NO_USER, $t_project_id);
plugin_config_set('notification_enable', $t_notification_enable, NO_USER, $t_project_id);
plugin_config_set('notify_handler', $t_notify_handler, NO_USER, $t_project_id);
plugin_config_set('notify_reporter', $t_notify_reporter, NO_USER, $t_project_id);
plugin_config_set('notify_email', $t_notify_email, NO_USER, $t_project_id);
plugin_config_set('email_subject', $t_email_subject, NO_USER, $t_project_id);
plugin_config_set('email_template', $t_email_template, NO_USER, $t_project_id);
plugin_config_set('download_requires_login', $t_download_requires_login, NO_USER, $t_project_id);
}
if ($t_action == 'delete' && $t_project_id != ALL_PROJECTS) {
plugin_config_delete('upload_threshold_level', NO_USER, $t_project_id);
plugin_config_delete('upload_method', NO_USER, $t_project_id);
plugin_config_delete('disk_dir', NO_USER, $t_project_id);
plugin_config_delete('ftp_server', NO_USER, $t_project_id);
plugin_config_delete('ftp_user', NO_USER, $t_project_id);
plugin_config_delete('ftp_pass', NO_USER, $t_project_id);
plugin_config_delete('file_number', NO_USER, $t_project_id);
plugin_config_delete('notification_enable', NO_USER, $t_project_id);
plugin_config_delete('notify_handler', NO_USER, $t_project_id);
plugin_config_delete('notify_reporter', NO_USER, $t_project_id);
plugin_config_delete('notify_email', NO_USER, $t_project_id);
plugin_config_delete('email_subject', NO_USER, $t_project_id);
plugin_config_delete('email_template', NO_USER, $t_project_id);
示例6: form_security_validate
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
form_security_validate( 'plugin_format_config_edit' );
auth_reauthenticate( );
access_ensure_global_level( config_get( 'manage_plugin_threshold' ) );
$f_process_text = gpc_get_int( 'process_text', ON );
$f_process_urls = gpc_get_int( 'process_urls', ON );
$f_process_buglinks = gpc_get_int( 'process_buglinks', ON );
if( plugin_config_get( 'process_text' ) != $f_process_text ) {
plugin_config_set( 'process_text', $f_process_text );
}
if( plugin_config_get( 'process_urls' ) != $f_process_urls ) {
plugin_config_set( 'process_urls', $f_process_urls );
}
if( plugin_config_get( 'process_buglinks' ) != $f_process_buglinks ) {
plugin_config_set( 'process_buglinks', $f_process_buglinks );
}
form_security_purge( 'plugin_format_config_edit' );
print_successful_redirect( plugin_page( 'config', true ) );
示例7: form_security_validate
<?php
form_security_validate('plugin_DailyScrum_config_update');
$f_foo_or_bar = gpc_get_string('foo_or_bar');
$f_reset = gpc_get_bool('reset', false);
if ($f_reset) {
plugin_config_delete('foo_or_bar');
} else {
if ($f_foo_or_bar == 'foo' || $f_foo_or_bar == 'bar') {
plugin_config_set('foo_or_bar', $f_foo_or_bar);
}
}
form_security_purge('plugin_DailyScrum_config_update');
print_successful_redirect(plugin_page('foo', true));
示例8: plugin_config_set
if (plugin_config_get('default_duration_unit') != $f_default_duration_unit) {
if ('d' === $f_default_duration_unit || 'h' === $f_default_duration_unit) {
plugin_config_set('default_duration_unit', $f_default_duration_unit);
} else {
$t_error_on_field = true;
}
}
if (plugin_config_get('working_hours_in_a_day') != $f_working_hours_in_a_day) {
if (1 <= $f_working_hours_in_a_day && $f_working_hours_in_a_day <= 24) {
plugin_config_set('working_hours_in_a_day', $f_working_hours_in_a_day);
} else {
$t_error_on_field = true;
}
}
if (plugin_config_get('rows_max') != $f_rows_max) {
plugin_config_set('rows_max', $f_rows_max);
}
if (plugin_config_get('weeks_max') != $f_weeks_max) {
plugin_config_set('weeks_max', $f_weeks_max);
}
if (plugin_config_get('label_max') != $f_label_max) {
plugin_config_set('label_max', $f_label_max);
}
if (plugin_config_get('eczlibrary') != config_get('plugin_MantisGraph_eczlibrary')) {
plugin_config_set('eczlibrary', config_get('plugin_MantisGraph_eczlibrary'));
}
if (plugin_config_get('jpgraph_path') != config_get('plugin_MantisGraph_jpgraph_path')) {
plugin_config_set('jpgraph_path', config_get('plugin_MantisGraph_jpgraph_path'));
}
form_security_purge('plugin_gantt_chart_config_edit');
print_successful_redirect(plugin_page('config', true));
示例9: form_security_validate
* Lightbox Integration is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License 2
* as published by the Free Software Foundation.
*
* Lightbox Integration is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Lightbox Integration; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* or see http://www.gnu.org/licenses/.
*/
form_security_validate('plugin_lightbox_config_edit');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
$f_display_on_img_preview = gpc_get_int('display_on_img_preview', OFF);
$f_display_on_img_link = gpc_get_int('display_on_img_link', OFF);
$f_img_extensions = gpc_get_string('img_extensions', 'jpg,jpeg,png,gif');
if (plugin_config_get('display_on_img_preview') != $f_display_on_img_preview) {
plugin_config_set('display_on_img_preview', $f_display_on_img_preview);
}
if (plugin_config_get('display_on_img_link') != $f_display_on_img_link) {
plugin_config_set('display_on_img_link', $f_display_on_img_link);
}
if (plugin_config_get('img_extensions') != $f_img_extensions) {
plugin_config_set('img_extensions', $f_img_extensions);
}
form_security_purge('plugin_lightbox_config_edit');
print_successful_redirect(plugin_page('config', true));
示例10: form_security_validate
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
form_security_validate('plugin_Dashboard_config_update');
$f_width = gpc_get_int('width', 4);
$f_reset_width = gpc_get_bool('reset-width', false);
if ($f_reset_width) {
plugin_config_delete('width');
} else {
plugin_config_set('width', $f_width);
}
$f_filter = gpc_get_int_array('filter', array());
$f_reset_boxes = gpc_get_bool('reset-boxes', false);
if ($f_reset_boxes) {
plugin_config_delete('boxes');
} else {
$f_boxes = array();
foreach ($f_filter as $t_filter_id => $t_filter_pos) {
if ($t_filter_pos != 0) {
$f_boxes[$t_filter_id] = $t_filter_pos;
}
}
plugin_config_set('boxes', $f_boxes);
}
form_security_purge('plugin_Dashboard_config_update');
print_successful_redirect(plugin_page('dashboard', true));
示例11: auth_reauthenticate
<?php
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
plugin_require_api('core/config_api.php');
$f_gpc = array('mail_add_bug_reports' => gpc_get_int('mail_add_bug_reports'), 'mail_add_bugnotes' => gpc_get_int('mail_add_bugnotes'), 'mail_add_complete_email' => gpc_get_int('mail_add_complete_email'), 'mail_add_users_from_cc_to' => gpc_get_int('mail_add_users_from_cc_to'), 'mail_auto_signup' => gpc_get_int('mail_auto_signup'), 'mail_block_attachments_md5' => array_map('strtolower', array_filter(array_map('trim', explode("\n", str_replace(array("\r\n", "\r"), "\n", gpc_get_string('mail_block_attachments_md5')))))), 'mail_block_attachments_logging' => gpc_get_int('mail_block_attachments_logging'), 'mail_debug' => gpc_get_int('mail_debug'), 'mail_debug_directory' => ERP_prepare_directory_string(gpc_get_string('mail_debug_directory')), 'mail_debug_show_memory_usage' => gpc_get_int('mail_debug_show_memory_usage'), 'mail_delete' => gpc_get_int('mail_delete'), 'mail_disposable_email_checker' => gpc_get_int('mail_disposable_email_checker'), 'mail_email_receive_own' => gpc_get_int('mail_email_receive_own'), 'mail_fallback_mail_reporter' => gpc_get_int('mail_fallback_mail_reporter'), 'mail_nodescription' => gpc_get_string('mail_nodescription'), 'mail_nosubject' => gpc_get_string('mail_nosubject'), 'mail_parse_html' => gpc_get_int('mail_parse_html'), 'mail_preferred_username' => gpc_get_string('mail_preferred_username'), 'mail_preferred_realname' => gpc_get_string('mail_preferred_realname'), 'mail_remove_mantis_email' => gpc_get_int('mail_remove_mantis_email'), 'mail_remove_replies' => gpc_get_int('mail_remove_replies'), 'mail_strip_gmail_style_replies' => gpc_get_int('mail_strip_gmail_style_replies'), 'mail_remove_replies_after' => gpc_get_string('mail_remove_replies_after'), 'mail_removed_reply_text' => gpc_get_string('mail_removed_reply_text'), 'mail_reporter_id' => gpc_get_int('mail_reporter_id'), 'mail_rule_system' => gpc_get_int('mail_rule_system'), 'mail_save_from' => gpc_get_int('mail_save_from'), 'mail_save_subject_in_note' => gpc_get_int('mail_save_subject_in_note'), 'mail_secured_script' => gpc_get_int('mail_secured_script'), 'mail_strip_signature' => gpc_get_int('mail_strip_signature'), 'mail_strip_signature_delim' => gpc_get_string('mail_strip_signature_delim'), 'mail_subject_id_regex' => gpc_get_string('mail_subject_id_regex'), 'mail_use_bug_priority' => gpc_get_int('mail_use_bug_priority'), 'mail_use_message_id' => gpc_get_int('mail_use_message_id'), 'mail_use_reporter' => gpc_get_int('mail_use_reporter'));
$f_mail_bug_priority = 'array (' . "\n" . gpc_get_string('mail_bug_priority') . "\n" . ')';
foreach ($f_gpc as $t_key => $t_value) {
if (plugin_config_get($t_key) !== $t_value) {
plugin_config_set($t_key, $t_value);
}
}
$t_mail_bug_priority = process_complex_value($f_mail_bug_priority);
if (is_array($t_mail_bug_priority)) {
if (plugin_config_get('mail_bug_priority') !== $t_mail_bug_priority) {
plugin_config_set('mail_bug_priority', $t_mail_bug_priority);
}
} else {
html_page_top(plugin_lang_get('plugin_title'));
echo '<br /><div class="center">';
echo plugin_lang_get('mail_bug_priority_array_failure') . ' ';
print_bracket_link(plugin_page('manage_config', TRUE), lang_get('proceed'));
echo '</div>';
$t_notsuccesfull = TRUE;
html_page_bottom(__FILE__);
}
if (!isset($t_notsuccesfull)) {
print_successful_redirect(plugin_page('manage_config', TRUE));
}
示例12: form_security_validate
<?php
form_security_validate('plugin_BackgroundImageView_config_edit');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_plugin_threshold'));
//$t_project_id = helper_get_current_project ();
$ShowInFooter = gpc_get_int('ShowInFooter', ON);
if (plugin_config_get('ShowInFooter') != $ShowInFooter) {
plugin_config_set('ShowInFooter', $ShowInFooter);
}
$ShowBackgroundImage = gpc_get_int('ShowBackgroundImage', ON);
if (plugin_config_get('ShowBackgroundImage') != $ShowBackgroundImage) {
plugin_config_set('ShowBackgroundImage', $ShowBackgroundImage);
}
$BackgroundImageAccessLevel = gpc_get_int('BackgroundImageAccessLevel');
if (plugin_config_get('BackgroundImageAccessLevel') != $BackgroundImageAccessLevel) {
plugin_config_set('BackgroundImageAccessLevel', $BackgroundImageAccessLevel);
}
form_security_purge('plugin_BackgroundImageView_config_edit');
print_successful_redirect(plugin_page('config', true));
示例13: gpc_get_int
//$t_project_id = helper_get_current_project ();
$ShowInFooter = gpc_get_int('ShowInFooter', ON);
if (plugin_config_get('ShowInFooter') != $ShowInFooter) {
plugin_config_set('ShowInFooter', $ShowInFooter);
}
$ShowRelationshipColumn = gpc_get_int('ShowRelationshipColumn', ON);
if (plugin_config_get('ShowRelationshipColumn') != $ShowRelationshipColumn) {
plugin_config_set('ShowRelationshipColumn', $ShowRelationshipColumn);
}
$ShowRelationships = gpc_get_int('ShowRelationships', ON);
if (plugin_config_get('ShowRelationships') != $ShowRelationships) {
plugin_config_set('ShowRelationships', $ShowRelationships);
}
$ShowRelationshipsColorful = gpc_get_int('ShowRelationshipsColorful', ON);
if (plugin_config_get('ShowRelationshipsColorful') != $ShowRelationshipsColorful) {
plugin_config_set('ShowRelationshipsColorful', $ShowRelationshipsColorful);
}
$ShowRelationshipIcons = gpc_get_int('ShowRelationshipIcons', ON);
if (plugin_config_get('ShowRelationshipIcons') != $ShowRelationshipIcons) {
plugin_config_set('ShowRelationshipIcons', $ShowRelationshipIcons);
}
$ShowRelationshipsControl = gpc_get_int('ShowRelationshipsControl', ON);
if (plugin_config_get('ShowRelationshipsControl') != $ShowRelationshipsControl) {
plugin_config_set('ShowRelationshipsControl', $ShowRelationshipsControl);
}
$RelationshipColumnAccessLevel = gpc_get_int('RelationshipColumnAccessLevel');
if (plugin_config_get('RelationshipColumnAccessLevel') != $RelationshipColumnAccessLevel) {
plugin_config_set('RelationshipColumnAccessLevel', $RelationshipColumnAccessLevel);
}
form_security_purge('plugin_RelationshipColumnView_config_edit');
print_successful_redirect(plugin_page('config', true));
示例14: gpc_get_int
/**
* Submit configuration changes
*/
if ($option_change) {
$specmanagement_config_api->updateValue('AccessLevel', ADMINISTRATOR);
$specmanagement_config_api->updateValue('ReadAccessLevel', REPORTER);
$specmanagement_config_api->updateValue('WriteAccessLevel', DEVELOPER);
$specmanagement_config_api->updateButton('ShowInFooter');
$specmanagement_config_api->updateButton('ShowFields');
$specmanagement_config_api->updateButton('ShowMenu');
$specmanagement_config_api->updateButton('ShowSpecStatCols');
$col_amount = gpc_get_int('CAmount', PLUGINS_SPECMANAGEMENT_COLUMN_AMOUNT);
if (plugin_config_get('CAmount') != $col_amount && plugin_config_get('CAmount') != '' && $col_amount <= PLUGINS_SPECMANAGEMENT_MAX_COLUMNS) {
plugin_config_set('CAmount', $col_amount);
} elseif (plugin_config_get('CAmount') == '') {
plugin_config_set('CAmount', PLUGINS_SPECMANAGEMENT_COLUMN_AMOUNT);
}
$specmanagement_config_api->updateDynamicValues('CStatSelect', PLUGINS_SPECMANAGEMENT_COLUMN_STAT_DEFAULT);
}
/**
* Submit configuration reset
*/
if ($option_reset) {
print_successful_redirect(plugin_page('reset_ensure', true));
}
/**
* Add a document type
*/
if ($option_addtype) {
if (isset($_POST['type'])) {
$specmanagement_database_api->insert_type_row($_POST['type']);
示例15: config_set_if_needed
/**
* Sets plugin config option if value is different from current/default
* @param string $p_name option name
* @param string $p_value value to set
* @return void
*/
function config_set_if_needed($p_name, $p_value)
{
if ($p_value != plugin_config_get($p_name)) {
plugin_config_set($p_name, $p_value);
}
}