From f3adc4550d97022063ebf9f14c4e413d99de84c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=91=D0=B4=D0=BE=D1=80=20=D0=9F=D0=BE=D0=B4=D0=BB?= =?UTF-8?q?=D0=B5=D1=81=D0=BD=D0=BE=D0=B2?= Date: Thu, 8 Feb 2018 17:14:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=82=D0=B8=D0=BF=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controller/Component.php | 3 +++ src/Database.php | 2 +- src/MailAlt.php | 4 ++-- src/Validator/Rule/Abstract.php | 2 +- src/View/Top.php | 10 +++++----- src/tales.php | 4 ++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Controller/Component.php b/src/Controller/Component.php index 3cd678d..c70c718 100644 --- a/src/Controller/Component.php +++ b/src/Controller/Component.php @@ -50,6 +50,7 @@ class Controller_Component public $templatePath; public $component_id; + public $component_title; public $COMPONENTS_WEB; public /*.Settings.*/$registry; @@ -207,6 +208,8 @@ class Controller_Component $path = Path::join (BASE_PATH, 'components', $name, $name . '.php'); $className = 'Component_' . $name; + + /*.Controller_Component.*/$component = null; if (file_exists($path)) { require_once ($path); diff --git a/src/Database.php b/src/Database.php index 836a54a..b08d864 100644 --- a/src/Database.php +++ b/src/Database.php @@ -70,7 +70,7 @@ class Database extends PDO /** * Извлекает из базы все элементы по запросу */ - public function fetchAllArray($query,$values=null) + public function fetchAllArray($query, $values = null) { /*.Database_PDOStatement.*/$sth = $this->prepare($query); $prep = $this->prepareValues($values); diff --git a/src/MailAlt.php b/src/MailAlt.php index 48f9a60..99b296d 100644 --- a/src/MailAlt.php +++ b/src/MailAlt.php @@ -48,7 +48,7 @@ class MailAlt /** * Тема письма */ - function subject($subject) + function subject(/*.string.*/$subject) { $this->mailer->Subject = $subject; } @@ -77,7 +77,7 @@ class MailAlt /** * Добавление вложения из файла */ - function addAttachment($filename, $name = false) + function addAttachment($filename, $name = null) { $this->mailer->addAttachment($filename, $name); } diff --git a/src/Validator/Rule/Abstract.php b/src/Validator/Rule/Abstract.php index cc5548f..40f5acc 100644 --- a/src/Validator/Rule/Abstract.php +++ b/src/Validator/Rule/Abstract.php @@ -6,7 +6,7 @@ abstract class Validator_Rule_Abstract protected $errorMsg; protected $ctx; - public function __construct($field, $errorMsg = false) + public function __construct($field, $errorMsg = null) { $this->field = $field; $this->errorMsg = $errorMsg; diff --git a/src/View/Top.php b/src/View/Top.php index 480f00d..d28fca0 100644 --- a/src/View/Top.php +++ b/src/View/Top.php @@ -23,9 +23,9 @@ class View_Top extends View_Composite { return false; } - private function groupFiles(array $list, $debug = true) + private function groupFiles(array $list, $debugMode = true) { - $debug = ($debug) ? 'debug=1' : ''; + $debug = ($debugMode) ? 'debug=1' : ''; $path = parse_url(WWW_PATH, PHP_URL_PATH); $groups = array(); @@ -77,12 +77,12 @@ class View_Top extends View_Composite { if (is_string($s)) { continue; } - $module = explode('_', $s->active_module, 2); - if (count($module) < 2) { + $moduleName = explode('_', $s->active_module, 2); + if (count($moduleName) < 2) { continue; } - $module = $module[1]; + $module = $moduleName[1]; $name = mb_strtolower($module); $fname = $name . '/' . $name; diff --git a/src/tales.php b/src/tales.php index 5739bef..ac34ef8 100644 --- a/src/tales.php +++ b/src/tales.php @@ -49,7 +49,7 @@ function phptal_component ($expression) { if(class_exists("Controller_Site")){ //Если мы в CMS2 $component = Controller_Site::loadComponent($expression); - }else{ + } else { global $db, $registry; // Иначе обращаемся к глобальным переменным $component = Controller_Component::loadComponent($expression, $db, $registry); } @@ -57,7 +57,7 @@ function phptal_component ($expression) { $result = $component->execute($req); - echo ""; + echo ""; return $result; }