diff --git a/src/Controller/Action.php b/src/Controller/Action.php index 9c72537..9d5753f 100644 --- a/src/Controller/Action.php +++ b/src/Controller/Action.php @@ -211,7 +211,8 @@ class Controller_Action public function nUrl($name, array $param = array()) { /*.Filter_ActionAccess.*/$access = $this->access; - if ($access != null || $access->checkAction($name)) { + + if ($access == null || $access->checkAction($name)) { return lcurry(array($this, 'postUrl'), $name, $param); } return null; diff --git a/src/Form/Form.php b/src/Form/Form.php index 3ea0a59..f0e6922 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -302,6 +302,7 @@ class Form_Form extends View_View { 'hidden' => 'THidden', 'radio' => 'TSelectOne', 'filebrowser' => 'TComponentBrowserInput', + 'documents' => 'TComponentBrowserInput', ); } diff --git a/src/MailAlt.php b/src/MailAlt.php new file mode 100644 index 0000000..f8761f6 --- /dev/null +++ b/src/MailAlt.php @@ -0,0 +1,90 @@ +mailer = new PHPMailer(); + $this->mailer->CharSet = 'UTF-8'; + } + + /** + * Установка отправителя + */ + function from($name) + { + $this->mailer->setFrom($name); + } + + /** + * Установка получателя + */ + function to($name) // recipient + { + $this->mailer->addAddress($name); + } + + function replyTo($name) // recipient + { + $this->mailer->AddReplyTo($name); + } + + /** + * Установка получателей копии + */ + function copy($name) // recipient cc + { + $this->addCC($name); + } + + function notify($notify) + { + $this->_notify = $notify; + } + + /** + * Тема письма + */ + function subject($subject) + { + $this->mailer->Subject = $subject; + } + + /** + * Текст письма + */ + function setContent($text) + { + $this->mailer->Body = $text; + } + + function setType($text) + { + $this->mailer->isHTML($text == 'text/html'); + } + + /** + * Кодировка текста в письме + */ + function setEncoding($encoding) + { + $this->encoding = $encoding; + } + + /** + * Добавление вложения из файла + */ + function addAttachment($filename, $name = false) + { + $this->mailer->addAttachment($filename, $name); + } + + /** + * Отправка почты + */ + function send() + { + return $this->mailer->send(); + } +} diff --git a/src/Validator/Validator.php b/src/Validator/Validator.php index 5a3bc4c..c429efe 100644 --- a/src/Validator/Validator.php +++ b/src/Validator/Validator.php @@ -44,6 +44,7 @@ class Validator_Validator // Список правил if (! isset($value['validate'])) continue; $rules = explode("|", $value['validate']); + foreach ($rules as $rule) { // Список параметров правила $rule_param = explode(",", $rule);