Beispiel #1
0
 /**
  * Получить массив описания параметров компонента
  * @return Array - массив настроек компонента
  */
 public function getSettings()
 {
     $arComponentName = array('NAMESPACE' => &$this->_componentNamespace, 'NAME' => &$this->_componentName, 'PATH' => &$this->_componentPath, 'DESCRIPTION' => &$this->_componentDescription);
     $arTemplateName = array('NAME' => &$this->_templateName, 'SKIN' => &$this->_templateSkin, 'PATH' => &$this->_templatePath, 'DESCRIPTION' => &$this->_templateDescription);
     $arSettings = ComponentTools::_getSettingsByName($arComponentName, $arTemplateName);
     ComponentTools::setParametersListForEachGroup($arSettings);
     return $arSettings;
 }
namespace ScriptAcid;

require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/kernel.php";
//sleep(2);
if (!App::USER()->IsAdmin()) {
    die('error: access denied.');
}
$componentName = $_GET['component_name'];
$templateName = $_GET['template_name'];
$arComponentSettings = ComponentTools::getSettingsByName($componentName, $templateName);
//$arTemplateSettings = Component::getTemplateSettingsByName($componentName, $templateName);
if (!$arComponentSettings) {
    die('error: illegal component name "' . $componentName . '"');
}
ComponentTools::setParametersListForEachGroup($arComponentSettings);
if ($arComponentSettings === false) {
    exit('error: incorrect component name.');
}
//d($_GET, '$_GET');
//d($_POST, '$_POST');
$arCurrentParams = array();
if (is_array($_POST['current_params'])) {
    $arCurrentParams = $_POST['current_params'];
}
$arHiddenParams = array();
// Задаем текущие значения
foreach ($arComponentSettings['PARAMETERS'] as $keyParameter => &$arParameter) {
    $arParameter['CURRENT_VALUE'] = null;
    if (@isset($arCurrentParams[$keyParameter])) {
        $arParameter['CURRENT_VALUE'] = $arCurrentParams[$keyParameter];