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


PHP LangSubst函数代码示例

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


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

示例1: __IncludeLang

 public static function __IncludeLang($filePath, $fileName, $lang = false)
 {
     if ($lang === false) {
         $lang = LANGUAGE_ID;
     }
     if ($lang != "en" && $lang != "ru") {
         if (file_exists($fname = $_SERVER["DOCUMENT_ROOT"] . $filePath . "/lang/" . LangSubst($lang) . "/" . $fileName)) {
             __IncludeLang($fname);
         }
     }
     if (file_exists($fname = $_SERVER["DOCUMENT_ROOT"] . $filePath . "/lang/" . $lang . "/" . $fileName)) {
         __IncludeLang($fname);
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:14,代码来源:component_util.php

示例2: IncludeModuleLangFile

function IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
{
	global $BX_DOC_ROOT;
	$filepath = rtrim(preg_replace("'[\\\\/]+'", "/", $filepath), "/ ");
	$module_path = "/modules/";
	if(strpos($filepath, $module_path) !== false)
	{
		$pos = strlen($filepath) - strpos(strrev($filepath), strrev($module_path));
		$rel_path = substr($filepath, $pos);
		$p = strpos($rel_path, "/");
		if(!$p)
			return false;

		$module_name = substr($rel_path, 0, $p);
		$rel_path = substr($rel_path, $p+1);
		$module_path = $BX_DOC_ROOT.BX_ROOT.$module_path.$module_name;
	}
	elseif(strpos($filepath, "/.last_version/") !== false)
	{
		$pos = strlen($filepath) - strpos(strrev($filepath), strrev("/.last_version/"));
		$rel_path = substr($filepath, $pos);
		$module_path = substr($filepath, 0, $pos-1);
	}
	else
	{
		return false;
	}

	if($lang === false)
		$lang = LANGUAGE_ID;

	$arMess = array();
	if(file_exists(($fname = $module_path."/lang/".$lang."/".$rel_path)))
	{
		if($lang <> "en" && $lang <> "ru")
			$arMess = __IncludeLang($module_path."/lang/".LangSubst($lang)."/".$rel_path, $bReturnArray);

		$msg = __IncludeLang($fname, $bReturnArray, true);
		if(is_array($msg))
			$arMess = array_merge($arMess, $msg);
	}
	elseif(file_exists(($fname = $module_path."/lang/".LangSubst($lang)."/".$rel_path)))
	{
		$arMess = __IncludeLang($fname, $bReturnArray, true);
	}
	if($bReturnArray)
		return $arMess;
	return true;
}
开发者ID:nProfessor,项目名称:Mytb,代码行数:49,代码来源:tools.php

示例3: IncludeWizardLang

	function IncludeWizardLang($relativePath = "", $lang = false)
	{
		if ($lang === false)
			$lang = LANGUAGE_ID;

		$wizardPath = $_SERVER["DOCUMENT_ROOT"].$this->path;

		if ($lang != "en" && $lang != "ru")
		{
			if (file_exists(($fname = $wizardPath."/lang/".LangSubst($lang)."/".$relativePath)))
				__IncludeLang($fname, false, true);
		}

		if (file_exists(($fname = $wizardPath."/lang/".$lang."/".$relativePath)))
			__IncludeLang($fname, false, true);
	}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:16,代码来源:wizard_site.php

示例4: IncludeLangFile

	function IncludeLangFile()
	{
		$arLangMessages = array();

		if($this->__folder <> '')
		{
			if(preg_match("#/([^/]*?\\.php)\$#", $this->__file, $match))
			{
				if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru")
					$arLangMessages = $this->__IncludeLangFile($_SERVER["DOCUMENT_ROOT"].$this->__folder."/lang/".LangSubst(LANGUAGE_ID)."/".$match[1]);

				$arLangMessages = $this->__IncludeLangFile($_SERVER["DOCUMENT_ROOT"].$this->__folder."/lang/".LANGUAGE_ID."/".$match[1]) + $arLangMessages;
			}
		}

		return $arLangMessages;
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:17,代码来源:component_template.php

示例5: GetList

 function GetList($arOrder = array(), $arFilter = array(), $arSelect = false)
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     if (isset($arFilter["ID"]) && !is_array($arFilter["ID"])) {
         $arFilter["ID"] = array($arFilter["ID"]);
     }
     $arRes = array();
     $path = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates";
     $handle = opendir($path);
     if ($handle) {
         while (($file = readdir($handle)) !== false) {
             if ($file == "." || $file == ".." || !is_dir($path . "/" . $file)) {
                 continue;
             }
             if ($file == ".default") {
                 continue;
             }
             if (isset($arFilter["ID"]) && !in_array($file, $arFilter["ID"])) {
                 continue;
             }
             $arTemplate = array("DESCRIPTION" => "");
             if (file_exists($fname = $path . "/" . $file . "/lang/" . LANGUAGE_ID . "/description.php")) {
                 __IncludeLang($fname, false, true);
             } elseif (file_exists($fname = $path . "/" . $file . "/lang/" . LangSubst(LANGUAGE_ID) . "/description.php")) {
                 __IncludeLang($fname, false, true);
             }
             if (file_exists($fname = $path . "/" . $file . "/description.php")) {
                 include $fname;
             }
             $arTemplate["ID"] = $file;
             if (!isset($arTemplate["NAME"])) {
                 $arTemplate["NAME"] = $file;
             }
             if ($arSelect === false || in_array("SCREENSHOT", $arSelect)) {
                 if (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $file . "/lang/" . LANGUAGE_ID . "/screen.gif")) {
                     $arTemplate["SCREENSHOT"] = BX_PERSONAL_ROOT . "/templates/" . $file . "/lang/" . LANGUAGE_ID . "/screen.gif";
                 } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $file . "/screen.gif")) {
                     $arTemplate["SCREENSHOT"] = BX_PERSONAL_ROOT . "/templates/" . $file . "/screen.gif";
                 } else {
                     $arTemplate["SCREENSHOT"] = false;
                 }
                 if (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $file . "/lang/" . LANGUAGE_ID . "/preview.gif")) {
                     $arTemplate["PREVIEW"] = BX_PERSONAL_ROOT . "/templates/" . $file . "/lang/" . LANGUAGE_ID . "/preview.gif";
                 } elseif (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $file . "/preview.gif")) {
                     $arTemplate["PREVIEW"] = BX_PERSONAL_ROOT . "/templates/" . $file . "/preview.gif";
                 } else {
                     $arTemplate["PREVIEW"] = false;
                 }
             }
             if ($arSelect === false || in_array("CONTENT", $arSelect)) {
                 $arTemplate["CONTENT"] = $APPLICATION->GetFileContent($path . "/" . $file . "/header.php") . "#WORK_AREA#" . $APPLICATION->GetFileContent($path . "/" . $file . "/footer.php");
             }
             if ($arSelect === false || in_array("STYLES", $arSelect)) {
                 if (file_exists($path . "/" . $file . "/styles.css")) {
                     $arTemplate["STYLES"] = $APPLICATION->GetFileContent($path . "/" . $file . "/styles.css");
                     $arTemplate["STYLES_TITLE"] = CSiteTemplate::__GetByStylesTitle($path . "/" . $file . "/.styles.php");
                 }
                 if (file_exists($path . "/" . $file . "/template_styles.css")) {
                     $arTemplate["TEMPLATE_STYLES"] = $APPLICATION->GetFileContent($path . "/" . $file . "/template_styles.css");
                 }
             }
             $arRes[] = $arTemplate;
         }
         closedir($handle);
     }
     $db_res = new CDBResult();
     $db_res->InitFromArray($arRes);
     return $db_res;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:70,代码来源:main.php

