本文整理汇总了PHP中CComponentUtil::GetComponentProps方法的典型用法代码示例。如果您正苦于以下问题:PHP CComponentUtil::GetComponentProps方法的具体用法?PHP CComponentUtil::GetComponentProps怎么用?PHP CComponentUtil::GetComponentProps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComponentUtil
的用法示例。
在下文中一共展示了CComponentUtil::GetComponentProps方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getParameters
/**
* Prepare and returns parameters of the component
*
* @param string $component Component name. For example: basis:elements.list
* @param array $prepareParams Array with settings for prepare parameters of merged the component. For example:
* <code>
* [
* 'SELECT_FIELDS' => array(
* 'RENAME' => 'LIST_SELECT_FIELDS',
* 'MOVE' => 'LIST'
* ]
* </code>
* Options:
* <ul>
* <li> RENAME — rename parameter
* <li> NAME — add new name (title) for parameter
* <li> MOVE — move parameter to another parameter group
* <li> DELETE — true or false
* </ul>
* @param array $arCurrentValues Don't change the name! It's used in the .parameters.php file (Hello from Bitrix)
* @param bool $selectOnlyListed Select parameters only listed in $prepareParams
* @return array Array for use in variable $arComponentParameters in the .parameters.php
* @throws \Bitrix\Main\LoaderException
*/
public static function getParameters($component, $prepareParams = [], $arCurrentValues, $selectOnlyListed = false)
{
$additionalComponentParams = [];
$componentParams = \CComponentUtil::GetComponentProps($component, $arCurrentValues);
if ($componentParams === false) {
throw new Main\LoaderException('Failed loading parameters for ' . $component);
}
if (!empty($prepareParams)) {
foreach ($componentParams['PARAMETERS'] as $code => &$params) {
if ($prepareParams[$code]['DELETE'] || $selectOnlyListed === true && !isset($prepareParams[$code])) {
unset($componentParams['PARAMETERS'][$code]);
continue;
}
if ($prepareParams[$code]['MOVE']) {
$params['PARENT'] = $prepareParams[$code]['MOVE'];
}
if ($prepareParams[$code]['NAME']) {
$params['NAME'] = $prepareParams[$code]['NAME'];
}
if ($prepareParams[$code]['RENAME']) {
$additionalComponentParams[$prepareParams[$code]['RENAME']] = $params;
unset($componentParams['PARAMETERS'][$code]);
}
}
unset($params);
$componentParams['PARAMETERS'] = array_replace_recursive($componentParams['PARAMETERS'], $additionalComponentParams);
}
return $componentParams;
}
示例2: GetComponentProperties
public static function GetComponentProperties($name = '', $template = '', $siteTemplate = '', $currentValues = array())
{
$template = !$template || $template == '.default' ? '' : $template;
$arTemplates = CComponentUtil::GetTemplatesList($name, $siteTemplate);
$result = array('templates' => array());
$arSiteTemplates = array(".default" => GetMessage("PAR_MAN_DEFAULT"));
if (!empty($siteTemplate)) {
$dbst = CSiteTemplate::GetList(array(), array("ID" => $siteTemplate), array());
while ($siteTempl = $dbst->Fetch()) {
$arSiteTemplates[$siteTempl['ID']] = $siteTempl['NAME'];
}
}
foreach ($arTemplates as $k => $templ) {
$showTemplateName = $templ["TEMPLATE"] !== '' && $arSiteTemplates[$templ["TEMPLATE"]] != '' ? $arSiteTemplates[$templ["TEMPLATE"]] : GetMessage("PAR_MAN_DEF_TEMPLATE");
$arTemplates[$k]['DISPLAY_NAME'] = $templ['NAME'] . ' (' . $showTemplateName . ')';
}
$arTemplateProps = array();
if (is_array($arTemplates)) {
foreach ($arTemplates as $arTemplate) {
$result['templates'][] = $arTemplate;
$tName = !$arTemplate['NAME'] || $arTemplate['NAME'] == '.default' ? '' : $arTemplate['NAME'];
if ($tName == $template) {
$arTemplateProps = CComponentUtil::GetTemplateProps($name, $arTemplate['NAME'], $siteTemplate, $currentValues);
}
}
}
$result['parameters'] = array();
$arProps = CComponentUtil::GetComponentProps($name, $currentValues, $arTemplateProps);
$result['tooltips'] = self::FetchHelp($name);
if (!isset($arProps['GROUPS']) || !is_array($arProps['GROUPS'])) {
$arProps['GROUPS'] = array();
}
if (!isset($arProps['PARAMETERS']) || !is_array($arProps['PARAMETERS'])) {
$arProps['PARAMETERS'] = array();
}
$result['groups'] = array();
foreach ($arProps['GROUPS'] as $k => $arGroup) {
$arGroup['ID'] = $k;
$result['groups'][] = $arGroup;
}
foreach ($arProps['PARAMETERS'] as $k => $arParam) {
$arParam['ID'] = preg_replace("/[^a-zA-Z0-9_-]/is", "_", $k);
if (!isset($arParam['PARENT'])) {
$arParam['PARENT'] = 'ADDITIONAL_SETTINGS';
}
$result['parameters'][] = $arParam;
if ($arParam['TYPE'] == 'FILE') {
self::$fileDialogs[] = array('NAME' => $arParam['ID'], 'TARGET' => isset($arParam['FD_TARGET']) ? $arParam['FD_TARGET'] : 'F', 'EXT' => isset($arParam['FD_EXT']) ? $arParam['FD_EXT'] : '', 'UPLOAD' => isset($arParam['FD_UPLOAD']) && $arParam['FD_UPLOAD'] && $arParam['FD_TARGET'] == 'F', 'USE_ML' => isset($arParam['FD_USE_MEDIALIB']) && $arParam['FD_USE_MEDIALIB'], 'ONLY_ML' => isset($arParam['FD_USE_ONLY_MEDIALIB']) && $arParam['FD_USE_ONLY_MEDIALIB'], 'ML_TYPES' => isset($arParam['FD_MEDIALIB_TYPES']) ? $arParam['FD_MEDIALIB_TYPES'] : false);
}
// TOOLTIPS FROM .parameters langs
if (!isset($result['tooltips'][$arParam['ID'] . '_TIP'])) {
$tip = GetMessage($arParam['ID'] . '_TIP');
if ($tip) {
$result['tooltips'][$arParam['ID'] . '_TIP'] = $tip;
}
}
}
return $result;
}
示例3: GetProperties
function GetProperties($componentName, $curTemplate = '')
{
$stid = (isset($_GET['stid'])) ? $_GET['stid'] : '';
$curTemplate = (!$curTemplate || $curTemplate == '.default') ? '' : CUtil::JSEscape($curTemplate);
$arTemplates = CComponentUtil::GetTemplatesList($componentName, $stid);
$arCurVals = isset($_POST['curval']) ? CEditorUtils::UnJSEscapeArray($_POST['curval']) : Array();
$loadHelp = (isset($_GET['loadhelp']) && $_GET['loadhelp']=="Y") ? true : false;
if (is_array($arTemplates))
{
foreach ($arTemplates as $k => $arTemplate)
{
push2arComp2Templates($arTemplate['NAME'], $arTemplate['TEMPLATE'], $arTemplate['TITLE'], $arTemplate['DESCRIPTION']);
$tName = (!$arTemplate['NAME'] || $arTemplate['NAME'] == '.default') ? '' : $arTemplate['NAME'];
if ($tName == $curTemplate)
{
$arTemplateProps = CComponentUtil::GetTemplateProps($componentName, $arTemplate['NAME'], $stid, $arCurVals);
if (is_array($arTemplateProps))
foreach ($arTemplateProps as $k => $arTemplateProp)
push2arComp2TemplateProps($componentName,$k,$arTemplateProp);
}
}
}
$arProps = CComponentUtil::GetComponentProps($componentName, $arCurVals);
if ($loadHelp && is_array($arProps['PARAMETERS']))
fetchPropsHelp($componentName);
$bGroup = (isset($arProps['GROUPS']) && count($arProps['GROUPS']) > 0);
if (is_array($arProps['GROUPS']))
{
foreach ($arProps['GROUPS'] as $k => $arGroup)
{
?>window.arComp2Groups.push({name: '<?php
echo CUtil::JSEscape($k);
?>
', title: '<?php
echo CUtil::JSEscape($arGroup['NAME']);
?>
'});<?
}
}
if (is_array($arProps['PARAMETERS']))
foreach ($arProps['PARAMETERS'] as $k => $arParam)
push2arComp2Props($k, $arParam, (($bGroup) ? $arProps['GROUPS'] : false));
}
示例4: GetComponentProperties
public static function GetComponentProperties($name = '', $template = '', $siteTemplate = '', $currentValues = array())
{
$template = !$template || $template == '.default' ? '' : $template;
$arTemplates = CComponentUtil::GetTemplatesList($name, $siteTemplate);
$result = array('templates' => array());
$arTemplateProps = array();
if (is_array($arTemplates)) {
foreach ($arTemplates as $arTemplate) {
$result['templates'][] = $arTemplate;
$tName = !$arTemplate['NAME'] || $arTemplate['NAME'] == '.default' ? '' : $arTemplate['NAME'];
if ($tName == $template) {
$arTemplateProps = CComponentUtil::GetTemplateProps($name, $arTemplate['NAME'], $siteTemplate, $currentValues);
}
}
}
$result['parameters'] = array();
$arProps = CComponentUtil::GetComponentProps($name, $currentValues, $arTemplateProps);
$result['tooltips'] = self::FetchHelp($name);
if (!isset($arProps['GROUPS']) || !is_array($arProps['GROUPS'])) {
$arProps['GROUPS'] = array();
}
if (!isset($arProps['PARAMETERS']) || !is_array($arProps['PARAMETERS'])) {
$arProps['PARAMETERS'] = array();
}
$result['groups'] = array();
foreach ($arProps['GROUPS'] as $k => $arGroup) {
$arGroup['ID'] = $k;
$result['groups'][] = $arGroup;
}
foreach ($arProps['PARAMETERS'] as $k => $arParam) {
$arParam['ID'] = preg_replace("/[^a-zA-Z0-9_-]/is", "_", $k);
if (!isset($arParam['PARENT'])) {
$arParam['PARENT'] = 'ADDITIONAL_SETTINGS';
}
$result['parameters'][] = $arParam;
if ($arParam['TYPE'] == 'FILE') {
self::$fileDialogs[] = array('NAME' => $arParam['ID'], 'TARGET' => isset($arParam['FD_TARGET']) ? $arParam['FD_TARGET'] : 'F', 'EXT' => isset($arParam['FD_EXT']) ? $arParam['FD_EXT'] : '', 'UPLOAD' => isset($arParam['FD_UPLOAD']) && $arParam['FD_UPLOAD'] && $arParam['FD_TARGET'] == 'F', 'USE_ML' => isset($arParam['FD_USE_MEDIALIB']) && $arParam['FD_USE_MEDIALIB'], 'ONLY_ML' => isset($arParam['FD_USE_ONLY_MEDIALIB']) && $arParam['FD_USE_ONLY_MEDIALIB'], 'ML_TYPES' => isset($arParam['FD_MEDIALIB_TYPES']) ? $arParam['FD_MEDIALIB_TYPES'] : false);
}
}
return $result;
}
示例5: _replacer
$template_name = _replacer($arRes['TEMPLATE_NAME']);
$arParams = $arRes['PARAMS'];
$arPHPparams = array();
//all php fragments wraped by ={}
foreach ($arParams as $param_name => $paramval) {
if (substr($paramval, 0, 2) == '={' && substr($paramval, -1) == '}') {
$arPHPparams[] = $param_name;
}
}
$len = count($arPHPparams);
$br = "\r\n";
$code = '$APPLICATION->IncludeComponent(' . $br . "\t" . '"' . $comp_name . '",' . $br . "\t" . '"' . $template_name . '",' . $br;
// If exist at least one parameter with php code inside
if (count($arParams) > 0) {
// Get array with description of component params
$arCompParams = CComponentUtil::GetComponentProps($comp_name);
$arTemplParams = CComponentUtil::GetTemplateProps($comp_name, $template_name, $template);
$arParameters = array();
if (isset($arCompParams["PARAMETERS"]) && is_array($arCompParams["PARAMETERS"])) {
$arParameters = $arParameters + $arCompParams["PARAMETERS"];
}
if (is_array($arTemplParams)) {
$arParameters = $arParameters + $arTemplParams;
}
// Replace values from 'DEFAULT'
for ($e = 0; $e < $len; $e++) {
$par_name = $arPHPparams[$e];
$arParams[$par_name] = isset($arParameters[$par_name]['DEFAULT']) ? $arParameters[$par_name]['DEFAULT'] : '';
}
CComponentUtil::PrepareVariables($arParams);
//ReturnPHPStr
示例6: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arComponentProps = CComponentUtil::GetComponentProps("bitrix:socialnetwork.activity", $arCurrentValues);
$arEventID = array("" => GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_ALL"), "system" => GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_SYSTEM"), "system_groups" => GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_SYSTEM_GROUPS"));
if (CModule::IncludeModule("socialnetwork") && CSocnetUser::IsFriendsAllowed()) {
$arEventID["system_friends"] = GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_SYSTEM_FRIENDS");
}
if (IsModuleInstalled("forum")) {
$arEventID["forum"] = GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_FORUM");
}
if (IsModuleInstalled("blog")) {
$arEventID["blog"] = GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_BLOG");
}
if (IsModuleInstalled("photogallery")) {
$arEventID["photo"] = GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_PHOTO");
}
if (IsModuleInstalled("intranet")) {
$arEventID["calendar"] = GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_CALENDAR");
$arEventID["tasks"] = GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_TASKS");
}
if (IsModuleInstalled("webdav")) {
$arEventID["files"] = GetMessage("GD_ACTIVITY_P_EVENT_ID_VALUE_FILES");
}
$arParameters = array("USER_PARAMETERS" => array("LOG_DATE_DAYS" => $arComponentProps["PARAMETERS"]["LOG_DATE_DAYS"], "LOG_CNT" => array("NAME" => GetMessage("GD_ACTIVITY_P_LOG_CNT"), "TYPE" => "STRING", "DEFAULT" => "7"), "EVENT_ID" => array("NAME" => GetMessage("GD_ACTIVITY_P_EVENT_ID"), "TYPE" => "LIST", "VALUES" => $arEventID, "MULTIPLE" => "N", "DEFAULT" => "")));
示例7: ProcessLPA
function ProcessLPA($filesrc = false, $old_filesrc = false)
{
if ($filesrc === false) {
return '';
}
// Find all php fragments in $filesrc and:
// 1. Kill all non-component 2.0 fragments
// 2. Get and check params of components
$arPHP = PHPParser::ParseFile($filesrc);
$l = count($arPHP);
if ($l > 0) {
$new_filesrc = '';
$end = 0;
for ($n = 0; $n < $l; $n++) {
$start = $arPHP[$n][0];
$new_filesrc .= CMain::EncodePHPTags(substr($filesrc, $end, $start - $end));
$end = $arPHP[$n][1];
//Trim php tags
$src = $arPHP[$n][2];
if (substr($src, 0, 5) == "<?php") {
$src = '<?' . substr($src, 5);
}
//If it's Component 2 - we handle it's params, non components2 will be erased
$comp2_begin = '<?$APPLICATION->INCLUDECOMPONENT(';
if (strtoupper(substr($src, 0, strlen($comp2_begin))) == $comp2_begin) {
$arRes = PHPParser::CheckForComponent2($src);
if ($arRes) {
$comp_name = CMain::_ReplaceNonLatin($arRes['COMPONENT_NAME']);
$template_name = CMain::_ReplaceNonLatin($arRes['TEMPLATE_NAME']);
$arParams = $arRes['PARAMS'];
$arPHPparams = array();
CMain::LPAComponentChecker($arParams, $arPHPparams);
$len = count($arPHPparams);
$br = "\r\n";
$code = '$APPLICATION->IncludeComponent(' . $br . "\t" . '"' . $comp_name . '",' . $br . "\t" . '"' . $template_name . '",' . $br;
// If exist at least one parameter with php code inside
if (count($arParams) > 0) {
// Get array with description of component params
$arCompParams = CComponentUtil::GetComponentProps($comp_name);
$arTemplParams = CComponentUtil::GetTemplateProps($comp_name, $template_name);
$arParameters = array();
if (isset($arCompParams["PARAMETERS"]) && is_array($arCompParams["PARAMETERS"])) {
$arParameters = $arParameters + $arCompParams["PARAMETERS"];
}
if (is_array($arTemplParams)) {
$arParameters = $arParameters + $arTemplParams;
}
// Replace values from 'DEFAULT'
for ($e = 0; $e < $len; $e++) {
$par_name = $arPHPparams[$e];
$arParams[$par_name] = isset($arParameters[$par_name]['DEFAULT']) ? $arParameters[$par_name]['DEFAULT'] : '';
}
//ReturnPHPStr
$params = PHPParser::ReturnPHPStr2($arParams, $arParameters);
$code .= "\t" . 'array(' . $br . "\t" . $params . $br . "\t" . ')';
} else {
$code .= "\t" . 'array()';
}
$parent_comp = CMain::_ReplaceNonLatin($arRes['PARENT_COMP']);
$arExParams_ = $arRes['FUNCTION_PARAMS'];
$bEx = isset($arExParams_) && is_array($arExParams_) && count($arExParams_) > 0;
if (!$parent_comp || strtolower($parent_comp) == 'false') {
$parent_comp = false;
}
if ($parent_comp) {
if ($parent_comp == 'true' || intVal($parent_comp) == $parent_comp) {
$code .= ',' . $br . "\t" . $parent_comp;
} else {
$code .= ',' . $br . "\t\"" . $parent_comp . '"';
}
}
if ($bEx) {
if (!$parent_comp) {
$code .= ',' . $br . "\tfalse";
}
$arExParams = array();
foreach ($arExParams_ as $k => $v) {
$k = CMain::_ReplaceNonLatin($k);
$v = CMain::_ReplaceNonLatin($v);
if (strlen($k) > 0 && strlen($v) > 0) {
$arExParams[$k] = $v;
}
}
//CComponentUtil::PrepareVariables($arExParams);
$exParams = PHPParser::ReturnPHPStr2($arExParams);
$code .= ',' . $br . "\tarray(" . $exParams . ')';
}
$code .= $br . ');';
$code = '<?' . $code . '?>';
$new_filesrc .= $code;
}
}
}
$new_filesrc .= CMain::EncodePHPTags(substr($filesrc, $end));
$filesrc = $new_filesrc;
} else {
$filesrc = CMain::EncodePHPTags($filesrc);
}
if (strpos($filesrc, '#PHP') !== false && $old_filesrc !== false) {
// Get array of PHP scripts from old saved file
//.........这里部分代码省略.........
示例8:
<?php
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
die;
}
$arComponentParameters = CComponentUtil::GetComponentProps('notagency:materials.list', $arCurrentValues);
示例9: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arComponentProps = CComponentUtil::GetComponentProps("bitrix:blog.new_posts", $arCurrentValues);
$arParameters = array("PARAMETERS" => array("PATH_TO_BLOG" => $arComponentProps["PARAMETERS"]["PATH_TO_BLOG"], "PATH_TO_POST" => $arComponentProps["PARAMETERS"]["PATH_TO_POST"], "PATH_TO_GROUP_BLOG_POST" => $arComponentProps["PARAMETERS"]["PATH_TO_GROUP_BLOG_POST"], "PATH_TO_USER" => $arComponentProps["PARAMETERS"]["PATH_TO_USER"], "CACHE_TYPE" => $arComponentProps["PARAMETERS"]["CACHE_TYPE"], "CACHE_TIME" => $arComponentProps["PARAMETERS"]["CACHE_TIME"]), "USER_PARAMETERS" => array("MESSAGE_COUNT" => $arComponentProps["PARAMETERS"]["MESSAGE_COUNT"], "MESSAGE_LENGTH" => $arComponentProps["PARAMETERS"]["MESSAGE_LENGTH"], "DATE_TIME_FORMAT" => $arComponentProps["PARAMETERS"]["DATE_TIME_FORMAT"]));
$arParameters["PARAMETERS"]["PATH_TO_BLOG"]["DEFAULT"] = "/company/personal/user/#user_id#/blog/";
$arParameters["PARAMETERS"]["PATH_TO_POST"]["DEFAULT"] = "/company/personal/user/#user_id#/blog/#post_id#/";
$arParameters["PARAMETERS"]["PATH_TO_GROUP_BLOG_POST"]["DEFAULT"] = "/workgroups/group/#group_id#/blog/#post_id#/";
$arParameters["PARAMETERS"]["PATH_TO_USER"]["DEFAULT"] = "/company/personal/user/#user_id#/";
$arParameters["PARAMETERS"]["CACHE_TYPE"]["DEFAULT"] = "A";
$arParameters["PARAMETERS"]["CACHE_TIME"]["DEFAULT"] = "180";
$arParameters["USER_PARAMETERS"]["DATE_TIME_FORMAT"]["DEFAULT"] = $arParams["DATE_TIME_FORMAT"];
$arParameters["USER_PARAMETERS"]["MESSAGE_COUNT"]["DEFAULT"] = 6;
$arParameters["USER_PARAMETERS"]["MESSAGE_LENGTH"]["DEFAULT"] = 100;
示例10: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arComponentProps = CComponentUtil::GetComponentProps("bitrix:support.ticket.list", $arCurrentValues);
$arLamp = array("" => GetMessage("GD_TICKETS_P_ALL"), "red" => GetMessage("GD_TICKETS_P_RED"), "green" => GetMessage("GD_TICKETS_P_GREEN"), "grey" => GetMessage("GD_TICKETS_P_GREY"));
$arParameters = array("PARAMETERS" => array("PATH_TO_TICKET_EDIT" => array("NAME" => GetMessage("GD_TICKETS_P_PATH_TO_TICKET_EDIT"), "TYPE" => "STRING", "DEFAULT" => "/extranet/services/support.php?ID=#ID#"), "PATH_TO_TICKET_NEW" => array("NAME" => GetMessage("GD_TICKETS_P_PATH_TO_TICKET_NEW"), "TYPE" => "STRING", "DEFAULT" => "/extranet/services/support.php?show_wizard=Y")), "USER_PARAMETERS" => array("ITEMS_COUNT" => $arComponentProps["PARAMETERS"]["TICKETS_PER_PAGE"], "LAMP" => array("NAME" => GetMessage("GD_TICKETS_P_LAMP"), "TYPE" => "LIST", "VALUES" => $arLamp, "MULTIPLE" => "Y", "DEFAULT" => "")));
$arParameters["USER_PARAMETERS"]["ITEMS_COUNT"]["DEFAULT"] = "5";
示例11: GetCompProperties
function GetCompProperties($name, $template = '', $siteTemplateId = '', $arCurVals = array())
{
$stid = $siteTemplateId;
$arProps = CComponentUtil::GetComponentProps($name, $arCurVals);
$arTemplateProps = CComponentUtil::GetTemplateProps($name, $template, $stid, $arCurVals);
return $arProps['PARAMETERS'] + $arTemplateProps;
}
示例12: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arComponentProps = CComponentUtil::GetComponentProps("bitrix:socialnetwork.forum.topic.last", $arCurrentValues);
$arComponentProps["PARAMETERS"]["TOPICS_COUNT"]["DEFAULT"] = 3;
$arParameters = array("USER_PARAMETERS" => array("TOPICS_COUNT" => $arComponentProps["PARAMETERS"]["TOPICS_COUNT"]));
示例13: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arComponentProps = CComponentUtil::GetComponentProps("bitrix:advertising.banner", $arCurrentValues);
$arParameters = array("PARAMETERS" => array("TYPE" => $arComponentProps["PARAMETERS"]["TYPE"]), "USER_PARAMETERS" => array());
示例14: GetMessage
}
}
if ($nLineTo > $src_line) {
break;
}
}
}
if ($arComponent === false) {
$strWarning .= GetMessage("comp_prop_err_comp") . "<br>";
}
$arComponentDescription = array();
$arTemplatesList = array();
$templateSiteTemplate = "";
if ($strWarning == "") {
$arComponentDescription = CComponentUtil::GetComponentDescr($_GET["component_name"]);
$arComponentParameters = CComponentUtil::GetComponentProps($_GET["component_name"], $arComponent["DATA"]["PARAMS"]);
$arTemplateParameters = CComponentUtil::GetTemplateProps($_GET["component_name"], $_GET["component_template"], $_GET["template_id"], $arComponent["DATA"]["PARAMS"]);
$arParameterGroups = array();
if (isset($arComponentParameters["GROUPS"]) && is_array($arComponentParameters["GROUPS"])) {
$arParameterGroups = $arParameterGroups + $arComponentParameters["GROUPS"];
}
if (isset($arTemplateParameters) && is_array($arTemplateParameters)) {
$arParameterGroups = $arParameterGroups + array("TEMPLATE" => array("NAME" => GetMessage("comp_templ_template")));
}
$arParameters = array();
if (isset($arComponentParameters["PARAMETERS"]) && is_array($arComponentParameters["PARAMETERS"])) {
$arParameters = $arParameters + $arComponentParameters["PARAMETERS"];
}
if (isset($arTemplateParameters) && is_array($arTemplateParameters)) {
$arParameters = $arParameters + $arTemplateParameters;
}
示例15: GetComponentParams
public 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;
}