- Модуль: fileman
- Путь к файлу: ~/bitrix/modules/fileman/classes/general/html_editor.php
- Класс: CHTMLEditor
- Вызов: CHTMLEditor::GetComponentParams
static function GetComponentParams($name, $siteTemplate = '', $template = '', $curValues = array(), $loadHelp = true)
{
$template = (!$template || $template == '.default') ? '' : CUtil::JSEscape($template);
$arTemplates = CComponentUtil::GetTemplatesList($name, $siteTemplate);
$result = array(
'groups' => array(),
'templates' => array(),
'props' => array(),
'template_props' => array()
);
$arProps = CComponentUtil::GetComponentProps($name, $curValues);
if (is_array($arTemplates))
{
foreach ($arTemplates as $k => $arTemplate)
{
$result['templates'][] = array(
'name' => $arTemplate['NAME'],
'template' => $arTemplate['TEMPLATE'],
'title' => $arTemplate['TITLE'],
'description' => $arTemplate['DESCRIPTION'],
);
$tName = (!$arTemplate['NAME'] || $arTemplate['NAME'] == '.default') ? '' : $arTemplate['NAME'];
if ($tName == $template)
{
$arTemplateProps = CComponentUtil::GetTemplateProps($name, $arTemplate['NAME'], $siteTemplate, $curValues);
if (is_array($arTemplateProps))
{
foreach ($arTemplateProps as $k => $arTemplateProp)
{
$result['templ_props'][] = self::_HandleComponentParam($k, $arTemplateProp, $arProps['GROUPS']);
}
}
}
}
}
//if ($loadHelp && is_array($arProps['PARAMETERS']))
// fetchPropsHelp($name);
if (is_array($arProps['GROUPS']))
{
foreach ($arProps['GROUPS'] as $k => $arGroup)
{
$result['templ_props'][] = array(
'name' => $k,
'title' => $arGroup['NAME']
);
}
}
if (is_array($arProps['PARAMETERS']))
{
foreach ($arProps['PARAMETERS'] as $k => $arParam)
{
$result['properties'][] = self::_HandleComponentParam($k, $arParam, $arProps['GROUPS']);
}
}
return $result;
}