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


PHP CComponentUtil::GetComponentsTree方法代码示例

本文整理汇总了PHP中CComponentUtil::GetComponentsTree方法的典型用法代码示例。如果您正苦于以下问题:PHP CComponentUtil::GetComponentsTree方法的具体用法?PHP CComponentUtil::GetComponentsTree怎么用?PHP CComponentUtil::GetComponentsTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComponentUtil的用法示例。


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

示例1: handleComp2Tree

function handleComp2Tree()
{
    $allowed_components = trim(COption::GetOptionString('fileman', "~allowed_components", ''));
    // Name filter exists
    if (strlen($allowed_components) > 0) {
        $arAC = explode("\n", $allowed_components);
        $arAC = array_unique($arAC);
        $arAllowedComponents = array();
        foreach ($arAC as $f) {
            $f = preg_replace("/\\s/is", "", $f);
            $f = preg_replace("/\\./is", "\\.", $f);
            $f = preg_replace("/\\*/is", ".*", $f);
            $arAllowedComponents[] = '/^' . $f . '$/';
        }
        $components_namespace = 'bitrix';
        $mask = substr(md5($allowed_components), 2, 6);
    } else {
        $arAllowedComponents = false;
        $components_namespace = false;
        $mask = 0;
    }
    // *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
    global $CACHE_MANAGER;
    $cache = array();
    $arTree = false;
    $lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : LANGUAGE_ID;
    $cache_name = 'fileman_component_tree_array_' . $lang;
    if (isset($_GET['clear_comp2_cache']) && $_GET['clear_comp2_cache'] == 'Y') {
        $CACHE_MANAGER->CleanDir("fileman_component_tree_array");
    }
    $ttl = 10 * 24 * 60 * 60;
    // Time of life
    if ($CACHE_MANAGER->Read($ttl, $cache_name, "fileman_component_tree_array")) {
        $cache = $CACHE_MANAGER->Get($cache_name);
        if (isset($cache[$mask])) {
            $arTree = $cache[$mask];
        }
    }
    if ($arTree === false) {
        $arTree = $cache[$mask] = CComponentUtil::GetComponentsTree($components_namespace, $arAllowedComponents);
        $CACHE_MANAGER->Set($cache_name, $cache);
    }
    // *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
    if (isset($arTree['#'])) {
        handleChildren($arTree['#'], '');
    }
}
开发者ID:Satariall,项目名称:izurit,代码行数:47,代码来源:fileman_load_components2.php

示例2: GetComponents

	public static function GetComponents($Params, $bClearCache = false)
	{
		global $CACHE_MANAGER;

		$allowed = trim(COption::GetOptionString('fileman', "~allowed_components", ''));
		$mask = $allowed === '' ? 0 : substr(md5($allowed), 0, 10);

		$lang = isset($Params['lang']) ? $Params['lang'] : LANGUAGE_ID;
		$cache_name = 'component_tree_array_'.$lang.'_'.$mask;
		$table_id = "fileman_component_tree";

		if ($bClearCache)
		{
			$CACHE_MANAGER->CleanDir($table_id);
		}

		if($CACHE_MANAGER->Read(self::CACHE_TIME, $cache_name, $table_id))
		{
			self::$arComponents = $CACHE_MANAGER->Get($cache_name);
		}

		if (empty(self::$arComponents))
		{
			// Name filter exists
			if ($allowed !== '')
			{
				$arAC = explode("\n", $allowed);
				$arAC = array_unique($arAC);
				$arAllowed = Array();
				foreach ($arAC as $f)
				{
					$f = preg_replace("/\s/is", "", $f);
					$f = preg_replace("/\./is", "\\.", $f);
					$f = preg_replace("/\*/is", ".*", $f);
					$arAllowed[] = '/^'.$f.'$/';
				}
				$namespace = 'bitrix';
			}
			else
			{
				$arAllowed = false;
				$namespace = false;
			}

			$arTree = CComponentUtil::GetComponentsTree($namespace, $arAllowed);
			self::$arComponents = array(
				'items' => array(),
				'groups' => array()
			);
			self::$thirdLevelId = 0;

			if (isset($arTree['#']))
			{
				self::_HandleComponentElement($arTree['#'], '');
			}

			$CACHE_MANAGER->Set($cache_name, self::$arComponents);
		}

		return self::$arComponents;
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:61,代码来源:html_editor.php

示例3: GetComponents

	public static function GetComponents($Params, $bClearCache = false)
	{
		

		$allowed = trim(COption::GetOptionString('fileman', "~allowed_components", ''));
		$mask = $allowed === '' ? 0 : substr(md5($allowed), 0, 10);

		if (empty(self::$arComponents))
		{
			// Name filter exists
			if ($allowed !== '')
			{
				$arAC = explode("\n", $allowed);
				$arAC = array_unique($arAC);
				$arAllowed = Array();
				foreach ($arAC as $f)
				{
					$f = preg_replace("/\s/is", "", $f);
					$f = preg_replace("/\./is", "\\.", $f);
					$f = preg_replace("/\*/is", ".*", $f);
					$arAllowed[] = '/^'.$f.'$/';
				}
				$namespace = 'freetrix';
			}
			else
			{
				$arAllowed = false;
				$namespace = false;
			}

			$arTree = CComponentUtil::GetComponentsTree($namespace, $arAllowed);
			self::$arComponents = array(
				'items' => array(),
				'groups' => array()
			);
			self::$thirdLevelId = 0;

			if (isset($arTree['#']))
			{
				self::_HandleComponentElement($arTree['#'], '');
			}

		}

		return self::$arComponents;
	}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:46,代码来源:html_editor.php


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