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


PHP createMenu函数代码示例

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


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

示例1: invite

function invite()
{
    global $context, $scripturl, $txt, $sourcedir, $user_info, $modSettings;
    if ($user_info['is_guest']) {
        redirectexit();
    }
    // Let's set up the template and language.
    require_once $sourcedir . '/ManageServer.php';
    require_once $sourcedir . '/Subs-Menu.php';
    loadLanguage('Admin');
    loadLanguage('Modifications');
    loadLanguage('ManageSettings');
    loadTemplate('Invite');
    // Invite areas.
    $areas = array('manage' => 'ManageInviteKeys', 'generate' => 'GenerateInviteKey', 'email' => 'EmailKey');
    // Default the area to the manage keys page.
    $_REQUEST['area'] = isset($_REQUEST['area']) && isset($areas[$_REQUEST['area']]) ? $_REQUEST['area'] : 'manage';
    // Declare the page title, duh =P
    $context['page_title'] = $txt['invite_system'];
    $invite_areas = array('manage' => array('title' => $txt['invite_manage'], 'areas' => array('manage' => array('label' => $txt['invite_manage'], 'file' => 'Invite.php', 'function' => 'ManageInviteKeys'))), 'generate' => array('title' => $txt['invite_generate'], 'areas' => array('generate' => array('label' => $txt['invite_generate'], 'file' => 'Invite.php', 'function' => 'GenerateInviteKey'))));
    if ($modSettings['invite_email'] || allowedTo('admin_forum')) {
        $invite_areas['email'] = array('title' => $txt['invite_email_send'], 'areas' => array('email' => array('label' => $txt['invite_email_member'], 'file' => 'Invite.php', 'function' => 'EmailKey')));
    }
    $menuOptions = array('disable_url_session_check' => true, 'current_area' => $_REQUEST['area']);
    createMenu($invite_areas, $menuOptions);
    // And finally, the Link Tree.
    $context['linktree'][] = array('url' => $scripturl . '?action=invite;area=' . $_REQUEST['area'], 'name' => $txt['invite_' . $_REQUEST['area']]);
    // Call the right function for this area.
    $areas[$_REQUEST['area']]();
}
开发者ID:Kheros,项目名称:MMOver,代码行数:30,代码来源:Invite.php

示例2: ModerationMain

function ModerationMain($dont_call = false)
{
    global $txt, $context, $scripturl, $sc, $modSettings, $user_info, $settings, $sourcedir, $options, $smcFunc;
    // Don't run this twice... and don't conflict with the admin bar.
    if (isset($context['admin_area'])) {
        return;
    }
    //Standard Member Color Link Varibale
    if (empty($context['MemberColor_ID_MEMBER'])) {
        $context['MemberColor_ID_MEMBER'] = array();
    }
    // Everyone using this area must be allowed here!
    if ($user_info['mod_cache']['gq'] == '0=1' && $user_info['mod_cache']['bq'] == '0=1' && !allowedTo('manage_membergroups')) {
        isAllowedTo('access_mod_center');
    }
    // We're gonna want a menu of some kind.
    require_once $sourcedir . '/Subs-Menu.php';
    // Load the language, and the template.
    loadLanguage('ModerationCenter');
    loadTemplate(false, 'admin');
    $context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
    $context['robot_no_index'] = true;
    // Can they approve any posts?
    if ($modSettings['postmod_active']) {
        $approve_boards = boardsAllowedTo('approve_posts');
    }
    // This is the menu structure - refer to Subs-Menu.php for the details.
    $moderation_areas = array('main' => array('title' => $txt['mc_main'], 'areas' => array('index' => array('label' => $txt['moderation_center'], 'function' => 'ModerationHome'), 'modlog' => array('enabled' => !empty($modSettings['modlog_enabled']), 'label' => $txt['modlog_view'], 'file' => 'Modlog.php', 'function' => 'ViewModlog'), 'notice' => array('file' => 'ModerationCenter.php', 'function' => 'ShowNotice', 'select' => 'index'), 'warnings' => array('label' => $txt['mc_warnings'], 'enabled' => in_array('w', $context['admin_features']) && $modSettings['warning_settings'][0] == 1, 'function' => 'ViewWarnings', 'subsections' => array('log' => array($txt['mc_warning_log']), 'templates' => array($txt['mc_warning_templates'], 'issue_warning'))), 'userwatch' => array('label' => $txt['mc_watched_users_title'], 'function' => 'ViewWatchedUsers', 'subsections' => array('member' => array($txt['mc_watched_users_member']), 'post' => array($txt['mc_watched_users_post']))))), 'posts' => array('title' => $txt['mc_posts'], 'enabled' => $user_info['mod_cache']['bq'] != '0=1' || !empty($approve_boards), 'areas' => array('postmod' => array('label' => $txt['mc_unapproved_posts'], 'enabled' => $modSettings['postmod_active'], 'file' => 'PostModeration.php', 'function' => 'PostModerationMain', 'custom_url' => $scripturl . '?action=moderate;area=postmod;sa=posts', 'subsections' => array('posts' => array($txt['mc_unapproved_replies']), 'topics' => array($txt['mc_unapproved_topics']))), 'attachmod' => array('label' => $txt['mc_unapproved_attachments'], 'enabled' => $modSettings['postmod_active'], 'file' => 'PostModeration.php', 'function' => 'PostModerationMain', 'custom_url' => $scripturl . '?action=moderate;area=attachmod;sa=attachments'), 'reports' => array('label' => $txt['mc_reported_posts'], 'enabled' => $user_info['mod_cache']['bq'] != '0=1', 'file' => 'ModerationCenter.php', 'function' => 'ReportedPosts', 'subsections' => array('open' => array($txt['mc_reportedp_active']), 'closed' => array($txt['mc_reportedp_closed']))))), 'groups' => array('title' => $txt['mc_groups'], 'enabled' => $user_info['mod_cache']['gq'] != '0=1' || allowedTo('manage_membergroups'), 'areas' => array('groups' => array('label' => $txt['mc_group_requests'], 'file' => 'Groups.php', 'function' => 'Groups', 'custom_url' => $scripturl . '?action=moderate;area=groups;sa=requests'), 'viewgroups' => array('label' => $txt['mc_view_groups'], 'file' => 'Groups.php', 'function' => 'Groups'))), 'prefs' => array('title' => $txt['mc_prefs'], 'areas' => array('settings' => array('label' => $txt['mc_settings'], 'function' => 'ModerationSettings'))));
    // I don't know where we're going - I don't know where we've been...
    $menuOptions = array('action' => 'moderate');
    $mod_include_data = createMenu($moderation_areas, $menuOptions);
    unset($moderation_areas);
    // We got something - didn't we? DIDN'T WE!
    if ($mod_include_data == false) {
        fatal_lang_error('no_access', false);
    }
    // Retain the ID information in case required by a subaction.
    $context['moderation_menu_id'] = $context['max_menu_id'];
    $context['moderation_menu_name'] = 'menu_data_' . $context['moderation_menu_id'];
    // What a pleasant shortcut - even tho we're not *really* on the admin screen who cares...
    $context['admin_area'] = $mod_include_data['current_area'];
    // Build the link tree.
    $context['linktree'][] = array('url' => $scripturl . '?action=moderate', 'name' => $txt['moderation_center']);
    if (isset($mod_include_data['current_area']) && $mod_include_data['current_area'] != 'index') {
        $context['linktree'][] = array('url' => $scripturl . '?action=moderate;area=' . $mod_include_data['current_area'], 'name' => $mod_include_data['label']);
    }
    if (!empty($mod_include_data['current_subsection']) && $mod_include_data['subsections'][$mod_include_data['current_subsection']][0] != $mod_include_data['label']) {
        $context['linktree'][] = array('url' => $scripturl . '?action=moderate;area=' . $mod_include_data['current_area'] . ';sa=' . $mod_include_data['current_subsection'], 'name' => $mod_include_data['subsections'][$mod_include_data['current_subsection']][0]);
    }
    // Now - finally - the bit before the encore - the main performance of course!
    if (!$dont_call) {
        if (isset($mod_include_data['file'])) {
            require_once $sourcedir . '/' . $mod_include_data['file'];
        }
        $mod_include_data['function']();
    }
}
开发者ID:Kheros,项目名称:MMOver,代码行数:57,代码来源:ModerationCenter.php

