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


PHP _normalizePath函数代码示例

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


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

示例1: Init

	function Init($modules)
	{
		/** @noinspection PhpUnusedLocalVariableInspection */
		global $APPLICATION, $USER, $DB, $MESS;

		if($this->bInit)
			return;
		$this->bInit = true;

		$aOptMenu = CUserOptions::GetOption("admin_menu", "pos", array());
		$this->AddOpenedSections($aOptMenu["sections"]);
		
		$aModuleMenu = array();
		if(is_array($modules))
		{
			foreach($modules as $module)
			{
				$module = _normalizePath($module);

				//trying to include file menu.php in the /admin/ folder of the current module
				$fname = getLocalPath("modules/".$module."/admin/menu.php");
				if($fname !== false)
				{
					$menu = CAdminMenu::_IncludeMenu($_SERVER["DOCUMENT_ROOT"].$fname);
					if(is_array($menu) && !empty($menu))
					{
						if(isset($menu["parent_menu"]) && $menu["parent_menu"] <> "")
						{
							//one section
							$aModuleMenu[] = $menu;
						}
						else
						{
							//multiple sections
							foreach($menu as $submenu)
								$aModuleMenu[] = $submenu;
						}
					}
				}
			}
		}

		//additional user menu
		$aMenuLinks = array();
		if(file_exists($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/admin/.left.menu.php"))
			include($_SERVER["DOCUMENT_ROOT"].FX_ROOT."/admin/.left.menu.php");
		if(!empty($aMenuLinks))
		{
			$bWasSeparator = false;
			$menu = array();
			foreach($aMenuLinks as $module_menu)
			{
				if($module_menu[3]["SEPARATOR"] == "Y")
				{
					//first level
					if(!empty($menu))
						$aModuleMenu[] = $menu;

					$menu = array(
						"parent_menu" => "global_menu_services",
						"icon" => "default_menu_icon",
						"page_icon" => "default_page_icon",
						"items_id"=>$module_menu[3]["SECTION_ID"],
						"items"=>array(),
						"sort"=>$module_menu[3]["SORT"],
						"text" => $module_menu[0],
					);
					$bWasSeparator = true;
				}
				elseif($bWasSeparator && $module_menu[3]["SECTION_ID"] == "")
				{
					//section items
					$menu["items"][] = array(
						"text" => $module_menu[0],
						"title"=>$module_menu[3]["ALT"],
						"url" => $module_menu[1],
						"more_url"=>$module_menu[2],
					);
				}
				elseif($module_menu[3]["SECTION_ID"] == "" || $module_menu[3]["SECTION_ID"] == "statistic" || $module_menu[3]["SECTION_ID"] == "sale")
				{
					//item in root
					$aModuleMenu[] = array(
						"parent_menu" => ($module_menu[3]["SECTION_ID"] == "statistic"? "global_menu_statistics" : ($module_menu[3]["SECTION_ID"] == "sale"? "global_menu_store":"global_menu_services")),
						"icon" => "default_menu_icon",
						"page_icon" => "default_page_icon",
						"sort"=>$module_menu[3]["SORT"],
						"text" => $module_menu[0],
						"title"=>$module_menu[3]["ALT"],
						"url" => $module_menu[1],
						"more_url"=>$module_menu[2],
					);
				}
				else
				{
					//item in section
					foreach($aModuleMenu as $i=>$section)
					{
						if($section["section"] == $module_menu[3]["SECTION_ID"])
						{
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:open_bx,代码行数:101,代码来源:admin_lib.php

示例2: _extractFile

 private function _extractFile(&$arEntry, $path, $removePath, $removeAllPath, &$arParams)
 {
     if (($res = $this->_readFileHeader($header)) != 1) {
         return $res;
     }
     //to be checked: file header should be coherent with $arEntry info
     $arEntry["filename"] = CharsetConverter::ConvertCharset($arEntry["filename"], "cp866", $this->fileSystemEncoding);
     $arEntry["stored_filename"] = CharsetConverter::ConvertCharset($arEntry["stored_filename"], "cp866", $this->fileSystemEncoding);
     //protecting against ../ etc in file path
     //only absolute path should be in the $arEntry
     $arEntry['filename'] = _normalizePath($arEntry['filename']);
     $arEntry['stored_filename'] = _normalizePath($arEntry['stored_filename']);
     if ($removeAllPath == true) {
         $arEntry['filename'] = basename($arEntry['filename']);
     } else {
         if ($removePath != "") {
             if ($this->_containsPath($removePath, $arEntry['filename']) == 2) {
                 //change file status
                 $arEntry['status'] = "filtered";
                 return $res;
             }
             $removePath_size = strlen($removePath);
             if (substr($arEntry['filename'], 0, $removePath_size) == $removePath) {
                 //remove path
                 $arEntry['filename'] = substr($arEntry['filename'], $removePath_size);
             }
         }
     }
     //making absolute path to the extracted file out of filename stored in the zip header and passed extracting path
     if ($path != '') {
         $arEntry['filename'] = $path . "/" . $arEntry['filename'];
     }
     //pre-extract callback
     if (isset($arParams['callback_pre_extract']) && $arParams['callback_pre_extract'] != '') {
         //generate local info
         $arLocalHeader = array();
         $this->_convertHeader2FileInfo($arEntry, $arLocalHeader);
         //callback call
         eval('$res = ' . $arParams['callback_pre_extract'] . '(\'callback_pre_extract\', $arLocalHeader);');
         //change file status
         if ($res == 0) {
             $arEntry['status'] = "skipped";
             $res = 1;
         }
         //update the info, only some fields can be modified
         $arEntry['filename'] = $arLocalHeader['filename'];
     }
     //check if extraction should be done
     if ($arEntry['status'] == 'ok') {
         $logicalFilename = $this->io->GetLogicalName($arEntry['filename']);
         if ((HasScriptExtension($arEntry['filename']) || IsFileUnsafe($arEntry['filename']) || !$this->io->ValidatePathString($logicalFilename) || !$this->io->ValidateFilenameString(GetFileName($logicalFilename))) && $this->checkBXPermissions == true) {
             $arEntry['status'] = "no_permissions";
         } else {
             //if the file exists, change status
             if (file_exists($arEntry['filename'])) {
                 if (is_dir($arEntry['filename'])) {
                     $arEntry['status'] = "already_a_directory";
                 } else {
                     if (!is_writeable($arEntry['filename'])) {
                         $arEntry['status'] = "write_protected";
                     } else {
                         if (filemtime($arEntry['filename']) > $arEntry['mtime'] && !$this->replaceExistentFiles) {
                             $arEntry['status'] = "newer_exist";
                         }
                     }
                 }
             } else {
                 //check the directory availability and create it if necessary
                 if (($arEntry['external'] & 0x10) == 0x10 || substr($arEntry['filename'], -1) == '/') {
                     $checkDir = $arEntry['filename'];
                 } else {
                     if (!strstr($arEntry['filename'], "/")) {
                         $checkDir = "";
                     } else {
                         $checkDir = dirname($arEntry['filename']);
                     }
                 }
                 if (($res = $this->_checkDir($checkDir, ($arEntry['external'] & 0x10) == 0x10)) != 1) {
                     //change file status
                     $arEntry['status'] = "path_creation_fail";
                     //return $res;
                     $res = 1;
                 }
             }
         }
     }
     //check if extraction should be done
     if ($arEntry['status'] == 'ok') {
         //if not a folder - extract
         if (!(($arEntry['external'] & 0x10) == 0x10)) {
             //if zip file with 0 compression
             if ($arEntry['compression'] == 0 && $arEntry['compressed_size'] == $arEntry['size']) {
                 if (($destFile = @fopen($arEntry['filename'], 'wb')) == 0) {
                     $arEntry['status'] = "write_error";
                     return $res;
                 }
                 //reading the fileby by self::ReadBlockSize octets blocks
                 $size = $arEntry['compressed_size'];
                 while ($size != 0) {
                     $length = $size < self::ReadBlockSize ? $size : self::ReadBlockSize;
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:101,代码来源:zip.php

示例3: GetById

 public static function GetById($id, $bWithParameters = false, $arAllCurrentValues = false)
 {
     $id = _normalizePath(strtolower($id));
     $folders = array("/bitrix/gadgets", "/local/gadgets");
     if (($p = strpos($id, "/")) > 0) {
         //specific namespace
         $arGdNS = array(substr($id, 0, $p));
         $id = substr($id, $p + 1);
     } else {
         // Find all namespaces of gadgets
         $arGdNS = array("bitrix");
         foreach ($folders as $folder) {
             $gdDir = $_SERVER["DOCUMENT_ROOT"] . $folder;
             if (is_dir($gdDir) && ($handle = opendir($gdDir))) {
                 while (false !== ($item = readdir($handle))) {
                     if (is_dir($gdDir . "/" . $item) && $item != "." && $item != ".." && $item != "bitrix") {
                         $arGdNS[] = $item;
                     }
                 }
                 closedir($handle);
             }
         }
     }
     // Find all gadgets
     $arGadget = false;
     foreach ($folders as $folder) {
         foreach ($arGdNS as $NS) {
             $gdDir = $_SERVER["DOCUMENT_ROOT"] . $folder . "/" . $NS;
             $gdDirSiteRoot = $folder . "/" . $NS;
             if (is_dir($gdDir . "/" . $id)) {
                 $arDescription = array();
                 CComponentUtil::__IncludeLang($gdDirSiteRoot . "/" . $id, "/.description.php");
                 if (!file_exists($gdDir . "/" . $id . "/.description.php")) {
                     continue;
                 }
                 if (!@(include $gdDir . "/" . $id . "/.description.php")) {
                     $arGadget = false;
                     continue;
                 }
                 if (isset($arDescription["LANG_ONLY"]) && $arDescription["LANG_ONLY"] != LANGUAGE_ID) {
                     $arGadget = false;
                     continue;
                 }
                 if ($bWithParameters) {
                     $arCurrentValues = array();
                     if (is_array($arAllCurrentValues)) {
                         foreach ($arAllCurrentValues as $k => $v) {
                             $pref = "G_" . strtoupper($id) . "_";
                             if (substr($k, 0, strlen($pref)) == $pref) {
                                 $arCurrentValues[substr($k, strlen($pref))] = $v;
                             } else {
                                 $pref = "GU_" . strtoupper($id) . "_";
                                 if (substr($k, 0, strlen($pref)) == $pref) {
                                     $arCurrentValues[substr($k, strlen($pref))] = $v;
                                 }
                             }
                         }
                     }
                     CComponentUtil::__IncludeLang($gdDirSiteRoot . "/" . $id, "/.parameters.php");
                     $arParameters = array();
                     if (file_exists($gdDir . "/" . $id . "/.parameters.php")) {
                         include $gdDir . "/" . $id . "/.parameters.php";
                     }
                     $arDescription["PARAMETERS"] = $arParameters["PARAMETERS"];
                     $arDescription["USER_PARAMETERS"] = array("TITLE_STD" => array("NAME" => GetMessage("CMDESKTOP_UP_TITLE_STD"), "TYPE" => "STRING", "DEFAULT" => ""));
                     if (array_key_exists("USER_PARAMETERS", $arParameters) && is_array($arParameters["USER_PARAMETERS"])) {
                         $arDescription["USER_PARAMETERS"] = array_merge($arDescription["USER_PARAMETERS"], $arParameters["USER_PARAMETERS"]);
                     }
                 }
                 $arDescription["PATH"] = $gdDir . "/" . $id;
                 $arDescription["PATH_SITEROOT"] = $gdDirSiteRoot . "/" . $id;
                 $arDescription["ID"] = strtoupper($id);
                 if ($arDescription["ICON"] && substr($arDescription["ICON"], 0, 1) != "/") {
                     $arDescription["ICON"] = "/bitrix/gadgets/" . $NS . "/" . $id . "/" . $arDescription["ICON"];
                 }
                 unset($arDescription["NOPARAMS"]);
                 $arGadget = $arDescription;
             }
         }
     }
     return $arGadget;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:82,代码来源:include.php

示例4: Rel2Abs

function Rel2Abs($curdir, $relpath)
{
	if($relpath == "")
		return false;

	$relpath = preg_replace("'[\\\/]+'", "/", $relpath);

	if($relpath[0] == "/" || preg_match("#^[a-z]:/#i", $relpath))
	{
		$res = $relpath;
	}
	else
	{
		$curdir = preg_replace("'[\\\/]+'", "/", $curdir);
		if($curdir[0] != "/" && !preg_match("#^[a-z]:/#i", $curdir))
			$curdir = "/".$curdir;
		if(substr($curdir, -1) != "/")
			$curdir .= "/";
		$res = $curdir.$relpath;
	}

	if(($p = strpos($res, "\0")) !== false)
		$res = substr($res, 0, $p);

	$res = _normalizePath($res);

	if(substr($res, 0, 1) !== "/" && !preg_match("#^[a-z]:/#i", $res))
		$res = "/".$res;

	$res = rtrim($res, ".\\+ ");

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

示例5: substr

				$url = $val["PATH"];

			if(($pos=strpos($url, "?"))!==false)
			{
				$params = substr($url, $pos+1);
				parse_str($params, $vars);
				unset($vars["SEF_APPLICATION_CUR_PAGE_URL"]);

				$_GET += $vars;
				$_REQUEST += $vars;
				//$GLOBALS += $vars;
				$_SERVER["QUERY_STRING"] = $QUERY_STRING = $params;
				$url = substr($url, 0, $pos);
			}

			$url = _normalizePath($url);

			if(!$io->FileExists($_SERVER['DOCUMENT_ROOT'].$url))
				continue;

			if (!$io->ValidatePathString($url))
				continue;

			$urlTmp = strtolower(ltrim($url, "/\\"));
			$urlTmp = str_replace(".", "", $urlTmp);
			$urlTmp = substr($urlTmp, 0, 7);
			if (($urlTmp == "bitrix/") || ($urlTmp == "upload/"))
				continue;

			$ext = strtolower(GetFileExtension($url));
			if ($ext != "php")
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:31,代码来源:urlrewrite.php

示例6: CheckFields

function CheckFields()
{
    global $DB, $strError, $FILENAME, $APPLICATION, $ID, $BODY, $USER, $SITE_ID, $STATUS_ID, $DOC_ROOT;
    $str = "";
    $arMsg = array();
    $SCRIPT_FILE_TYPE = GetFileType($FILENAME);
    $FILENAME = trim($FILENAME);
    $FILENAME = "/" . ltrim(_normalizePath($FILENAME), "/");
    $io = CBXVirtualIo::GetInstance();
    if (strlen($FILENAME) <= 0) {
        $arMsg[] = array("id" => "FILENAME", "text" => GetMessage("FLOW_FORGOT_FILENAME"));
    } elseif (!$io->ValidatePathString($FILENAME)) {
        $arMsg[] = array("id" => "FILENAME", "text" => GetMessage("FLOW_FILE_NAME_NOT_VALID"));
    } elseif ($SCRIPT_FILE_TYPE != "SOURCE") {
        $arMsg[] = array("id" => "FILENAME", "text" => GetMessage("FLOW_INCORRECT_FILETYPE"));
    } else {
        $SITE_ID = CWorkflow::__CheckSite($SITE_ID);
        if (!$SITE_ID) {
            $SITE_ID = CSite::GetSiteByFullPath($_SERVER['DOCUMENT_ROOT'] . $FILENAME);
        }
        if (!$USER->CanDoFileOperation('fm_edit_in_workflow', array($SITE_ID, $FILENAME))) {
            $s = str_replace("#FILENAME#", "{$FILENAME}", GetMessage("FLOW_ACCESS_DENIED"));
            $arMsg[] = array("id" => "FILENAME", "text" => $s . ": " . GetMessage("FLOW_MIN_RIGHTS"));
        } elseif ($STATUS_ID == 1 && !($USER->CanDoFileOperation('fm_edit_existent_file', array($SITE_ID, $FILENAME)) && $USER->CanDoFileOperation('fm_create_new_file', array($SITE_ID, $FILENAME)))) {
            $arMsg[] = array("id" => "FILENAME", "text" => GetMessage("FLOW_ACCESS_DENIED_FOR_FILE_WRITE", array("#FILENAME#" => $FILENAME)));
        } else {
            $z = CWorkflow::GetByFilename($FILENAME, $SITE_ID);
            if ($zr = $z->Fetch()) {
                if ($zr["ID"] != $ID && $zr["STATUS_ID"] != 1) {
                    $arMsg[] = array("id" => "FILENAME", "text" => str_replace("#FILENAME#", $FILENAME, GetMessage("FLOW_FILENAME_EXIST")));
                }
            }
        }
    }
    if (!CWorkflow::IsAdmin()) {
        $arGroups = $USER->GetUserGroupArray();
        if (!is_array($arGroups)) {
            $arGroups = array(2);
        }
        $arFilter = array("GROUP_ID" => $arGroups, "PERMISSION_TYPE_1" => 1, "ID_EXACT_MATCH" => "Y", "ID" => $STATUS_ID);
        $rsStatuses = CWorkflowStatus::GetList($by = "s_c_sort", $strOrder, $arFilter, $is_filtered, array("ID"));
        if (!$rsStatuses->Fetch()) {
            $arMsg[] = array("id" => "STATUS_ID", "text" => GetMessage("FLOW_ERROR_WRONG_STATUS"));
        }
    }
    $bIsPhp = IsPHP($BODY);
    if ($bIsPhp) {
        if ($USER->CanDoFileOperation('fm_lpa', array($SITE_ID, $FILENAME)) && !$USER->CanDoOperation('edit_php')) {
            if (CModule::IncludeModule("fileman")) {
                $old_res = CFileman::ParseFileContent($APPLICATION->GetFileContent($DOC_ROOT . $FILENAME), true);
                $old_BODY = $old_res["CONTENT"];
                $BODY = CMain::ProcessLPA($BODY, $old_BODY);
            } else {
                $arMsg[] = array("id" => "BODY", "text" => "Error! Fileman is not included!");
            }
        } else {
            if (!$USER->CanDoOperation('edit_php')) {
                $arMsg[] = array("id" => "BODY", "text" => GetMessage("FLOW_PHP_IS_NOT_AVAILABLE"));
            }
        }
    }
    if (!empty($arMsg)) {
        $e = new CAdminException($arMsg);
        $GLOBALS["APPLICATION"]->ThrowException($e);
        return false;
    }
    return true;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:68,代码来源:workflow_edit.php

示例7: GetTemplateProps

 /**
  * @param string $componentName
  * @param string $templateName
  * @param string $siteTemplate
  * @param array $arCurrentValues Don't change the name! It's used in the .parameters.php file.
  * @return array
  */
 public static function GetTemplateProps($componentName, $templateName, $siteTemplate = "", $arCurrentValues = array())
 {
     $arTemplateParameters = array();
     $componentName = trim($componentName);
     if (strlen($componentName) <= 0) {
         return $arTemplateParameters;
     }
     if (strlen($templateName) <= 0) {
         $templateName = ".default";
     }
     if (!preg_match("#[A-Za-z0-9_.-]#i", $templateName)) {
         return $arTemplateParameters;
     }
     $path2Comp = CComponentEngine::MakeComponentPath($componentName);
     if (strlen($path2Comp) <= 0) {
         return $arTemplateParameters;
     }
     $componentPath = getLocalPath("components" . $path2Comp);
     if (!CComponentUtil::isComponent($componentPath)) {
         return $arTemplateParameters;
     }
     if ($siteTemplate != "") {
         $siteTemplate = _normalizePath($siteTemplate);
     }
     $folders = array();
     if ($siteTemplate != "") {
         $folders[] = "/local/templates/" . $siteTemplate . "/components" . $path2Comp . "/" . $templateName;
     }
     $folders[] = "/local/templates/.default/components" . $path2Comp . "/" . $templateName;
     $folders[] = "/local/components" . $path2Comp . "/templates/" . $templateName;
     if ($siteTemplate != "") {
         $folders[] = BX_PERSONAL_ROOT . "/templates/" . $siteTemplate . "/components" . $path2Comp . "/" . $templateName;
     }
     $folders[] = BX_PERSONAL_ROOT . "/templates/.default/components" . $path2Comp . "/" . $templateName;
     $folders[] = "/bitrix/components" . $path2Comp . "/templates/" . $templateName;
     foreach ($folders as $templateFolder) {
         if (file_exists($_SERVER["DOCUMENT_ROOT"] . $templateFolder)) {
             if (file_exists($_SERVER["DOCUMENT_ROOT"] . $templateFolder . "/.parameters.php")) {
                 CComponentUtil::__IncludeLang($templateFolder, ".parameters.php");
                 include $_SERVER["DOCUMENT_ROOT"] . $templateFolder . "/.parameters.php";
             }
             return $arTemplateParameters;
         }
     }
     return $arTemplateParameters;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:53,代码来源:component_util.php

示例8: SetOptionString

	public static function SetOptionString($module_id, $name, $value="", $desc=false, $site="")
	{
		global $DB,$CACHE_MANAGER;
		if(CACHED_b_option!==false) $CACHE_MANAGER->Clean("b_option");

		if($site === false)
			$site = SITE_ID;

		$strSqlWhere = " SITE_ID".($site==""?" IS NULL":"='".$DB->ForSql($site, 2)."'")." ";

		$name = $DB->ForSql($name, 50);
		$res = $DB->Query(
			"SELECT 'x' ".
			"FROM b_option ".
			"WHERE ".$strSqlWhere.
			"	AND MODULE_ID='".$DB->ForSql($module_id)."' ".
			"	AND NAME='".$name."'"
			);

		if($res_array = $res->Fetch())
		{
			$DB->Query(
				"UPDATE b_option SET ".
				"	VALUE='".$DB->ForSql($value, 2000)."'".
				($desc!==false?", DESCRIPTION='".$DB->ForSql($desc, 255)."'":"")." ".
				"WHERE ".$strSqlWhere.
				"	AND MODULE_ID='".$DB->ForSql($module_id)."' ".
				"	AND NAME='".$name."'"
				);
		}
		else
		{
			$DB->Query(
				"INSERT INTO b_option(SITE_ID, MODULE_ID, NAME, VALUE, DESCRIPTION) ".
				"VALUES(".($site==""?"NULL":"'".$DB->ForSQL($site, 2)."'").", ".
				"'".$DB->ForSql($module_id, 50)."', '".$name."', ".
				"'".$DB->ForSql($value, 2000)."', '".$DB->ForSql($desc, 255)."') "
				);
		}

		if($site == "")
			$site = '-';

		global $MAIN_OPTIONS;
		$MAIN_OPTIONS[$site][$module_id][$name] = $value;

		$module_id = _normalizePath($module_id);
		$fname = $_SERVER['DOCUMENT_ROOT'].BX_ROOT.'/modules/'.$module_id.'/option_triggers.php';
		if(file_exists($fname))
			include_once($fname);

		$events = GetModuleEvents("main", "OnAfterSetOption_".$name);
		while ($arEvent = $events->Fetch())
			ExecuteModuleEventEx($arEvent, array($value));

		return true;
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:57,代码来源:option.php

示例9: GetTemplateProps

 function GetTemplateProps($componentName, $templateName, $siteTemplate = "", $arCurrentValues = array())
 {
     $arTemplateParameters = array();
     $componentName = trim($componentName);
     if (strlen($componentName) <= 0) {
         return $arTemplateParameters;
     }
     if (strlen($templateName) <= 0) {
         $templateName = ".default";
     }
     if (!preg_match("#[A-Za-z0-9_.-]#i", $templateName)) {
         return $arTemplateParameters;
     }
     $path2Comp = CComponentEngine::MakeComponentPath($componentName);
     if (strlen($path2Comp) <= 0) {
         return $arTemplateParameters;
     }
     $componentPath = "/bitrix/components" . $path2Comp;
     if (!CComponentUtil::isComponent($componentPath)) {
         return $arTemplateParameters;
     }
     if ($siteTemplate && strlen($siteTemplate) > 0) {
         $siteTemplate = _normalizePath($siteTemplate);
         if (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $siteTemplate . "/components" . $path2Comp . "/" . $templateName)) {
             if (is_dir($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $siteTemplate . "/components" . $path2Comp . "/" . $templateName) && file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $siteTemplate . "/components" . $path2Comp . "/" . $templateName . "/.parameters.php")) {
                 CComponentUtil::__IncludeLang(BX_PERSONAL_ROOT . "/templates/" . $siteTemplate . "/components" . $path2Comp . "/" . $templateName, ".parameters.php");
                 include $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/" . $siteTemplate . "/components" . $path2Comp . "/" . $templateName . "/.parameters.php";
             }
             return $arTemplateParameters;
         }
     }
     if (file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/.default/components" . $path2Comp . "/" . $templateName)) {
         if (is_dir($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/.default/components" . $path2Comp . "/" . $templateName) && file_exists($_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/.default/components" . $path2Comp . "/" . $templateName . "/.parameters.php")) {
             CComponentUtil::__IncludeLang(BX_PERSONAL_ROOT . "/templates/.default/components" . $path2Comp . "/" . $templateName, ".parameters.php");
             include $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/templates/.default/components" . $path2Comp . "/" . $templateName . "/.parameters.php";
         }
         return $arTemplateParameters;
     }
     if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/components" . $path2Comp . "/templates/" . $templateName)) {
         if (is_dir($_SERVER["DOCUMENT_ROOT"] . "/bitrix/components" . $path2Comp . "/templates/" . $templateName) && file_exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/components" . $path2Comp . "/templates/" . $templateName . "/.parameters.php")) {
             CComponentUtil::__IncludeLang("/bitrix/components" . $path2Comp . "/templates/" . $templateName, ".parameters.php");
             include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components" . $path2Comp . "/templates/" . $templateName . "/.parameters.php";
         }
         return $arTemplateParameters;
     }
     return $arTemplateParameters;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:47,代码来源:component_util.php

示例10: ClearVars

ClearVars();

$edit_php = $USER->CanDoOperation('edit_php');
if(!$edit_php && !$USER->CanDoOperation('view_other_settings') && !$USER->CanDoOperation('lpa_template_edit'))
	$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));

IncludeModuleLangFile(__FILE__);

$lpa = ($USER->CanDoOperation('lpa_template_edit') && !$edit_php); // Limit PHP access: for non admin users
$lpa_view = !$USER->CanDoOperation('edit_other_settings') && !$USER->CanDoOperation('lpa_template_edit'); //

$strError="";
$strOK="";
$bVarsFromForm = false;

$ID = _normalizePath($ID);

if($lpa && $_REQUEST['edit'] != "Y" && strlen($ID) <= 0) // In lpa mode users can only edit existent templates
	$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));

$bEdit = false;
if(strlen($ID)>0 && $_REQUEST['edit'] != "N")
{
	$templ = CSiteTemplate::GetByID($ID);
	if($x = $templ->ExtractFields("str_"))
		$bEdit=true;
}

$aTabs = array(
	array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB1"), "ICON" => "template_edit", "TITLE" => GetMessage("MAIN_TAB1_TITLE")),
	array("DIV" => "edit2", "TAB" => GetMessage("MAIN_TAB2"), "ICON" => "template_edit", "TITLE" => GetMessage("MAIN_TAB2_TITLE")),
开发者ID:nProfessor,项目名称:Mytb,代码行数:31,代码来源:template_edit.php

示例11: Copyright

<?php

##############################################
# Bitrix Site Manager                        #
# Copyright (c) 2002-2007 Bitrix             #
# http://www.bitrixsoft.com                  #
# mailto:admin@bitrixsoft.com                #
##############################################
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
if (!$USER->CanDoOperation('edit_php')) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
$from = $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/admin/restore.php";
$to = $_SERVER["DOCUMENT_ROOT"] . "/restore.php";
$path = _normalizePath($f_id);
if (check_bitrix_sessid() && copy($_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/backup/" . $path, $_SERVER["DOCUMENT_ROOT"] . "/" . $path) && file_put_contents($to, str_replace("%DEFAULT_LANG_ID%", LANG, file_get_contents($from)))) {
    LocalRedirect("/restore.php?lang=" . LANG);
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("MAIN_EXEC_RESTORE_MSG"), "DETAILS" => GetMessage("MAIN_EXEC_RESTORE_TEXT") . ' ' . htmlspecialcharsbx($path), "HTML" => true));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
开发者ID:Satariall,项目名称:izurit,代码行数:22,代码来源:exec_restore.php

示例12: ClearVars

ClearVars();

$edit_php = $USER->CanDoOperation('edit_php');
if(!$edit_php && !$USER->CanDoOperation('view_other_settings') && !$USER->CanDoOperation('lpa_template_edit'))
	$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));

IncludeModuleLangFile(__FILE__);

$lpa = ($USER->CanDoOperation('lpa_template_edit') && !$edit_php); // Limit PHP access: for non admin users
$lpa_view = !$USER->CanDoOperation('edit_other_settings') && !$USER->CanDoOperation('lpa_template_edit'); //

$strError="";
$strOK="";
$bVarsFromForm = false;

$ID = _normalizePath($_REQUEST["ID"]);

if($lpa && $_REQUEST['edit'] != "Y" && strlen($ID) <= 0) // In lpa mode users can only edit existent templates
	$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));

$bEdit = false;
$templFields = array();
if(strlen($ID)>0 && $_REQUEST['edit'] != "N")
{
	$templ = CSiteTemplate::GetByID($ID);
	if(($templFields = $templ->ExtractFields("str_")))
		$bEdit = true;
}

$aTabs = array(
	array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB1"), "ICON" => "template_edit", "TITLE" => GetMessage("MAIN_TAB1_TITLE")),
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:template_edit.php

示例13: Rel2Abs

function Rel2Abs($curdir, $relpath)
{
    if ($relpath == "") {
        return false;
    }
    if (substr($relpath, 0, 1) == "/" || preg_match("#^[a-z]:/#i", $relpath)) {
        $res = $relpath;
    } else {
        if (substr($curdir, 0, 1) != "/" && !preg_match("#^[a-z]:/#i", $curdir)) {
            $curdir = "/" . $curdir;
        }
        if (substr($curdir, -1) != "/") {
            $curdir .= "/";
        }
        $res = $curdir . $relpath;
    }
    if (($p = strpos($res, "")) !== false) {
        $res = substr($res, 0, $p);
    }
    $res = _normalizePath($res);
    if (substr($res, 0, 1) !== "/" && !preg_match("#^[a-z]:/#i", $res)) {
        $res = "/" . $res;
    }
    $res = rtrim($res, ".\\+ ");
    return $res;
}
开发者ID:gitkv,项目名称:bash,代码行数:26,代码来源:tools.php

示例14: GetTemplate

 public static function GetTemplate($template, $arSiteTemplates = array())
 {
     global $APPLICATION;
     $arDirs = array("templates/.default/page_templates");
     foreach ($arSiteTemplates as $val) {
         $arDirs[] = "templates/" . $val . "/page_templates";
     }
     $template = _normalizePath($template);
     $sFile = false;
     foreach ($arDirs as $dir) {
         $path = getLocalPath($dir, BX_PERSONAL_ROOT);
         if ($path === false) {
             continue;
         }
         $template_dir = $_SERVER["DOCUMENT_ROOT"] . $path;
         $template_file = $template_dir . "/" . $template . "/template.php";
         if (!file_exists($template_file)) {
             continue;
         }
         if ($APPLICATION->GetFileAccessPermission($path . "/" . $template . "/template.php") < "R") {
             continue;
         }
         $sFile = $template_file;
     }
     if ($sFile !== false) {
         $pageTemplate = false;
         include_once $sFile;
         if (is_object($pageTemplate)) {
             return $pageTemplate;
         }
     }
     return false;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:33,代码来源:admin_tools.php

示例15: GetMessage

jsDD.Reset();
//jsDD.registerContainer(BX.findParent(window.structPopup.GetContent(), {tag: 'DIV'}));
jsDD.registerContainer(BX.WindowManager.Get().GetContent());

</script>

<?
$obJSPopup->ShowTitlebar();
$obJSPopup->StartDescription('bx-structure');
?>
<p><b><?echo GetMessage("pub_struct_desc_title")?></b></p>
<div class="bx-struct-settings" onclick="structShowSettingsMenu(this)" onmouseover="this.className+=' bx-struct-settings-over'" onmouseout="this.className=this.className.replace(/\s*bx-struct-settings-over/ig, '')" title="<?echo GetMessage("pub_struct_settings_title")?>"><?echo GetMessage("pub_struct_settings")?></div>
<div class="bx-struct-settings bx-struct-button" onclick="structOpenDirs(this)" onmouseover="this.className+=' bx-struct-settings-over'" onmouseout="this.className=this.className.replace(/\s*bx-struct-settings-over/ig, '')" title="<?echo GetMessage("pub_struct_folders_title")?>"><?echo GetMessage("pub_struct_folders_button")?></div>
<br />
<br style="clear:both;" />
<?
$obJSPopup->StartContent();
?>
<div id="structure_content">
<?
//display first level tree
$arRoot = __struct_get_file_info($DOC_ROOT, "/");
echo __struct_show_files(array($arRoot), $DOC_ROOT, "", _normalizePath($_GET["path"]));
?>
</div>
<?
$obJSPopup->ShowStandardButtons(array("close"));
?>
<?
require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin_js.php");
?>
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:structure.php


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