openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 066192f73bc01928b927d17efed10bca7d48bddf
parent 597130d5544aaca4f5669da300283aaefb8cecbd
Author: Jan Dankert <devnull@localhost>
Date:   Sun,  3 Dec 2017 04:14:42 +0100

Namespace für Template-Engine

Diffstat:
modules/template-engine/components/html/Component.class.php | 6++++--
modules/template-engine/components/html/button/Button.class.php | 2++
modules/template-engine/components/html/checkbox/Checkbox.class.php | 2++
modules/template-engine/components/html/column/Column.class.php | 2++
modules/template-engine/components/html/date/Date.class.php | 2++
modules/template-engine/components/html/dummy/Dummy.class.php | 2++
modules/template-engine/components/html/editor/Editor.class.php | 4+++-
modules/template-engine/components/html/else/Else.class.php | 2++
modules/template-engine/components/html/focus/Focus.class.php | 2++
modules/template-engine/components/html/form/Form.class.php | 2++
modules/template-engine/components/html/group/Group.class.php | 2++
modules/template-engine/components/html/header/Header.class.php | 2++
modules/template-engine/components/html/hidden/Hidden.class.php | 2++
modules/template-engine/components/html/if/If.class.php | 4+++-
modules/template-engine/components/html/image/Image.class.php | 2++
modules/template-engine/components/html/input/Input.class.php | 2++
modules/template-engine/components/html/inputarea/Inputarea.class.php | 2++
modules/template-engine/components/html/insert/Insert.class.php | 2++
modules/template-engine/components/html/label/Label.class.php | 2++
modules/template-engine/components/html/link/Link.class.php | 2++
modules/template-engine/components/html/list/List.class.php | 2++
modules/template-engine/components/html/logo/Logo.class.php | 2++
modules/template-engine/components/html/newline/Newline.class.php | 2++
modules/template-engine/components/html/output/Output.class.php | 2++
modules/template-engine/components/html/page/Window.class.php | 2++
modules/template-engine/components/html/part/Part.class.php | 2++
modules/template-engine/components/html/password/Password.class.php | 2++
modules/template-engine/components/html/qrcode/Qrcode.class.php | 2++
modules/template-engine/components/html/radio/Radio.class.php | 2++
modules/template-engine/components/html/radiobox/Radiobox.class.php | 2++
modules/template-engine/components/html/row/Row.class.php | 2++
modules/template-engine/components/html/selectbox/Selectbox.class.php | 2++
modules/template-engine/components/html/selector/Selector.class.php | 2++
modules/template-engine/components/html/set/Set.class.php | 2++
modules/template-engine/components/html/table/Table.class.php | 2++
modules/template-engine/components/html/text/Text.class.php | 2++
modules/template-engine/components/html/tree/Tree.class.php | 2++
modules/template-engine/components/html/upload/Upload.class.php | 2++
modules/template-engine/components/html/user/User.class.php | 2++
modules/template-engine/components/html/window/Window.class.php | 2++
modules/template-engine/engine/TemplateEngine.class.php | 2+-
41 files changed, 85 insertions(+), 5 deletions(-)