示例3: prepareModcenter

 /**
  * Prepare menu, make checks, load files, and create moderation menu.
  * This can be called from the class, or from outside, to
  * set up moderation menu.
  */
 public function prepareModcenter()
 {
     global $txt, $context, $scripturl, $modSettings, $user_info, $options;
     // Don't run this twice... and don't conflict with the admin bar.
     if (isset($context['admin_area'])) {
         return;
     }
     $context['can_moderate_boards'] = $user_info['mod_cache']['bq'] != '0=1';
     $context['can_moderate_groups'] = $user_info['mod_cache']['gq'] != '0=1';
     $context['can_moderate_approvals'] = $modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']);
     // Everyone using this area must be allowed here!
     if (!$context['can_moderate_boards'] && !$context['can_moderate_groups'] && !$context['can_moderate_approvals']) {
         isAllowedTo('access_mod_center');
     }
     // We're gonna want a menu of some kind.
     require_once SUBSDIR . '/Menu.subs.php';
     // Load the language, and the template.
     loadLanguage('ModerationCenter');
     loadTemplate(false, 'admin');
     $context['admin_preferences'] = !empty($options['admin_preferences']) ? unserialize($options['admin_preferences']) : array();
     $context['robot_no_index'] = true;
     // Moderation counts for things that this moderator can take care of
     require_once SUBSDIR . '/Moderation.subs.php';
     $mod_counts = loadModeratorMenuCounts();
     // This is the menu structure - refer to subs/Menu.subs.php for the details.
     $moderation_areas = array('main' => array('title' => $txt['mc_main'], 'areas' => array('index' => array('label' => $txt['moderation_center'], 'controller' => 'ModerationCenter_Controller', 'function' => 'action_moderationHome', 'icon' => 'transparent.png', 'class' => 'admin_img_home'), 'settings' => array('label' => $txt['mc_settings'], 'controller' => 'ModerationCenter_Controller', 'function' => 'action_moderationSettings', 'icon' => 'transparent.png', 'class' => 'admin_img_features'), 'modlogoff' => array('label' => $txt['mc_logoff'], 'controller' => 'ModerationCenter_Controller', 'function' => 'action_modEndSession', 'enabled' => empty($modSettings['securityDisable_moderate']), 'icon' => 'transparent.png', 'class' => 'admin_img_exit'), 'notice' => array('controller' => 'ModerationCenter_Controller', 'function' => 'action_showNotice', 'select' => 'index', 'icon' => 'transparent.png', 'class' => 'admin_img_news'))), 'logs' => array('title' => $txt['mc_logs'], 'areas' => array('modlog' => array('label' => $txt['modlog_view'], 'enabled' => !empty($modSettings['modlog_enabled']) && $context['can_moderate_boards'], 'file' => 'Modlog.controller.php', 'dir' => ADMINDIR, 'controller' => 'Modlog_Controller', 'function' => 'action_log', 'icon' => 'transparent.png', 'class' => 'admin_img_logs'), 'warnings' => array('label' => $txt['mc_warnings'], 'enabled' => in_array('w', $context['admin_features']) && !empty($modSettings['warning_enable']) && $context['can_moderate_boards'], 'controller' => 'ModerationCenter_Controller', 'function' => 'action_viewWarnings', 'icon' => 'transparent.png', 'class' => 'admin_img_reports', 'subsections' => array('log' => array($txt['mc_warning_log']), 'templates' => array($txt['mc_warning_templates'], 'issue_warning'))))), 'posts' => array('title' => $txt['mc_posts'] . (!empty($mod_counts['pt_total']) ? ' [' . $mod_counts['pt_total'] . ']' : ''), 'enabled' => $context['can_moderate_boards'] || $context['can_moderate_approvals'], 'areas' => array('postmod' => array('label' => $txt['mc_unapproved_posts'] . (!empty($mod_counts['postmod']) ? ' [' . $mod_counts['postmod'] . ']' : ''), 'enabled' => $context['can_moderate_approvals'], 'file' => 'PostModeration.controller.php', 'controller' => 'PostModeration_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_posts', 'custom_url' => $scripturl . '?action=moderate;area=postmod', 'subsections' => array('posts' => array($txt['mc_unapproved_replies']), 'topics' => array($txt['mc_unapproved_topics']))), 'emailmod' => array('label' => $txt['mc_emailerror'] . (!empty($mod_counts['emailmod']) ? ' [' . $mod_counts['emailmod'] . ']' : ''), 'enabled' => !empty($modSettings['maillist_enabled']) && allowedTo('approve_emails'), 'file' => 'ManageMaillist.controller.php', 'dir' => ADMINDIR, 'function' => 'UnapprovedEmails', 'icon' => 'transparent.png', 'class' => 'admin_img_mail', 'custom_url' => $scripturl . '?action=admin;area=maillist;sa=emaillist'), 'attachmod' => array('label' => $txt['mc_unapproved_attachments'] . (!empty($mod_counts['attachments']) ? ' [' . $mod_counts['attachments'] . ']' : ''), 'enabled' => $context['can_moderate_approvals'], 'file' => 'PostModeration.controller.php', 'controller' => 'PostModeration_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_attachment', 'custom_url' => $scripturl . '?action=moderate;area=attachmod;sa=attachments'), 'reports' => array('label' => $txt['mc_reported_posts'] . (!empty($mod_counts['reports']) ? ' [' . $mod_counts['reports'] . ']' : ''), 'enabled' => $context['can_moderate_boards'], 'controller' => 'ModerationCenter_Controller', 'function' => 'action_reportedPosts', 'icon' => 'transparent.png', 'class' => 'admin_img_reports', 'subsections' => array('open' => array($txt['mc_reportedp_active'] . (!empty($mod_counts['reports']) ? ' [' . $mod_counts['reports'] . ']' : '')), 'closed' => array($txt['mc_reportedp_closed']))))), 'groups' => array('title' => $txt['mc_groups'] . (!empty($mod_counts['mg_total']) ? ' [' . $mod_counts['mg_total'] . ']' : ''), 'enabled' => $context['can_moderate_groups'], 'areas' => array('userwatch' => array('label' => $txt['mc_watched_users_title'], 'enabled' => in_array('w', $context['admin_features']) && !empty($modSettings['warning_enable']) && $context['can_moderate_boards'], 'controller' => 'ModerationCenter_Controller', 'function' => 'action_viewWatchedUsers', 'icon' => 'transparent.png', 'class' => 'admin_img_permissions', 'subsections' => array('member' => array($txt['mc_watched_users_member']), 'post' => array($txt['mc_watched_users_post']))), 'groups' => array('label' => $txt['mc_group_requests'] . (!empty($mod_counts['groupreq']) ? ' [' . $mod_counts['groupreq'] . ']' : ''), 'file' => 'Groups.controller.php', 'controller' => 'Groups_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_regcenter', 'custom_url' => $scripturl . '?action=moderate;area=groups;sa=requests'), 'members' => array('enabled' => allowedTo('moderate_forum'), 'label' => $txt['mc_member_requests'] . (!empty($mod_counts['memberreq']) ? ' [' . $mod_counts['memberreq'] . ']' : ''), 'file' => 'ManageMembers.controller.php', 'controller' => 'ManageMembers_Controller', 'function' => 'action_approve', 'icon' => 'transparent.png', 'class' => 'admin_img_members', 'custom_url' => $scripturl . '?action=admin;area=viewmembers;sa=browse;type=approve'), 'viewgroups' => array('label' => $txt['mc_view_groups'], 'file' => 'Groups.controller.php', 'controller' => 'Groups_Controller', 'function' => 'action_index', 'icon' => 'transparent.png', 'class' => 'admin_img_membergroups'))));
     // Make sure the administrator has a valid session...
     validateSession('moderate');
     // I don't know where we're going - I don't know where we've been...
     $menuOptions = array('action' => 'moderate', 'hook' => 'moderation', 'disable_url_session_check' => true, 'default_include_dir' => CONTROLLERDIR);
     $mod_include_data = createMenu($moderation_areas, $menuOptions);
     unset($moderation_areas);
     // We got something - didn't we? DIDN'T WE!
     if ($mod_include_data == false) {
         fatal_lang_error('no_access', false);
     }
     // Retain the ID information in case required by a subaction.
     $context['moderation_menu_id'] = $context['max_menu_id'];
     $context['moderation_menu_name'] = 'menu_data_' . $context['moderation_menu_id'];
     $context[$context['moderation_menu_name']]['tab_data'] = array('title' => $txt['moderation_center'], 'help' => '', 'description' => sprintf($txt['mc_description'], $context['user']['name'], $scripturl . '?action=moderate;area=settings'));
     // What a pleasant shortcut - even tho we're not *really* on the admin screen who cares...
     $context['admin_area'] = $mod_include_data['current_area'];
     // Build the link tree.
     $context['linktree'][] = array('url' => $scripturl . '?action=moderate', 'name' => $txt['moderation_center']);
     if (isset($mod_include_data['current_area']) && $mod_include_data['current_area'] != 'index') {
         $context['linktree'][] = array('url' => $scripturl . '?action=moderate;area=' . $mod_include_data['current_area'], 'name' => $mod_include_data['label']);
     }
     if (!empty($mod_include_data['current_subsection']) && $mod_include_data['subsections'][$mod_include_data['current_subsection']][0] != $mod_include_data['label']) {
         $context['linktree'][] = array('url' => $scripturl . '?action=moderate;area=' . $mod_include_data['current_area'] . ';sa=' . $mod_include_data['current_subsection'], 'name' => $mod_include_data['subsections'][$mod_include_data['current_subsection']][0]);
     }
     // Finally, store this, so that if we're called from the class, it can use it.
     $this->_mod_include_data = $mod_include_data;
 }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:58,代码来源:ModerationCenter.controller.php

