This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via d1c7b365ce3d4c4084e986b0b1370427afcf3f45 (commit)
from 3d1e5e46396c89b96c63fe19a81f0370a2895ff0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d1c7b365ce3d4c4084e986b0b1370427afcf3f45
Author: Ivan1986 <iva...@li...>
Date: Mon Apr 26 17:27:23 2010 +0400
Класс состояния шаблона в файл абстрактного шаблонизатора
diff --git a/QFW/Templater/Templater.php b/QFW/Templater/Templater.php
index f69de23..eb95493 100644
--- a/QFW/Templater/Templater.php
+++ b/QFW/Templater/Templater.php
@@ -164,4 +164,45 @@ abstract class Templater
}
+/**
+ * Класс для сохранения состояния шаблонизатора<br>
+ * Сохраняет путь к шаблонам и переменные
+ *
+ * @author ivan1986
+ */
+class TemplaterState
+{
+ /** @var string текущий путь к шаблонам */
+ private $path;
+
+ /** @var array Массив переменных */
+ private $vars;
+
+ /** @var Templater_PlainView Ссылка на шаболонизатор */
+ private $tpl;
+
+ /**
+ * Сохраняет все переменные в шаблоне, а при уничтожении восстанавливает
+ *
+ * @param Templater_PlainView $templater
+ */
+ public function __construct($templater)
+ {
+ $this->path = $templater->getScriptPath();
+ $this->vars = $templater->getTemplateVars();
+ $this->tpl = $templater;
+ }
+
+ /**
+ * Восстанавливает старые переменные
+ */
+ public function __destruct()
+ {
+ $this->tpl->setScriptPath($this->path);
+ $this->tpl->clearVars();
+ $this->tpl->assign($this->vars);
+ }
+
+};
+
?>
\ No newline at end of file
diff --git a/lib/Modules/Scafold/ScafoldController.php b/lib/Modules/Scafold/ScafoldController.php
index 6fd853b..7d1b626 100644
--- a/lib/Modules/Scafold/ScafoldController.php
+++ b/lib/Modules/Scafold/ScafoldController.php
@@ -89,7 +89,6 @@ abstract class ScafoldController extends Controller
{
// считаем страницы с нуля и убираем отрицательные
$page = max($page-1, 0);
- require_once LIBPATH.'/TemplaterState.php';
$state = new TemplaterState(QFW::$view);
QFW::$view->setScriptPath(dirname(__FILE__));
@@ -219,7 +218,6 @@ abstract class ScafoldController extends Controller
$data = QFW::$db->selectRow('SELECT * FROM ?# WHERE ?#=?',
$this->table, $this->primaryKey, $id);
- require_once LIBPATH.'/TemplaterState.php';
$state = new TemplaterState(QFW::$view);
QFW::$view->setScriptPath(dirname(__FILE__));
diff --git a/lib/TemplaterState.php b/lib/TemplaterState.php
deleted file mode 100644
index be4df18..0000000
--- a/lib/TemplaterState.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-/**
- * Класс для сохранения состояния шаблонизатора<br>
- * Сохраняет путь к шаблонам и переменные
- *
- * @author ivan1986
- */
-class TemplaterState
-{
- /** @var string текущий путь к шаблонам */
- private $path;
-
- /** @var array Массив переменных */
- private $vars;
-
- /** @var Templater_PlainView Ссылка на шаболонизатор */
- private $tpl;
-
- /**
- * Сохраняет все переменные в шаблоне, а при уничтожении восстанавливает
- *
- * @param Templater_PlainView $templater
- */
- public function __construct($templater)
- {
- $this->path = $templater->getScriptPath();
- $this->vars = $templater->getTemplateVars();
- $this->tpl = $templater;
- }
-
- /**
- * Восстанавливает старые переменные
- */
- public function __destruct()
- {
- $this->tpl->setScriptPath($this->path);
- $this->tpl->clearVars();
- $this->tpl->assign($this->vars);
- }
-
-};
-
-?>
-----------------------------------------------------------------------
Summary of changes:
QFW/Templater/Templater.php | 41 +++++++++++++++++++++++++++
lib/Modules/Scafold/ScafoldController.php | 2 -
lib/TemplaterState.php | 44 -----------------------------
3 files changed, 41 insertions(+), 46 deletions(-)
delete mode 100644 lib/TemplaterState.php
hooks/post-receive
--
quickfw
|