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


PHP prepare_menu函数代码示例

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


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

示例1: showFormAction

 /**
  * Builds a page with form for upload translation file.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $target = $request->request->get('target');
     if (!preg_match("/^[\\w-]{2,5}\$/", $target)) {
         $target = get_current_locale();
     }
     $override = (bool) $request->request->get('override', false);
     $page = array('errors' => $request->attributes->get('errors', array()));
     // Load list of all available locales.
     $locales_list = array();
     $all_locales = get_available_locales();
     foreach ($all_locales as $loc) {
         $locales_list[] = array('id' => $loc, 'name' => $this->getLocaleName($loc));
     }
     $page['stored'] = $request->query->has('stored');
     $page['localesList'] = $locales_list;
     $page['formtarget'] = $target;
     $page['formoverride'] = $override;
     $page['title'] = getlocal('Translations import');
     $page['menuid'] = 'translation';
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('translation_import', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:31,代码来源:TranslationImportController.php

示例2: showFormAction

 /**
  * Builds a page with members edit form.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  * @throws NotFoundException If the operator's group with specified ID is
  *   not found in the system.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $group_id = $request->attributes->getInt('group_id');
     $page = array('groupid' => $group_id, 'errors' => $request->attributes->get('errors', array()));
     $operators = get_operators_list();
     $group = group_by_id($group_id);
     // Check if the group exists
     if (!$group) {
         throw new NotFoundException('The group is not found.');
     }
     $page['formop'] = array();
     $page['currentgroup'] = $group ? htmlspecialchars($group['vclocalname']) : '';
     // Get list of group's members
     $checked_operators = get_group_members($group_id);
     // Prepare the list of all operators
     $page['operators'] = array();
     foreach ($operators as $op) {
         $op['vclocalename'] = $op['vclocalename'];
         $op['vclogin'] = $op['vclogin'];
         $op['checked'] = in_array($op['operatorid'], $checked_operators);
         $page['operators'][] = $op;
     }
     // Set other values and render the page
     $page['stored'] = $request->query->get('stored');
     $page['title'] = getlocal('Members');
     $page['menuid'] = 'groups';
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('group_members', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:39,代码来源:MembersController.php

示例3: showFormAction

    /**
     * Builds a page with form for features system settings.
     *
     * @param Request $request Incoming request.
     * @return string Rendered page content.
     */
    public function showFormAction(Request $request)
    {
        $operator = $this->getOperator();
        $page = array(
            'agentId' => '',
            'errors' => array(),
        );

        // Load all needed options and fill form with them.
        $options = $this->getOptionsList();
        foreach ($options as $opt) {
            $page['form' . $opt] = (Settings::get($opt) == '1');
        }

        $page['canmodify'] = is_capable(CAN_ADMINISTRATE, $operator);
        $page['stored'] = $request->query->get('stored');
        $page['title'] = getlocal('Messenger settings');
        $page['menuid'] = 'settings';
        $page = array_merge($page, prepare_menu($operator));
        $page['tabs'] = $this->buildTabs($request);

        $this->getAssetManager()->attachJs('js/compiled/features.js');

        return $this->render('settings_features', $page);
    }
开发者ID:nico13051995,项目名称:IntITA,代码行数:31,代码来源:FeaturesController.php

