1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-29 04:55:02 +03:00

Переведены на использование конфигурационных массивов модули: mail, session, text, viewer с плагинами. Viewer.class.php пока использует константы для Assign в Smarty - это можно будет убрать только после переопределения шаблонов.

This commit is contained in:
Alexey Kachayev 2009-08-19 13:15:47 +00:00
parent aa94bb9504
commit 10d3a3773e
5 changed files with 63 additions and 25 deletions

View file

@ -15,7 +15,7 @@
--------------------------------------------------------- ---------------------------------------------------------
*/ */
require_once(DIR_SERVER_ENGINE.'/lib/external/phpMailer/class.phpmailer.php'); require_once(Config::Get('path.root.engine').'/lib/external/phpMailer/class.phpmailer.php');
/** /**
* Модуль для отправки почты(e-mail) через phpMailer * Модуль для отправки почты(e-mail) через phpMailer
@ -27,23 +27,23 @@ class LsMail extends Module {
* Настройки SMTP сервера для отправки писем * Настройки SMTP сервера для отправки писем
* *
*/ */
protected $sHost=SYS_MAIL_SMTP_HOST; protected $sHost;
protected $iPort=SYS_MAIL_SMTP_PORT; protected $iPort;
protected $sUsername=SYS_MAIL_SMTP_USER; protected $sUsername;
protected $sPassword=SYS_MAIL_SMTP_PASSWORD; protected $sPassword;
protected $bSmtpAuth=SYS_MAIL_SMTP_AUTH; protected $bSmtpAuth;
/** /**
* Метод отправки почты * Метод отправки почты
* *
* @var string * @var string
*/ */
protected $sMailerType=SYS_MAIL_TYPE; protected $sMailerType;
/** /**
* Кодировка писем * Кодировка писем
* *
* @var string * @var string
*/ */
protected $sCharSet=SYS_MAIL_CHARSET; protected $sCharSet;
/** /**
* Делать или нет перенос строк в письме * Делать или нет перенос строк в письме
* *
@ -56,13 +56,13 @@ class LsMail extends Module {
* *
* @var string * @var string
*/ */
protected $sFrom=SYS_MAIL_FROM_EMAIL; protected $sFrom;
/** /**
* Имя от кого отправляется вся почта * Имя от кого отправляется вся почта
* *
* @var string * @var string
*/ */
protected $sFromName=SYS_MAIL_FROM_NAME; protected $sFromName;
protected $sSubject=''; protected $sSubject='';
protected $sBody=''; protected $sBody='';
@ -71,6 +71,31 @@ class LsMail extends Module {
* *
*/ */
public function Init() { public function Init() {
/**
* Настройки SMTP сервера для отправки писем
*/
$this->sHost = Config::Get('sys.mail.smtp.host');
$this->iPort = Config::Get('sys.mail.smtp.port');
$this->sUsername = Config::Get('sys.mail.smtp.user');
$this->sPassword = Config::Get('sys.mail.smtp.password');
$this->bSmtpAuth = Config::Get('sys.mail.smtp.auth');
/**
* Метод отправки почты
*/
$this->sMailerType=Config::Get('sys.mail.type');
/**
* Кодировка писем
*/
$this->sCharSet=Config::Get('sys.mail.charset');
/**
* Мыло от кого отправляется вся почта
*/
$this->sFrom=Config::Get('sys.mail.from_email');
/**
* Имя от кого отправляется вся почта
*/
$this->sFromName=Config::Get('sys.mail.from_name');
/** /**
* Создаём объект phpMailer и устанвливаем ему необходимые настройки * Создаём объект phpMailer и устанвливаем ему необходимые настройки
*/ */

View file

@ -35,7 +35,7 @@ class LsSession extends Module {
* Инициализация модуля * Инициализация модуля
* *
*/ */
public function Init() { public function Init() {
/** /**
* Стартуем сессию * Стартуем сессию
*/ */

View file

@ -15,7 +15,7 @@
--------------------------------------------------------- ---------------------------------------------------------
*/ */
require_once(DIR_SERVER_ENGINE.'/lib/external/Jevix/jevix.class.php'); require_once(Config::Get('path.root.engine').'/lib/external/Jevix/jevix.class.php');
/** /**
* Модуль обработки текста на основе типографа Jevix * Модуль обработки текста на основе типографа Jevix
@ -38,7 +38,7 @@ class LsText extends Module {
* Создаем объект типографа и запускаем его конфигурацию * Создаем объект типографа и запускаем его конфигурацию
*/ */
$this->oJevix = new Jevix(); $this->oJevix = new Jevix();
$this->JevixConfig(); $this->JevixConfig();
} }
/** /**
@ -128,7 +128,7 @@ class LsText extends Module {
$sResult=$this->JevixParser($sResult); $sResult=$this->JevixParser($sResult);
$sResult=$this->VideoParser($sResult); $sResult=$this->VideoParser($sResult);
$sResult=$this->CodeSourceParser($sResult); $sResult=$this->CodeSourceParser($sResult);
if (BLOG_URL_NO_INDEX) { if (Config::Get('view.noindex')) {
// требует доработки, т.к. обрабатывает ВСЕ ссылки, включая в <code></code> // требует доработки, т.к. обрабатывает ВСЕ ссылки, включая в <code></code>
$sResult=$this->MakeUrlNoIndex($sResult); $sResult=$this->MakeUrlNoIndex($sResult);
} }

View file

@ -15,7 +15,7 @@
--------------------------------------------------------- ---------------------------------------------------------
*/ */
require_once(DIR_SERVER_ENGINE.'/lib/external/Smarty-2.6.19/libs/Smarty.class.php'); require_once(Config::Get('path.root.engine').'/lib/external/Smarty-2.6.19/libs/Smarty.class.php');
/** /**
* Модуль обработки шаблонов используя шаблонизатор Smarty * Модуль обработки шаблонов используя шаблонизатор Smarty
@ -39,19 +39,19 @@ class LsViewer extends Module {
* *
* @var unknown_type * @var unknown_type
*/ */
protected $sHtmlTitle=SITE_NAME; protected $sHtmlTitle;
/** /**
* SEO ключевые слова страницы * SEO ключевые слова страницы
* *
* @var unknown_type * @var unknown_type
*/ */
protected $sHtmlKeywords=SITE_KEYWORDS; protected $sHtmlKeywords;
/** /**
* SEO описание страницы * SEO описание страницы
* *
* @var unknown_type * @var unknown_type
*/ */
protected $sHtmlDescription=SITE_DESCRIPTION; protected $sHtmlDescription;
/** /**
* Разделитель заголовка HTML страницы * Разделитель заголовка HTML страницы
@ -83,15 +83,28 @@ class LsViewer extends Module {
* Инициализация модуля * Инициализация модуля
* *
*/ */
public function Init() { public function Init() {
/**
* Заголовок HTML страницы
*/
$this->sHtmlTitle=Config::Get('view.name');
/**
* SEO ключевые слова страницы
*/
$this->sHtmlKeywords=Config::Get('view.keywords');
/**
* SEO описание страницы
*/
$this->sHtmlDescription=Config::Get('view.description');
/** /**
* Создаём объект Smarty и устанавливаем необходиму параметры * Создаём объект Smarty и устанавливаем необходиму параметры
*/ */
$this->oSmarty = new Smarty(); $this->oSmarty = new Smarty();
$this->oSmarty->template_dir=DIR_SMARTY_TEMPLATE; $this->oSmarty->template_dir=Config::Get('path.smarty.template');
$this->oSmarty->compile_dir=DIR_SMARTY_COMPILED; $this->oSmarty->compile_dir=Config::Get('path.smarty.compiled');
$this->oSmarty->cache_dir=DIR_SMARTY_CACHE; $this->oSmarty->cache_dir=Config::Get('path.smarty.cache');
$this->oSmarty->plugins_dir=array(DIR_SMARTY_PLUG,'plugins'); $this->oSmarty->plugins_dir=array(Config::Get('path.smarty.plug'),'plugins');
/** /**
* Подключаем к Smarty небольшой плагинчик форматирования даты * Подключаем к Smarty небольшой плагинчик форматирования даты
*/ */
@ -238,7 +251,7 @@ class LsViewer extends Module {
*/ */
if ($sResponseAjax) { if ($sResponseAjax) {
if ($sResponseAjax=='jsHttpRequest') { if ($sResponseAjax=='jsHttpRequest') {
require_once(DIR_SERVER_ENGINE."/lib/external/JsHttpRequest/JsHttpRequest.php"); require_once(Config::Get('path.root.engine')."/lib/external/JsHttpRequest/JsHttpRequest.php");
$JsHttpRequest = new JsHttpRequest("UTF-8"); $JsHttpRequest = new JsHttpRequest("UTF-8");
} }
$this->Security_ValidateSendForm(); $this->Security_ValidateSendForm();

View file

@ -47,7 +47,7 @@ function smarty_insert_block($aParams,&$oSmarty) {
/** /**
* Подключаем необходимый обработчик * Подключаем необходимый обработчик
*/ */
$result=require_once(DIR_SERVER_ROOT.'/classes/blocks/Block'.$sBlock.'.class.php'); $result=require_once(Config::Get('path.root.server').'/classes/blocks/Block'.$sBlock.'.class.php');
$sCmd='$oBlock=new Block'.$sBlock.'($aParamsBlock);'; $sCmd='$oBlock=new Block'.$sBlock.'($aParamsBlock);';
eval($sCmd); eval($sCmd);
/** /**