• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getlocal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: buildTabs

    /**
     * Builds list of the localization tabs.
     *
     * @param Request $request Current request.
     * @return array Tabs list. The keys of the array are tabs titles and the
     *   values are tabs URLs.
     */
    protected function buildTabs(Request $request)
    {
        $tabs = array();
        $route = $request->attributes->get('_route');

        $tabs[getlocal('Translations')] = ($route != 'translations')
            ? $this->generateUrl('translations')
            : '';

        $import = ($route == 'translation_import'
            || $route == 'translation_import_process');
        $tabs[getlocal('Translations import')] = !$import
            ? $this->generateUrl('translation_import')
            : '';

        $export = ($route == 'translation_export'
            || $route == 'translation_export_process');
        $tabs[getlocal('Translations export')] = !$export
            ? $this->generateUrl('translation_export')
            : '';

        $tabs[getlocal('Locales')] = ($route != 'locales')
            ? $this->generateUrl('locales')
            : '';

        return $tabs;
    }
开发者ID:nico13051995,项目名称:IntITA,代码行数:34,代码来源:AbstractController.php


示例3: 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


示例4: 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


示例5: 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


示例6: tpl_menu

function tpl_menu()
{
    global $page, $webimroot, $errors, $current_locale;
    ?>
			<li>
				<h2><b><?php 
    echo getlocal("lang.choose");
    ?>
</b></h2>
				<ul class="locales">
<?php 
    foreach ($page['localeLinks'] as $id => $title) {
        ?>
					<li<?php 
        menuloc($id);
        ?>
 ><a href='?locale=<?php 
        echo $id;
        ?>
'><?php 
        echo $title;
        ?>
</a></li>
<?php 
    }
    ?>
				</ul>
			</li>
<?php 
}
开发者ID:paulcn,项目名称:mibew,代码行数:30,代码来源:inc_locales.php


示例7: 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