diff --git a/modules/template-engine/components/html/Component.class.php b/modules/template-engine/components/html/Component.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + abstract class Component { @@ -144,7 +146,7 @@ class Expression case 'text': return $this->value; default: - throw new LogicException("Invalid expression type '$type' in attribute value. Allowed: text|var"); + throw new \LogicException("Invalid expression type '$type' in attribute value. Allowed: text|var"); } } @@ -209,7 +211,7 @@ class Expression return $invert.'@$conf['."'".implode("'".']'.'['."'",$config_parts)."'".']'; default: - throw new LogicException("Unknown expression type '{$this->type}' in attribute value. Allowed: var|function|method|text|size|property|message|messagevar|arrayvar|config or none"); + throw new \LogicException("Unknown expression type '{$this->type}' in attribute value. Allowed: var|function|method|text|size|property|message|messagevar|arrayvar|config or none"); } } diff --git a/modules/template-engine/components/html/button/Button.class.php b/modules/template-engine/components/html/button/Button.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class ButtonComponent extends Component { diff --git a/modules/template-engine/components/html/checkbox/Checkbox.class.php b/modules/template-engine/components/html/checkbox/Checkbox.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class CheckboxComponent extends Component { diff --git a/modules/template-engine/components/html/column/Column.class.php b/modules/template-engine/components/html/column/Column.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class ColumnComponent extends Component { public $width; diff --git a/modules/template-engine/components/html/date/Date.class.php b/modules/template-engine/components/html/date/Date.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class DateComponent extends Component { public $date; diff --git a/modules/template-engine/components/html/dummy/Dummy.class.php b/modules/template-engine/components/html/dummy/Dummy.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class DummyComponent extends Component { } diff --git a/modules/template-engine/components/html/editor/Editor.class.php b/modules/template-engine/components/html/editor/Editor.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class EditorComponent extends Component { public $type; @@ -47,7 +49,7 @@ HTML; break; default: - throw new LogicException("Unknown editor type: ".$this->type); + throw new \LogicException("Unknown editor type: ".$this->type); } } } diff --git a/modules/template-engine/components/html/else/Else.class.php b/modules/template-engine/components/html/else/Else.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class ElseComponent extends Component { diff --git a/modules/template-engine/components/html/focus/Focus.class.php b/modules/template-engine/components/html/focus/Focus.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class FocusComponent extends Component { diff --git a/modules/template-engine/components/html/form/Form.class.php b/modules/template-engine/components/html/form/Form.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class FormComponent extends Component { diff --git a/modules/template-engine/components/html/group/Group.class.php b/modules/template-engine/components/html/group/Group.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class GroupComponent extends Component { diff --git a/modules/template-engine/components/html/header/Header.class.php b/modules/template-engine/components/html/header/Header.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class HeaderComponent extends Component { public function begin() diff --git a/modules/template-engine/components/html/hidden/Hidden.class.php b/modules/template-engine/components/html/hidden/Hidden.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class HiddenComponent extends Component { diff --git a/modules/template-engine/components/html/if/If.class.php b/modules/template-engine/components/html/if/If.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class IfComponent extends Component { public $true; @@ -36,7 +38,7 @@ HTML; elseif (! empty($this->empty)) echo 'empty(' . $this->textasvarname($this->empty).')'; else - throw new LogicException("Element 'if' has not enough parameters."); + throw new \LogicException("Element 'if' has not enough parameters."); echo '); if($if'.$this->getDepth().'){?>'; } diff --git a/modules/template-engine/components/html/image/Image.class.php b/modules/template-engine/components/html/image/Image.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class ImageComponent extends Component { diff --git a/modules/template-engine/components/html/input/Input.class.php b/modules/template-engine/components/html/input/Input.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class InputComponent extends Component { diff --git a/modules/template-engine/components/html/inputarea/Inputarea.class.php b/modules/template-engine/components/html/inputarea/Inputarea.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class InputareaComponent extends Component { diff --git a/modules/template-engine/components/html/insert/Insert.class.php b/modules/template-engine/components/html/insert/Insert.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class InsertComponent extends Component { public $name= ''; diff --git a/modules/template-engine/components/html/label/Label.class.php b/modules/template-engine/components/html/label/Label.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class LabelComponent extends Component { diff --git a/modules/template-engine/components/html/link/Link.class.php b/modules/template-engine/components/html/link/Link.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + /** * Erzeugt einen HTML-Link. * diff --git a/modules/template-engine/components/html/list/List.class.php b/modules/template-engine/components/html/list/List.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class ListComponent extends Component { diff --git a/modules/template-engine/components/html/logo/Logo.class.php b/modules/template-engine/components/html/logo/Logo.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class LogoComponent extends Component { public $name; diff --git a/modules/template-engine/components/html/newline/Newline.class.php b/modules/template-engine/components/html/newline/Newline.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class NewlineComponent extends Component { diff --git a/modules/template-engine/components/html/output/Output.class.php b/modules/template-engine/components/html/output/Output.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class OutputComponent extends Component { } diff --git a/modules/template-engine/components/html/page/Window.class.php b/modules/template-engine/components/html/page/Window.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class WindowComponent extends Component { } diff --git a/modules/template-engine/components/html/part/Part.class.php b/modules/template-engine/components/html/part/Part.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class PartComponent extends Component { public $class = ''; diff --git a/modules/template-engine/components/html/password/Password.class.php b/modules/template-engine/components/html/password/Password.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class PasswordComponent extends Component { diff --git a/modules/template-engine/components/html/qrcode/Qrcode.class.php b/modules/template-engine/components/html/qrcode/Qrcode.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class QrcodeComponent extends Component { diff --git a/modules/template-engine/components/html/radio/Radio.class.php b/modules/template-engine/components/html/radio/Radio.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class RadioComponent extends Component { diff --git a/modules/template-engine/components/html/radiobox/Radiobox.class.php b/modules/template-engine/components/html/radiobox/Radiobox.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class RadioboxComponent extends Component { diff --git a/modules/template-engine/components/html/row/Row.class.php b/modules/template-engine/components/html/row/Row.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class RowComponent extends Component { diff --git a/modules/template-engine/components/html/selectbox/Selectbox.class.php b/modules/template-engine/components/html/selectbox/Selectbox.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class SelectboxComponent extends Component { diff --git a/modules/template-engine/components/html/selector/Selector.class.php b/modules/template-engine/components/html/selector/Selector.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class SelectorComponent extends Component { diff --git a/modules/template-engine/components/html/set/Set.class.php b/modules/template-engine/components/html/set/Set.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class SetComponent extends Component { public $var; diff --git a/modules/template-engine/components/html/table/Table.class.php b/modules/template-engine/components/html/table/Table.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class TableComponent extends Component { diff --git a/modules/template-engine/components/html/text/Text.class.php b/modules/template-engine/components/html/text/Text.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class TextComponent extends Component { public $prefix = ''; diff --git a/modules/template-engine/components/html/tree/Tree.class.php b/modules/template-engine/components/html/tree/Tree.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class TreeComponent extends Component { public $tree; diff --git a/modules/template-engine/components/html/upload/Upload.class.php b/modules/template-engine/components/html/upload/Upload.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class UploadComponent extends Component { public $size = 40; diff --git a/modules/template-engine/components/html/user/User.class.php b/modules/template-engine/components/html/user/User.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class UserComponent extends Component { public $user; diff --git a/modules/template-engine/components/html/window/Window.class.php b/modules/template-engine/components/html/window/Window.class.php @@ -1,5 +1,7 @@ <?php +namespace template_engine\components; + class WindowComponent extends Component { } diff --git a/modules/template-engine/engine/TemplateEngine.class.php b/modules/template-engine/engine/TemplateEngine.class.php @@ -101,7 +101,7 @@ class TemplateEngine require_once ($classFilename); - $className .= 'Component'; + $className = 'template_engine\components\\'.$className .'Component'; $component = new $className(); $component->setDepth($depth);