Альтернативный белый список

This commit is contained in:
Origami11 2020-11-02 18:00:14 +03:00
parent 86a180123b
commit 82c129305e
19 changed files with 82 additions and 131 deletions

View file

@ -23,7 +23,8 @@ class ComponentRequest {
if ($key == 'active_page') {
return $this->r->get($key);
}
if ($arr = $this->r->get($key)) {
$arr = $this->r->get($key);
if ($arr !== NULL) {
if (is_array($arr)) {
return Arr::get($arr, $this->component_id, $default);
} else {
@ -127,6 +128,14 @@ class Controller_Component
}
public function getTemplatePath($name) {
/*.Settings.*/$registry = $this->registry;
$template = ($this->template) ? $this->template : $registry->readKey(array('system', 'template'));
foreach ($this->viewPath as $index => $viewPath) {
if(is_dir(Path::join($this->viewPath[$index], 'templates', $template))) {
return Path::join($this->viewPath[$index], 'templates', $template, $name);
}
}
return Path::join($this->viewPath[0], 'templates', 'modern', $name);
}
@ -182,7 +191,7 @@ class Controller_Component
$options = new Form_OptionFactory($this->db, $this->registry);
$settings = $this->getInfo();
$form->addFieldList($settings['parameter'], $options);
$form->addFieldList($settings['parameter'], $options);
$view->form = $form;
$view->component = $settings['component'];
@ -271,10 +280,9 @@ class Controller_Component
if(class_exists("Controller_Site")){ //Если мы в CMS2
$instance = Controller_Site::getInstance();
$instance->componentsConfig[] = $editor;
}else{
} else {
global $componentsConfig;
$componentsConfig[] = $editor;
}
}