本文整理汇总了PHP中Lang::getLang方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::getLang方法的具体用法?PHP Lang::getLang怎么用?PHP Lang::getLang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::getLang方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: picker
public static function picker()
{
global $activeLang;
//pr($activeLang);
if (count($activeLang) > 1) {
$get = Init::returnGet();
global $init;
$in = array();
global $mainClass;
// global $pageClass;
// global $usePage;
foreach ($init->params as $ll) {
if ($ll == $mainClass) {
continue;
}
// if($usePage && $ll == $pageClass)
// continue;
$in[] = $ll;
}
$imp = implode("/", $in);
?>
<select id="gantibhs" class="form-control" onchange="gantiLang();">
<?php
foreach ($activeLang as $lng) {
?>
<option value="<?php
echo $lng;
?>
" <?php
if (Lang::getLang() == $lng) {
echo "selected";
}
?>
><?php
echo strtoupper($lng);
?>
</option>
<?php
}
?>
</select>
<script>
function gantiLang(){
var slc = $('#gantibhs').val();
document.location = '<?php
echo _SPPATH;
?>
'+slc+'/<?php
echo $imp . $get;
?>
';
}
</script>
<?php
}
}
示例2: Init
//echo $file;echo "<br>";
require_once $file;
}
// include db setting, web setting, and paths
require_once 'include/access.php';
$init = new Init($mainClass, $DbSetting, $WebSetting, $timezone, $js, $css, $nameSpaceForApps);
//starting the session
session_start();
//pr($WebSetting);
//Init Languange
$lang = new Lang($WebSetting['lang']);
$lang->activateLangSession();
$lang->activateGetSetLang();
//pr($lang);
//pr($_SESSION);
$selected_lang = Lang::getLang();
if (!isset($selected_lang) || $selected_lang == "" || is_object($selected_lang)) {
$selected_lang = "en";
}
//pr($selected_lang);
//echo "lang/".strtolower($selected_lang).".php";
require_once "lang/" . strtolower($selected_lang) . ".php";
//get globals
$db = $init->getDB();
$params = $init->getParams();
$template = $init->getTemplate();
//theme selection
if (strpos($_GET['url'], 'EfiHome') !== false || $_GET['url'] == "index") {
$themepath = 'adminlte2';
} else {
$themepath = ThemeItem::getTheme();
示例3: activateGetSetLang
public function activateGetSetLang()
{
if (isset($_GET['setlang'])) {
$_SESSION['lang'] = $_GET['setlang'];
//lempar
global $init;
if (count($init->activeLang) > 0) {
if (in_array($init->params[0], $init->activeLang)) {
unset($init->params[0]);
$init->params = array_values($init->params);
}
$selected_lang = Lang::getLang();
$imp = implode("/", $init->params);
$get = \Init::returnGet();
header("Location:" . _SPPATH . $selected_lang . "/" . $imp . $get);
exit;
}
} else {
global $init;
if (count($init->activeLang) > 0) {
if (in_array($init->params[0], $init->activeLang)) {
$_SESSION['lang'] = $init->params[0];
}
}
}
}
示例4: buildConfigFile
private function buildConfigFile()
{
$this->bootFramework();
$this->rewriter->toFile($this->configDirectory . '/app.php', array('url' => $this->getBaseUrl(), 'locale' => Lang::getLang(), 'key' => $this->post('encryption_code', 'ChangeMe!123')));
$activeTheme = $this->post('active_theme');
if ($activeTheme) {
$activeTheme = strtolower(str_replace('.', '-', $activeTheme));
} else {
$activeTheme = 'demo';
}
$this->rewriter->toFile($this->configDirectory . '/cms.php', array('activeTheme' => $activeTheme, 'backendUri' => $this->post('backend_uri', '/backend'), 'defaultMask.file' => $this->post('file_mask', '777'), 'defaultMask.folder' => $this->post('folder_mask', '777')));
$this->rewriter->toFile($this->configDirectory . '/database.php', $this->getDatabaseConfigValues());
}
示例5: outputCached
public function outputCached($filename, $contentType = "text/html", $encoding = "utf-8")
{
while (ob_get_length()) {
ob_end_clean();
}
header("Content-Type: {$contentType};charset={$encoding}");
$cache = Cache::Priv(sha1(json_encode(array($filename, Lang::getLang(), $this->params))), ".html");
if ($cache->exists()) {
echo $cache->getContents();
Output::finish();
}
$content = $this->parse($filename);
$cache->setContents($content);
echo $content;
Output::finish();
}
示例6: setLangPath
public function setLangPath($WebSetting)
{
$selected_lang = "";
if (count($this->activeLang) > 0) {
$selected_lang = Lang::getLang() . "/";
}
define('_LANGPATH', $WebSetting['folder'] . $selected_lang);
}
示例7: id
public function id($args)
{
// pr($args);
/*
* begin the calculation
*/
$url = addslashes($_GET['jurusan']);
// echo $url;
global $activeLang;
// pr($activeLang);
$langtext = "";
if (count($activeLang) > 0) {
$sl = Lang::getLang();
$langtext = "AND post_lang = '{$sl}'";
}
// echo $langtext;
$pg = new Page();
$arrPage = $pg->getWhere("post_url = '{$url}' AND post_status = 'publish' {$langtext}");
$pg = $arrPage[0];
//pr($arrPage);
if ($pg->post_url == "") {
$pg = new Page();
$arrPage = $pg->getWhere("post_url = '{$url}' AND post_status = 'publish'");
if (count($arrPage) > 0) {
$pg = $arrPage[0];
if ($pg->post_link == "" || $pg->post_link == '0') {
?>
<div class="alert alert-warning language_disclaimer" role="alert">
<?php
echo Efiwebsetting::getData('Language_Disclaimer');
?>
</div>
<?php
}
} else {
Redirect::p404();
}
}
// Redirect::p404();
//die('die');
//pr($pg);
$page = $pg;
// isi semua meta tag dan title
$this->isiMeta($pg);
$json = "";
if ($pg->post_attachments != "") {
$json = json_decode(stripslashes($pg->post_attachments));
}
//pr($json);
if ($pg->post_attachment_order == "") {
$pa = \Efiwebsetting::getData('PageAttachment');
} else {
$pa = $pg->post_attachment_order;
}
$exp = explode(",", $pa);
$dimatikan_animasi_header = 1;
foreach ($exp as $p) {
if ($p == "Page") {
if ($pg->post_link != "" && $pg->post_link != '0') {
$_SESSION['pageObj'] = $page;
//kalau ada link
$arrSp = Registor::getFeatureStartPage();
list($cname, $fname) = $arrSp[$pg->post_link];
$new = new $cname();
$new->{$fname}();
} else {
$arr['page'] = $page;
$arr['dimatikan_animasi_header'] = $dimatikan_animasi_header;
$layout_id = "Page_id";
$file = Layout::getFile($layout_id);
Mold::theme("Pages/" . $layout_id . "/" . $file, $arr);
}
} else {
if (array_key_exists($p, $json) && $json->{$p} > 0) {
$paralax = new $p();
$paralax->viewme($json->{$p}, "Page", $page->ID);
if (contains($p, array("Parallax", "Carousel"))) {
$dimatikan_animasi_header = 0;
}
}
}
}
//
// //cek Parallax plg atas
// if(array_key_exists("ParallaxModel",$json) && $json->ParallaxModel>0){
// $paralax = new ParallaxModel();
// $paralax->viewme($json->ParallaxModel);
// $dimatikan_animasi_header = 0;
// }
//
// //cek carousel
// if(array_key_exists("GalleryCarousel__view",$json) && $json->GalleryCarousel__view>0){
// $cr = new GalleryCarousel();
// $cr->viewme($json->GalleryCarousel__view);
// $dimatikan_animasi_header = 0;
// }
//
//
//
// if(array_key_exists("Gallery__view",$json)&&$json->Gallery__view>0){
//.........这里部分代码省略.........