示例4: createMenu

 function createMenu($dir)
 {
     if (is_dir($dir)) {
         echo "<li><a class='load-dir' data-file='{$dir}' href='#'>" . basename($dir) . "</a><ul>";
         foreach (glob("{$dir}/*") as $path) {
             createMenu($path);
         }
         echo "</ul></li>";
     } else {
         $extension = pathinfo($dir);
         $extension = $extension['extension'];
         echo "<li><a class='load-file' data-file='{$dir}' href='{$dir}' >" . basename($dir, "." . $extension) . "</a></li>";
     }
 }
开发者ID:Radicis,项目名称:helpdesk,代码行数:14,代码来源:CreateMenu_helper.php

示例5: ShowHelp

function ShowHelp()
{
    global $settings, $user_info, $language, $context, $txt, $sourcedir, $options, $scripturl;
    loadTemplate('Help');
    loadLanguage('Manual');
    $manual_areas = array('getting_started' => array('title' => $txt['manual_category_getting_started'], 'description' => '', 'areas' => array('introduction' => array('label' => $txt['manual_section_intro'], 'template' => 'manual_intro'), 'main_menu' => array('label' => $txt['manual_section_main_menu'], 'template' => 'manual_main_menu'), 'board_index' => array('label' => $txt['manual_section_board_index'], 'template' => 'manual_board_index'), 'message_view' => array('label' => $txt['manual_section_message_view'], 'template' => 'manual_message_view'), 'topic_view' => array('label' => $txt['manual_section_topic_view'], 'template' => 'manual_topic_view'))), 'registering' => array('title' => $txt['manual_category_registering'], 'description' => '', 'areas' => array('when_how' => array('label' => $txt['manual_section_when_how_register'], 'template' => 'manual_when_how_register'), 'registration_screen' => array('label' => $txt['manual_section_registration_screen'], 'template' => 'manual_registration_screen'), 'activating_account' => array('label' => $txt['manual_section_activating_account'], 'template' => 'manual_activating_account'), 'logging_in' => array('label' => $txt['manual_section_logging_in_out'], 'template' => 'manual_logging_in_out'), 'password_reminders' => array('label' => $txt['manual_section_password_reminders'], 'template' => 'manual_password_reminders'))), 'profile_features' => array('title' => $txt['manual_category_profile_features'], 'description' => '', 'areas' => array('profile_info' => array('label' => $txt['manual_section_profile_info'], 'template' => 'manual_profile_info_summary', 'description' => $txt['manual_entry_profile_info_desc'], 'subsections' => array('summary' => array($txt['manual_entry_profile_info_summary'], 'template' => 'manual_profile_info_summary'), 'posts' => array($txt['manual_entry_profile_info_posts'], 'template' => 'manual_profile_info_posts'), 'stats' => array($txt['manual_entry_profile_info_stats'], 'template' => 'manual_profile_info_stats'))), 'modify_profile' => array('label' => $txt['manual_section_modify_profile'], 'template' => 'manual_modify_profile_settings', 'description' => $txt['manual_entry_modify_profile_desc'], 'subsections' => array('settings' => array($txt['manual_entry_modify_profile_settings'], 'template' => 'manual_modify_profile_settings'), 'forum' => array($txt['manual_entry_modify_profile_forum'], 'template' => 'manual_modify_profile_forum'), 'look' => array($txt['manual_entry_modify_profile_look'], 'template' => 'manual_modify_profile_look'), 'auth' => array($txt['manual_entry_modify_profile_auth'], 'template' => 'manual_modify_profile_auth'), 'notify' => array($txt['manual_entry_modify_profile_notify'], 'template' => 'manual_modify_profile_notify'), 'pm' => array($txt['manual_entry_modify_profile_pm'], 'template' => 'manual_modify_profile_pm'), 'buddies' => array($txt['manual_entry_modify_profile_buddies'], 'template' => 'manual_modify_profile_buddies'), 'groups' => array($txt['manual_entry_modify_profile_groups'], 'template' => 'manual_modify_profile_groups'))), 'actions' => array('label' => $txt['manual_section_profile_actions'], 'template' => 'manual_profile_actions_subscriptions', 'description' => $txt['manual_entry_modify_profile_desc'], 'subsections' => array('subscriptions' => array($txt['manual_entry_profile_actions_subscriptions'], 'template' => 'manual_profile_actions_subscriptions'), 'delete' => array($txt['manual_entry_profile_actions_delete'], 'template' => 'manual_profile_actions_delete'))))), 'posting_basics' => array('title' => $txt['manual_category_posting_basics'], 'description' => '', 'areas' => array('posting_topics' => array('label' => $txt['manual_section_posting_topics'], 'template' => 'manual_posting_topics'), 'smileys' => array('label' => $txt['manual_section_smileys'], 'template' => 'manual_smileys'), 'bbcode' => array('label' => $txt['manual_section_bbcode'], 'template' => 'manual_bbcode'))), 'personal_messages' => array('title' => $txt['manual_category_personal_messages'], 'description' => '', 'areas' => array('messages' => array('label' => $txt['manual_section_pm_messages'], 'template' => 'manual_pm_messages'))), 'forum_tools' => array('title' => $txt['manual_category_forum_tools'], 'description' => '', 'areas' => array('searching' => array('label' => $txt['manual_section_searching'], 'template' => 'manual_searching'))));
    // Set a few options for the menu.
    $menu_options = array('disable_url_session_check' => true);
    require_once $sourcedir . '/Subs-Menu.php';
    $manual_area_data = createMenu($manual_areas, $menu_options);
    unset($manual_areas);
    // Make a note of the Unique ID for this menu.
    $context['manual_menu_id'] = $context['max_menu_id'];
    $context['manual_menu_name'] = 'menu_data_' . $context['manual_menu_id'];
    // Get the selected item.
    $context['manual_area_data'] = $manual_area_data;
    $context['menu_item_selected'] = $manual_area_data['current_area'];
    // Set a title and description for the tab strip if subsections are present.
    if (isset($context['manual_area_data']['subsections'])) {
        $context[$context['manual_menu_name']]['tab_data'] = array('title' => $manual_area_data['label'], 'description' => isset($manual_area_data['description']) ? $manual_area_data['description'] : '');
    }
    // Bring it on!
    $context['sub_template'] = isset($manual_area_data['current_subsection'], $manual_area_data['subsections'][$manual_area_data['current_subsection']]['template']) ? $manual_area_data['subsections'][$manual_area_data['current_subsection']]['template'] : $manual_area_data['template'];
    $context['page_title'] = $manual_area_data['label'] . ' - ' . $txt['manual_smf_user_help'];
    // Build the link tree.
    $context['linktree'][] = array('url' => $scripturl . '?action=help', 'name' => $txt['help']);
    if (isset($manual_area_data['current_area']) && $manual_area_data['current_area'] != 'index') {
        $context['linktree'][] = array('url' => $scripturl . '?action=admin;area=' . $manual_area_data['current_area'], 'name' => $manual_area_data['label']);
    }
    if (!empty($manual_area_data['current_subsection']) && $manual_area_data['subsections'][$manual_area_data['current_subsection']][0] != $manual_area_data['label']) {
        $context['linktree'][] = array('url' => $scripturl . '?action=admin;area=' . $manual_area_data['current_area'] . ';sa=' . $manual_area_data['current_subsection'], 'name' => $manual_area_data['subsections'][$manual_area_data['current_subsection']][0]);
    }
    // We actually need a special style sheet for help ;)
    $context['template_layers'][] = 'manual';
    // The smiley info page needs some cheesy information.
    if ($manual_area_data['current_area'] == 'smileys') {
        ShowSmileyHelp();
    }
}
开发者ID:Kheros,项目名称:MMOver,代码行数:39,代码来源:Help.php

