No newline at end of file #0
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@106 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -106,4 +106,4 @@ abstract class Action
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -133,4 +133,4 @@ final class Cache
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@ -156,4 +156,4 @@ class DBConnector
|
||||
return mysqli_rollback($handler);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Родительский класс для всех декораторов. Содержит основной функционал.
|
||||
* Родительский класс для всех декораторов. Содержит основной функционал.
|
||||
*
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link
|
||||
* @package Majestic
|
||||
* @subpackage Decorator
|
||||
* @since
|
||||
* @since
|
||||
* @version SVN: $Id$
|
||||
* @filesource $URL$
|
||||
*/
|
||||
@ -59,4 +59,4 @@ abstract class Decorator
|
||||
*/
|
||||
abstract function exec();
|
||||
}
|
||||
?>
|
||||
?>
|
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Эксепшен для выводя результата работы класса
|
||||
* Эксепшен для выводя результата работы класса
|
||||
*
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link
|
||||
* @package Majestic
|
||||
* @subpackage Core
|
||||
* @since
|
||||
* @since
|
||||
* @version SVN: $Id$
|
||||
* @filesource $URL$
|
||||
*/
|
||||
class DynamicPageException extends Exception
|
||||
{}
|
||||
?>
|
||||
?>
|
@ -88,4 +88,4 @@ final class Env
|
||||
return $param ? $res[$param] : $res;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -191,7 +191,7 @@ class Format
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Байты в мегабайты
|
||||
* @param int $bytes
|
||||
@ -202,7 +202,7 @@ class Format
|
||||
$mb = number_format((int) $bytes / 1024 / 1024, 2, '.', '');
|
||||
return preg_replace("/(\.?)0+$/", "", $mb) . 'МБ';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Байты в килобайты
|
||||
* @param int $bytes
|
||||
@ -219,4 +219,4 @@ class Format
|
||||
* Оффсет с учетом летнего/зимнего времени
|
||||
*/
|
||||
Format::setTimezoneOffset(date('Z') - ((date('I') ? 60*60 : 0 )));
|
||||
?>
|
||||
?>
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link
|
||||
*
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link
|
||||
* @package Majestic
|
||||
* @subpackage Load
|
||||
* @since
|
||||
* @since
|
||||
* @version SVN: $Id$
|
||||
* @filesource $URL$
|
||||
*/
|
||||
@ -21,7 +21,7 @@ class Load
|
||||
if (isset(self::$models[$model_name])) {
|
||||
return self::$models[$model_name];
|
||||
}
|
||||
|
||||
|
||||
$class_name = $model_name.MODEL_POSTFIX;
|
||||
return self::$models[$model_name] = new $class_name;
|
||||
}
|
||||
@ -42,4 +42,4 @@ class Load
|
||||
return self::$router ? self::$router : self::$router = new Router;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -63,4 +63,4 @@ class MJException extends Exception
|
||||
return $return . '</table>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Класс для отправки почты
|
||||
*
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
*
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link http://netmonsters.ru
|
||||
* @package Core
|
||||
* @subpackage mail
|
||||
* @since
|
||||
* @since
|
||||
* @version SVN: $Id$
|
||||
* @filesource $URL$
|
||||
*/
|
||||
@ -18,16 +18,16 @@ class Mailer
|
||||
public $templater;
|
||||
public $headers;
|
||||
protected $host;
|
||||
|
||||
function __construct($host, $template = null)
|
||||
|
||||
function __construct($host, $template = null)
|
||||
{
|
||||
if ($template !== null) {
|
||||
$this->templater = Load::templater(ACTION_TPL_PATH . '/' . $this->template_dir);
|
||||
$this->template = $template;
|
||||
}
|
||||
|
||||
|
||||
$this->host = $host;
|
||||
|
||||
|
||||
$this->headers .= 'From: robot@' . $this->host . "\r\n";
|
||||
$this->headers .= 'Date: '. date('r') ."\r\n";
|
||||
$this->headers .= "Return-Path: robot@". $this->host ."\r\n";
|
||||
@ -43,7 +43,7 @@ class Mailer
|
||||
|
||||
/**
|
||||
* Отправляет письма
|
||||
*
|
||||
*
|
||||
* @param mixed $mail
|
||||
* @param mixed $subject
|
||||
* @param mixed $data
|
||||
@ -51,19 +51,19 @@ class Mailer
|
||||
function send ($mail, $subject, $data)
|
||||
{
|
||||
$this->headers .= "To: ".$mail."\r\n";
|
||||
|
||||
|
||||
foreach ($data as $key => $val) {
|
||||
$this->templater->assign($key, $val);
|
||||
}
|
||||
|
||||
|
||||
$message = $this->templater->fetch($this->template.'.tpl');
|
||||
$encoded_subject = '=?UTF-8?B?' . base64_encode($subject) . "?=\r\n";
|
||||
return mail($mail, $subject, $message, $this->headers);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Отправка письма с непосредственным указанием контента
|
||||
*
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $subject
|
||||
* @param string $content
|
||||
@ -75,4 +75,4 @@ class Mailer
|
||||
return mail($email, $encoded_subject, $content, $this->headers);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -250,4 +250,4 @@ class ModelInsertResult extends ModelChangeResult
|
||||
return $this->id;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -12,16 +12,16 @@
|
||||
*/
|
||||
class PageController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Действия на инициализацию.
|
||||
*
|
||||
*
|
||||
*/
|
||||
protected function init() {}
|
||||
|
||||
/**
|
||||
* Действия после разбора роута.
|
||||
*
|
||||
*
|
||||
*/
|
||||
protected function onDispatch() {}
|
||||
|
||||
@ -57,4 +57,4 @@ class PageController
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -13,55 +13,55 @@
|
||||
|
||||
|
||||
class Pager extends Action
|
||||
{
|
||||
{
|
||||
public $template_dir = '.';
|
||||
|
||||
|
||||
protected $current_page = 1;
|
||||
protected $max_page_num;
|
||||
protected $num_rows;
|
||||
protected $limit;
|
||||
protected $start_offset = 0;
|
||||
protected $count = 0;
|
||||
|
||||
|
||||
public function __construct($count, $current_page = 1, $records_limit = 20)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
|
||||
$this->count = $count;
|
||||
$this->limit = $records_limit;
|
||||
|
||||
|
||||
$this->max_page_num = ceil($this->count/$this->limit);
|
||||
$this->current_page = ((int)$current_page <= $this->max_page_num && (int)$current_page > 0) ? (int)$current_page : 1;
|
||||
|
||||
|
||||
$this->start_offset = $this->limit * ($this->current_page - 1);
|
||||
$this->num_rows = ($this->limit + $this->start_offset) <= $this->count ? ($this->limit + $this->start_offset) : $this->count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Возвращает текущую страницу
|
||||
*
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPage()
|
||||
{
|
||||
return $this->current_page;
|
||||
}
|
||||
|
||||
|
||||
public function startOffset()
|
||||
{
|
||||
return $this->start_offset;
|
||||
}
|
||||
|
||||
|
||||
public function limit()
|
||||
{
|
||||
return $this->limit;
|
||||
}
|
||||
|
||||
|
||||
public function setNumRows($num_rows)
|
||||
{
|
||||
$this->num_rows = $num_rows;
|
||||
}
|
||||
|
||||
|
||||
function init()
|
||||
{
|
||||
$this->template = "Pager";
|
||||
@ -75,4 +75,4 @@ class Pager extends Action
|
||||
$this->templater->assign('count', $this->count);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -128,4 +128,4 @@ final class Route
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Эксепшен для вывода статических шаблонов
|
||||
* Эксепшен для вывода статических шаблонов
|
||||
*
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link
|
||||
* @copyright NetMonsters <team@netmonsters.ru>
|
||||
* @link
|
||||
* @package Majestic
|
||||
* @subpackage Core
|
||||
* @since
|
||||
* @since
|
||||
* @version SVN: $Id$
|
||||
* @filesource $URL$
|
||||
*/
|
||||
@ -15,4 +15,4 @@ class StaticPageException extends Exception
|
||||
{
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
@ -172,4 +172,4 @@ final class Sublimer
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@ -107,4 +107,4 @@ class DBConnector
|
||||
throw new MJException('Rollback disabled for postgreSQL Connector' ,1);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
Reference in New Issue
Block a user