示例4: showFormAction

 /**
  * Builds a page with form for edit operator's groups.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  * @throws NotFoundException If the operator with specified ID is not found
  *   in the system.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $operator_in_isolation = in_isolation($operator);
     $op_id = $request->attributes->getInt('operator_id');
     // Check if the target user exists
     $op = operator_by_id($op_id);
     if (!$op) {
         throw new NotFoundException('The operator is not found.');
     }
     $page = array('opid' => $op_id, 'errors' => array());
     $groups = $operator_in_isolation ? get_groups_for_operator($operator) : get_all_groups();
     $can_modify = is_capable(CAN_ADMINISTRATE, $operator);
     $page['currentop'] = $op ? get_operator_name($op) . ' (' . $op['vclogin'] . ')' : getlocal('-not found-');
     $page['canmodify'] = $can_modify ? '1' : '';
     // Get IDs of groups the operator belongs to.
     $checked_groups = array();
     if ($op) {
         $checked_groups = get_operator_group_ids($op_id);
     }
     // Get all available groups
     $page['groups'] = array();
     foreach ($groups as $group) {
         $group['vclocalname'] = $group['vclocalname'];
         $group['vclocaldescription'] = $group['vclocaldescription'];
         $group['checked'] = in_array($group['groupid'], $checked_groups);
         $page['groups'][] = $group;
     }
     $page['stored'] = $request->query->has('stored');
     $page['title'] = getlocal('Operator groups');
     $page['menuid'] = $operator['operatorid'] == $op_id ? 'profile' : 'operators';
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('operator_groups', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:43,代码来源:GroupsController.php

示例5: showFormAction

 /**
  * Builds a page with form for edit operator's permissions.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  * @throws NotFoundException If the operator with specified ID is not found
  *   in the system.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $op_id = $request->attributes->get('operator_id');
     $page = array('opid' => $op_id, 'canmodify' => is_capable(CAN_ADMINISTRATE, $operator) ? '1' : '', 'errors' => array());
     $op = operator_by_id($op_id);
     if (!$op) {
         throw new NotFoundException('The operator is not found.');
     }
     // Check if the target operator exists
     $page['currentop'] = $op ? get_operator_name($op) . ' (' . $op['vclogin'] . ')' : getlocal('-not found-');
     // Build list of permissions which belongs to the target operator.
     $checked_permissions = array();
     foreach (permission_ids() as $perm => $id) {
         if (is_capable($perm, $op)) {
             $checked_permissions[] = $id;
         }
     }
     // Build list of all available permissions
     $page['permissionsList'] = array();
     foreach (get_permission_list() as $perm) {
         $perm['checked'] = in_array($perm['id'], $checked_permissions);
         $page['permissionsList'][] = $perm;
     }
     $page['stored'] = $request->query->has('stored');
     $page['title'] = getlocal('Permissions');
     $page['menuid'] = $operator['operatorid'] == $op_id ? 'profile' : 'operators';
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('operator_permissions', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:39,代码来源:PermissionsController.php

示例6: showFormAction

 /**
  * Builds a page with form for performance system settings.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $page = array('agentId' => '', 'errors' => $request->attributes->get('errors', array()));
     // Load settings from the database
     $options = array('online_timeout', 'connection_timeout', 'updatefrequency_operator', 'updatefrequency_chat', 'max_connections_from_one_host', 'updatefrequency_tracking', 'visitors_limit', 'invitation_lifetime', 'tracking_lifetime', 'thread_lifetime', 'max_uploaded_file_size');
     $params = array();
     foreach ($options as $opt) {
         $params[$opt] = Settings::get($opt);
     }
     // Build form values
     $form = $request->request;
     $page['formonlinetimeout'] = $form->get('onlinetimeout', $params['online_timeout']);
     $page['formconnectiontimeout'] = $form->get('connectiontimeout', $params['connection_timeout']);
     $page['formfrequencyoperator'] = $form->get('frequencyoperator', $params['updatefrequency_operator']);
     $page['formfrequencychat'] = $form->get('frequencychat', $params['updatefrequency_chat']);
     $page['formonehostconnections'] = $form->get('onehostconnections', $params['max_connections_from_one_host']);
     $page['formthreadlifetime'] = $form->get('threadlifetime', $params['thread_lifetime']);
     $page['formmaxuploadedfilesize'] = $form->get('maxuploadedfilesize', $params['max_uploaded_file_size']);
     if (Settings::get('enabletracking')) {
         $page['formfrequencytracking'] = $form->get('frequencytracking', $params['updatefrequency_tracking']);
         $page['formvisitorslimit'] = $form->get('visitorslimit', $params['visitors_limit']);
         $page['forminvitationlifetime'] = $form->get('invitationlifetime', $params['invitation_lifetime']);
         $page['formtrackinglifetime'] = $form->get('trackinglifetime', $params['tracking_lifetime']);
     }
     $page['enabletracking'] = Settings::get('enabletracking');
     $page['stored'] = $request->query->get('stored');
     $page['title'] = getlocal("Messenger settings");
     $page['menuid'] = "settings";
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('settings_performance', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:39,代码来源:PerformanceController.php

示例7: indexAction

    /**
     * Generates a page with awaiting visitors.
     *
     * @param Request $request
     * @return string Rendered page content
     */
    public function indexAction(Request $request)
    {
        $operator = $this->getOperator();

        // Operator becomes online as soon as he open "operator/users" page
        notify_operator_alive($operator['operatorid'], 0);
        $operator['istatus'] = 0;
        $this->getAuthenticationManager()->setOperator($operator);

        $_SESSION[SESSION_PREFIX . "operatorgroups"] = get_operator_groups_list($operator['operatorid']);

        $page = array();
        $page['havemenu'] = !$request->query->has('nomenu');
        $page['showonline'] = (Settings::get('showonlineoperators') == '1');
        $page['showvisitors'] = (Settings::get('enabletracking') == '1');
        $page['title'] = getlocal("List of visitors waiting");
        $page['menuid'] = "users";

        $page = array_merge($page, prepare_menu($operator));

        // Attach files of the client side application and start it
        $this->getAssetManager()->attachJs('js/compiled/users_app.js');
        $this->getAssetManager()->attachJs(
            $this->startJsApplication($request, $operator),
            \Mibew\Asset\AssetManagerInterface::INLINE,
            1000
        );

        return $this->render('users', $page);
    }