示例6: createQuestion

function createQuestion($atom)
{
    // choose a random key from the atom array
    $question = array_rand($atom);
    ?>
	<fieldset>
	<legend>Your challenge</legend>
		<form method="get">
			<h3>What is the symbol for <?php 
    echo $atom[$question];
    ?>
?</h3>
			<input type="hidden" name="question" value="<?php 
    echo $question;
    ?>
"/>
			<?php 
    createMenu($atom, "answer");
    ?>
			<input class="right" name="go" type="submit" value="I got this!"/>
		</form>
	</fieldset>
<?php 
}
开发者ID:lowriek,项目名称:CSCI1154_Examples,代码行数:24,代码来源:atomquiz.php

示例7: messageIndexBar

/**
 * A menu to easily access different areas of the PM section
 *
 * @param string $area
 */
function messageIndexBar($area)
{
    global $txt, $context, $scripturl, $modSettings, $user_info;
    require_once SUBSDIR . '/Menu.subs.php';
    $pm_areas = array('folders' => array('title' => $txt['pm_messages'], 'counter' => 'unread_messages', 'areas' => array('inbox' => array('label' => $txt['inbox'], 'custom_url' => $scripturl . '?action=pm', 'counter' => 'unread_messages'), 'send' => array('label' => $txt['new_message'], 'custom_url' => $scripturl . '?action=pm;sa=send', 'permission' => 'pm_send'), 'sent' => array('label' => $txt['sent_items'], 'custom_url' => $scripturl . '?action=pm;f=sent'), 'drafts' => array('label' => $txt['drafts_show'], 'custom_url' => $scripturl . '?action=pm;sa=showpmdrafts', 'permission' => 'pm_draft', 'enabled' => !empty($modSettings['drafts_enabled']) && !empty($modSettings['drafts_pm_enabled'])))), 'labels' => array('title' => $txt['pm_labels'], 'counter' => 'labels_unread_total', 'areas' => array()), 'actions' => array('title' => $txt['pm_actions'], 'areas' => array('search' => array('label' => $txt['pm_search_bar_title'], 'custom_url' => $scripturl . '?action=pm;sa=search'), 'prune' => array('label' => $txt['pm_prune'], 'custom_url' => $scripturl . '?action=pm;sa=prune'))), 'pref' => array('title' => $txt['pm_preferences'], 'areas' => array('manlabels' => array('label' => $txt['pm_manage_labels'], 'custom_url' => $scripturl . '?action=pm;sa=manlabels'), 'manrules' => array('label' => $txt['pm_manage_rules'], 'custom_url' => $scripturl . '?action=pm;sa=manrules'), 'settings' => array('label' => $txt['pm_settings'], 'custom_url' => $scripturl . '?action=pm;sa=settings'))));
    // Handle labels.
    $label_counters = array('unread_messages' => $context['labels'][-1]['unread_messages']);
    if (empty($context['currently_using_labels'])) {
        unset($pm_areas['labels']);
    } else {
        // Note we send labels by id as it will have less problems in the querystring.
        $label_counters['labels_unread_total'] = 0;
        foreach ($context['labels'] as $label) {
            if ($label['id'] == -1) {
                continue;
            }
            // Count the amount of unread items in labels.
            $label_counters['labels_unread_total'] += $label['unread_messages'];
            // Add the label to the menu.
            $pm_areas['labels']['areas']['label' . $label['id']] = array('label' => $label['name'], 'custom_url' => $scripturl . '?action=pm;l=' . $label['id'], 'counter' => 'label' . $label['id'], 'messages' => $label['messages']);
            $label_counters['label' . $label['id']] = $label['unread_messages'];
        }
    }
    // Do we have a limit on the amount of messages we can keep?
    if (!empty($context['message_limit'])) {
        $bar = round($user_info['messages'] * 100 / $context['message_limit'], 1);
        $context['limit_bar'] = array('messages' => $user_info['messages'], 'allowed' => $context['message_limit'], 'percent' => $bar, 'bar' => $bar > 100 ? 100 : (int) $bar, 'text' => sprintf($txt['pm_currently_using'], $user_info['messages'], $bar));
    }
    // Set a few options for the menu.
    $menuOptions = array('current_area' => $area, 'hook' => 'pm', 'disable_url_session_check' => true, 'counters' => !empty($label_counters) ? $label_counters : 0, 'default_include_dir' => CONTROLLERDIR);
    // Actually create the menu!
    $pm_include_data = createMenu($pm_areas, $menuOptions);
    unset($pm_areas);
    // No menu means no access.
    if (!$pm_include_data && (!$user_info['is_guest'] || validateSession())) {
        fatal_lang_error('no_access', false);
    }
    // Make a note of the Unique ID for this menu.
    $context['pm_menu_id'] = $context['max_menu_id'];
    $context['pm_menu_name'] = 'menu_data_' . $context['pm_menu_id'];
    // Set the selected item.
    $context['menu_item_selected'] = $pm_include_data['current_area'];
    // Grab the file needed for this action
    if (isset($pm_include_data['file'])) {
        require_once $pm_include_data['file'];
    }
    // Set the template for this area and add the profile layer.
    if (!isset($_REQUEST['xml'])) {
        $template_layers = Template_Layers::getInstance();
        $template_layers->add('pm');
    }
}
开发者ID:KeiroD,项目名称:Elkarte,代码行数:57,代码来源:PersonalMessage.controller.php

示例8: createMenu

function createMenu($parent = 0, $level = 0)
{
    if ($level >= 3) {
        return false;
    }
    // toma el listado de páginas
    $pages = get_pages(array('parent' => $parent, 'sort_order' => 'ASC', 'sort_column' => 'menu_order'));
    $len = count($pages);
    if ($len > 0) {
        // dibuja la lista del menu
        ?>
		<ul class="<?php 
        echo 'level_' . $level;
        ?>
"><?php 
        $last_index = $len - 1;
        // indice del último elemento del nivel
        $active_id = get_the_ID();
        // id de la página activa
        $i = 0;
        // recorre la lista de páginas
        foreach ($pages as $page) {
            // tova las variables configurables de cáda págia
            $vars = get_post_custom($page->ID);
            // agrega las clases de estilo
            $clases = array();
            $clases[] = 'level_' . $level;
            $clases[] = $i == 0 ? 'first' : ($i == $last_index ? 'last' : 'middle');
            //$clases[]= ($i%2)==0? 'par': 'non';
            if ($active_id == $page->ID) {
                $clases[] = 'active';
            }
            if (isset($vars['link-class'])) {
                $clases[] = implode(' ', $vars['link-class']);
            }
            // dirección final
            $href = isset($vars['link-href']) ? current($vars['link-href']) : get_permalink($page->ID);
            $target = isset($vars['link-target']) ? current($vars['link-target']) : '_self';
            // dibuja la liga
            ?>
			<li class="<?php 
            echo implode(' ', $clases);
            ?>
">
				<a href="<?php 
            echo $href;
            ?>
" target="<?php 
            echo $target;
            ?>
"><span><?php 
            echo isset($vars['link-title']) ? $vars['link-title'][0] : $page->post_title;
            ?>
</span></a><?php 
            // dubuja los hijos
            createMenu($page->ID, $level + 1);
            ?>
			</li><?php 
            $i++;
            // incremente i, para llevar la relacion de primero y ultimo, par y non
        }
        // dibuja el fin del menu
        ?>
			<li class="clearboth"></li>
		</ul><?php 
    }
}
开发者ID:danisdead,项目名称:gastrointernacional,代码行数:67,代码来源:menu.php

