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


PHP allowedTo函数代码示例

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


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

示例1: template_shop_above

function template_shop_above()
{
    global $txt, $context, $modSettings, $scripturl;
    // Doing nothing? So be it :P
    if (!isset($context['shop_do'])) {
        $context['shop_do'] = '';
    }
    // TODO: Simplify the code (for the links) below?
    echo '
		<!-- The Linktree -->
		<table width="100%" cellpadding="3" cellspacing="0"><tr><td valign="bottom">', theme_linktree(), '</td></tr></table>
		<table width="100%" cellpadding="0" cellspacing="0" border="0" style="padding-top: 1ex;"><tr>
			<td width="180" valign="top" style="width: 26ex; padding-right: 10px; padding-bottom: 10px;">
				<table width="100%" cellpadding="4" cellspacing="1" border="0" class="bordercolor">
					<tr>
						<td class="catbg">', $txt['shop'], ' Stuff</td>
					</tr>
					<tr class="windowbg2">
						<td class="smalltext" style="line-height: 1.3; padding-bottom: 3ex;">
							', $context['shop_do'] == 'main' ? '<b>' : '', '<a href="', $scripturl, '?action=shop">', $txt['shop'], ' Home</a>', $context['shop_do'] == 'main' ? '</b>' : '', '<br />';
    // Allowed to buy stuff?
    if (allowedTo('shop_buy')) {
        echo '
							', ($context['shop_do'] == 'buy' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=buy">' . $txt['shop_buy'] . '</a>' . ($context['shop_do'] == 'buy' ? '</b>' : '') . '<br />';
    }
    // The inventory - Everyone can access this!
    echo '
							', ($context['shop_do'] == 'inv' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=inv">' . $txt['shop_yourinv'] . '</a>' . ($context['shop_do'] == 'inv' ? '</b>' : ''), '<br />';
    // Allowed to send money to other people
    if (allowedTo('shop_sendmoney')) {
        echo '
							', ($context['shop_do'] == 'sendmoney' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=sendmoney">' . $txt['shop_send_money'] . '</a>' . ($context['shop_do'] == 'sendmoney' ? '</b>' : '') . '<br />';
    }
    // Allowed to send items to other people?
    if (allowedTo('shop_senditems')) {
        echo '
							', $context['shop_do'] == 'senditems' ? '<b>' : '', '<a href="' . $scripturl . '?action=shop;do=senditems">' . $txt['shop_send_item'] . '</a>' . ($context['shop_do'] == 'senditems' ? '</b>' : ''), '<br />';
    }
    // Allowed to view inventory of others?
    if (allowedTo('shop_invother')) {
        echo '
							', $context['shop_do'] == 'invother' ? '<b>' : '', '<a href="' . $scripturl . '?action=shop;do=invother">' . $txt['shop_invother'] . '</a>' . ($context['shop_do'] == 'invother' ? '</b>' : ''), '<br />';
    }
    // Allowed to access the bank?
    if (allowedTo('shop_bank')) {
        echo '
							', ($context['shop_do'] == 'bank' ? '<b>' : '') . $modSettings['shopBankEnabled'] ? '<a href="' . $scripturl . '?action=shop;do=bank">' . $txt['shop_bank'] . '</a><br />' : '' . ($context['shop_do'] == 'bank' ? '</b>' : '');
    }
    // Allowed to access the trade centre?
    if (allowedTo('shop_trade')) {
        echo '
							', ($context['shop_do'] == 'trade' ? '<b>' : '') . $modSettings['shopTradeEnabled'] ? '<a href="' . $scripturl . '?action=shop;do=trade">' . $txt['shop_trade'] . '</a><br />' : '', $context['shop_do'] == 'trade' ? '</b>' : '';
    }
    echo '
						</td>
					</tr>
				</table>
			</td>
			<td valign="top">';
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:60,代码来源:Shop.template.php

示例2: template_profile_above

function template_profile_above()
{
    global $context, $scripturl, $txt, $settings;
    echo '
	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
    // If an error occurred while trying to save previously, give the user a clue!
    echo template_error_message();
    // If the profile was update successfully, let the user know this.
    if (!empty($context['profile_updated'])) {
        echo '
		<div class="ui-body ui-body-e">
			', $context['profile_updated'], '
		</div>';
    }
    // Profile menu
    if (allowedTo('profile_identity_any')) {
        echo '
		<div data-role="controlgroup">
			<a data-role="button" href="', $scripturl, '?action=profile;area=summary;u=', $context['member']['id'], '">', $txt['profileInfo'], '</a>';
        if (allowedTo('profile_identity_own')) {
            echo '
			<a data-role="button" href="', $scripturl, '?action=profile;area=account;u=', $context['member']['id'], '">', $txt['account'], '</a>';
        }
        if (allowedTo('profile_identity_own')) {
            echo '
			<a data-role="button" href="', $scripturl, '?action=profile;area=forumprofile;u=', $context['member']['id'], '">', $txt['profileEdit'], '</a>';
        }
        echo '
		</div><br />';
    }
}
开发者ID:ahrasis,项目名称:themes,代码行数:32,代码来源:Profile.template.php

示例3: fixp_menu_button

function fixp_menu_button(&$buttons)
{
    global $boardurl, $txt, $context;
    fixp_loadLanguage();
    $context['current_action'] = 'fixp';
    $buttons['fixp'] = array('title' => $txt['fixp'], 'show' => allowedTo('admin_forum'), 'href' => $boardurl . '/fix_packages.php', 'active_button' => true, 'sub_buttons' => array());
}
开发者ID:rhodefey,项目名称:tools,代码行数:7,代码来源:fix_packages.php

示例4: gplus_admin_areas

function gplus_admin_areas(&$admin_areas)
{
    global $scripturl, $txt;
    if (allowedTo('admin_forum')) {
        gplus_array_insert($admin_areas, 'layout', array('sa_gplus' => array('title' => $txt['gp_googplus'], 'areas' => array('gplus' => array('label' => $txt['gp_app_config'], 'file' => 'GPlus/GplusAdmin.php', 'function' => 'gplusa', 'custom_url' => $scripturl . '?action=admin;area=gplus', 'icon' => 'server.gif', 'subsections' => array('gplus' => array($txt['gp_app_config']), 'gplus_logs' => array($txt['gp_app_logs'])))))));
    }
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:7,代码来源:GPlusHooks.php

示例5: Facebooka

    public function Facebooka()
    {
        global $fb_object, $fb_hook_object, $modSettings, $sourcedir, $context;
        require_once $sourcedir . '/ManageServer.php';
        loadTemplate('FacebookAdmin');
        allowedTo('admin_forum');
        $fb_object = new SAFacebookadmin();
        $context['html_headers'] .= '
		    <script type="text/javascript">
		        function fbLogin() {

					FB.login(function(response) {
                        if (response.authResponse) {
                            alert(\'' . $fb_object->txt['fb_grantperm1'] . '\');
                            window.location = \'https://www.facebook.com/dialog/oauth?client_id=' . $modSettings['fb_app_id'] . '&redirect_uri=' . urlencode($fb_hook_object->scripturl . '') . '&scope=email,publish_actions\';
                        }
						else {
                            alert(\'' . $fb_object->txt['fb_grantperm'] . '\');
                        }
                    }, {scope: \'email,publish_actions\'});

                }
		    </script>';
        $context['page_title'] = $fb_hook_object->txt['fb_main1'];
        $context[$context['admin_menu_name']]['tab_data']['title'] = $fb_hook_object->txt['fb_main1'];
        $context[$context['admin_menu_name']]['tab_data']['description'] = $fb_hook_object->txt['fb_main1'];
        $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($fb_object->subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'facebook';
        call_user_func(array('SAFacebookadmin', $fb_object->subActions[$_REQUEST['sa']]));
    }
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:29,代码来源:FacebookAdmin.php

示例6: 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]();
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:26,代码来源:ManagePosts.php

示例7: BoardIndex

/**
 * This function shows the board index.
 * It uses the BoardIndex template, and main sub template.
 * It may use the boardindex subtemplate for wireless support.
 * It updates the most online statistics.
 * It is accessed by ?action=boardindex.
 */
function BoardIndex()
{
    global $txt, $user_info, $sourcedir, $modSettings, $context, $settings, $scripturl;
    // For wireless, we use the Wireless template...
    if (WIRELESS) {
        $context['sub_template'] = WIRELESS_PROTOCOL . '_boardindex';
    } else {
        loadTemplate('BoardIndex');
    }
    // Set a canonical URL for this page.
    $context['canonical_url'] = $scripturl;
    // Do not let search engines index anything if there is a random thing in $_GET.
    if (!empty($_GET)) {
        $context['robot_no_index'] = true;
    }
    // Retrieve the categories and boards.
    require_once $sourcedir . '/Subs-BoardIndex.php';
    $boardIndexOptions = array('include_categories' => true, 'base_level' => 0, 'parent_id' => 0, 'set_latest_post' => true, 'countChildPosts' => !empty($modSettings['countChildPosts']));
    $context['categories'] = getBoardIndex($boardIndexOptions);
    // Get the user online list.
    require_once $sourcedir . '/Subs-MembersOnline.php';
    $membersOnlineOptions = array('show_hidden' => allowedTo('moderate_forum'), 'sort' => 'log_time', 'reverse_sort' => true);
    $context += getMembersOnlineStats($membersOnlineOptions);
    $context['show_buddies'] = !empty($user_info['buddies']);
    // Are we showing all membergroups on the board index?
    if (!empty($settings['show_group_key'])) {
        $context['membergroups'] = cache_quick_get('membergroup_list', 'Subs-Membergroups.php', 'cache_getMembergroupList', array());
    }
    // Track most online statistics? (Subs-MembersOnline.php)
    if (!empty($modSettings['trackStats'])) {
        trackStatsUsersOnline($context['num_guests'] + $context['num_spiders'] + $context['num_users_online']);
    }
    // Retrieve the latest posts if the theme settings require it.
    if (isset($settings['number_recent_posts']) && $settings['number_recent_posts'] > 1) {
        $latestPostOptions = array('number_posts' => $settings['number_recent_posts']);
        $context['latest_posts'] = cache_quick_get('boardindex-latest_posts:' . md5($user_info['query_wanna_see_board'] . $user_info['language']), 'Subs-Recent.php', 'cache_getLastPosts', array($latestPostOptions));
    }
    $settings['display_recent_bar'] = !empty($settings['number_recent_posts']) ? $settings['number_recent_posts'] : 0;
    $settings['show_member_bar'] &= allowedTo('view_mlist');
    $context['show_stats'] = allowedTo('view_stats') && !empty($modSettings['trackStats']);
    $context['show_member_list'] = allowedTo('view_mlist');
    $context['show_who'] = allowedTo('who_view') && !empty($modSettings['who_enabled']);
    // Load the calendar?
    if (!empty($modSettings['cal_enabled']) && allowedTo('calendar_view')) {
        // Retrieve the calendar data (events, birthdays, holidays).
        $eventOptions = array('include_holidays' => $modSettings['cal_showholidays'] > 1, 'include_birthdays' => $modSettings['cal_showbdays'] > 1, 'include_events' => $modSettings['cal_showevents'] > 1, 'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index']);
        $context += cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'Subs-Calendar.php', 'cache_getRecentEvents', array($eventOptions));
        // Whether one or multiple days are shown on the board index.
        $context['calendar_only_today'] = $modSettings['cal_days_for_index'] == 1;
        // This is used to show the "how-do-I-edit" help.
        $context['calendar_can_edit'] = allowedTo('calendar_edit_any');
    } else {
        $context['show_calendar'] = false;
    }
    $context['page_title'] = sprintf($txt['forum_index'], $context['forum_name']);
    // Mark read button
    $context['mark_read_button'] = array('markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']));
    // Allow mods to add additional buttons here
    call_integration_hook('integrate_mark_read_button');
}
开发者ID:albertlast,项目名称:SMF2.1,代码行数:67,代码来源:BoardIndex.php

示例8: install_menu_button

function install_menu_button(&$buttons)
{
    global $boardurl, $context;
    $context['sub_template'] = 'install_script';
    $context['current_action'] = 'install';
    $buttons['install'] = array('title' => 'Installation script', 'show' => allowedTo('admin_forum'), 'href' => $boardurl . '/install.php', 'active_button' => true, 'sub_buttons' => array());
}
开发者ID:emanuele45,项目名称:DismissibleNotices,代码行数:7,代码来源:install.php

示例9: integrate_chars_admin_actions

function integrate_chars_admin_actions(&$admin_areas)
{
    global $txt;
    if (allowedTo('admin_forum')) {
        $admin_areas['members']['areas']['membergroups']['subsections']['badges'] = [$txt['badges'], 'admin_forum'];
        $admin_areas['characters'] = ['title' => $txt['chars_menu_title'], 'permission' => ['admin_forum'], 'areas' => ['templates' => ['label' => $txt['char_templates'], 'function' => 'CharacterTemplates', 'icon' => 'quick_edit_button', 'permission' => ['admin_forum'], 'subsections' => []], 'sheets' => ['label' => $txt['char_sheet_admin'], 'function' => 'CharacterSheets', 'icon' => 'package_ops', 'permission' => ['admin_forum'], 'subsections' => []]]];
    }
}
开发者ID:Arantor,项目名称:smf-characters,代码行数:8,代码来源:Admin-Chars.php

示例10: bans_menu_button

function bans_menu_button(&$buttons)
{
    global $boardurl, $txt, $context;
    bans_loadLanguage();
    $context['sub_template'] = 'ban_script';
    $context['current_action'] = 'bans';
    $buttons['bans'] = array('title' => $txt['bans'], 'show' => allowedTo('admin_forum'), 'href' => $boardurl . '/ban_script.php', 'active_button' => true, 'sub_buttons' => array());
}
开发者ID:ahrasis,项目名称:tools,代码行数:8,代码来源:ban_script.php

示例11: Arcade_menu_buttons

function Arcade_menu_buttons(&$menu_buttons)
{
    global $context, $modSettings, $scripturl, $txt;
    if (!$context['allow_admin']) {
        $context['allow_admin'] = allowedTo('arcade_admin');
    }
    $context['allow_arcade'] = allowedTo('arcade_view') && !empty($modSettings['arcadeEnabled']);
    arcade_array_insert($menu_buttons, 'search', array('arcade' => array('title' => $txt['arcade'], 'href' => $scripturl . '?action=arcade', 'show' => $context['allow_arcade'], 'active_button' => false, 'sub_buttons' => array())));
}
开发者ID:nikop,项目名称:SMF-Arcade,代码行数:9,代码来源:ArcadeHooks.php

示例12: PrintTopic

function PrintTopic()
{
    global $topic, $txt, $scripturl, $context, $user_info;
    global $board_info, $smcFunc, $modSettings;
    // Redirect to the boardindex if no valid topic id is provided.
    if (empty($topic)) {
        redirectexit();
    }
    // Whatever happens don't index this.
    $context['robot_no_index'] = true;
    // Get the topic starter information.
    $request = $smcFunc['db_query']('', '
		SELECT m.poster_time, IFNULL(mem.real_name, m.poster_name) AS poster_name
		FROM {db_prefix}messages AS m
			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
		WHERE m.id_topic = {int:current_topic}
		ORDER BY m.id_msg
		LIMIT 1', array('current_topic' => $topic));
    // Redirect to the boardindex if no valid topic id is provided.
    if ($smcFunc['db_num_rows']($request) == 0) {
        redirectexit();
    }
    $row = $smcFunc['db_fetch_assoc']($request);
    $smcFunc['db_free_result']($request);
    // Lets "output" all that info.
    loadTemplate('Printpage');
    $context['template_layers'] = array('print');
    $context['board_name'] = $board_info['name'];
    $context['category_name'] = $board_info['cat']['name'];
    $context['poster_name'] = $row['poster_name'];
    $context['post_time'] = timeformat($row['poster_time'], false);
    $context['parent_boards'] = array();
    foreach ($board_info['parent_boards'] as $parent) {
        $context['parent_boards'][] = $parent['name'];
    }
    // Split the topics up so we can print them.
    $request = $smcFunc['db_query']('', '
		SELECT subject, poster_time, body, IFNULL(mem.real_name, poster_name) AS poster_name
		FROM {db_prefix}messages AS m
			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
		WHERE m.id_topic = {int:current_topic}' . ($modSettings['postmod_active'] && !allowedTo('approve_posts') ? '
			AND (m.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR m.id_member = {int:current_member}') . ')' : '') . '
		ORDER BY m.id_msg', array('current_topic' => $topic, 'is_approved' => 1, 'current_member' => $user_info['id']));
    $context['posts'] = array();
    while ($row = $smcFunc['db_fetch_assoc']($request)) {
        // Censor the subject and message.
        censorText($row['subject']);
        censorText($row['body']);
        $context['posts'][] = array('subject' => $row['subject'], 'member' => $row['poster_name'], 'time' => timeformat($row['poster_time'], false), 'timestamp' => forum_time(true, $row['poster_time']), 'body' => parse_bbc($row['body'], 'print'));
        if (!isset($context['topic_subject'])) {
            $context['topic_subject'] = $row['subject'];
        }
    }
    $smcFunc['db_free_result']($request);
    // Set a canonical URL for this page.
    $context['canonical_url'] = $scripturl . '?topic=' . $topic . '.0';
}
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:57,代码来源:Printpage.php

示例13: shd_stats_hdadmininfo

function shd_stats_hdadmininfo(&$subactions)
{
    global $context, $modSettings, $txt;
    if (!allowedTo('admin_forum') || empty($modSettings['shdp_enable_stats'])) {
        return;
    }
    $subactions['stats'] = array('function' => 'shd_stats_source', 'icon' => '../reports.png', 'title' => $txt['shdp_stats']);
    $context[$context['admin_menu_name']]['tab_data']['tabs']['stats'] = $subactions['stats'];
}
开发者ID:jdarwood007,项目名称:SimpleDesk,代码行数:9,代码来源:SDPluginStats.php

示例14: shd_profile_areas

/**
 *	Sets up the profile menu additions.
 *
 *	@param array $profile_areas Current profile_areas.
 *
 *	@since 2.0
*/
function shd_profile_areas(&$profile_areas)
{
    global $sourcedir, $modSettings, $context, $txt;
    static $called = false;
    if ($called) {
        return;
    }
    if (empty($called)) {
        $called = true;
    }
    // SimpleDesk sections. Added here after the initial cleaning is done, so that we can do our own permission checks without arguing with SMF's system (so much)
    if (empty($modSettings['helpdesk_active'])) {
        return;
    }
    shd_load_language('sd_language/SimpleDeskProfile');
    // Put it here so we can reuse it for the left menu a bit
    $context['helpdesk_menu'] = array('title' => $txt['shd_profile_area'], 'areas' => array('hd_profile' => array('label' => $txt['shd_profile_main'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => shd_allowed_to('shd_view_profile_any') || $context['user']['is_owner'] && shd_allowed_to('shd_view_profile_own'), 'permission' => array('own' => array('is_not_guest'), 'any' => array('is_not_guest'))), 'hd_prefs' => array('label' => $txt['shd_profile_preferences'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => shd_allowed_to('shd_view_preferences_any') || $context['user']['is_owner'] && shd_allowed_to('shd_view_preferences_own'), 'permission' => array('own' => array('shd_view_preferences_own'), 'any' => array('shd_view_preferences_any'))), 'hd_showtickets' => array('label' => $txt['shd_profile_show_tickets'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => $context['user']['is_owner'] && shd_allowed_to('shd_view_ticket_own') || shd_allowed_to('shd_view_ticket_any'), 'permission' => array('own' => array('shd_view_ticket_own'), 'any' => array('shd_view_ticket_any'))), 'hd_permissions' => array('label' => $txt['shd_profile_permissions'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => shd_allowed_to('admin_helpdesk'), 'permission' => array('own' => array('admin_helpdesk'), 'any' => array('admin_helpdesk'))), 'hd_actionlog' => array('label' => $txt['shd_profile_actionlog'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => empty($modSettings['shd_disable_action_log']) && (shd_allowed_to('shd_view_profile_log_any') || $context['user']['is_owner'] && shd_allowed_to('shd_view_profile_log_own')), 'permission' => array('own' => array('shd_view_profile_log_own'), 'any' => array('shd_view_profile_log_any')))));
    // Kill the existing profile menu but save it in a temporary place first.
    $old_profile_areas = $profile_areas;
    $profile_areas = array();
    // Now, where we add this depends very much on what mode we're in. In HD only mode, we want our menu first before anything else.
    if (!empty($modSettings['shd_helpdesk_only'])) {
        require_once $sourcedir . '/Profile-Modify.php';
        // Move some stuff around.
        $context['helpdesk_menu']['areas']['permissions'] = array('label' => $txt['shd_show_forum_permissions'], 'file' => 'Profile-View.php', 'function' => 'showPermissions', 'enabled' => allowedTo('manage_permissions'));
        $context['helpdesk_menu']['areas']['tracking'] = array('label' => $txt['trackUser'], 'file' => 'Profile-View.php', 'function' => 'tracking', 'subsections' => array('activity' => array($txt['trackActivity'], 'moderate_forum'), 'ip' => array($txt['trackIP'], 'moderate_forum'), 'edits' => array($txt['trackEdits'], 'moderate_forum')), 'enabled' => allowedTo('moderate_forum'));
        $profile_areas['helpdesk'] = $context['helpdesk_menu'];
        $profile_areas += $old_profile_areas;
        unset($profile_areas['info']['areas']['permissions'], $profile_areas['info']['areas']['tracking']);
        $remove = array('info' => array('summary', 'statistics', 'showposts', 'viewwarning'), 'edit_profile' => array('forumprofile', 'ignoreboards', 'lists', 'notification'), 'profile_action' => array('issuewarning'));
        if (!empty($modSettings['shd_disable_pm'])) {
            $remove['profile_action'][] = 'sendpm';
            $remove['edit_profile'][] = 'pmprefs';
        }
        foreach ($remove as $area => $items) {
            foreach ($items as $item) {
                if (!empty($profile_areas[$area]['areas'][$item])) {
                    $profile_areas[$area]['areas'][$item]['enabled'] = false;
                }
            }
        }
        $profile_areas['edit_profile']['areas']['theme']['file'] = 'sd_source/SimpleDesk-Profile.php';
        $profile_areas['edit_profile']['areas']['theme']['function'] = 'shd_profile_theme_wrapper';
    } else {
        foreach ($old_profile_areas as $area => $details) {
            if ($area == 'edit_profile') {
                $profile_areas['helpdesk'] = $context['helpdesk_menu'];
            }
            $profile_areas[$area] = $details;
        }
    }
    // Now engage any hooks.
    call_integration_hook('shd_hook_profilemenu', array(&$profile_areas));
}
开发者ID:wintstar,项目名称:Testing,代码行数:61,代码来源:Subs-SimpleDeskProfile.php

示例15: Twittera

function Twittera()
{
    global $txt, $sourcedir, $context;
    require_once $sourcedir . '/ManageServer.php';
    loadTemplate('TwitterAdmin');
    allowedTo('admin_forum');
    $context['page_title'] = $txt['twittmaina'];
    $context[$context['admin_menu_name']]['tab_data']['title'] = $txt['twittmaina'];
    $context[$context['admin_menu_name']]['tab_data']['description'] = $txt['twittmaina'];
    $subActions = array('twitter' => 'twitadmin', 'twittlog' => 'twitlogs', 'boards' => 'twit_tweet', 'about' => 'twit_about');
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'twitter';
    $subActions[$_REQUEST['sa']]();
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:13,代码来源:TwitterAdmin.php


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