开发者ID:nico13051995,项目名称:IntITA,代码行数:36,代码来源:UsersController.php

示例8: indexAction

    /**
     * Generates list of all locales in the system.
     *
     * @param Request $request Incoming request.
     * @return string Rendered page content.
     */
    public function indexAction(Request $request)
    {
        $operator = $this->getOperator();
        $page = array(
            // Use errors list stored in the request. We need to do so to have
            // an ability to pass the request from other actions.
            'errors' => $request->attributes->get('errors', array()),
        );

        $fs_locales = discover_locales();
        $available_locales = get_available_locales();

        $locales_list = array();
        foreach ($fs_locales as $locale) {
            $locales_list[] = array(
                'code' => $locale,
                'name' => $this->getLocaleName($locale),
                'isDisabled' => !in_array($locale, $available_locales),
            );
        }

        $page['localesList'] = $locales_list;
        $page['title'] = getlocal('Locales');
        $page['menuid'] = 'translation';
        $page = array_merge($page, prepare_menu($operator));
        $page['tabs'] = $this->buildTabs($request);

        return $this->render('locales', $page);
    }
开发者ID:nico13051995,项目名称:IntITA,代码行数:35,代码来源:LocaleController.php

示例9: indexAction

 /**
  * Generates list of all available groups.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  */
 public function indexAction(Request $request)
 {
     $operator = $this->getOperator();
     $page = array('errors' => array());
     $sort_by = $request->query->get('sortby');
     if (!in_array($sort_by, array('name', 'lastseen', 'weight'))) {
         $sort_by = 'name';
     }
     $sort['by'] = $sort_by;
     $sort['desc'] = $request->query->get('sortdirection', 'desc') == 'desc';
     // Load and prepare groups
     $groups = get_sorted_groups($sort);
     foreach ($groups as &$group) {
         $group['vclocalname'] = $group['vclocalname'];
         $group['vclocaldescription'] = $group['vclocaldescription'];
         $group['isOnline'] = group_is_online($group);
         $group['isAway'] = group_is_away($group);
         $group['lastTimeOnline'] = time() - ($group['ilastseen'] ? $group['ilastseen'] : time());
         $group['inumofagents'] = $group['inumofagents'];
     }
     unset($group);
     // Set values that are needed to build sorting block.
     $page['groups'] = $groups;
     $page['formsortby'] = $sort['by'];
     $page['formsortdirection'] = $sort['desc'] ? 'desc' : 'asc';
     $page['canmodify'] = is_capable(CAN_ADMINISTRATE, $operator);
     $page['availableOrders'] = array(array('id' => 'name', 'name' => getlocal('Name')), array('id' => 'lastseen', 'name' => getlocal('Last active')), array('id' => 'weight', 'name' => getlocal('Weight')));
     $page['availableDirections'] = array(array('id' => 'desc', 'name' => getlocal('descending')), array('id' => 'asc', 'name' => getlocal('ascending')));
     // Set other variables and render the response.
     $page['title'] = getlocal('Groups');
     $page['menuid'] = 'groups';
     $page = array_merge($page, prepare_menu($operator));
     $this->getAssetManager()->attachJs('js/compiled/groups.js');
     return $this->render('groups', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:41,代码来源:ManagementController.php

示例10: dashboardAction

 /**
  * Renders operator's home page.
  *
  * @param Request $request Incoming request
  * @return string Rendered page content.
  */
 public function dashboardAction(Request $request)
 {
     $operator = $this->getOperator();
     $is_online = is_operator_online($operator['operatorid']);
     $page = array('version' => MIBEW_VERSION, 'localeLinks' => get_locale_links(), 'needUpdate' => version_compare(Settings::get('dbversion'), MIBEW_VERSION, '<'), 'profilePage' => $this->generateUrl('operator_edit', array('operator_id' => $operator['operatorid'])), 'isOnline' => $is_online, 'warnOffline' => true, 'title' => getlocal('Home'), 'menuid' => 'main');
     $page = array_merge($page, prepare_menu($operator));
     return $this->render('index', $page);
 }
开发者ID:seodom,项目名称:mibew,代码行数:14,代码来源:HomeController.php

示例11: indexAction

 /**
  * Generates list of all plugins in the system.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  */
 public function indexAction(Request $request)
 {
     $page = array('errors' => $request->attributes->get('errors', array()));
     $page['plugins'] = $this->buildPluginsList();
     $page['title'] = getlocal('Plugins');
     $page['menuid'] = 'plugins';
     $page = array_merge($page, prepare_menu($this->getOperator()));
     $this->getAssetManager()->attachJs('js/compiled/plugins.js');
     return $this->render('plugins', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:16,代码来源:PluginController.php

示例12: showFormAction

 /**
  * Builds a page with form for add/edit group.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  * @throws NotFoundException If the operator's group with specified ID is
  *   not found in the system.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $group_id = $request->attributes->getInt('group_id');
     $page = array('gid' => false, 'errors' => $request->attributes->get('errors', array()));
     if ($group_id) {
         // Check if the group exisits
         $group = group_by_id($group_id);
         if (!$group) {
             throw new NotFoundException('The group is not found.');
         }
         // Set form values
         $page['formname'] = $group['vclocalname'];
         $page['formdescription'] = $group['vclocaldescription'];
         $page['formcommonname'] = $group['vccommonname'];
         $page['formcommondescription'] = $group['vccommondescription'];
         $page['formemail'] = $group['vcemail'];
         $page['formweight'] = $group['iweight'];
         $page['formparentgroup'] = $group['parent'];
         $page['grid'] = $group['groupid'];
         $page['formtitle'] = $group['vctitle'];
         $page['formchattitle'] = $group['vcchattitle'];
         $page['formhosturl'] = $group['vchosturl'];
         $page['formlogo'] = $group['vclogo'];
     }
     // Override group's fields from the request if it's needed. This
     // case will take place when save handler fails.
     if ($request->isMethod('POST')) {
         $page['formname'] = $request->request->get('name');
         $page['formdescription'] = $request->request->get('description');
         $page['formcommonname'] = $request->request->get('commonname');
         $page['formcommondescription'] = $request->request->get('commondescription');
         $page['formemail'] = $request->request->get('email');
         $page['formweight'] = $request->request->get('weight');
         $page['formparentgroup'] = $request->request->get('parentgroup');
         $page['formtitle'] = $request->request->get('title');
         $page['formchattitle'] = $request->request->get('chattitle');
         $page['formhosturl'] = $request->request->get('hosturl');
         $page['formlogo'] = $request->request->get('logo');
     }
     // Set other page variables and render the template.
     $page['stored'] = $request->query->has('stored');
     $page['availableParentGroups'] = get_available_parent_groups($group_id);
     $page['formaction'] = $request->getBaseUrl() . $request->getPathInfo();
     $page['title'] = getlocal('Group details');
     $page['menuid'] = 'groups';
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     $this->getAssetManager()->attachJs('js/compiled/group.js');
     return $this->render('group_edit', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:59,代码来源:SettingsController.php

示例13: showFormAction

 /**
  * Builds a page with form for common system settings.
  *
  * @param Request $request Incoming request.
  * @return string Rendered page content.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $page = array('agentId' => '', 'errors' => $request->attributes->get('errors', array()));
     // Load settings values from the database
     $options = array('email', 'title', 'logo', 'hosturl', 'usernamepattern', 'chattitle', 'geolink', 'geolinkparams', 'sendmessagekey', 'cron_key', 'left_messages_locale');
     $params = array();
     foreach ($options as $opt) {
         $params[$opt] = Settings::get($opt);
     }
     // Set form values
     $form = $request->request;
     $page['formemail'] = $form->get('email', $params['email']);
     $page['formleftmessageslocale'] = $form->get('leftmessageslocale', $params['left_messages_locale']);
     $page['formtitle'] = $form->get('title', $params['title']);
     $page['formlogo'] = $form->get('logo', $params['logo']);
     $page['formhosturl'] = $form->get('hosturl', $params['hosturl']);
     $page['formgeolink'] = $form->get('geolink', $params['geolink']);
     $page['formgeolinkparams'] = $form->get('geolinkparams', $params['geolinkparams']);
     $page['formusernamepattern'] = $form->get('usernamepattern', $params['usernamepattern']);
     $page['formchatstyle'] = $form->get('chatstyle', ChatStyle::getDefaultStyle());
     $page['formpagestyle'] = $form->get('pagestyle', PageStyle::getDefaultStyle());
     $page['formchattitle'] = $form->get('chattitle', $params['chattitle']);
     $page['formsendmessagekey'] = $form->get('sendmessagekey', $params['sendmessagekey']);
     $page['formcronkey'] = $form->get('cronkey', $params['cron_key']);
     if (Settings::get('enabletracking')) {
         $page['forminvitationstyle'] = $form->get('invitationstyle', InvitationStyle::getDefaultStyle());
         $page['availableInvitationStyles'] = InvitationStyle::getAvailableStyles();
     }
     $page['availableLocales'] = get_available_locales();
     $page['availableChatStyles'] = ChatStyle::getAvailableStyles();
     $page['availablePageStyles'] = PageStyle::getAvailableStyles();
     $page['chatStylePreviewPath'] = $this->generateUrl('style_preview', array('type' => 'chat'));
     $page['pageStylePreviewPath'] = $this->generateUrl('style_preview', array('type' => 'page'));
     $page['invitationStylePreviewPath'] = $this->generateUrl('style_preview', array('type' => 'invitation'));
     $page['stored'] = $request->query->has('stored');
     $page['enabletracking'] = Settings::get('enabletracking');
     $page['cron_path'] = $this->generateUrl('cron', array('cron_key' => $params['cron_key']), UrlGeneratorInterface::ABSOLUTE_URL);
     $page['title'] = getlocal('Messenger settings');
     $page['menuid'] = 'settings';
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('settings_common', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:50,代码来源:CommonController.php

示例14: indexAction

 /**
  * Generates a page with statistics info.
  *
  * @param Request $request
  * @return string Rendered page content
  */
 public function indexAction(Request $request)
 {
     $operator = $this->getOperator();
     $statistics_type = $request->attributes->get('type');
     $page = array();
     $page['operator'] = get_operator_name($operator);
     $page['availableDays'] = range(1, 31);
     $page['availableMonth'] = get_month_selection(time() - 400 * 24 * 60 * 60, time() + 50 * 24 * 60 * 60);
     $page['showresults'] = false;
     $page['type'] = $statistics_type;
     $page['showbydate'] = $statistics_type == self::TYPE_BY_DATE;
     $page['showbyagent'] = $statistics_type == self::TYPE_BY_OPERATOR;
     $page['showbypage'] = $statistics_type == self::TYPE_BY_PAGE;
     $cron_uri = $this->generateUrl('cron', array('cron_key' => Settings::get('cron_key')), UrlGeneratorInterface::ABSOLUTE_URL);
     $page['pageDescription'] = getlocal('From this page you can generate a variety of usage reports. Last time statistics was calculated {0}. You can calculate it <a href="{1}" target="_blank">manually</a>.', array(date_to_text(Settings::get('_last_cron_run')), $cron_uri));
     $page['show_invitations_info'] = (bool) Settings::get('enabletracking');
     $page['errors'] = array();
     // Get and validate time interval
     $time_interval = $this->extractTimeInterval($request);
     $start = $time_interval['start'];
     $end = $time_interval['end'];
     if ($start > $end) {
         $page['errors'][] = getlocal('You have selected From date after Till date');
     }
     $page = array_merge($page, set_form_date($start, 'start'), set_form_date($end - 24 * 60 * 60, 'end'));
     // Get statistics info
     if ($statistics_type == self::TYPE_BY_DATE) {
         $statistics = get_by_date_statistics($start, $end);
         $page['reportByDate'] = $statistics['records'];
         $page['reportByDateTotal'] = $statistics['total'];
     } elseif ($statistics_type == self::TYPE_BY_OPERATOR) {
         $page['reportByAgent'] = get_by_operator_statistics($start, $end);
     } elseif ($statistics_type == self::TYPE_BY_PAGE) {
         $page['reportByPage'] = get_by_page_statistics($start, $end);
     }
     $page['showresults'] = count($page['errors']) == 0;
     $page['title'] = getlocal("Statistics");
     $page['menuid'] = "statistics";
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('statistics', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:48,代码来源:StatisticsController.php

示例15: showFormAction

 /**
  * Builds a page with form for edit operator's avatar.
  *
  * @param Request $request incoming request.
  * @return string Rendered page content.
  * @throws NotFoundException If the operator with specified ID is not found
  *   in the system.
  */
 public function showFormAction(Request $request)
 {
     $operator = $this->getOperator();
     $op_id = $request->attributes->get('operator_id');
     $page = array('opid' => $op_id, 'errors' => $request->attributes->get('errors', array()));
     $can_modify = $op_id == $operator['operatorid'] && is_capable(CAN_MODIFYPROFILE, $operator) || is_capable(CAN_ADMINISTRATE, $operator);
     // Try to load the target operator.
     $op = operator_by_id($op_id);
     if (!$op) {
         throw new NotFoundException('The operator is not found');
     }
     $page['avatar'] = $op['vcavatar'] ? $this->asset($op['vcavatar']) : '';
     $page['currentop'] = $op ? get_operator_name($op) . ' (' . $op['vclogin'] . ')' : getlocal('-not found-');
     $page['canmodify'] = $can_modify ? '1' : '';
     $page['title'] = getlocal('Upload photo');
     $page['menuid'] = $operator['operatorid'] == $op_id ? 'profile' : 'operators';
     $page = array_merge($page, prepare_menu($operator));
     $page['tabs'] = $this->buildTabs($request);
     return $this->render('operator_avatar', $page);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:28,代码来源:AvatarController.php


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