示例9: createMenu

<aside class="sidebar col-sm-3" role="complementary">
    <ul id="folder-nav" class="nav sidebar ">
        <?php 
createMenu($dir);
?>
    </ul>
</aside>
<div class="col-md-8">
    <div id="fileTitle"></div>
    <div id="content">
    <h1>Lucid IT Solutions</h1>
    <h2>Knowledgebase</h2>
    <p>This template has a responsive menu toggling system. The menu will appear collapsed on smaller screens, and will appear non-collapsed on larger screens. When toggled using the button below, the menu will appear/disappear. On small screens, the page content will be pushed off canvas.</p>



开发者ID:Radicis,项目名称:helpdesk,代码行数:13,代码来源:home.php

示例10: createMenu

createMenu($fullcsv, $tempJSONMenuObject, $navAppend, $listPageObjectArray);
$tempFileForWrite = fopen(PROGRAM_INSTALL_PATH . MENU_AJAX_JSON_DIR_NAME . MENU_FILE_NAME_HONEYMOON, 'w') or die("can't open file");
$outputJSON = trimJSONMenuObject($json->encode($tempJSONMenuObject));
fwrite($tempFileForWrite, $outputJSON);
chmod(PROGRAM_INSTALL_PATH . MENU_AJAX_JSON_DIR_NAME . MENU_FILE_NAME_HONEYMOON, 0777);
if (!DEBUG_MODE && FTP_ENABLED) {
    ftp_to_deployment_site(PROGRAM_INSTALL_PATH . MENU_AJAX_JSON_DIR_NAME . MENU_FILE_NAME_HONEYMOON, REMOTE_INSTALL_FULL_PATH . MENU_AJAX_JSON_DIR_NAME);
}
if (isset($statusFile)) {
    fwrite($statusFile, "Finished " . MENU_FILE_NAME_HONEYMOON . "<br>");
}
//End honeymoon menu
//Start adults menu
$tempJSONMenuObject = new MenuJSONObject("Adults Only");
$navAppend = "a";
createMenu($fullcsv, $tempJSONMenuObject, $navAppend, $listPageObjectArray);
$tempFileForWrite = fopen(PROGRAM_INSTALL_PATH . MENU_AJAX_JSON_DIR_NAME . MENU_FILE_NAME_ADULTS, 'w') or die("can't open file");
$outputJSON = trimJSONMenuObject($json->encode($tempJSONMenuObject));
fwrite($tempFileForWrite, $outputJSON);
chmod(PROGRAM_INSTALL_PATH . MENU_AJAX_JSON_DIR_NAME . MENU_FILE_NAME_ADULTS, 0777);
if (!DEBUG_MODE && FTP_ENABLED) {
    ftp_to_deployment_site(PROGRAM_INSTALL_PATH . MENU_AJAX_JSON_DIR_NAME . MENU_FILE_NAME_ADULTS, REMOTE_INSTALL_FULL_PATH . MENU_AJAX_JSON_DIR_NAME);
}
if (isset($statusFile)) {
    fwrite($statusFile, "Finished " . MENU_FILE_NAME_ADULTS . "<br>");
}
//End adults menu
//echo $outputJSON;
if (isset($statusFile)) {
    fwrite($statusFile, "Finished generate-js-left-nav.php<br>");
}
开发者ID:tchalvak,项目名称:airl,代码行数:31,代码来源:generate-js-left-nav.php

示例11: ModifyProfile