示例8: runUpdateAction

 /**
  * Runs the Updater.
  *
  * @param Request $request Incoming request.
  * @return Response|string Rendered page contents or Symfony's response
  *   object.
  */
 public function runUpdateAction(Request $request)
 {
     $upd = $this->getUpdater();
     $upd->run();
     $parameters = array('version' => MIBEW_VERSION, 'fixedwrap' => true, 'title' => getlocal('Update'), 'done' => $this->getUpdater()->getLog(), 'errors' => $this->getUpdater()->getErrors());
     return $this->render('update_progress', $parameters);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:14,代码来源:UpdateController.php


示例9: 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


示例10: tpl_menu

function tpl_menu()
{
    global $page, $mibewroot, $errors, $current_locale;
    ?>
			<li>
				<h2><b><?php 
    echo getlocal("lang.choose");
    ?>
</b></h2>
				<ul class="locales">
<?php 
    foreach ($page['localeLinks'] as $id => $title) {
        ?>
					<li<?php 
        menuloc($id);
        ?>
 ><a href="?locale=<?php 
        echo urlencode($id);
        ?>
"><?php 
        echo safe_htmlspecialchars($title);
        ?>
</a></li>
<?php 
    }
    ?>
				</ul>
			</li>
<?php 
}
开发者ID:kuell,项目名称:chat,代码行数:30,代码来源:inc_locales.php


示例11: execute

 /**
  * {@inheritdoc}
  */
 public function execute(Template $template, Context $context, $args, $source)
 {
     // Check if there is at least one argument
     $parsed_arguments = $template->parseArguments($args);
     if (count($parsed_arguments) == 0) {
         throw new \InvalidArgumentException('"l10n" helper expects at least one argument.');
     }
     $text = $context->get(array_shift($parsed_arguments));
     // We need to escape extra arguments passed to the helper. Thus we need
     // to get escape function and its arguments from the template engine.
     $escape_func = $template->getEngine()->getEscape();
     $escape_args = $template->getEngine()->getEscapeArgs();
     // Check if there are any other arguments passed into helper and escape
     // them.
     $local_args = array();
     foreach ($parsed_arguments as $parsed_argument) {
         // Get locale argument string and add it to escape function
         // arguments.
         array_unshift($escape_args, $context->get($parsed_argument));
         // Escape locale argument's value
         $local_args[] = call_user_func_array($escape_func, array_values($escape_args));
         // Remove locale argument's value from escape function argument
         array_shift($escape_args);
     }
     $result = getlocal($text, $local_args);
     return new SafeString($result);
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:30,代码来源:L10nHelper.php


示例12: 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


示例13: setup_group_settings_tabs

function setup_group_settings_tabs($gid, $active)
{
    global $page, $webimroot, $settings;
    if ($gid) {
        $page['tabs'] = array(getlocal("page_group.tab.main") => $active != 0 ? "{$webimroot}/operator/group.php?gid={$gid}" : "", getlocal("page_group.tab.members") => $active != 1 ? "{$webimroot}/operator/groupmembers.php?gid={$gid}" : "");
    } else {
        $page['tabs'] = array();
    }
}
开发者ID:laiello,项目名称:cartonbank,代码行数:9,代码来源:groups.php


示例14: setup_group_settings_tabs

function setup_group_settings_tabs($gid, $active)
{
    global $page, $webimroot, $settings;
    if ($gid) {
        $page['tabselected'] = $active;
        $page['tabs'] = array(array('title' => getlocal("page_group.tab.main"), 'link' => "{$webimroot}/operator/group.php?gid={$gid}"), array('title' => getlocal("page_group.tab.members"), 'link' => "{$webimroot}/operator/groupmembers.php?gid={$gid}"));
    } else {
        $page['tabs'] = array();
    }
}
开发者ID:paulcn,项目名称:mibew,代码行数:10,代码来源:groups.php


示例15: buildTabs

 /**
  * Builds list of the styles tabs.
  *
  * @param Request $request Current request.
  * @return array Tabs list. The keys of the array are tabs titles and the
  *   values are tabs URLs.
  */
 protected function buildTabs(Request $request)
 {
     $tabs = array();
     $type = $request->attributes->get('type');
     $tabs[getlocal("Operator pages themes preview")] = $type != self::TYPE_PAGE ? $this->generateUrl('style_preview', array('type' => self::TYPE_PAGE)) : '';
     $tabs[getlocal("Chat themes preview")] = $type != self::TYPE_CHAT ? $this->generateUrl('style_preview', array('type' => self::TYPE_CHAT)) : '';
     if (Settings::get('enabletracking')) {
         $tabs[getlocal("Invitation themes preview")] = $type != self::TYPE_INVITATION ? $this->generateUrl('style_preview', array('type' => self::TYPE_INVITATION)) : '';
     }
     return $tabs;
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:18,代码来源:StyleController.php


示例16: buildTabs

 /**
  * Builds list of the group tabs.
  *
  * @param Request $request Current request.
  * @return array Tabs list. The keys of the array are tabs titles and the
  *   values are tabs URLs.
  */
 protected function buildTabs(Request $request)
 {
     $tabs = array();
     $route = $request->attributes->get('_route');
     $group_id = $request->attributes->get('group_id', false);
     $args = array('group_id' => $group_id);
     if ($group_id) {
         $tabs[getlocal('General')] = $route == 'group_members' ? $this->generateUrl('group_edit', $args) : '';
         $tabs[getlocal('Members')] = $route != 'group_members' ? $this->generateUrl('group_members', $args) : '';
     }
     return $tabs;
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:19,代码来源:AbstractController.php


示例17: tpl_content

function tpl_content()
{
    global $page, $webimroot, $errors;
    ?>

<?php 
    require_once 'inc_errors.php';
    echo getlocal("install.err.back");
    ?>

<?php 
}
开发者ID:laiello,项目名称:cartonbank,代码行数:12,代码来源:install_err.php


示例18: getAvailableUpdates

 /**
  * Builds list of available updates to display in the template.
  *
  * @return array List of updates data. Each item of the list is associative
  * array with the following keys:
  *   - "title": string, title of the update.
  *   - "version": string, the latest available version.
  *   - "url": string, URL of the page the updated version can be downloaded
  *     from.
  *   - "description": string, description of the update.
  */
 protected function getAvailableUpdates()
 {
     $updates = AvailableUpdate::all();
     if (!$updates) {
         return array();
     }
     $data = array();
     foreach ($updates as $update) {
         $title = $update->target == 'core' ? 'Mibew' : getlocal('{0} plugin', array($update->target));
         $data[] = array('title' => $title, 'version' => $update->version, 'url' => $update->url, 'description' => $update->description);
     }
     return $data;
 }
开发者ID:abhijitroy07,项目名称:mibew,代码行数:24,代码来源:AboutController.php


示例19: setup_operator_settings_tabs

function setup_operator_settings_tabs($opId, $active)
{
    global $page, $webimroot, $settings;
    loadsettings();
    if ($opId) {
        if ($settings['enablegroups'] == '1') {
            $page['tabs'] = array(getlocal("page_agent.tab.main") => $active != 0 ? "{$webimroot}/operator/operator.php?op={$opId}" : "", getlocal("page_agent.tab.avatar") => $active != 1 ? "{$webimroot}/operator/avatar.php?op={$opId}" : "", getlocal("page_agent.tab.groups") => $active != 2 ? "{$webimroot}/operator/opgroups.php?op={$opId}" : "", getlocal("page_agent.tab.permissions") => $active != 3 ? "{$webimroot}/operator/permissions.php?op={$opId}" : "");
        } else {
            $page['tabs'] = array(getlocal("page_agent.tab.main") => $active != 0 ? "{$webimroot}/operator/operator.php?op={$opId}" : "", getlocal("page_agent.tab.avatar") => $active != 1 ? "{$webimroot}/operator/avatar.php?op={$opId}" : "", getlocal("page_agent.tab.permissions") => $active != 3 ? "{$webimroot}/operator/permissions.php?op={$opId}" : "");
        }
    } else {
        $page['tabs'] = array();
    }
}
开发者ID:laiello,项目名称:cartonbank,代码行数:14,代码来源:operator_settings.php


示例20: get_groups_list

function get_groups_list()
{
    global $settings;
    $result = array();
    if ($settings['enablegroups'] == '1') {
        $link = connect();
        $allgroups = get_all_groups($link);
        mysql_close($link);
        $result[] = array('groupid' => '', 'vclocalname' => getlocal("page.gen_button.default_group"));
        foreach ($allgroups as $g) {
            $result[] = $g;
        }
    }
    return $result;
}
开发者ID:kuell,项目名称:chat,代码行数:15,代码来源:getcode.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getlocale函数代码示例发布时间:2022-05-15
下一篇:
PHP getlist函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap