本文整理汇总了PHP中adminIndex函数的典型用法代码示例。如果您正苦于以下问题:PHP adminIndex函数的具体用法?PHP adminIndex怎么用?PHP adminIndex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了adminIndex函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: StaffSettings
function StaffSettings()
{
global $context, $mbname, $txt, $db_prefix;
isAllowedTo('admin_forum');
adminIndex('staff_settings');
$context['sub_template'] = 'adminset';
// Set the page title
$context['page_title'] = $mbname . ' - ' . $txt['smfstaff_staffsetting'];
// Get all Staff Groups
$query2 = db_query("\n\tSELECT \n\t\tID_GROUP\n\tFROM {$db_prefix}staff", __FILE__, __LINE__);
$staff_groups = array();
while ($row = mysql_fetch_assoc($query2)) {
$staff_groups[$row['ID_GROUP']] = array('ID_GROUP' => $row['ID_GROUP']);
}
mysql_free_result($query2);
$groups = array();
$groups2 = array();
$query = db_query("\n\tSELECT \n\t\tm.ID_GROUP, m.groupName, m.onlineColor \n\tFROM {$db_prefix}membergroups as m WHERE m.minPosts = -1 \n\t\t\tORDER BY m.groupName", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($query)) {
// Check if the group is not listed already.
if (!isset($staff_groups[$row['ID_GROUP']])) {
$groups[$row['ID_GROUP']] = array('id' => $row['ID_GROUP'], 'name' => $row['groupName'], 'color' => empty($row['onlineColor']) ? '' : $row['onlineColor']);
} else {
$groups2[$row['ID_GROUP']] = array('id' => $row['ID_GROUP'], 'name' => $row['groupName'], 'color' => empty($row['onlineColor']) ? '' : $row['onlineColor']);
}
}
mysql_free_result($query);
$context['smfstaff_groups'] = $groups;
$context['smfstaff_showgroups'] = $groups2;
}
示例2: ManageSmileys
function ManageSmileys()
{
global $context, $txt, $scripturl, $modSettings;
isAllowedTo('manage_smileys');
adminIndex('manage_smileys');
loadLanguage('ManageSmileys');
loadTemplate('ManageSmileys');
$subActions = array('addsmiley' => 'AddSmiley', 'editicon' => 'EditMessageIcons', 'editicons' => 'EditMessageIcons', 'editsets' => 'EditSmileySets', 'editsmileys' => 'EditSmileys', 'import' => 'EditSmileySets', 'modifyset' => 'EditSmileySets', 'modifysmiley' => 'EditSmileys', 'setorder' => 'EditSmileyOrder', 'settings' => 'EditSmileySettings', 'install' => 'InstallSmileySet');
// Default the sub-action to 'edit smiley settings'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'settings';
$context['page_title'] =& $txt['smileys_manage'];
$context['sub_action'] = $_REQUEST['sa'];
$context['sub_template'] =& $context['sub_action'];
// Load up all the tabs...
$context['admin_tabs'] = array('title' => &$txt['smileys_manage'], 'help' => 'smileys', 'description' => $txt['smiley_settings_explain'], 'tabs' => array('editsets' => array('title' => $txt['smiley_sets'], 'description' => $txt['smiley_editsets_explain'], 'href' => $scripturl . '?action=smileys;sa=editsets'), 'addsmiley' => array('title' => $txt['smileys_add'], 'description' => $txt['smiley_addsmiley_explain'], 'href' => $scripturl . '?action=smileys;sa=addsmiley'), 'editsmileys' => array('title' => $txt['smileys_edit'], 'description' => $txt['smiley_editsmileys_explain'], 'href' => $scripturl . '?action=smileys;sa=editsmileys'), 'setorder' => array('title' => $txt['smileys_set_order'], 'description' => $txt['smiley_setorder_explain'], 'href' => $scripturl . '?action=smileys;sa=setorder'), 'editicons' => array('title' => $txt['icons_edit_message_icons'], 'description' => $txt['icons_edit_icons_explain'], 'href' => $scripturl . '?action=smileys;sa=editicons'), 'settings' => array('title' => $txt['settings'], 'description' => $txt['smiley_settings_explain'], 'href' => $scripturl . '?action=smileys;sa=settings', 'is_last' => true)));
// Select the right tab based on the sub action.
if (isset($context['admin_tabs']['tabs'][$context['sub_action']])) {
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;
}
// Some settings may not be enabled, disallow these from the tabs as appropriate.
if (empty($modSettings['messageIcons_enable'])) {
unset($context['admin_tabs']['tabs']['editicons']);
}
if (empty($modSettings['smiley_enable'])) {
unset($context['admin_tabs']['tabs']['addsmiley']);
unset($context['admin_tabs']['tabs']['editsmileys']);
unset($context['admin_tabs']['tabs']['setorder']);
}
// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}
示例3: ManageCalendar
function ManageCalendar()
{
global $context, $txt, $scripturl, $modSettings;
isAllowedTo('admin_forum');
// Administrative side bar, here we come!
adminIndex('manage_calendar');
// Everything's gonna need this.
loadLanguage('ManageCalendar');
// Default text.
$context['explain_text'] =& $txt['calendar_desc'];
// Little short on the ground of functions here... but things can and maybe will change...
$subActions = array('editholiday' => 'EditHoliday', 'holidays' => 'ModifyHolidays', 'settings' => 'ModifySettings');
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'settings';
// Set up the two tabs here...
$context['admin_tabs'] = array('title' => &$txt['manage_calendar'], 'help' => 'calendar', 'description' => $txt['calendar_settings_desc'], 'tabs' => array('holidays' => array('title' => $txt['manage_holidays'], 'description' => $txt['manage_holidays_desc'], 'href' => $scripturl . '?action=managecalendar;sa=holidays'), 'settings' => array('title' => $txt['calendar_settings'], 'description' => $txt['calendar_settings_desc'], 'href' => $scripturl . '?action=managecalendar;sa=settings', 'is_last' => true)));
// Select the tab they're at...
if (isset($context['admin_tabs']['tabs'][$_REQUEST['sa']])) {
$context['admin_tabs']['tabs'][$_REQUEST['sa']]['is_selected'] = true;
}
// Some settings may not be enabled, disallow these from the tabs as appropriate.
if (empty($modSettings['cal_enabled'])) {
unset($context['admin_tabs']['tabs']['holidays']);
}
$subActions[$_REQUEST['sa']]();
}
示例4: ManageNews
function ManageNews()
{
global $context, $txt, $scripturl;
// First, let's do a quick permissions check for the best error message possible.
isAllowedTo(array('edit_news', 'send_mail', 'admin_forum'));
// Administrative side bar, here we come!
adminIndex('news');
loadTemplate('ManageNews');
// Format: 'sub-action' => array('function', 'permission')
$subActions = array('editnews' => array('EditNews', 'edit_news'), 'mailingmembers' => array('SelectMailingMembers', 'send_mail'), 'mailingcompose' => array('ComposeMailing', 'send_mail'), 'mailingsend' => array('SendMailing', 'send_mail'), 'settings' => array('ModifyNewsSettings', 'admin_forum'));
// Default to sub action 'main' or 'settings' depending on permissions.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('edit_news') ? 'editnews' : (allowedTo('send_mail') ? 'mailingmembers' : 'settings'));
// Have you got the proper permissions?
isAllowedTo($subActions[$_REQUEST['sa']][1]);
// Create the tabs for the template.
$context['admin_tabs'] = array('title' => $txt['news_title'], 'help' => 'edit_news', 'description' => $txt[670], 'tabs' => array());
if (allowedTo('edit_news')) {
$context['admin_tabs']['tabs'][] = array('title' => $txt[7], 'description' => $txt[670], 'href' => $scripturl . '?action=news', 'is_selected' => $_REQUEST['sa'] == 'editnews');
}
if (allowedTo('send_mail')) {
$context['admin_tabs']['tabs'][] = array('title' => $txt[6], 'description' => $txt['news_mailing_desc'], 'href' => $scripturl . '?action=news;sa=mailingmembers', 'is_selected' => substr($_REQUEST['sa'], 0, 7) == 'mailing');
}
if (allowedTo('admin_forum')) {
$context['admin_tabs']['tabs'][] = array('title' => $txt['settings'], 'description' => $txt['news_settings_desc'], 'href' => $scripturl . '?action=news;sa=settings', 'is_selected' => $_REQUEST['sa'] == 'settings');
}
$context['admin_tabs']['tabs'][count($context['admin_tabs']['tabs']) - 1]['is_last'] = true;
$subActions[$_REQUEST['sa']][0]();
}
示例5: Packages
function Packages()
{
global $txt, $scripturl, $sourcedir, $context;
isAllowedTo('admin_forum');
// Managing packages!
adminIndex('manage_packages');
// Load all the basic stuff.
require_once $sourcedir . '/Subs-Package.php';
loadLanguage('Packages');
loadTemplate('Packages');
// Set up the linktree and title so it's already done.
$context['linktree'][] = array('url' => $scripturl . '?action=packages', 'name' => &$txt['package1']);
$context['page_title'] = $txt['package1'];
// Delegation makes the world... that is, the package manager go 'round.
$subActions = array('browse' => 'PackageBrowse', 'remove' => 'PackageRemove', 'list' => 'PackageList', 'install' => 'PackageInstallTest', 'install2' => 'PackageInstall', 'uninstall' => 'PackageInstallTest', 'uninstall2' => 'PackageInstall', 'installed' => 'InstalledList', 'options' => 'PackageOptions', 'flush' => 'FlushInstall', 'examine' => 'ExamineFile');
// Work out exactly who it is we are calling.
if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
$context['sub_action'] = $_REQUEST['sa'];
} else {
$context['sub_action'] = 'browse';
}
// Set up some tabs...
$context['admin_tabs'] = array('title' => &$txt['package1'], 'description' => $txt['package_manager_desc'], 'tabs' => array('browse' => array('title' => $txt['package3'], 'href' => $scripturl . '?action=packages;sa=browse'), 'packageget' => array('title' => $txt['download_packages'], 'description' => $txt['download_packages_desc'], 'href' => $scripturl . '?action=packageget'), 'installed' => array('title' => $txt['installed_packages'], 'description' => $txt['installed_packages_desc'], 'href' => $scripturl . '?action=packages;sa=installed'), 'options' => array('title' => $txt['package_settings'], 'description' => $txt['package_install_options_ftp_why'], 'href' => $scripturl . '?action=packages;sa=options', 'is_last' => true)));
// Attempt to automatically select the right tab.
if (isset($context['admin_tabs']['tabs'][$context['sub_action']])) {
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;
} else {
$context['admin_tabs']['tabs']['browse']['is_selected'] = true;
}
// Call the function we're handing control to.
$subActions[$context['sub_action']]();
}
示例6: PackageGet
function PackageGet()
{
global $txt, $scripturl, $context, $boarddir, $sourcedir, $modSettings;
isAllowedTo('admin_forum');
require_once $sourcedir . '/Subs-Package.php';
// Still managing packages...
adminIndex('manage_packages');
// Use the Packages template... no reason to separate.
loadLanguage('Packages');
loadTemplate('Packages');
// Add the appropriate items to the link tree.
$context['linktree'][] = array('url' => $scripturl . '?action=packages', 'name' => &$txt['package1']);
$context['linktree'][] = array('url' => $scripturl . '?action=packageget', 'name' => &$txt['smf182']);
$context['page_title'] = $txt['package1'];
// Here is a list of all the potentially valid actions.
$subActions = array('servers' => 'PackageServers', 'add' => 'PackageServerAdd', 'browse' => 'PackageGBrowse', 'download' => 'PackageDownload', 'remove' => 'PackageServerRemove', 'upload' => 'PackageUpload');
// Now let's decide where we are taking this...
if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
$context['sub_action'] = $_REQUEST['sa'];
} elseif ($_REQUEST['action'] == 'pgdownload') {
$context['sub_action'] = 'download';
} else {
$context['sub_action'] = 'servers';
}
// Now create the tabs for the template.
$context['admin_tabs'] = array('title' => &$txt['package1'], 'description' => $txt['package_manager_desc'], 'tabs' => array('browse' => array('title' => $txt['package3'], 'href' => $scripturl . '?action=packages;sa=browse'), 'packageget' => array('title' => $txt['download_packages'], 'description' => $txt['download_packages_desc'], 'href' => $scripturl . '?action=packageget', 'is_selected' => true), 'installed' => array('title' => $txt['installed_packages'], 'description' => $txt['installed_packages_desc'], 'href' => $scripturl . '?action=packages;sa=installed'), 'options' => array('title' => $txt['package_settings'], 'description' => $txt['package_install_options_ftp_why'], 'href' => $scripturl . '?action=packages;sa=options', 'is_last' => true)));
$subActions[$context['sub_action']]();
}
示例7: RegCenter
function RegCenter()
{
global $modSettings, $context, $txt, $db_prefix, $scripturl;
// Old templates might still request this.
if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'browse') {
redirectexit('action=viewmembers;sa=browse' . (isset($_REQUEST['type']) ? ';type=' . $_REQUEST['type'] : ''));
}
$subActions = array('register' => array('AdminRegister', 'moderate_forum'), 'agreement' => array('EditAgreement', 'admin_forum'), 'reservednames' => array('SetReserve', 'admin_forum'), 'settings' => array('AdminSettings', 'admin_forum'));
// Work out which to call...
$context['sub_action'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('moderate_forum') ? 'register' : 'settings');
// Must have sufficient permissions.
isAllowedTo($subActions[$context['sub_action']][1]);
// Set the admin area...
adminIndex('registration_center');
// Loading, always loading.
loadLanguage('Login');
loadTemplate('Register');
// Next create the tabs for the template.
$context['admin_tabs'] = array('title' => &$txt['registration_center'], 'help' => 'registrations', 'description' => $txt['admin_settings_desc'], 'tabs' => array('register' => array('title' => $txt['admin_browse_register_new'], 'description' => $txt['admin_register_desc'], 'href' => $scripturl . '?action=regcenter;sa=register', 'is_selected' => $context['sub_action'] == 'register', 'is_last' => !allowedTo('admin_forum'))));
if (allowedTo('admin_forum')) {
$context['admin_tabs']['tabs']['agreement'] = array('title' => $txt['smf11'], 'description' => $txt['smf12'], 'href' => $scripturl . '?action=regcenter;sa=agreement', 'is_selected' => $context['sub_action'] == 'agreement');
$context['admin_tabs']['tabs']['reservednames'] = array('title' => $txt[341], 'description' => $txt[699], 'href' => $scripturl . '?action=regcenter;sa=reservednames', 'is_selected' => $context['sub_action'] == 'reservednames');
$context['admin_tabs']['tabs']['settings'] = array('title' => $txt['settings'], 'description' => $txt['admin_settings_desc'], 'href' => $scripturl . '?action=regcenter;sa=settings', 'is_last' => true, 'is_selected' => $context['sub_action'] == 'settings');
}
// Finally, get around to calling the function...
$subActions[$context['sub_action']][0]();
}
示例8: ManagePostSettings
function ManagePostSettings()
{
global $context, $txt, $scripturl;
// Boldify "Posts and Topics" on the admin bar.
adminIndex('posts_and_topics');
$subActions = array('posts' => array('ModifyPostSettings', 'admin_forum'), 'bbc' => array('ModifyBBCSettings', 'admin_forum'), 'censor' => array('SetCensor', 'moderate_forum'), 'topics' => array('ModifyTopicSettings', 'admin_forum'));
// Default the sub-action to 'view ban list'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('admin_forum') ? 'posts' : 'censor');
// Make sure you can do this.
isAllowedTo($subActions[$_REQUEST['sa']][1]);
$context['page_title'] = $txt['manageposts_title'];
// Tabs for browsing the different ban functions.
$context['admin_tabs'] = array('title' => $txt['manageposts_title'], 'help' => 'posts_and_topics', 'description' => $txt['manageposts_description'], 'tabs' => array());
if (allowedTo('admin_forum')) {
$context['admin_tabs']['tabs'][] = array('title' => $txt['manageposts_settings'], 'description' => $txt['manageposts_settings_description'], 'href' => $scripturl . '?action=postsettings;sa=posts', 'is_selected' => $_REQUEST['sa'] == 'posts');
$context['admin_tabs']['tabs'][] = array('title' => $txt['manageposts_bbc_settings'], 'description' => $txt['manageposts_bbc_settings_description'], 'href' => $scripturl . '?action=postsettings;sa=bbc', 'is_selected' => $_REQUEST['sa'] == 'bbc');
}
if (allowedTo('moderate_forum')) {
$context['admin_tabs']['tabs'][] = array('title' => $txt[135], 'description' => $txt[141], 'href' => $scripturl . '?action=postsettings;sa=censor', 'is_selected' => $_REQUEST['sa'] == 'censor', 'is_last' => !allowedTo('admin_forum'));
}
if (allowedTo('admin_forum')) {
$context['admin_tabs']['tabs'][] = array('title' => $txt['manageposts_topic_settings'], 'description' => $txt['manageposts_topic_settings_description'], 'href' => $scripturl . '?action=postsettings;sa=topics', 'is_selected' => $_REQUEST['sa'] == 'topics', 'is_last' => true);
}
// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']][0]();
}
示例9: view
function view()
{
global $context;
adminIndex('globalhf');
checkSession('get');
//Load main trader template.
$context['sub_template'] = 'main';
//Set the page title
$context['page_title'] = 'Global Headers and Footers';
}
示例10: ViewMembers
function ViewMembers()
{
global $txt, $scripturl, $context, $modSettings, $db_prefix;
$subActions = array('all' => array('ViewMemberlist', 'moderate_forum'), 'approve' => array('AdminApprove', 'moderate_forum'), 'browse' => array('MembersAwaitingActivation', 'moderate_forum'), 'search' => array('SearchMembers', 'moderate_forum'), 'query' => array('ViewMemberlist', 'moderate_forum'));
// Default to sub action 'index' or 'settings' depending on permissions.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'all';
// We know the sub action, now we know what you're allowed to do.
isAllowedTo($subActions[$_REQUEST['sa']][1]);
// Administration bar, I choose you!
adminIndex('view_members');
// Load the essentials.
loadLanguage('ManageMembers');
loadTemplate('ManageMembers');
// Get counts on every type of activation - for sections and filtering alike.
$request = db_query("\n\t\tSELECT COUNT(*) AS totalMembers, is_activated\n\t\tFROM {$db_prefix}members\n\t\tWHERE is_activated != 1\n\t\tGROUP BY is_activated", __FILE__, __LINE__);
$context['activation_numbers'] = array();
$context['awaiting_activation'] = 0;
$context['awaiting_approval'] = 0;
while ($row = mysql_fetch_assoc($request)) {
$context['activation_numbers'][$row['is_activated']] = $row['totalMembers'];
}
mysql_free_result($request);
foreach ($context['activation_numbers'] as $activation_type => $total_members) {
if (in_array($activation_type, array(0, 2))) {
$context['awaiting_activation'] += $total_members;
} elseif (in_array($activation_type, array(3, 4, 5))) {
$context['awaiting_approval'] += $total_members;
}
}
// For the page header... do we show activation?
$context['show_activate'] = !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 || !empty($context['awaiting_activation']);
// What about approval?
$context['show_approve'] = !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2 || !empty($context['awaiting_approval']);
// Setup the admin tabs.
$context['admin_tabs'] = array('title' => $txt[9], 'help' => 'view_members', 'description' => $txt[11], 'tabs' => array());
if (allowedTo('moderate_forum')) {
$context['admin_tabs']['tabs'] = array('viewmembers' => array('title' => $txt[303], 'description' => $txt[11], 'href' => $scripturl . '?action=viewmembers;sa=all', 'is_selected' => $_REQUEST['sa'] == 'all'), 'search' => array('title' => $txt['mlist_search'], 'description' => $txt[11], 'href' => $scripturl . '?action=viewmembers;sa=search', 'is_selected' => $_REQUEST['sa'] == 'search' || $_REQUEST['sa'] == 'query'), 'approve' => array('title' => sprintf($txt['admin_browse_awaiting_approval'], $context['awaiting_approval']), 'description' => $txt['admin_browse_approve_desc'], 'href' => $scripturl . '?action=viewmembers;sa=browse;type=approve', 'is_selected' => false), 'activate' => array('title' => sprintf($txt['admin_browse_awaiting_activate'], $context['awaiting_activation']), 'description' => $txt['admin_browse_activate_desc'], 'href' => $scripturl . '?action=viewmembers;sa=browse;type=activate', 'is_selected' => false, 'is_last' => true));
}
// Sort out the tabs for the ones which may not exist!
if (!$context['show_activate']) {
$context['admin_tabs']['tabs']['approve']['is_last'] = true;
unset($context['admin_tabs']['tabs']['activate']);
}
if (!$context['show_approve']) {
if (!$context['show_activate']) {
$context['admin_tabs']['tabs']['search']['is_last'] = true;
}
unset($context['admin_tabs']['tabs']['approve']);
}
$subActions[$_REQUEST['sa']][0]();
}
示例11: GlobalHF
function GlobalHF()
{
global $context, $settings, $txt, $global_hf;
isAllowedTo('admin_forum');
adminIndex('globalhf');
define('GlobalHF_VERSION', '<a href="http://custom.simplemachines.org/mods/index.php?mod=351" target="_blank">Global Headers and Footers 2.0.1</a>');
define('GlobalHF_COPYRIGHT', 'Copyright <a href="http://www.smfhacks.com/" target="_blank">SMFHacks.com</a> 2012');
loadLanguage('smfhacks_languages/global-hf');
loadTemplate('smfhacks_templates/global-hf');
GlobalHFCheckSaving();
$context['template_layers'][] = 'global_hf_copyright';
$context['html_headers'] .= "\n" . '<link rel="stylesheet" type="text/css" href="' . $settings['default_theme_url'] . '/smfhacks_css/global-hf.css" />';
$context['page_title'] = $txt['global_hf']['title'];
$context['sub_template'] = 'global_hf_admin';
}
示例12: ManageSearch
function ManageSearch()
{
global $context, $txt, $scripturl;
isAllowedTo('admin_forum');
adminIndex('manage_search');
loadLanguage('Search');
loadTemplate('ManageSearch');
$subActions = array('settings' => 'EditSearchSettings', 'weights' => 'EditWeights', 'method' => 'EditSearchMethod', 'createfulltext' => 'EditSearchMethod', 'removecustom' => 'EditSearchMethod', 'removefulltext' => 'EditSearchMethod', 'createmsgindex' => 'CreateMessageIndex');
// Default the sub-action to 'edit search settings'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'settings';
$context['sub_action'] = $_REQUEST['sa'];
// Create the tabs for the template.
$context['admin_tabs'] = array('title' => &$txt['manage_search'], 'help' => 'search', 'description' => $txt['search_settings_desc'], 'tabs' => array('weights' => array('title' => $txt['search_weights'], 'description' => $txt['search_weights_desc'], 'href' => $scripturl . '?action=managesearch;sa=weights'), 'method' => array('title' => $txt['search_method'], 'description' => $txt['search_method_desc'], 'href' => $scripturl . '?action=managesearch;sa=method'), 'settings' => array('title' => $txt['settings'], 'description' => $txt['search_settings_desc'], 'href' => $scripturl . '?action=managesearch;sa=settings', 'is_last' => true)));
// Make sure the tab they are using has is_selected set.
if (isset($context['admin_tabs']['tabs'][$_REQUEST['sa']])) {
$context['admin_tabs']['tabs'][$_REQUEST['sa']]['is_selected'] = true;
}
// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}
示例13: ModifySettings
function ModifySettings()
{
global $context, $txt, $scripturl, $modSettings;
// This is just to keep the database password more secure.
isAllowedTo('admin_forum');
checkSession('get');
// The administration bar......
adminIndex('edit_settings');
$context['page_title'] = $txt[222];
$context['sub_template'] = 'show_settings';
$subActions = array('core' => 'ModifyCoreSettings', 'other' => 'ModifyOtherSettings', 'cache' => 'ModifyCacheSettings');
// By default we're editing the core settings
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'core';
$context['sub_action'] = $_REQUEST['sa'];
// Load up all the tabs...
$context['admin_tabs'] = array('title' => &$txt[222], 'help' => 'serversettings', 'description' => $txt[347], 'tabs' => array('core' => array('title' => $txt['core_configuration'], 'href' => $scripturl . '?action=serversettings;sa=core;sesc=' . $context['session_id']), 'other' => array('title' => $txt['other_configuration'], 'href' => $scripturl . '?action=serversettings;sa=other;sesc=' . $context['session_id']), 'cache' => array('title' => $txt['caching_settings'], 'href' => $scripturl . '?action=serversettings;sa=cache;sesc=' . $context['session_id'], 'is_last' => true)));
// Select the right tab based on the sub action.
if (isset($context['admin_tabs']['tabs'][$context['sub_action']])) {
$context['admin_tabs']['tabs'][$context['sub_action']]['is_selected'] = true;
}
// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}
示例14: PrettyInterface
function PrettyInterface()
{
global $context, $scripturl, $settings, $txt;
// Keep the critters out
isAllowedTo('admin_forum');
// Default templating stuff
loadTemplate('PrettyUrls');
if (loadLanguage('PrettyUrls') == false) {
loadLanguage('PrettyUrls', 'english');
}
// Shiny chrome interface
adminIndex('config');
$context['template_layers']['pretty_chrome'] = 'pretty_chrome';
$context['html_headers'] .= '
<link rel="stylesheet" type="text/css" href="' . $settings['default_theme_url'] . '/pretty/chrome.css" media="screen,projection" />';
$context['pretty']['chrome'] = array('admin' => true, 'menu' => array('news' => array('href' => $scripturl . '?action=admin;area=pretty', 'title' => $txt['pretty_chrome_menu_news']), 'settings' => array('href' => $scripturl . '?action=admin;area=pretty;sa=settings', 'title' => $txt['pretty_chrome_menu_settings']), 'maintenance' => array('href' => $scripturl . '?action=admin;area=pretty;sa=maintenance', 'title' => $txt['pretty_chrome_menu_maintenance'])), 'title' => $txt['pretty_chrome_title']);
// What can we do today?
$subActions = array('filters' => 'pretty_edit_filters', 'maintenance' => 'pretty_maintenance', 'news' => 'pretty_news', 'settings' => 'pretty_manage_settings', 'test' => 'pretty_test_rewrites');
if (isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']])) {
call_user_func($subActions[$_REQUEST['sa']]);
} else {
pretty_news();
}
}
示例15: ModifyMembergroups
function ModifyMembergroups()
{
global $context, $txt, $scripturl;
$subActions = array('add' => array('AddMembergroup', 'manage_membergroups'), 'delete' => array('DeleteMembergroup', 'manage_membergroups'), 'edit' => array('EditMembergroup', 'manage_membergroups'), 'index' => array('MembergroupIndex', 'manage_membergroups'), 'members' => array('MembergroupMembers', 'manage_membergroups'), 'settings' => array('ModifyMembergroupSettings', 'admin_forum'));
// Default to sub action 'index' or 'settings' depending on permissions.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (allowedTo('manage_membergroups') ? 'index' : 'settings');
// Do the permission check, you might not be allowed her.
isAllowedTo($subActions[$_REQUEST['sa']][1]);
// We're in the admin screen, so show a nice side bar.
adminIndex('edit_groups');
// Language and template stuff, the usual.
loadLanguage('ManageMembers');
loadTemplate('ManageMembergroups');
// Setup the admin tabs.
$context['admin_tabs'] = array('title' => $txt['membergroups_title'], 'help' => 'membergroups', 'description' => $txt['membergroups_description'], 'tabs' => array());
if (allowedTo('manage_membergroups')) {
$context['admin_tabs']['tabs']['index'] = array('title' => $txt['membergroups_edit_groups'], 'description' => $txt['membergroups_description'], 'href' => $scripturl . '?action=membergroups', 'is_selected' => $_REQUEST['sa'] != 'add' && $_REQUEST['sa'] != 'settings');
$context['admin_tabs']['tabs']['add_cat'] = array('title' => $txt['membergroups_new_group'], 'description' => $txt['membergroups_description'], 'href' => $scripturl . '?action=membergroups;sa=add', 'is_selected' => $_REQUEST['sa'] == 'add', 'is_last' => !allowedTo('admin_forum'));
}
if (allowedTo('admin_forum')) {
$context['admin_tabs']['tabs']['settings'] = array('title' => $txt['settings'], 'description' => $txt['membergroups_description'], 'href' => $scripturl . '?action=membergroups;sa=settings', 'is_selected' => $_REQUEST['sa'] == 'settings', 'is_last' => true);
}
// Call the right function.
$subActions[$_REQUEST['sa']][0]();
}