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


PHP GetDefaultLocale函数代码示例

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


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

示例1: __construct

    function __construct($args)
    {
        $this->args = $args;
        $this->site = new MgSiteConnection();
        $this->site->Open(new MgUserInformation($args['SESSION']));

        SetLocalizedFilesPath(GetLocalizationPath());
        if(isset($_REQUEST['LOCALE'])) {
            $locale = $_REQUEST['LOCALE'];
        } else {
            $locale = GetDefaultLocale();
        }

        $equalToLocal = GetLocalizedString('QUERYEQUALTO', $locale );
        $notEqualToLocal = GetLocalizedString('QUERYNOTEQUALTO', $locale );
        $greatThanLocal = GetLocalizedString('QUERYGREATTHAN', $locale );
        $greatThanEqualLocal = GetLocalizedString('QUERYGREATTHANEQUAL', $locale );
        $lessThanLocal = GetLocalizedString('QUERYLESSTHAN', $locale );
        $lessThanEqualLocal = GetLocalizedString('QUERYLESSTHANEQUAL', $locale );
        $beginLocal = GetLocalizedString('QUERYBEGIN', $locale );
        $containsLocal = GetLocalizedString('QUERYCONTAINS', $locale );

        $this->numOperators = array($equalToLocal, $notEqualToLocal, $greatThanLocal, $greatThanEqualLocal, $lessThanLocal, $lessThanEqualLocal);
        $this->numExpressions = array(' = %s', ' != %s', ' > %s', ' >= %s', ' < %s', ' <= %s');

        $this->strOperators = array($beginLocal, $containsLocal, $equalToLocal);
        $this->strExpressions = array(" like '%s%%'", " like '%%%s%%'", " = '%s'");
    }
开发者ID:ranyaof,项目名称:gismaster,代码行数:28,代码来源:query.php

示例2: GetDefaultLocale

//
//  This library is free software; you can redistribute it and/or
//  modify it under the terms of version 2.1 of the GNU Lesser
//  General Public License as published by the Free Software Foundation.
//
//  This library is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//  Lesser General Public License for more details.
//
//  You should have received a copy of the GNU Lesser General Public
//  License along with this library; if not, write to the Free Software
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
include 'common.php';
include 'constants.php';
$locale = GetDefaultLocale();
$scaleDenominator;
$annotations;
$args = GetRequestMethod();
GetParameters($args);
$templ = file_get_contents("../viewerfiles/quickplotpreviewinner.templ");
SetLocalizedFilesPath(GetLocalizationPath());
// Localize the page
$templ = Localize($templ, $locale, GetClientOS());
// Set some annotation labels in the page by replacing the placeholders in the html code
$templ = str_replace(array_keys($annotations), array_values($annotations), $templ);
// Set the date annotation according to its format mask
$pattern = "/\\{date:.*\\[php=(.+?)\\].+?\\}/";
$matches = array();
if (preg_match($pattern, $templ, $matches)) {
    $mask = $matches[1];
开发者ID:kanbang,项目名称:Colt,代码行数:31,代码来源:quickplotpreviewinner.php

示例3: ValidateLocaleString

function ValidateLocaleString($proposedLocaleString)
{
    // aa or aa-aa
    $validLocaleString = GetDefaultLocale();
    // Default
    if ($proposedLocaleString != null && (preg_match('/^[A-Za-z]{2}$/', $proposedLocaleString) || preg_match('/^[A-Za-z]{2}-[A-Za-z]{2}$/', $proposedLocaleString))) {
        $validLocaleString = $proposedLocaleString;
    }
    return $validLocaleString;
}
开发者ID:kanbang,项目名称:Colt,代码行数:10,代码来源:common.php

示例4: InitializeWebTier

Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-->

<head>
<title>PHP Test</title>
</head>
<body>

<?php 
include 'common.php';
echo "<b>Server Admin Service Tests</b><p>";
// Initialize web tier with the site configuration file.
InitializeWebTier();
$cred = new MgUserInformation();
$cred->SetMgUsernamePassword("Administrator", "admin");
$cred->SetLocale(GetDefaultLocale());
$cred->SetClientIp(GetClientIp());
$cred->SetClientAgent(GetClientAgent());
$serverAdmin = new MgServerAdmin();
$serverAdmin->Open("localhost", $cred);
$operation = $_GET['OPERATION'];
//Get all information properties
$infoProp = $serverAdmin->GetInformationProperties();
try {
    switch ($operation) {
        case "ONLINE":
            $serverAdmin->BringOnline();
            if ($serverAdmin->IsOnline()) {
                echo "Server online<p>";
            } else {
                echo "Server offline<p>";
开发者ID:kanbang,项目名称:Colt,代码行数:31,代码来源:serveradminhelper.php


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