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


PHP prepareDBSettingContext函数代码示例

本文整理汇总了PHP中prepareDBSettingContext函数的典型用法代码示例。如果您正苦于以下问题:PHP prepareDBSettingContext函数的具体用法?PHP prepareDBSettingContext怎么用?PHP prepareDBSettingContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: EditSearchSettings

/**
 * Edit some general settings related to the search function.
 * Called by ?action=admin;area=managesearch;sa=settings.
 * Requires the admin_forum permission.
 *
 * @param $return_config
 * @uses ManageSearch template, 'modify_settings' sub-template.
 */
function EditSearchSettings($return_config = false)
{
    global $txt, $context, $scripturl, $sourcedir, $modSettings;
    // What are we editing anyway?
    $config_vars = array(array('permissions', 'search_posts'), array('check', 'simpleSearch'), array('check', 'search_dropdown'), array('int', 'search_results_per_page'), array('int', 'search_max_results', 'subtext' => $txt['search_max_results_disable']), '', array('int', 'search_floodcontrol_time', 'subtext' => $txt['search_floodcontrol_time_desc'], 6, 'postinput' => $txt['seconds']));
    call_integration_hook('integrate_modify_search_settings', array(&$config_vars));
    // Perhaps the search method wants to add some settings?
    require_once $sourcedir . '/Search.php';
    $searchAPI = findSearchAPI();
    if (is_callable(array($searchAPI, 'searchSettings'))) {
        call_user_func_array($searchAPI->searchSettings, array(&$config_vars));
    }
    if ($return_config) {
        return $config_vars;
    }
    $context['page_title'] = $txt['search_settings_title'];
    $context['sub_template'] = 'show_settings';
    call_integration_hook('integrate_modify_search_weights', array(&$factors));
    // We'll need this for the settings.
    require_once $sourcedir . '/ManageServer.php';
    // A form was submitted.
    if (isset($_REQUEST['save'])) {
        checkSession();
        call_integration_hook('integrate_save_search_settings');
        saveDBSettings($config_vars);
        redirectexit('action=admin;area=managesearch;sa=settings;' . $context['session_var'] . '=' . $context['session_id']);
    }
    // Prep the template!
    $context['post_url'] = $scripturl . '?action=admin;area=managesearch;save;sa=settings';
    $context['settings_title'] = $txt['search_settings_title'];
    // We need this for the in-line permissions
    createToken('admin-mp');
    prepareDBSettingContext($config_vars);
}
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:42,代码来源:ManageSearch.php

示例2: ModifyKarmaSettings

/**
 * Config array for chaning the karma settings
 * Accessed  from ?action=admin;area=featuresettings;sa=karma;
 *
 * @param $return_config
 */
function ModifyKarmaSettings($return_config = false)
{
    global $txt, $scripturl, $context, $modSettings;
    loadLanguage('Karma+ManageKarma');
    if (empty($modSettings['karmaMode'])) {
        $config_vars = array(array('select', 'karmaMode', explode('|', $txt['karma_options'])));
    } else {
        $config_vars = array(array('select', 'karmaMode', explode('|', $txt['karma_options'])), '', array('int', 'karmaMinPosts', 6, 'postinput' => strtolower($txt['posts'])), array('float', 'karmaWaitTime', 6, 'postinput' => $txt['hours']), array('check', 'karmaTimeRestrictAdmins'));
    }
    call_integration_hook('integrate_karma_settings', array(&$config_vars));
    if ($return_config) {
        return $config_vars;
    }
    // Saving?
    if (isset($_GET['save'])) {
        checkSession();
        call_integration_hook('integrate_save_karma_settings');
        saveDBSettings($config_vars);
        $_SESSION['adm-save'] = true;
        redirectexit('action=admin;area=featuresettings;sa=karma');
    }
    $context['post_url'] = $scripturl . '?action=admin;area=featuresettings;save;sa=karma';
    $context['settings_title'] = $txt['karma'];
    loadLanguage('ManageKarma');
    prepareDBSettingContext($config_vars);
}
开发者ID:realdigger,项目名称:smf-karma,代码行数:32,代码来源:ManageKarma.php

示例3: gplus_admin

function gplus_admin()
{
    global $txt, $scripturl, $context;
    $context['sub_template'] = 'show_settings';
    $config_vars = array(array('check', 'gp_app_enabled'), array('check', 'gp_app_enabledautolog'), '', array('text', 'gp_app_client_id'), array('text', 'gp_app_client_secret'), '', array('text', 'gp_app_custon_logurl'), array('text', 'gp_app_custon_logimg'), array('int', 'gp_app_detait_gid'), array('select', 'gp_reg_auto', array($txt['gp_dfbregauto'], $txt['gp_dfbregauto1'])), '', array('text', 'gp_app_board_showplus1'));
    if (isset($_GET['save'])) {
        checkSession();
        saveDBSettings($config_vars);
        redirectexit('action=admin;area=gplus');
    }
    $context['post_url'] = $scripturl . '?action=admin;area=gplus;save';
    $context['settings_title'] = $txt['gp_googplus'];
    prepareDBSettingContext($config_vars);
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:14,代码来源:GplusAdmin.php

示例4: CLS_ChangeThemeSettings

function CLS_ChangeThemeSettings($return_config = false)
{
    global $txt, $scripturl, $context;
    $config_vars = array();
    $config_vars[] = array('check', 'change_theme_check_top');
    $config_vars[] = array('check', 'change_theme_check_bot');
    if ($return_config) {
        return $config_vars;
    }
    $context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=cls';
    if (isset($_GET['save'])) {
        checkSession();
        saveDBSettings($config_vars);
        redirectexit('action=admin;area=modsettings;sa=cls');
    }
    prepareDBSettingContext($config_vars);
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:17,代码来源:cls.php

示例5: addMenuButtonWithBoardsListAdminSettings

/**
 * @param bool $return_config
 * @return array config vars
 */
function addMenuButtonWithBoardsListAdminSettings($return_config = false)
{
    global $txt, $scripturl, $context;
    loadLanguage('MenuButtonWithBoardsList/');
    $context['page_title'] = $txt['menu_button_with_boards'];
    $context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=menu_button_with_boards';
    $context['settings_message'] = '';
    $config_vars = array(array('title', 'menu_button_with_boards_settings'), array('text', 'menu_button_with_boards_title'), array('text', 'menu_button_with_boards_cats', 'subtext' => $txt['menu_button_with_boards_cats_desc']));
    if ($return_config) {
        return $config_vars;
    }
    if (isset($_GET['save'])) {
        checkSession();
        saveDBSettings($config_vars);
        clean_cache();
        redirectexit('action=admin;area=modsettings;sa=menu_button_with_boards');
    }
    prepareDBSettingContext($config_vars);
}
开发者ID:realdigger,项目名称:SMF-Menu-Button-With-Boards-List,代码行数:23,代码来源:Mod-MenuButtonWithBoardsList.php

示例6: ajaxchat_modifySettings

function ajaxchat_modifySettings($return_config = false)
{
    global $txt, $scripturl, $context, $settings, $sc, $modSettings;
    $config_vars = array(array('check', 'enableShoutBox'), array('check', 'anyPageShoutBox'), array('check', 'enableChatButtonNo'));
    if ($return_config) {
        return $config_vars;
    }
    $context['post_url'] = $scripturl . '?action=admin;area=modsettings;save;sa=chat';
    $context['settings_title'] = $txt['chat'];
    // No removing this line you, dirty unwashed mod authors. :p
    if (empty($config_vars)) {
        $context['settings_save_dont_show'] = true;
        $context['settings_message'] = '<div style="text-align: center">' . $txt['modification_no_misc_settings'] . '</div>';
        return prepareDBSettingContext($config_vars);
    }
    // Saving?
    if (isset($_GET['save'])) {
        checkSession();
        $save_vars = $config_vars;
        saveDBSettings($save_vars);
        redirectexit('action=admin;area=modsettings;sa=chat');
    }
    prepareDBSettingContext($config_vars);
}
开发者ID:yasl,项目名称:smf-ajaxchatintegration,代码行数:24,代码来源:AJAXChatIntegration.php

示例7: ArcadeAdminPemission

function ArcadeAdminPemission($return_config = false)
{
    global $scripturl, $txt, $modSettings, $context, $settings;
    $config_vars = array(array('select', 'arcadePermissionMode', array($txt['arcade_permission_mode_none'], $txt['arcade_permission_mode_category'], $txt['arcade_permission_mode_game'], $txt['arcade_permission_mode_and_both'], $txt['arcade_permission_mode_or_both'])), '', array('check', 'arcadePostPermission'), array('int', 'arcadePostsPlay'), array('int', 'arcadePostsLastDay'), array('int', 'arcadePostsPlayAverage'), '', array('permissions', 'arcade_view', 0, $txt['perm_arcade_view']), array('permissions', 'arcade_play', 0, $txt['perm_arcade_play']), array('permissions', 'arcade_submit', 0, $txt['perm_arcade_submit']));
    if ($return_config) {
        return $config_vars;
    }
    if (isset($_GET['save'])) {
        checkSession('post');
        saveDBSettings($config_vars);
        writeLog();
        redirectexit('action=admin;area=arcade;sa=permission');
    }
    $context['post_url'] = $scripturl . '?action=admin;area=arcade;sa=permission;save';
    $context['settings_title'] = $txt['arcade_general_permissions'];
    $context['sub_template'] = 'show_settings';
    prepareDBSettingContext($config_vars);
}
开发者ID:nikop,项目名称:SMF-Arcade,代码行数:18,代码来源:ArcadeAdmin.php

示例8: ModifyCacheSettings

function ModifyCacheSettings()
{
    global $context, $scripturl, $txt, $helptxt, $sc, $modSettings;
    // Cache information is in here, honest.
    loadLanguage('ModSettings');
    loadLanguage('Help');
    // Define the variables we want to edit.
    $config_vars = array(array('select', 'cache_enable', array($txt['cache_off'], $txt['cache_level1'], $txt['cache_level2'], $txt['cache_level3'])), array('text', 'cache_memcached'));
    // Saving again?
    if (isset($_GET['save'])) {
        saveDBSettings($config_vars);
        redirectexit('action=serversettings;sa=cache;sesc=' . $sc);
    }
    $context['post_url'] = $scripturl . '?action=serversettings2;save;sa=cache';
    $context['settings_title'] = $txt['caching_settings'];
    $context['settings_message'] = $txt['caching_information'];
    // Detect an optimizer?
    if (function_exists('eaccelerator_put')) {
        $detected = 'eAccelerator';
    } elseif (function_exists('mmcache_put')) {
        $detected = 'MMCache';
    } elseif (function_exists('apc_store')) {
        $detected = 'APC';
    } elseif (function_exists('output_cache_put')) {
        $detected = 'Zend';
    } elseif (function_exists('memcache_set')) {
        $detected = 'Memcached';
    } else {
        $detected = 'no_caching';
    }
    $context['settings_message'] = sprintf($context['settings_message'], $txt['detected_' . $detected]);
    // Prepare the template.
    prepareDBSettingContext($config_vars);
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:34,代码来源:ManageServer.php

示例9: ModifyDraftSettings

function ModifyDraftSettings($return_config = false)
{
    global $txt, $sourcedir, $context, $scripturl, $backend_subdir;
    $config_vars = array(array('int', 'enableAutoSaveDrafts', 'subtext' => $txt['draftsave_subnote'], 'postinput' => $txt['manageposts_seconds']));
    $context['page_title'] = $txt['manageposts_draft_settings'];
    $context['sub_template'] = 'show_settings';
    if ($return_config) {
        return $config_vars;
    }
    require_once $sourcedir . '/' . $backend_subdir . '/ManageServer.php';
    if (isset($_GET['save'])) {
        checkSession();
        saveDBSettings($config_vars);
        redirectexit('action=admin;area=postsettings;sa=drafts');
    }
    // Final settings...
    $context['post_url'] = $scripturl . '?action=admin;area=postsettings;save;sa=drafts';
    $context['settings_title'] = $txt['manageposts_draft_settings'];
    prepareDBSettingContext($config_vars);
}
开发者ID:norv,项目名称:EosAlpha,代码行数:20,代码来源:ManagePosts.php

示例10: EditBoardSettings

/**
 * A screen to set a few general board and category settings.
 *
 * @uses modify_general_settings sub-template.
 * @param $return_config
 */
function EditBoardSettings($return_config = false)
{
    global $context, $txt, $sourcedir, $modSettings, $scripturl, $smcFunc;
    // Load the boards list - for the recycle bin!
    $recycle_boards = array('');
    $request = $smcFunc['db_query']('order_by_board_order', '
		SELECT b.id_board, b.name AS board_name, c.name AS cat_name
		FROM {db_prefix}boards AS b
			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
		WHERE redirect = {string:empty_string}', array('empty_string' => ''));
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        $recycle_boards[$row['id_board']] = $row['cat_name'] . ' - ' . $row['board_name'];
    }
    $smcFunc['db_free_result']($request);
    // Here and the board settings...
    $config_vars = array(array('title', 'settings'), array('permissions', 'manage_boards'), '', array('check', 'countChildPosts'), array('check', 'recycle_enable', 'onclick' => 'document.getElementById(\'recycle_board\').disabled = !this.checked;'), array('select', 'recycle_board', $recycle_boards), array('check', 'allow_ignore_boards'), array('check', 'deny_boards_access'));
    call_integration_hook('integrate_modify_board_settings', array(&$config_vars));
    if ($return_config) {
        return $config_vars;
    }
    // Needed for the settings template.
    require_once $sourcedir . '/ManageServer.php';
    // Don't let guests have these permissions.
    $context['post_url'] = $scripturl . '?action=admin;area=manageboards;save;sa=settings';
    $context['permissions_excluded'] = array(-1);
    $context['page_title'] = $txt['boards_and_cats'] . ' - ' . $txt['settings'];
    loadTemplate('ManageBoards');
    $context['sub_template'] = 'show_settings';
    // Add some javascript stuff for the recycle box.
    $context['settings_insert_below'] = '
		<script type="text/javascript"><!-- // --><![CDATA[
			document.getElementById("recycle_board").disabled = !document.getElementById("recycle_enable").checked;
		// ]]></script>';
    // Warn the admin against selecting the recycle topic without selecting a board.
    $context['force_form_onsubmit'] = 'if(document.getElementById(\'recycle_enable\').checked && document.getElementById(\'recycle_board\').value == 0) { return confirm(\'' . $txt['recycle_board_unselected_notice'] . '\');} return true;';
    // Doing a save?
    if (isset($_GET['save'])) {
        checkSession();
        call_integration_hook('integrate_save_board_settings');
        saveDBSettings($config_vars);
        redirectexit('action=admin;area=manageboards;sa=settings');
    }
    // We need this for the in-line permissions
    createToken('admin-mp');
    // Prepare the settings...
    prepareDBSettingContext($config_vars);
}
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:53,代码来源:ManageBoards.php

示例11: settings


//.........这里部分代码省略.........
function subform(type, value)
{
	document.miniform.minitype.value=type;
	document.miniform.value.value=value;
	document.miniform.submit();
}
function move(id, value)
{
	subform(value, id);
}
</script>';
        //	if(isset($_POST['tea_useapiabove']))
        //	{
        //		$_POST['tea_corpid'] = $corp;
        //		$_POST['tea_allianceid'] = $alliance;
        //		unset($_POST['tea_useapiabove']);
        //	}
        //	if(!empty($_POST['tea_ts_delrule']
        if ($_POST['minitype'] == 'delrule') {
            if (!is_numeric($_POST['value'])) {
                die("delete value must be number");
            }
            $this->tea->query("DELETE FROM {db_prefix}tea_ts_rules WHERE id = " . $_POST['value']);
            redirectexit('action=admin;area=tea;sa=ts');
        } elseif ($_POST['minitype'] == 'up' || $_POST['minitype'] == 'down') {
            $id = $_POST['value'];
            if (!is_numeric($id)) {
                die("move id must be number");
            }
            $rules = $this->smcFunc['db_query']('', "SELECT id FROM {db_prefix}tea_ts_rules ORDER BY id");
            $rules = $this->tea->select($rules);
            if (!empty($rules)) {
                //	foreach($rules as $rule)
                //	{
                //		$rl[$rule[1]][$rule[0]] = $rule[0];
                //		if($rule[0] == $id)
                //			$main = $rule[1];
                //	}
                //	if(isset($main))
                //	{
                //		$rules = $rl[$main];
                //		sort($rules);
                foreach ($rules as $i => $rule) {
                    if ($rule[0] == $id) {
                        if ($_POST['minitype'] == 'up') {
                            $move = $rules[$i - 1][0];
                        } elseif ($_POST['minitype'] == 'down') {
                            $move = $rules[$i + 1][0];
                        }
                        $this->tea->query("UPDATE {db_prefix}tea_ts_rules SET id = -1 WHERE id = " . $move);
                        $this->tea->query("UPDATE {db_prefix}tea_ts_rules SET id = {$move} WHERE id = " . $id);
                        $this->tea->query("UPDATE {db_prefix}tea_ts_rules SET id = {$id} WHERE id = -1");
                        break;
                    }
                }
            }
            redirectexit('action=admin;area=tea;sa=ts');
        }
        if (isset($_POST['group'])) {
            $this->tea->query("DELETE FROM {db_prefix}tea_ts_groups");
            foreach ($_POST['group'] as $g => $v) {
                $this->tea->query("\n\t\t\t\t\t\tINSERT INTO {db_prefix}tea_ts_groups\n\t\t\t\t\t\t\t(id, value)\n\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t\t({string:id}, {int:value})", array('id' => $g, 'value' => '1'));
            }
        }
        // Saving?
        if (isset($_GET['save'])) {
            if ($_POST['tea_ts_addrule_group'] > -1 && !empty($_POST['tea_ts_addrule_tsg'])) {
                if (!is_numeric($_POST['tea_ts_addrule_group'])) {
                    die('Group must be Number');
                }
                $l = $_POST['tea_ts_addrule_tsg'][0];
                $_POST['tea_ts_addrule_tsg'] = substr($_POST['tea_ts_addrule_tsg'], 1);
                if (!is_numeric($_POST['tea_ts_addrule_tsg'])) {
                    die('Group must be Number');
                }
                if ($l != 's' && $l != 'c') {
                    die('Channel must be s or c');
                }
                if ($_POST['tea_ts_addrule_id'] == 'new') {
                    $this->tea->query('INSERT INTO {db_prefix}tea_ts_rules (smf, ts, tst, nf) VALUES (' . $_POST['tea_ts_addrule_group'] . ', ' . $_POST['tea_ts_addrule_tsg'] . ', \'' . $l . '\', \'' . mysql_real_escape_string($_POST['tea_ts_addrule_nf']) . '\')');
                } else {
                    if (!is_numeric($_POST['tea_ts_addrule_id'])) {
                        die('ID must be Number or new');
                    }
                    $this->tea->query("UPDATE {db_prefix}tea_ts_rules SET smf = " . $_POST['tea_ts_addrule_group'] . ", ts = " . $_POST['tea_ts_addrule_tsg'] . ", tst = '" . $l . "', nf = '" . mysql_real_escape_string($_POST['tea_ts_addrule_nf']) . "' WHERE id = " . $_POST['tea_ts_addrule_id']);
                }
            }
            unset($config_vars[100], $config_vars[101], $config_vars[102], $config_vars[103]);
            $config_vars[] = array('select', 'tea_charid', $charlist);
            $config_vars[] = array('text', 'tea_ts_info');
            saveDBSettings($config_vars);
            redirectexit('action=admin;area=tea;sa=ts');
            loadUserSettings();
            writeLog();
        }
        $this->context['post_url'] = $scripturl . '?action=admin;area=tea;sa=ts;save';
        //	$context['settings_title'] = $txt['tea_tea'];
        //	$context['settings_message'] = $txt['tea_settings_message'];
        prepareDBSettingContext($config_vars);
    }
开发者ID:bgame-hunter,项目名称:temars-eve-api,代码行数:101,代码来源:TEA_TS.php

示例12: ModifyLoadBalancingSettings

function ModifyLoadBalancingSettings($return_config = false)
{
    global $txt, $scripturl, $context, $settings, $modSettings;
    // Setup a warning message, but disabled by default.
    $disabled = true;
    $context['settings_message'] = $txt['loadavg_disabled_conf'];
    if (strpos(strtolower(PHP_OS), 'win') === 0) {
        $context['settings_message'] = $txt['loadavg_disabled_windows'];
    } else {
        $modSettings['load_average'] = @file_get_contents('/proc/loadavg');
        if (!empty($modSettings['load_average']) && preg_match('~^([^ ]+?) ([^ ]+?) ([^ ]+)~', $modSettings['load_average'], $matches) !== 0) {
            $modSettings['load_average'] = (double) $matches[1];
        } elseif (($modSettings['load_average'] = @`uptime`) !== null && preg_match('~load averages?: (\\d+\\.\\d+), (\\d+\\.\\d+), (\\d+\\.\\d+)~i', $modSettings['load_average'], $matches) !== 0) {
            $modSettings['load_average'] = (double) $matches[1];
        } else {
            unset($modSettings['load_average']);
        }
        if (!empty($modSettings['load_average'])) {
            $context['settings_message'] = sprintf($txt['loadavg_warning'], $modSettings['load_average']);
            $disabled = false;
        }
    }
    // Start with a simple checkbox.
    $config_vars = array(array('check', 'loadavg_enable'));
    // Set the default values for each option.
    $default_values = array('loadavg_auto_opt' => '1.0', 'loadavg_search' => '2.5', 'loadavg_allunread' => '2.0', 'loadavg_unreadreplies' => '3.5', 'loadavg_show_posts' => '2.0', 'loadavg_forum' => '40.0');
    // Loop through the settings.
    foreach ($default_values as $name => $value) {
        // Use the default value if the setting isn't set yet.
        $value = !isset($modSettings[$name]) ? $value : $modSettings[$name];
        $config_vars[] = array('text', $name, 'value' => $value, 'disabled' => $disabled);
    }
    if ($return_config) {
        return $config_vars;
    }
    $context['post_url'] = $scripturl . '?action=admin;area=serversettings;sa=loads;save';
    $context['settings_title'] = $txt['load_balancing_settings'];
    // Saving?
    if (isset($_GET['save'])) {
        // Stupidity is not allowed.
        foreach ($_POST as $key => $value) {
            if (strpos($key, 'loadavg') === 0 || $key === 'loadavg_enable') {
                continue;
            } elseif ($key == 'loadavg_auto_opt' && $value <= 1) {
                $_POST['loadavg_auto_opt'] = '1.0';
            } elseif ($key == 'loadavg_forum' && $value < 10) {
                $_POST['loadavg_forum'] = '10.0';
            } elseif ($value < 2) {
                $_POST[$key] = '2.0';
            }
        }
        saveDBSettings($config_vars);
        redirectexit('action=admin;area=serversettings;sa=loads;' . $context['session_var'] . '=' . $context['session_id']);
    }
    prepareDBSettingContext($config_vars);
}
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:56,代码来源:ManageServer.php

示例13: ModifyMembergroupsettings

/**
 * Set some general membergroup settings and permissions.
 * Called by ?action=admin;area=membergroups;sa=settings
 * Requires the admin_forum permission (and manage_permissions for changing permissions)
 * Redirects to itself.
 *
 * @uses membergroup_settings sub template of ManageMembergroups.
 */
function ModifyMembergroupsettings()
{
    global $context, $sourcedir, $scripturl, $modSettings, $txt;
    $context['sub_template'] = 'show_settings';
    $context['page_title'] = $txt['membergroups_settings'];
    // Needed for the settings functions.
    require_once $sourcedir . '/ManageServer.php';
    // Don't allow assignment of guests.
    $context['permissions_excluded'] = array(-1);
    // Only one thing here!
    $config_vars = array(array('permissions', 'manage_membergroups'));
    call_integration_hook('integrate_modify_membergroup_settings', array(&$config_vars));
    if (isset($_REQUEST['save'])) {
        checkSession();
        call_integration_hook('integrate_save_membergroup_settings');
        // Yeppers, saving this...
        saveDBSettings($config_vars);
        redirectexit('action=admin;area=membergroups;sa=settings');
    }
    // Some simple context.
    $context['post_url'] = $scripturl . '?action=admin;area=membergroups;save;sa=settings';
    $context['settings_title'] = $txt['membergroups_settings'];
    // We need this for the in-line permissions
    createToken('admin-mp');
    prepareDBSettingContext($config_vars);
}
开发者ID:albertlast,项目名称:SMF2.1,代码行数:34,代码来源:ManageMembergroups.php

示例14: EditSmileySettings

function EditSmileySettings($return_config = false)
{
    global $modSettings, $context, $settings, $txt, $boarddir, $sourcedir, $scripturl;
    // The directories...
    $context['smileys_dir'] = empty($modSettings['smileys_dir']) ? $boarddir . '/Smileys' : $modSettings['smileys_dir'];
    $context['smileys_dir_found'] = is_dir($context['smileys_dir']);
    // Get the names of the smiley sets.
    $smiley_sets = explode(',', $modSettings['smiley_sets_known']);
    $set_names = explode("\n", $modSettings['smiley_sets_names']);
    $smiley_context = array();
    foreach ($smiley_sets as $i => $set) {
        $smiley_context[$set] = $set_names[$i];
    }
    // All the settings for the page...
    $config_vars = array(array('title', 'settings'), array('permissions', 'manage_smileys'), '', array('select', 'smiley_sets_default', $smiley_context), array('check', 'smiley_sets_enable'), array('check', 'smiley_enable', 'subtext' => $txt['smileys_enable_note']), array('text', 'smileys_url'), array('text', 'smileys_dir', 'invalid' => !$context['smileys_dir_found']), '', array('check', 'messageIcons_enable', 'subtext' => $txt['setting_messageIcons_enable_note']));
    if ($return_config) {
        return $config_vars;
    }
    // Setup the basics of the settings template.
    require_once $sourcedir . '/ManageServer.php';
    $context['sub_template'] = 'show_settings';
    // Finish up the form...
    $context['post_url'] = $scripturl . '?action=admin;area=smileys;save;sa=settings';
    $context['permissions_excluded'] = array(-1);
    // Saving the settings?
    if (isset($_GET['save'])) {
        checkSession();
        // Validate the smiley set name.
        $_POST['smiley_sets_default'] = empty($smiley_context[$_POST['smiley_sets_default']]) ? 'default' : $_POST['smiley_sets_default'];
        // Make sure that the smileys are in the right order after enabling them.
        if (isset($_POST['smiley_enable'])) {
            sortSmileyTable();
        }
        saveDBSettings($config_vars);
        cache_put_data('parsing_smileys', null, 480);
        cache_put_data('posting_smileys', null, 480);
        redirectexit('action=admin;area=smileys;sa=settings');
    }
    prepareDBSettingContext($config_vars);
}
开发者ID:valek0972,项目名称:hackits,代码行数:40,代码来源:ManageSmileys.php

示例15: ModifyCalendarSettings

function ModifyCalendarSettings($return_config = false)
{
    global $modSettings, $context, $settings, $txt, $boarddir, $sourcedir, $scripturl, $smcFunc;
    // Load the boards list.
    $boards = array('');
    $request = $smcFunc['db_query']('order_by_board_order', '
		SELECT b.id_board, b.name AS board_name, c.name AS cat_name
		FROM {db_prefix}boards AS b
			LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)', array());
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        $boards[$row['id_board']] = $row['cat_name'] . ' - ' . $row['board_name'];
    }
    $smcFunc['db_free_result']($request);
    // Look, all the calendar settings - of which there are many!
    $config_vars = array(array('permissions', 'calendar_view', 'help' => 'cal_enabled'), array('permissions', 'calendar_post'), array('permissions', 'calendar_edit_own'), array('permissions', 'calendar_edit_any'), '', array('int', 'cal_days_for_index'), array('select', 'cal_showholidays', array(0 => $txt['setting_cal_show_never'], 1 => $txt['setting_cal_show_cal'], 3 => $txt['setting_cal_show_index'], 2 => $txt['setting_cal_show_all'])), array('select', 'cal_showbdays', array(0 => $txt['setting_cal_show_never'], 1 => $txt['setting_cal_show_cal'], 3 => $txt['setting_cal_show_index'], 2 => $txt['setting_cal_show_all'])), array('select', 'cal_showevents', array(0 => $txt['setting_cal_show_never'], 1 => $txt['setting_cal_show_cal'], 3 => $txt['setting_cal_show_index'], 2 => $txt['setting_cal_show_all'])), '', array('select', 'cal_defaultboard', $boards), array('check', 'cal_daysaslink'), array('check', 'cal_allow_unlinked'), array('check', 'cal_showInTopic'), '', array('int', 'cal_minyear'), array('int', 'cal_maxyear'), '', array('check', 'cal_allowspan'), array('int', 'cal_maxspan'));
    if ($return_config) {
        return $config_vars;
    }
    // Get the settings template fired up.
    require_once $sourcedir . '/ManageServer.php';
    // Some important context stuff
    $context['page_title'] = $txt['calendar_settings'];
    $context['sub_template'] = 'show_settings';
    // Get the final touches in place.
    $context['post_url'] = $scripturl . '?action=admin;area=managecalendar;save;sa=settings';
    $context['settings_title'] = $txt['calendar_settings'];
    // Saving the settings?
    if (isset($_GET['save'])) {
        checkSession();
        saveDBSettings($config_vars);
        // Update the stats in case.
        updateSettings(array('calendar_updated' => time()));
        redirectexit('action=admin;area=managecalendar;sa=settings');
    }
    // Prepare the settings...
    prepareDBSettingContext($config_vars);
}
开发者ID:valek0972,项目名称:hackits,代码行数:37,代码来源:ManageCalendar.php


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