示例6: IncludeLangFile

 public static function IncludeLangFile($filepath)
 {
     $file = basename($filepath);
     $dir = dirname($filepath);
     if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru" && file_exists($fname = $dir . "/lang/" . LangSubst(LANGUAGE_ID) . "/" . $file)) {
         __IncludeLang($fname, false, true);
     }
     if (file_exists($fname = $dir . "/lang/" . LANGUAGE_ID . "/" . $file)) {
         __IncludeLang($fname, false, true);
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:11,代码来源:admin_tools.php

示例7: GetWizardList

 function GetWizardList($filterNamespace = false, $bLoadFromModules = false)
 {
     $arWizards = array();
     $arLoadedWizards = array();
     $wizardPath = $_SERVER["DOCUMENT_ROOT"] . CWizardUtil::GetRepositoryPath();
     if ($handle = @opendir($wizardPath)) {
         while (($dirName = readdir($handle)) !== false) {
             if ($dirName == "." || $dirName == ".." || !is_dir($wizardPath . "/" . $dirName)) {
                 continue;
             }
             if (file_exists($wizardPath . "/" . $dirName . "/.description.php")) {
                 //Skip component without namespace
                 if ($filterNamespace !== false && strlen($filterNamespace) > 0) {
                     continue;
                 }
                 if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru") {
                     if (file_exists($fname = $wizardPath . "/" . $dirName . "/lang/" . LangSubst(LANGUAGE_ID) . "/.description.php")) {
                         __IncludeLang($fname, false, true);
                     }
                 }
                 if (file_exists($fname = $wizardPath . "/" . $dirName . "/lang/" . LANGUAGE_ID . "/.description.php")) {
                     __IncludeLang($fname, false, true);
                 }
                 $arWizardDescription = array();
                 include $wizardPath . "/" . $dirName . "/.description.php";
                 $arWizards[] = array("ID" => $dirName) + $arWizardDescription;
                 $arLoadedWizards[] = $dirName;
             } else {
                 if ($filterNamespace !== false && (strlen($filterNamespace) <= 0 || $filterNamespace != $dirName)) {
                     continue;
                 }
                 if ($nspaceHandle = @opendir($wizardPath . "/" . $dirName)) {
                     while (($file = readdir($nspaceHandle)) !== false) {
                         $pathToWizard = $wizardPath . "/" . $dirName . "/" . $file;
                         if ($file == "." || $file == ".." || !is_dir($pathToWizard)) {
                             continue;
                         }
                         if (file_exists($pathToWizard . "/.description.php")) {
                             if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru") {
                                 if (file_exists($fname = $pathToWizard . "/lang/" . LangSubst(LANGUAGE_ID) . "/.description.php")) {
                                     __IncludeLang($fname, false, true);
                                 }
                             }
                             if (file_exists($fname = $pathToWizard . "/lang/" . LANGUAGE_ID . "/.description.php")) {
                                 __IncludeLang($fname, false, true);
                             }
                             $arWizardDescription = array();
                             include $pathToWizard . "/.description.php";
                             $arWizards[] = array("ID" => $dirName . ":" . $file) + $arWizardDescription;
                             $arLoadedWizards[] = $dirName . ":" . $file;
                         }
                     }
                     @closedir($nspaceHandle);
                 }
             }
         }
         @closedir($handle);
     }
     if ($bLoadFromModules) {
         $modulesPath = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules";
         if ($handle = @opendir($modulesPath)) {
             while (($moduleName = readdir($handle)) !== false) {
                 if ($moduleName == "." || $moduleName == ".." || !is_dir($modulesPath . "/" . $moduleName)) {
                     continue;
                 }
                 if (!file_exists($modulesPath . "/" . $moduleName . "/install/wizards")) {
                     continue;
                 }
                 if ($handle1 = @opendir($modulesPath . "/" . $moduleName . "/install/wizards")) {
                     while (($dirName = readdir($handle1)) !== false) {
                         if ($dirName == "." || $dirName == ".." || !is_dir($modulesPath . "/" . $moduleName . "/install/wizards/" . $dirName)) {
                             continue;
                         }
                         if ($filterNamespace !== false && (strlen($filterNamespace) <= 0 || $filterNamespace != $dirName)) {
                             continue;
                         }
                         if ($handle2 = @opendir($modulesPath . "/" . $moduleName . "/install/wizards/" . $dirName)) {
                             while (($file = readdir($handle2)) !== false) {
                                 $pathToWizard = $modulesPath . "/" . $moduleName . "/install/wizards/" . $dirName . "/" . $file;
                                 if ($file == "." || $file == ".." || !is_dir($pathToWizard)) {
                                     continue;
                                 }
                                 if (in_array($dirName . ":" . $file, $arLoadedWizards)) {
                                     continue;
                                 }
                                 if (file_exists($pathToWizard . "/.description.php")) {
                                     if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru") {
                                         if (file_exists($fname = $pathToWizard . "/lang/" . LangSubst(LANGUAGE_ID) . "/.description.php")) {
                                             __IncludeLang($fname, false, true);
                                         }
                                     }
                                     if (file_exists($fname = $pathToWizard . "/lang/" . LANGUAGE_ID . "/.description.php")) {
                                         __IncludeLang($fname, false, true);
                                     }
                                     $arWizardDescription = array();
                                     include $pathToWizard . "/.description.php";
                                     $arWizards[] = array("ID" => $moduleName . ":" . $dirName . ":" . $file) + $arWizardDescription;
                                     $arLoadedWizards[] = $dirName . ":" . $file;
                                 }
                             }
//.........这里部分代码省略.........
开发者ID:spas-viktor,项目名称:books,代码行数:101,代码来源:wizard_util.php

示例8: GetThemes

 function GetThemes($relativePath)
 {
     $arThemes = array();
     if (!is_dir($_SERVER["DOCUMENT_ROOT"] . $relativePath)) {
         return $arThemes;
     }
     $themePath = $_SERVER["DOCUMENT_ROOT"] . $relativePath;
     $themePath = str_replace("\\", "/", $themePath);
     if ($handle = @opendir($themePath)) {
         while (($file = readdir($handle)) !== false) {
             if ($file == "." || $file == ".." || !is_dir($themePath . "/" . $file)) {
                 continue;
             }
             $arTemplate = array();
             if (is_file($themePath . "/" . $file . "/description.php")) {
                 if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru") {
                     if (file_exists($fname = $themePath . "/" . $file . "/lang/" . LangSubst(LANGUAGE_ID) . "/description.php")) {
                         __IncludeLang($fname);
                     }
                 }
                 if (file_exists($fname = $themePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/description.php")) {
                     __IncludeLang($fname);
                 }
                 @(include $themePath . "/" . $file . "/description.php");
             }
             $arTheme = array("ID" => $file, "SORT" => isset($arTemplate["SORT"]) && intval($arTemplate["SORT"]) > 0 ? intval($arTemplate["SORT"]) : 10, "NAME" => isset($arTemplate["NAME"]) ? $arTemplate["NAME"] : $file);
             if (file_exists($themePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/small.png")) {
                 $arTheme["PREVIEW"] = $relativePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/small.png";
             } elseif (file_exists($themePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/preview.gif")) {
                 $arTheme["PREVIEW"] = $relativePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/preview.gif";
             } elseif (file_exists($themePath . "/" . $file . "/small.png")) {
                 $arTheme["PREVIEW"] = $relativePath . "/" . $file . "/small.png";
             } elseif (file_exists($themePath . "/" . $file . "/preview.gif")) {
                 $arTheme["PREVIEW"] = $relativePath . "/" . $file . "/preview.gif";
             } else {
                 $arTheme["PREVIEW"] = false;
             }
             if (file_exists($themePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/big.png")) {
                 $arTheme["SCREENSHOT"] = $relativePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/big.png";
             } elseif (file_exists($themePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/screen.gif")) {
                 $arTheme["SCREENSHOT"] = $relativePath . "/" . $file . "/lang/" . LANGUAGE_ID . "/screen.gif";
             } elseif (file_exists($themePath . "/" . $file . "/big.png")) {
                 $arTheme["SCREENSHOT"] = $relativePath . "/" . $file . "/big.png";
             } elseif (file_exists($themePath . "/" . $file . "/screen.gif")) {
                 $arTheme["SCREENSHOT"] = $relativePath . "/" . $file . "/screen.gif";
             } else {
                 $arTheme["SCREENSHOT"] = false;
             }
             $arThemes[$file] = $arTemplate + $arTheme;
         }
         @closedir($handle);
     }
     uasort($arThemes, create_function('$a, $b', 'return strcmp($a["SORT"], $b["SORT"]);'));
     return $arThemes;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:55,代码来源:utils.php

示例9: define

<?php

define("STOP_STATISTICS", true);
define("NOT_CHECK_PERMISSIONS", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
if ($_SERVER["REQUEST_METHOD"] == "POST" && check_bitrix_sessid() && isset($_POST["siteId"]) && ctype_alnum($_POST["siteId"]) && strlen($_POST["siteId"]) == 2) {
    $path = realpath(dirname(__FILE__));
    require_once "{$path}/../../class.php";
    $cart = new SaleBasketLineComponent();
    $cart->initComponent('bitrix:sale.basket.basket.line');
    $cart->includeComponentLang();
    $lang = LangSubst(LANGUAGE_ID);
    __IncludeLang("{$path}/lang/{$lang}/template.php");
    //	IncludeTemplateLangFile(__FILE__);
    $APPLICATION->RestartBuffer();
    header('Content-Type: text/html; charset=' . LANG_CHARSET);
    $cart->executeAjax($_POST["siteId"]);
    die;
}
开发者ID:Satariall,项目名称:izurit,代码行数:19,代码来源:ajax.php

示例10: includeComponentLang

 /**
  * Function includes language files from within the component directory.
  *
  * <p>For example: $this->includeComponentLang("ajax.php") will include "lang/en/ajax.php" file. </p>
  * <p>Note: component must be inited by initComponent method.</p>
  * @param string $relativePath
  * @param string|bool $lang
  * @return void
  *
  */
 public final function includeComponentLang($relativePath = "", $lang = false)
 {
     static $messCache = array();
     if (!$this->__bInited) {
         return null;
     }
     if ($relativePath == "") {
         $relativePath = "component.php";
     }
     if ($lang === false) {
         $lang = LANGUAGE_ID;
     }
     $path = $this->__path . "/lang/" . $lang . "/" . $relativePath;
     if (!isset($messCache[$path])) {
         $messCache[$path] = array();
         $langSubst = LangSubst($lang);
         if ($lang != $langSubst) {
             $fname = $_SERVER["DOCUMENT_ROOT"] . $this->__path . "/lang/" . $langSubst . "/" . $relativePath;
             if (file_exists($fname)) {
                 $messCache[$path] = __IncludeLang($fname, true, true);
             }
         }
         $fname = $_SERVER["DOCUMENT_ROOT"] . $path;
         if (file_exists($fname)) {
             $messCache[$path] = __IncludeLang($fname, true, true) + $messCache[$path];
         }
     }
     if (isset($messCache[$path])) {
         global $MESS;
         foreach ($messCache[$path] as $id => $message) {
             $MESS[$id] = $message;
         }
     }
 }
开发者ID:ASDAFF,项目名称:open_bx,代码行数:44,代码来源:component.php

示例11: GetList

 function GetList($arOrder = array(), $arFilter = array(), $arSelect = false)
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     if (isset($arFilter["ID"]) && !is_array($arFilter["ID"])) {
         $arFilter["ID"] = array($arFilter["ID"]);
     }
     $folders = array("/local/templates", BX_PERSONAL_ROOT . "/templates");
     $arRes = array();
     foreach ($folders as $folder) {
         $path = $_SERVER["DOCUMENT_ROOT"] . $folder;
         if (is_dir($path)) {
             $handle = opendir($path);
             if ($handle) {
                 while (($file = readdir($handle)) !== false) {
                     if ($file == "." || $file == ".." || !is_dir($path . "/" . $file)) {
                         continue;
                     }
                     if ($file == ".default") {
                         continue;
                     }
                     if (isset($arRes[$file])) {
                         continue;
                     }
                     if (isset($arFilter["ID"]) && !in_array($file, $arFilter["ID"])) {
                         continue;
                     }
                     $arTemplate = array("DESCRIPTION" => "");
                     if (file_exists($fname = $path . "/" . $file . "/lang/" . LANGUAGE_ID . "/description.php")) {
                         __IncludeLang($fname, false, true);
                     } elseif (file_exists($fname = $path . "/" . $file . "/lang/" . LangSubst(LANGUAGE_ID) . "/description.php")) {
                         __IncludeLang($fname, false, true);
                     }
                     if (file_exists($fname = $path . "/" . $file . "/description.php")) {
                         include $fname;
                     }
                     $arTemplate["ID"] = $file;
                     $arTemplate["PATH"] = $folder . "/" . $file;
                     if (!isset($arTemplate["NAME"])) {
                         $arTemplate["NAME"] = $file;
                     }
                     if ($arSelect === false || in_array("SCREENSHOT", $arSelect)) {
                         if (file_exists($path . "/" . $file . "/lang/" . LANGUAGE_ID . "/screen.gif")) {
                             $arTemplate["SCREENSHOT"] = $folder . "/" . $file . "/lang/" . LANGUAGE_ID . "/screen.gif";
                         } elseif (file_exists($path . "/" . $file . "/screen.gif")) {
                             $arTemplate["SCREENSHOT"] = $folder . "/" . $file . "/screen.gif";
                         } else {
                             $arTemplate["SCREENSHOT"] = false;
                         }
                         if (file_exists($path . "/" . $file . "/lang/" . LANGUAGE_ID . "/preview.gif")) {
                             $arTemplate["PREVIEW"] = $folder . "/" . $file . "/lang/" . LANGUAGE_ID . "/preview.gif";
                         } elseif (file_exists($path . "/" . $file . "/preview.gif")) {
                             $arTemplate["PREVIEW"] = $folder . "/" . $file . "/preview.gif";
                         } else {
                             $arTemplate["PREVIEW"] = false;
                         }
                     }
                     if ($arSelect === false || in_array("CONTENT", $arSelect)) {
                         $arTemplate["CONTENT"] = $APPLICATION->GetFileContent($path . "/" . $file . "/header.php") . "#WORK_AREA#" . $APPLICATION->GetFileContent($path . "/" . $file . "/footer.php");
                     }
                     if ($arSelect === false || in_array("STYLES", $arSelect)) {
                         if (file_exists($path . "/" . $file . "/styles.css")) {
                             $arTemplate["STYLES"] = $APPLICATION->GetFileContent($path . "/" . $file . "/styles.css");
                             $arTemplate["STYLES_TITLE"] = CSiteTemplate::__GetByStylesTitle($path . "/" . $file . "/.styles.php");
                         }
                         if (file_exists($path . "/" . $file . "/template_styles.css")) {
                             $arTemplate["TEMPLATE_STYLES"] = $APPLICATION->GetFileContent($path . "/" . $file . "/template_styles.css");
                         }
                     }
                     $arRes[$file] = $arTemplate;
                 }
                 closedir($handle);
             }
         }
     }
     if (is_array($arOrder)) {
         $columns = array();
         static $fields = array("ID" => 1, "NAME" => 1, "DESCRIPTION" => 1, "SORT" => 1);
         foreach ($arOrder as $key => $val) {
             $key = strtoupper($key);
             if (isset($fields[$key])) {
                 $columns[$key] = strtoupper($val) == "DESC" ? SORT_DESC : SORT_ASC;
             }
         }
         if (!empty($columns)) {
             \Bitrix\Main\Type\Collection::sortByColumn($arRes, $columns);
         }
     }
     $db_res = new CDBResult();
     $db_res->InitFromArray($arRes);
     return $db_res;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:92,代码来源:site_template.php

示例12: FetchHelp

 public static function FetchHelp($componentName, $lang = false)
 {
     $cName = str_replace("..", "", $componentName);
     $cName = str_replace(":", "/", $cName);
     $lang = $lang ? preg_replace("/[^a-zA-Z0-9_]/is", "", $lang) : LANGUAGE_ID;
     $filePath = "/bitrix/components/" . $cName;
     $fileName = "help/.tooltips.php";
     $arTooltips = array();
     $fname = $_SERVER["DOCUMENT_ROOT"] . $filePath . "/lang/" . LangSubst($lang) . "/" . $fileName;
     if ($lang != "en" && $lang != "ru" && file_exists($fname)) {
         $arTooltips = __IncludeLang($fname, true, true);
     }
     $fname = $_SERVER["DOCUMENT_ROOT"] . $filePath . "/lang/" . $lang . "/" . $fileName;
     if (file_exists($fname)) {
         $arTooltips = __IncludeLang($fname, true, true);
     }
     return $arTooltips;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:18,代码来源:component_params_manager.php

示例13: _loadLang

 private static function _loadLang($lang, $bReturn, $arAdditionalMess = false)
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     $jsMsg = '';
     $mess_lang_default = array();
     $mess_lang = array();
     if ($lang) {
         $langSubst = LangSubst(LANGUAGE_ID);
         if ($langSubst != LANGUAGE_ID) {
             $lang_filename = $_SERVER['DOCUMENT_ROOT'] . str_replace("/lang/" . LANGUAGE_ID . "/", "/lang/" . $langSubst . "/", $lang);
             if (file_exists($lang_filename)) {
                 $mess_lang_default = __IncludeLang($lang_filename, true, true);
             }
         }
         $lang_filename = $_SERVER['DOCUMENT_ROOT'] . $lang;
         if (file_exists($lang_filename)) {
             $mess_lang = __IncludeLang($lang_filename, true, true);
         }
         $mess_lang = array_merge($mess_lang_default, $mess_lang);
         if (!empty($mess_lang)) {
             $jsMsg = '(window.BX||top.BX).message(' . CUtil::PhpToJSObject($mess_lang, false) . ');';
         }
     }
     if (is_array($arAdditionalMess)) {
         $jsMsg = '(window.BX||top.BX).message(' . CUtil::PhpToJSObject($arAdditionalMess, false) . ');' . $jsMsg;
     }
     if ($jsMsg !== '') {
         $jsMsg = '<script type="text/javascript">' . $jsMsg . '</script>';
         if ($bReturn) {
             return $jsMsg . "\r\n";
         } else {
             $APPLICATION->AddLangJS($jsMsg);
         }
     }
     return $jsMsg;
 }
开发者ID:gitkv,项目名称:bash,代码行数:37,代码来源:tools.php

示例14: IncludeLangFile

 function IncludeLangFile($relativePath = "", $lang = false)
 {
     $arLangMessages = array();
     if ($this->__folder != '') {
         $absPath = $_SERVER["DOCUMENT_ROOT"] . $this->__folder . "/lang/";
         if ($lang === false) {
             $lang = LANGUAGE_ID;
         }
         if ($relativePath == "") {
             $relativePath = bx_basename($this->__file);
         }
         if ($lang != "en" && $lang != "ru") {
             $arLangMessages = $this->__IncludeLangFile($absPath . LangSubst($lang) . "/" . $relativePath);
         }
         $arLangMessages = $this->__IncludeLangFile($absPath . $lang . "/" . $relativePath) + $arLangMessages;
     }
     return $arLangMessages;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:18,代码来源:component_template.php

示例15: InstallService

 function InstallService($serviceID, $serviceStage)
 {
     $wizard =& $this->GetWizard();
     $siteID = WizardServices::GetCurrentSiteID($wizard->GetVar("siteID"));
     define("WIZARD_SITE_ID", $siteID);
     define("WIZARD_SITE_ROOT_PATH", $_SERVER["DOCUMENT_ROOT"]);
     $rsSites = CSite::GetByID($siteID);
     if ($arSite = $rsSites->Fetch()) {
         define("WIZARD_SITE_DIR", $arSite["DIR"]);
     } else {
         define("WIZARD_SITE_DIR", "/");
     }
     define("WIZARD_SITE_PATH", str_replace("//", "/", WIZARD_SITE_ROOT_PATH . "/" . WIZARD_SITE_DIR . "/"));
     $wizardPath = $wizard->GetPath();
     define("WIZARD_RELATIVE_PATH", $wizardPath);
     define("WIZARD_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $wizardPath);
     $templatesPath = WizardServices::GetTemplatesPath(WIZARD_RELATIVE_PATH . "/site");
     $arTemplates = WizardServices::GetTemplates($templatesPath);
     $templateID = $wizard->GetVar("templateID");
     define("WIZARD_TEMPLATE_ID", $templateID);
     define("WIZARD_TEMPLATE_RELATIVE_PATH", $templatesPath . "/" . WIZARD_TEMPLATE_ID);
     define("WIZARD_TEMPLATE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . WIZARD_TEMPLATE_RELATIVE_PATH);
     $themeID = $wizard->GetVar($templateID . "_themeID");
     $arThemes = WizardServices::GetThemes(WIZARD_TEMPLATE_RELATIVE_PATH . "/themes");
     define("WIZARD_THEME_ID", $themeID);
     define("WIZARD_THEME_RELATIVE_PATH", WIZARD_TEMPLATE_RELATIVE_PATH . "/themes/" . WIZARD_THEME_ID);
     define("WIZARD_THEME_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . WIZARD_THEME_RELATIVE_PATH);
     $servicePath = WIZARD_RELATIVE_PATH . "/site/services/" . $serviceID;
     define("WIZARD_SERVICE_RELATIVE_PATH", $servicePath);
     define("WIZARD_SERVICE_ABSOLUTE_PATH", $_SERVER["DOCUMENT_ROOT"] . $servicePath);
     define("WIZARD_IS_RERUN", $_SERVER["PHP_SELF"] != "/index.php");
     define("WIZARD_SITE_LOGO", intval($wizard->GetVar("siteLogo")));
     define("WIZARD_INSTALL_DEMO_DATA", $wizard->GetVar("installDemoData") == "Y");
     define("WIZARD_REINSTALL_DATA", false);
     define("WIZARD_FIRST_INSTAL", $firstStep = COption::GetOptionString("main", "wizard_first" . substr($wizard->GetID(), 7) . "_" . $wizard->GetVar("siteID"), false, $wizard->GetVar("siteID")));
     $dbUsers = CGroup::GetList($by = "id", $order = "asc", array("ACTIVE" => "Y"));
     while ($arUser = $dbUsers->Fetch()) {
         define("WIZARD_" . $arUser["STRING_ID"] . "_GROUP", $arUser["ID"]);
     }
     if (!file_exists(WIZARD_SERVICE_ABSOLUTE_PATH . "/" . $serviceStage)) {
         return false;
     }
     if (LANGUAGE_ID != "en" && LANGUAGE_ID != "ru") {
         if (file_exists($fname = WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/" . LangSubst(LANGUAGE_ID) . "/" . $serviceStage)) {
             __IncludeLang($fname, false, true);
         }
     }
     if (file_exists($fname = WIZARD_SERVICE_ABSOLUTE_PATH . "/lang/" . LANGUAGE_ID . "/" . $serviceStage)) {
         __IncludeLang($fname, false, true);
     }
     @set_time_limit(3600);
     global $DB, $DBType, $APPLICATION, $USER, $CACHE_MANAGER;
     include WIZARD_SERVICE_ABSOLUTE_PATH . "/" . $serviceStage;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:54,代码来源:wizard.php


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