function ModifyProfile($post_errors = array())
{
    global $txt, $scripturl, $user_info, $context, $sourcedir, $user_profile, $cur_profile;
    global $modSettings, $memberContext, $profile_vars, $smcFunc, $post_errors, $options, $user_settings;
    // Don't reload this as we may have processed error strings.
    if (empty($post_errors)) {
        loadLanguage('Profile');
    }
    loadTemplate('Profile');
    require_once $sourcedir . '/Subs-Menu.php';
    // Did we get the user by name...
    if (isset($_REQUEST['user'])) {
        $memberResult = loadMemberData($_REQUEST['user'], true, 'profile');
    } elseif (!empty($_REQUEST['u'])) {
        $memberResult = loadMemberData((int) $_REQUEST['u'], false, 'profile');
    } else {
        $memberResult = loadMemberData($user_info['id'], false, 'profile');
    }
    // Check if loadMemberData() has returned a valid result.
    if (!is_array($memberResult)) {
        fatal_lang_error('not_a_user', false);
    }
    // If all went well, we have a valid member ID!
    list($memID) = $memberResult;
    $context['id_member'] = $memID;
    $cur_profile = $user_profile[$memID];
    // Let's have some information about this member ready, too.
    loadMemberContext($memID);
    $context['member'] = $memberContext[$memID];
    // Is this the profile of the user himself or herself?
    $context['user']['is_owner'] = $memID == $user_info['id'];
    /* Define all the sections within the profile area!
    		We start by defining the permission required - then SMF takes this and turns it into the relevant context ;)
    		Possible fields:
    			For Section:
    				string $title:		Section title.
    				array $areas:		Array of areas within this section.
    
    			For Areas:
    				string $label:		Text string that will be used to show the area in the menu.
    				string $file:		Optional text string that may contain a file name that's needed for inclusion in order to display the area properly.
    				string $custom_url:	Optional href for area.
    				string $function:	Function to execute for this section.
    				bool $enabled:		Should area be shown?
    				string $sc:		Session check validation to do on save - note without this save will get unset - if set.
    				bool $hidden:		Does this not actually appear on the menu?
    				bool $password:		Whether to require the user's password in order to save the data in the area.
    				array $subsections:	Array of subsections, in order of appearance.
    				array $permission:	Array of permissions to determine who can access this area. Should contain arrays $own and $any.
    	*/
    $profile_areas = array('info' => array('title' => $txt['profileInfo'], 'areas' => array('summary' => array('label' => $txt['summary'], 'file' => 'Profile-View.php', 'function' => 'summary', 'permission' => array('own' => 'profile_view_own', 'any' => 'profile_view_any')), 'statistics' => array('label' => $txt['statPanel'], 'file' => 'Profile-View.php', 'function' => 'statPanel', 'permission' => array('own' => 'profile_view_own', 'any' => 'profile_view_any')), 'showposts' => array('label' => $txt['showPosts'], 'file' => 'Profile-View.php', 'function' => 'showPosts', 'subsections' => array('messages' => array($txt['showMessages'], array('profile_view_own', 'profile_view_any')), 'topics' => array($txt['showTopics'], array('profile_view_own', 'profile_view_any')), 'attach' => array($txt['showAttachments'], array('profile_view_own', 'profile_view_any'))), 'permission' => array('own' => 'profile_view_own', 'any' => 'profile_view_any')), 'permissions' => array('label' => $txt['showPermissions'], 'file' => 'Profile-View.php', 'function' => 'showPermissions', 'permission' => array('own' => 'manage_permissions', 'any' => 'manage_permissions')), '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')), 'permission' => array('own' => 'moderate_forum', 'any' => 'moderate_forum')), 'viewwarning' => array('label' => $txt['profile_view_warnings'], 'enabled' => in_array('w', $context['admin_features']) && $modSettings['warning_settings'][0] == 1 && $cur_profile['warning'] && $context['user']['is_owner'] && !empty($modSettings['warning_show']), 'file' => 'Profile-View.php', 'function' => 'viewWarning', 'permission' => array('own' => 'profile_view_own', 'any' => 'issue_warning')))), 'edit_profile' => array('title' => $txt['profileEdit'], 'areas' => array('account' => array('label' => $txt['account'], 'file' => 'Profile-Modify.php', 'function' => 'account', 'enabled' => $context['user']['is_admin'] || $cur_profile['id_group'] != 1 && !in_array(1, explode(',', $cur_profile['additional_groups'])), 'sc' => 'post', 'password' => true, 'permission' => array('own' => array('profile_identity_any', 'profile_identity_own', 'manage_membergroups'), 'any' => array('profile_identity_any', 'manage_membergroups'))), 'forumprofile' => array('label' => $txt['forumprofile'], 'file' => 'Profile-Modify.php', 'function' => 'forumProfile', 'sc' => 'post', 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own', 'profile_title_own', 'profile_title_any'), 'any' => array('profile_extra_any', 'profile_title_any'))), 'theme' => array('label' => $txt['theme'], 'file' => 'Profile-Modify.php', 'function' => 'theme', 'sc' => 'post', 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own'), 'any' => array('profile_extra_any'))), 'authentication' => array('label' => $txt['authentication'], 'file' => 'Profile-Modify.php', 'function' => 'authentication', 'enabled' => !empty($modSettings['enableOpenID']) || !empty($cur_profile['openid_uri']), 'sc' => 'post', 'hidden' => empty($modSettings['enableOpenID']) && empty($cur_profile['openid_uri']), 'password' => true, 'permission' => array('own' => array('profile_identity_any', 'profile_identity_own'), 'any' => array('profile_identity_any'))), 'notification' => array('label' => $txt['notification'], 'file' => 'Profile-Modify.php', 'function' => 'notification', 'sc' => 'post', 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own'), 'any' => array('profile_extra_any'))), 'pmprefs' => array('label' => $txt['pmprefs'], 'file' => 'Profile-Modify.php', 'function' => 'pmprefs', 'enabled' => allowedTo(array('profile_extra_own', 'profile_extra_any')), 'sc' => 'post', 'permission' => array('own' => array('pm_read'), 'any' => array('profile_extra_any'))), 'ignoreboards' => array('label' => $txt['ignoreboards'], 'file' => 'Profile-Modify.php', 'function' => 'ignoreboards', 'enabled' => !empty($modSettings['allow_ignore_boards']), 'sc' => 'post', 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own'), 'any' => array('profile_extra_any'))), 'lists' => array('label' => $txt['editBuddyIgnoreLists'], 'file' => 'Profile-Modify.php', 'function' => 'editBuddyIgnoreLists', 'enabled' => !empty($modSettings['enable_buddylist']) && $context['user']['is_owner'], 'sc' => 'post', 'subsections' => array('buddies' => array($txt['editBuddies']), 'ignore' => array($txt['editIgnoreList'])), 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own'), 'any' => array())), 'groupmembership' => array('label' => $txt['groupmembership'], 'file' => 'Profile-Modify.php', 'function' => 'groupMembership', 'enabled' => !empty($modSettings['show_group_membership']) && $context['user']['is_owner'], 'sc' => 'request', 'permission' => array('own' => array('profile_view_own'), 'any' => array('manage_membergroups'))))), 'profile_action' => array('title' => $txt['profileAction'], 'areas' => array('sendpm' => array('label' => $txt['profileSendIm'], 'custom_url' => $scripturl . '?action=pm;sa=send', 'permission' => array('own' => array(), 'any' => array('pm_send'))), 'issuewarning' => array('label' => $txt['profile_issue_warning'], 'enabled' => in_array('w', $context['admin_features']) && $modSettings['warning_settings'][0] == 1 && (!$context['user']['is_owner'] || $context['user']['is_admin']), 'file' => 'Profile-Actions.php', 'function' => 'issueWarning', 'permission' => array('own' => array('issue_warning'), 'any' => array('issue_warning'))), 'banuser' => array('label' => $txt['profileBanUser'], 'custom_url' => $scripturl . '?action=admin;area=ban;sa=add', 'enabled' => $cur_profile['id_group'] != 1 && !in_array(1, explode(',', $cur_profile['additional_groups'])), 'permission' => array('own' => array(), 'any' => array('manage_bans'))), 'subscriptions' => array('label' => $txt['subscriptions'], 'file' => 'Profile-Actions.php', 'function' => 'subscriptions', 'enabled' => !empty($modSettings['paid_enabled']), 'permission' => array('own' => array('profile_view_own'), 'any' => array('moderate_forum'))), 'deleteaccount' => array('label' => $txt['deleteAccount'], 'file' => 'Profile-Actions.php', 'function' => 'deleteAccount', 'sc' => 'post', 'password' => true, 'permission' => array('own' => array('profile_remove_any', 'profile_remove_own'), 'any' => array('profile_remove_any'))), 'activateaccount' => array('file' => 'Profile-Actions.php', 'function' => 'activateAccount', 'sc' => 'get', 'permission' => array('own' => array(), 'any' => array('moderate_forum'))))));
    // Let them modify profile areas easily.
    call_integration_hook('integrate_profile_areas', array(&$profile_areas));
    // Do some cleaning ready for the menu function.
    $context['password_areas'] = array();
    $current_area = isset($_REQUEST['area']) ? $_REQUEST['area'] : '';
    foreach ($profile_areas as $section_id => $section) {
        // Do a bit of spring cleaning so to speak.
        foreach ($section['areas'] as $area_id => $area) {
            // If it said no permissions that meant it wasn't valid!
            if (empty($area['permission'][$context['user']['is_owner'] ? 'own' : 'any'])) {
                $profile_areas[$section_id]['areas'][$area_id]['enabled'] = false;
            } else {
                $profile_areas[$section_id]['areas'][$area_id]['permission'] = $area['permission'][$context['user']['is_owner'] ? 'own' : 'any'];
            }
            // Password required - only if not on OpenID.
            if (!empty($area['password'])) {
                $context['password_areas'][] = $area_id;
            }
        }
    }
    // Is there an updated message to show?
    if (isset($_GET['updated'])) {
        $context['profile_updated'] = $txt['profile_updated_own'];
    }
    // Set a few options for the menu.
    $menuOptions = array('disable_url_session_check' => true, 'current_area' => $current_area, 'extra_url_parameters' => array('u' => $context['id_member']));
    // Actually create the menu!
    $profile_include_data = createMenu($profile_areas, $menuOptions);
    // No menu means no access.
    if (!$profile_include_data && (!$user_info['is_guest'] || validateSession())) {
        fatal_lang_error('no_access', false);
    }
    // Make a note of the Unique ID for this menu.
    $context['profile_menu_id'] = $context['max_menu_id'];
    $context['profile_menu_name'] = 'menu_data_' . $context['profile_menu_id'];
    // Set the selected item - now it's been validated.
    $current_area = $profile_include_data['current_area'];
    $context['menu_item_selected'] = $current_area;
    // Before we go any further, let's work on the area we've said is valid. Note this is done here just in case we every compromise the menu function in error!
    $context['completed_save'] = false;
    $security_checks = array();
    $found_area = false;
    foreach ($profile_areas as $section_id => $section) {
        // Do a bit of spring cleaning so to speak.
        foreach ($section['areas'] as $area_id => $area) {
            // Is this our area?
            if ($current_area == $area_id) {
                // This can't happen - but is a security check.
                if (isset($section['enabled']) && $section['enabled'] == false || isset($area['enabled']) && $area['enabled'] == false) {
//.........这里部分代码省略.........
开发者ID:keweiliu6,项目名称:test-smf2,代码行数:101,代码来源:Profile.php

示例12: header

<?php

header("Content-type: text/html; charset=utf-8");
define("APPID", "wx3558953cf2ade643");
define("APPSECRET", "009253937b0d48367326c50423251127");
$action = isset($_GET['action']) ? $_GET['action'] : '';
//创建菜单
if ($action == "create") {
    echo createMenu($data);
    //创建菜单
}
//删除菜单
if ($action == "delete") {
    $access_token = access_token();
    echo file_get_contents("https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=" . $access_token);
}
//获取ACCESS_TOKEN
function access_token()
{
    $access_html = file_get_contents("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . APPID . "&secret=" . APPSECRET);
    $access_html = json_decode($access_html);
    return $access_html->access_token;
}
//创建菜单
function createMenu($data)
{
    $access_token = access_token();
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" . $access_token);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
开发者ID:shaoslu,项目名称:jidoubao,代码行数:31,代码来源:wx_menu.php

示例13: action_index

 /**
  * Allow the change or view of profiles.
  * Loads the profile menu.
  *
  * @see Action_Controller::action_index()
  */
 public function action_index()
 {
     global $txt, $scripturl, $user_info, $context, $user_profile, $cur_profile;
     global $modSettings, $memberContext, $profile_vars, $post_errors, $user_settings;
     // Don't reload this as we may have processed error strings.
     if (empty($post_errors)) {
         loadLanguage('Profile+Drafts');
     }
     loadTemplate('Profile');
     require_once SUBSDIR . '/Menu.subs.php';
     require_once SUBSDIR . '/Profile.subs.php';
     $memID = currentMemberID();
     $context['id_member'] = $memID;
     $cur_profile = $user_profile[$memID];
     // Let's have some information about this member ready, too.
     loadMemberContext($memID);
     $context['member'] = $memberContext[$memID];
     // Is this the profile of the user himself or herself?
     $context['user']['is_owner'] = $memID == $user_info['id'];
     /**
      * Define all the sections within the profile area!
      * We start by defining the permission required - then we take this and turn
      * it into the relevant context ;)
      *
      * Possible fields:
      *   For Section:
      *    - string $title: Section title.
      *    - array $areas:  Array of areas within this section.
      *
      *   For Areas:
      *    - string $label:      Text string that will be used to show the area in the menu.
      *    - string $file:       Optional text string that may contain a file name that's needed for inclusion in order to display the area properly.
      *    - string $custom_url: Optional href for area.
      *    - string $function:   Function to execute for this section.
      *    - bool $enabled:      Should area be shown?
      *    - string $sc:         Session check validation to do on save - note without this save will get unset - if set.
      *    - bool $hidden:       Does this not actually appear on the menu?
      *    - bool $password:     Whether to require the user's password in order to save the data in the area.
      *    - array $subsections: Array of subsections, in order of appearance.
      *    - array $permission:  Array of permissions to determine who can access this area. Should contain arrays $own and $any.
      */
     $profile_areas = array('info' => array('title' => $txt['profileInfo'], 'areas' => array('summary' => array('label' => $txt['summary'], 'file' => 'ProfileInfo.controller.php', 'controller' => 'ProfileInfo_Controller', 'function' => 'action_summary', 'token' => 'profile-aa%u', 'token_type' => 'get', 'permission' => array('own' => 'profile_view_own', 'any' => 'profile_view_any')), 'statistics' => array('label' => $txt['statPanel'], 'file' => 'ProfileInfo.controller.php', 'controller' => 'ProfileInfo_Controller', 'function' => 'action_statPanel', 'permission' => array('own' => 'profile_view_own', 'any' => 'profile_view_any')), 'showposts' => array('label' => $txt['showPosts'], 'file' => 'ProfileInfo.controller.php', 'controller' => 'ProfileInfo_Controller', 'function' => 'action_showPosts', 'subsections' => array('messages' => array($txt['showMessages'], array('profile_view_own', 'profile_view_any')), 'topics' => array($txt['showTopics'], array('profile_view_own', 'profile_view_any')), 'unwatchedtopics' => array($txt['showUnwatched'], array('profile_view_own', 'profile_view_any'), 'enabled' => $modSettings['enable_unwatch'] && $context['user']['is_owner']), 'attach' => array($txt['showAttachments'], array('profile_view_own', 'profile_view_any'))), 'permission' => array('own' => 'profile_view_own', 'any' => 'profile_view_any')), 'showdrafts' => array('label' => $txt['drafts_show'], 'file' => 'Draft.controller.php', 'controller' => 'Draft_Controller', 'function' => 'action_showProfileDrafts', 'enabled' => !empty($modSettings['drafts_enabled']) && $context['user']['is_owner'], 'permission' => array('own' => 'profile_view_own', 'any' => array())), 'showlikes' => array('label' => $txt['likes_show'], 'file' => 'Likes.controller.php', 'controller' => 'Likes_Controller', 'function' => 'action_showProfileLikes', 'enabled' => !empty($modSettings['likes_enabled']) && $context['user']['is_owner'], 'subsections' => array('given' => array($txt['likes_given'], array('profile_view_own')), 'received' => array($txt['likes_received'], array('profile_view_own'))), 'permission' => array('own' => 'profile_view_own', 'any' => array())), 'permissions' => array('label' => $txt['showPermissions'], 'file' => 'ProfileInfo.controller.php', 'controller' => 'ProfileInfo_Controller', 'function' => 'action_showPermissions', 'permission' => array('own' => 'manage_permissions', 'any' => 'manage_permissions')), 'history' => array('label' => $txt['history'], 'file' => 'ProfileHistory.controller.php', 'controller' => 'ProfileHistory_Controller', 'function' => 'action_index', 'subsections' => array('activity' => array($txt['trackActivity'], 'moderate_forum'), 'ip' => array($txt['trackIP'], 'moderate_forum'), 'edits' => array($txt['trackEdits'], 'moderate_forum'), 'logins' => array($txt['trackLogins'], array('profile_view_own', 'moderate_forum'))), 'permission' => array('own' => 'moderate_forum', 'any' => 'moderate_forum')), 'viewwarning' => array('label' => $txt['profile_view_warnings'], 'enabled' => in_array('w', $context['admin_features']) && !empty($modSettings['warning_enable']) && $cur_profile['warning'] && (!empty($modSettings['warning_show']) && ($context['user']['is_owner'] || $modSettings['warning_show'] == 2)), 'file' => 'ProfileInfo.controller.php', 'controller' => 'ProfileInfo_Controller', 'function' => 'action_viewWarning', 'permission' => array('own' => 'profile_view_own', 'any' => 'issue_warning')))), 'edit_profile' => array('title' => $txt['profileEdit'], 'areas' => array('account' => array('label' => $txt['account'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_account', 'enabled' => $context['user']['is_admin'] || $cur_profile['id_group'] != 1 && !in_array(1, explode(',', $cur_profile['additional_groups'])), 'sc' => 'post', 'token' => 'profile-ac%u', 'password' => true, 'permission' => array('own' => array('profile_identity_any', 'profile_identity_own', 'manage_membergroups'), 'any' => array('profile_identity_any', 'manage_membergroups'))), 'forumprofile' => array('label' => $txt['forumprofile'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_forumProfile', 'sc' => 'post', 'token' => 'profile-fp%u', 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own', 'profile_title_own', 'profile_title_any'), 'any' => array('profile_extra_any', 'profile_title_any'))), 'theme' => array('label' => $txt['theme'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_themepick', 'sc' => 'post', 'token' => 'profile-th%u', 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own'), 'any' => array('profile_extra_any'))), 'authentication' => array('label' => $txt['authentication'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_authentication', 'enabled' => !empty($modSettings['enableOpenID']) || !empty($cur_profile['openid_uri']), 'sc' => 'post', 'token' => 'profile-au%u', 'hidden' => empty($modSettings['enableOpenID']) && empty($cur_profile['openid_uri']), 'password' => true, 'permission' => array('own' => array('profile_identity_any', 'profile_identity_own'), 'any' => array('profile_identity_any'))), 'notification' => array('label' => $txt['notifications'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_notification', 'sc' => 'post', 'token' => 'profile-nt%u', 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own'), 'any' => array('profile_extra_any'))), 'contactprefs' => array('label' => $txt['contactprefs'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_pmprefs', 'enabled' => allowedTo(array('profile_extra_own', 'profile_extra_any')), 'sc' => 'post', 'token' => 'profile-pm%u', 'permission' => array('own' => array('pm_read'), 'any' => array('profile_extra_any'))), 'ignoreboards' => array('label' => $txt['ignoreboards'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_ignoreboards', 'enabled' => !empty($modSettings['allow_ignore_boards']), 'sc' => 'post', 'token' => 'profile-ib%u', 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own'), 'any' => array('profile_extra_any'))), 'lists' => array('label' => $txt['editBuddyIgnoreLists'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_editBuddyIgnoreLists', 'enabled' => !empty($modSettings['enable_buddylist']) && $context['user']['is_owner'], 'sc' => 'post', 'token' => 'profile-bl%u', 'subsections' => array('buddies' => array($txt['editBuddies']), 'ignore' => array($txt['editIgnoreList'])), 'permission' => array('own' => array('profile_extra_any', 'profile_extra_own'), 'any' => array())), 'groupmembership' => array('label' => $txt['groupmembership'], 'file' => 'ProfileOptions.controller.php', 'controller' => 'ProfileOptions_Controller', 'function' => 'action_groupMembership', 'enabled' => !empty($modSettings['show_group_membership']) && $context['user']['is_owner'], 'sc' => 'request', 'token' => 'profile-gm%u', 'token_type' => 'request', 'permission' => array('own' => array('profile_view_own'), 'any' => array('manage_membergroups'))))), 'profile_action' => array('title' => $txt['profileAction'], 'areas' => array('sendpm' => array('label' => $txt['profileSendIm'], 'custom_url' => $scripturl . '?action=pm;sa=send', 'permission' => array('own' => array(), 'any' => array('pm_send'))), 'issuewarning' => array('label' => $txt['profile_issue_warning'], 'enabled' => in_array('w', $context['admin_features']) && !empty($modSettings['warning_enable']) && (!$context['user']['is_owner'] || $context['user']['is_admin']), 'file' => 'ProfileAccount.controller.php', 'controller' => 'ProfileAccount_Controller', 'function' => 'action_issuewarning', 'token' => 'profile-iw%u', 'permission' => array('own' => array(), 'any' => array('issue_warning'))), 'banuser' => array('label' => $txt['profileBanUser'], 'custom_url' => $scripturl . '?action=admin;area=ban;sa=add', 'enabled' => $cur_profile['id_group'] != 1 && !in_array(1, explode(',', $cur_profile['additional_groups'])), 'permission' => array('own' => array(), 'any' => array('manage_bans'))), 'subscriptions' => array('label' => $txt['subscriptions'], 'file' => 'ProfileSubscriptions.controller.php', 'controller' => 'ProfileSubscriptions_Controller', 'function' => 'action_subscriptions', 'enabled' => !empty($modSettings['paid_enabled']), 'permission' => array('own' => array('profile_view_own'), 'any' => array('moderate_forum'))), 'deleteaccount' => array('label' => $txt['deleteAccount'], 'file' => 'ProfileAccount.controller.php', 'controller' => 'ProfileAccount_Controller', 'function' => 'action_deleteaccount', 'sc' => 'post', 'token' => 'profile-da%u', 'password' => true, 'permission' => array('own' => array('profile_remove_any', 'profile_remove_own'), 'any' => array('profile_remove_any'))), 'activateaccount' => array('file' => 'ProfileAccount.controller.php', 'controller' => 'ProfileAccount_Controller', 'function' => 'action_activateaccount', 'sc' => 'get', 'token' => 'profile-aa%u', 'permission' => array('own' => array(), 'any' => array('moderate_forum'))))));
     // Is there an updated message to show?
     if (isset($_GET['updated'])) {
         $context['profile_updated'] = $txt['profile_updated_own'];
     }
     // Set a few options for the menu.
     $menuOptions = array('disable_url_session_check' => true, 'hook' => 'profile', 'extra_url_parameters' => array('u' => $context['id_member']), 'default_include_dir' => CONTROLLERDIR);
     // Actually create the menu!
     $profile_include_data = createMenu($profile_areas, $menuOptions);
     unset($profile_areas);
     // If it said no permissions that meant it wasn't valid!
     if ($profile_include_data && empty($profile_include_data['permission'])) {
         $profile_include_data['enabled'] = false;
     }
     // No menu and guest? A warm welcome to register
     if (!$profile_include_data && $user_info['is_guest']) {
         is_not_guest();
     }
     // No menu means no access.
     if (!$profile_include_data || isset($profile_include_data['enabled']) && $profile_include_data['enabled'] === false) {
         fatal_lang_error('no_access', false);
     }
     // Make a note of the Unique ID for this menu.
     $context['profile_menu_id'] = $context['max_menu_id'];
     $context['profile_menu_name'] = 'menu_data_' . $context['profile_menu_id'];
     // Set the selected item - now it's been validated.
     $current_area = $profile_include_data['current_area'];
     $context['menu_item_selected'] = $current_area;
     // Before we go any further, let's work on the area we've said is valid.
     // Note this is done here just in case we ever compromise the menu function in error!
     $this->_completed_save = false;
     $context['do_preview'] = isset($_REQUEST['preview_signature']);
     // Are we saving data in a valid area?
     if (isset($profile_include_data['sc']) && (isset($_REQUEST['save']) || $context['do_preview'])) {
         checkSession($profile_include_data['sc']);
         $this->_completed_save = true;
     }
     // Does this require session validating?
     if (!empty($area['validate']) || isset($_REQUEST['save']) && !$context['user']['is_owner']) {
         validateSession();
     }
     // Do we need to perform a token check?
     if (!empty($profile_include_data['token'])) {
         if ($profile_include_data['token'] !== true) {
             $token_name = str_replace('%u', $context['id_member'], $profile_include_data['token']);
         } else {
             $token_name = 'profile-u' . $context['id_member'];
         }
         if (isset($profile_include_data['token_type']) && in_array($profile_include_data['token_type'], array('request', 'post', 'get'))) {
             $token_type = $profile_include_data['token_type'];
         } else {
             $token_type = 'post';
         }
//.........这里部分代码省略.........
开发者ID:scripple,项目名称:Elkarte,代码行数:101,代码来源:Profile.controller.php

示例14: getCorrectSubmenu

if (isset($_POST['sectionCount'])) {
    $sectionCount = $_POST['sectionCount'];
    $menu = [];
    for ($idx = 0; $idx < $sectionCount; $idx++) {
        $subMenu = [];
        for ($idy = 0; $idy < 5; $idy++) {
            if (!empty($_POST[$idx . '_subName_' . $idy]) && $_POST[$idx . '_subName_' . $idy] != 'none') {
                $subMenu[$idy] = getCorrectSubmenu($idx, $idy);
            }
        }
        if (!empty($_POST[$idx . '_menu'])) {
            $menu[$idx] = getCorrectMainMenu($idx, $subMenu);
        }
    }
    $menuData = urldecode(json_encode(array('button' => $menu)));
    createMenu($menuData);
}
function createMenu($menu)
{
    global $token;
    $url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" . $token;
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $menu);
    $res = curl_exec($ch);
    curl_close($ch);
    return $res;
}
function getCorrectSubmenu($idx, $idy)
开发者ID:slientServer,项目名称:weixin_helper,代码行数:31,代码来源:menu_page.php

示例15: boxStart

                    <tr>
                        <td style="padding-left:10px;padding-top:10px;vertical-align:top;">
                            <?php 
boxStart('Gruppenauswahl', 'N/A');
echo '<form action=index.php name=selectGroup style="padding:0px;margin:0px;">';
echo '<table cellpadding=0 cellspacing=0 border=0 style="width:290px;">';
//echo '<tr><td style="width:145px;text-align:left;"><div class=text-bf>Gruppenfilter:</div></td><td style="width:145px;text-align:right;"><input class=basicInput type=text name=groupfilter ';
//	if($this->namefilter != null) echo 'value='.$this->groupfilter;
//	echo '></td></tr>';
echo '<tr><td style="width:145px;text-align:left;vertical-align:middle;"><span class=text-bf>Direktauswahl</span></td><td align=right style="width:145px;height:20px;">';
if ($this->groupSelect != null) {
    $activeGroup = $this->groupSelect;
} else {
    $activeGroup = '';
}
createMenu('dropdown-search', 'directSelect', $this->groupList, $activeGroup, '', 100);
echo '</td></tr>';
if ($this->status != null and $this->statusMsg != null) {
    if ($this->status == 'ok') {
        echo '<tr><td colspan=3><div class=apply>' . $this->statusMsg . '</div></td></tr>';
    } elseif ($this->status == 'warning') {
        echo '<tr><td colspan=3><div class=warning>' . $this->statusMsg . '</div></td></tr>';
    }
}
echo '<tr><td colspan=2 style="text-align:right;"><button class=basicButton name=lookUp value=true onclick="javascript:document.selectGroup.submit();">lookUp</button></td></tr>';
echo '</table>';
echo '<input type=hidden name=cmd value=lookUp>';
echo '</form>';
boxEnd();
?>
                        </td>
开发者ID:open-steam,项目名称:usermanagement-ldap,代码行数:31,代码来源:lookUpTemplate.php


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