openrat-cms

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

commit 7a6c79051c8d0fa6f3f8d14f8de54101c21b2090
parent 49b6b2ab58c6438c62a8102aec1fdb948c2793ea
Author: dankert <openrat@jandankert.de>
Date:   Fri, 18 Mar 2022 22:38:42 +0100

Refactoring: Extracted the TemplateGenerator out of the PageGenerator.

Diffstat:
Mmodules/cms/action/BaseAction.class.php | 21++++++++++++++++++++-
Mmodules/cms/action/PageAction.class.php | 10++++------
Mmodules/cms/action/page/PagePreviewAction.class.php | 9+++++----
Mmodules/cms/action/template/TemplatePreviewAction.class.php | 2+-
Mmodules/cms/action/template/TemplateShowAction.class.php | 55++++++++++++++++++++-----------------------------------
Mmodules/cms/action/text/TextShowAction.class.php | 4+---
Mmodules/cms/generator/PageGenerator.class.php | 105+++++--------------------------------------------------------------------------
Amodules/cms/generator/TemplateGenerator.class.php | 150+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmodules/cms/generator/link/PreviewLink.class.php | 11++++-------
Mmodules/cms/generator/link/PublicLink.class.php | 2++
Mmodules/cms/model/Element.class.php | 47+++++++++++++++++++++++++++++++++++++----------
Dmodules/cms/ui/themes/default/html/views/file/show.php | 2--
Dmodules/cms/ui/themes/default/html/views/file/show.tpl.src.xml | 1-
Dmodules/cms/ui/themes/default/html/views/folder/show.php | 61-------------------------------------------------------------
Dmodules/cms/ui/themes/default/html/views/folder/show.tpl.src.xml | 53-----------------------------------------------------
Mmodules/cms/ui/themes/default/html/views/image/preview.php | 2+-
Mmodules/cms/ui/themes/default/html/views/image/preview.tpl.src.xml | 2+-
Dmodules/cms/ui/themes/default/html/views/image/show.php | 15---------------
Dmodules/cms/ui/themes/default/html/views/image/show.tpl.src.xml | 15---------------
Dmodules/cms/ui/themes/default/html/views/page/show.php | 2--
Dmodules/cms/ui/themes/default/html/views/page/show.tpl.src.xml | 1-
Dmodules/cms/ui/themes/default/html/views/template/show.php | 2--
Dmodules/cms/ui/themes/default/html/views/template/show.tpl.src.xml | 1-
Dmodules/cms/ui/themes/default/html/views/text/show.php | 2--
Dmodules/cms/ui/themes/default/html/views/text/show.tpl.src.xml | 1-
25 files changed, 252 insertions(+), 324 deletions(-)

diff --git a/modules/cms/action/BaseAction.class.php b/modules/cms/action/BaseAction.class.php @@ -3,13 +3,32 @@ namespace cms\action; +use util\exception\ClientException; + /** */ -abstract class BaseAction extends Action +abstract class BaseAction extends Action implements Method { public function __construct() { parent::__construct(); } + + + /** + * @throws ClientException + */ + public function post() + { + throw new ClientException("Bad Method"); + } + + /** + * @throws ClientException + */ + public function view() + { + throw new ClientException("Bad Method"); + } } \ No newline at end of file diff --git a/modules/cms/action/PageAction.class.php b/modules/cms/action/PageAction.class.php @@ -106,17 +106,15 @@ class PageAction extends ObjectAction if ( $languageId = $this->request->getLanguageId()) $context->languageId = $languageId; + else + $context->languageId = $this->page->getProject()->getDefaultLanguageId(); if ( $modelId = $this->request->getModelId()) $context->modelId = $modelId; - - if ( !$context->languageId ) - $context->languageId = $this->page->getProject()->getDefaultLanguageId(); - - if ( !$context->modelId ) + else $context->modelId = $this->page->getProject()->getDefaultModelId(); - return $context; + return $context; } } diff --git a/modules/cms/action/page/PagePreviewAction.class.php b/modules/cms/action/page/PagePreviewAction.class.php @@ -3,6 +3,9 @@ namespace cms\action\page; use cms\action\Method; use cms\action\PageAction; use cms\action\RequestParams; +use cms\generator\link\PreviewLink; +use cms\generator\PageContext; +use cms\generator\Producer; use util\Html; class PagePreviewAction extends PageAction implements Method { @@ -15,10 +18,8 @@ class PagePreviewAction extends PageAction implements Method { $this->setModelAndLanguage(); - $this->setTemplateVar('preview_url',Html::url('page','show',$this->page->objectid,array( - RequestParams::PARAM_OUTPUT => 'preview', - RequestParams::PARAM_LANGUAGE_ID => $this->page->getProject()->getDefaultLanguageId(), - RequestParams::PARAM_MODEL_ID => $this->page->getProject()->getDefaultModelId()) ) ); + $linkFormat = new PreviewLink( $this->createPageContext(Producer::SCHEME_PREVIEW) ); + $this->setTemplateVar('preview_url',$linkFormat->linkToObject($this->page,$this->page) ); } diff --git a/modules/cms/action/template/TemplatePreviewAction.class.php b/modules/cms/action/template/TemplatePreviewAction.class.php @@ -20,7 +20,7 @@ class TemplatePreviewAction extends TemplateAction implements Method { $this->setTemplateVar('modelid' ,$modelId); - $this->setTemplateVar('preview_url',Html::url('template','show',$this->template->templateid,array('target'=>'none','modelid'=>$modelId ) ) ); + $this->setTemplateVar('preview_url',Html::url('template','show',$this->template->templateid,array('target'=>'none','modelid'=>$modelId,'output'=>'preview' ) ) ); } public function post() { } diff --git a/modules/cms/action/template/TemplateShowAction.class.php b/modules/cms/action/template/TemplateShowAction.class.php @@ -3,50 +3,35 @@ namespace cms\action\template; use cms\action\Method; use cms\action\RequestParams; use cms\action\TemplateAction; +use cms\generator\Producer; +use cms\generator\TemplateGenerator; use cms\model\Element; use cms\model\Project; use cms\model\TemplateModel; class TemplateShowAction extends TemplateAction implements Method { + public function view() { - $modelId = $this->request->getModelId(); - if ( ! $modelId ) - $modelId = Project::create( $this->template->projectid )->getDefaultModelId(); - - $templatemodel = new TemplateModel($this->template->templateid, $modelId); - $templatemodel->load(); - - $this->addHeader('Content-Type',$templatemodel->mimeType().'; charset=UTF-8' ); - $text = $templatemodel->src; - - foreach( $this->template->getElementIds() as $elid ) - { - $element = new Element( $elid ); - $element->load(); - $text = str_replace('{{'.$elid.'}}',$element->name, - $text ); - $text = str_replace('{{->'.$elid.'}}','', - $text ); - - $text = str_replace('{{IFEMPTY:'.$elid.':BEGIN}}','', - $text ); - $text = str_replace('{{IFEMPTY:'.$elid.':END}}','', - $text ); - - $text = str_replace('{{IFNOTEMPTY:'.$elid.':BEGIN}}','', - $text ); - $text = str_replace('{{IFNOTEMPTY:'.$elid.':END}}','', - $text ); - - unset( $element ); - } - - $this->setTemplateVar('text',$text); - } + $tplGenerator = new TemplateGenerator( $this->template->templateid, $this->request->getModelId(), Producer::SCHEME_PREVIEW ); + + $this->addHeader('Content-Type',$tplGenerator->getMimeType().'; charset=UTF-8' ); + // Template should have access to the page properties. + // Template should have access to the settings of this node object. + $data = []; + $data['_page' ] = []; + $data['_localsettings'] = []; + $data['_settings' ] = []; + + /** @var Element $element */ + foreach($this->template->getElements() as $element ) { + + $element->load(); + $data[ $element->name ] = $element->getDefaultValue(); + } - public function post() { + $this->setTemplateVar('value',$tplGenerator->generateValue( $data ) ); } } diff --git a/modules/cms/action/text/TextShowAction.class.php b/modules/cms/action/text/TextShowAction.class.php @@ -6,8 +6,6 @@ use cms\action\TextAction; class TextShowAction extends TextAction implements Method { public function view() { - parent::showView(); - } - public function post() { + parent::view(); } } diff --git a/modules/cms/generator/PageGenerator.class.php b/modules/cms/generator/PageGenerator.class.php @@ -85,114 +85,21 @@ class PageGenerator extends BaseGenerator $page = new Page( $this->context->objectId ); $page->load(); - $template = new Template( $page->templateid ); - $template->load(); + $tplGenerator = new TemplateGenerator( $page->templateid,$this->context->modelId, $this->context->scheme ); - $values = $this->generatePageElements( $page ); - - // Get a List with ElementId->ElementName - $elements = array_map(function($element) { - return $element->name; - },$page->getTemplate()->getElements() ); - - $templatemodel = new TemplateModel( $template->templateid, $this->context->modelId ); - if ( $this->context->scheme == Producer::SCHEME_PREVIEW ) - $templatemodel->load(); - else - $templatemodel->loadForPublic(); - - $src = $templatemodel->src; - - $data = array(); + $pageValues = $this->generatePageElements( $page ); // generating the value of all page elements. // Template should have access to the page properties. // Template should have access to the settings of this node object. + $data = []; $data['_page' ] = $page->getProperties() ; $data['_localsettings'] = $page->getSettings() ; $data['_settings' ] = $page->getTotalSettings(); - // No we are collecting the data and are fixing some old stuff. - - foreach( $elements as $elementId=>$elementName ) - { - $data[ $elementName ] = $values[$elementId]; - - // The following code is for old template values: - - // convert {{<id>}} to {{<name>}} - $src = str_replace( '{{'.$elementId.'}}','{{'.$elementName.'}}',$src ); - - $src = str_replace( '{{IFNOTEMPTY:'.$elementId.':BEGIN}}','{{#'.$elementName.'}}',$src ); - $src = str_replace( '{{IFNOTEMPTY:'.$elementId.':END}}' ,'{{/'.$elementName.'}}',$src ); - $src = str_replace( '{{IFEMPTY:' .$elementId.':BEGIN}}','{{^'.$elementName.'}}',$src ); - $src = str_replace( '{{IFEMPTY:' .$elementId.':END}}' ,'{{/'.$elementName.'}}',$src ); - - /*if ( $this->icons ) - $src = str_replace( '{{->'.$elementId.'}}','<a href="javascript:parent.openNewAction(\''.$elementName.'\',\'pageelement\',\''.$this->objectid.'_'.$value->element->elementid.'\');" title="'.$value->element->desc.'"><img src="'.OR_THEMES_DIR.$conf['interface']['theme'].'/images/icon_el_'.$value->element->type.IMG_ICON_EXT.'" border="0" align="left"></a>',$src ); - else*/ - $src = str_replace( '{{->'.$elementId.'}}','',$src ); - } - - if ( DEVELOPMENT ) - Logger::trace( 'pagedata: '.print_r($data,true) ); - - // Now we have collected all data, lets call the template engine: - - $mustache = new Mustache(); - $mustache->escape = null; // No HTML escaping, this is the job of this CMS ;) - $mustache->partialLoader = function( $name ) use ($page,$template) { - - if ( substr($name,0,5) == 'file:') { - $fileid = intval( substr($name,5) ); - $file = new File( $fileid ); - return $file->loadValue(); - } - - - $project = Project::create( $page->projectid ); - $templateid = array_search($name,$project->getTemplates() ); - - if ( ! $templateid ) - throw new \InvalidArgumentException( TextMessage::create('template ${name} not found',['name'=>$name]) ); - - if ( $templateid == $template->templateid ) - throw new \InvalidArgumentException('Template recursion detected on template-id '.$templateid); - - - $templatemodel = new TemplateModel( $templateid, $this->context->modelId ); - $templatemodel->load(); - - return $templatemodel->src; - }; - - try { - $mustache->parse($src); - } catch (\Exception $e) { - // Should we throw it to the caller? - // No, because it is not a technical error. So let's only log it. - Logger::warn("Template rendering failed: ".$e->getMessage() ); - return $e->getMessage(); - } - $src = $mustache->render( $data ); - - // now we have the fully generated source. - - // should we do a UTF-8-escaping here? - // Default should be off, because if you are fully using utf-8 (you should do), this is unnecessary. - if ( Configuration::subset('publish' )->is('escape_8bit_characters') ) - if ( substr($this->mimeType(),-4) == 'html' ) - { - /* - * - $src = htmlentities($src,ENT_NOQUOTES,'UTF-8'); - $src = str_replace('&lt;' , '<', $src); - $src = str_replace('&gt;' , '>', $src); - $src = str_replace('&amp;', '&', $src); - */ - $src = translateutf8tohtml($src); - } + foreach( $page->getTemplate()->getElements() as $elementId=>$element ) + $data[ $element->name ] = $pageValues[$elementId]; - return $src; + return $tplGenerator->generateValue( $data ); } protected function generate() diff --git a/modules/cms/generator/TemplateGenerator.class.php b/modules/cms/generator/TemplateGenerator.class.php @@ -0,0 +1,149 @@ +<?php + + +namespace cms\generator; + + +use cms\base\Configuration; +use cms\generator\PageContext; +use cms\model\File; +use cms\model\Folder; +use cms\model\Language; +use cms\model\Page; +use cms\model\Project; +use cms\model\Template; +use cms\model\TemplateModel; +use cms\model\Value; +use logger\Logger; +use util\exception\GeneratorException; +use util\Mustache; +use util\text\TextMessage; + + +class TemplateGenerator +{ + + private $templateId; + private $modelId; + private $scheme; + + public function __construct($templateId, $modelId, $scheme ) + { + $this->templateId = $templateId; + $this->modelId = $modelId; + $this->scheme = $scheme; + } + + + /** + * Generates the template content. + * + * @param $data array values + * @return String Inhalt + */ + public function generateValue( $data ) + { + $template = new Template( $this->templateId ); + $template->load(); + + // Get a List with ElementId->ElementName + $elements = array_map(function($element) { + return $element->name; + },$template->getElements() ); + + $templatemodel = new TemplateModel( $template->templateid, $this->modelId ); + if ( $this->scheme == Producer::SCHEME_PREVIEW ) + $templatemodel->load(); + else + $templatemodel->loadForPublic(); + + $src = $templatemodel->src; + + // No we are collecting the data and are fixing some old stuff. + + foreach( $elements as $elementId=>$elementName ) + { + // The following code is for old template values: + + // convert {{<id>}} to {{<name>}} + $src = str_replace( '{{'.$elementId.'}}','{{'.$elementName.'}}',$src ); + + $src = str_replace( '{{IFNOTEMPTY:'.$elementId.':BEGIN}}','{{#'.$elementName.'}}',$src ); + $src = str_replace( '{{IFNOTEMPTY:'.$elementId.':END}}' ,'{{/'.$elementName.'}}',$src ); + $src = str_replace( '{{IFEMPTY:' .$elementId.':BEGIN}}','{{^'.$elementName.'}}',$src ); + $src = str_replace( '{{IFEMPTY:' .$elementId.':END}}' ,'{{/'.$elementName.'}}',$src ); + + $src = str_replace( '{{->'.$elementId.'}}','',$src ); + } + + if ( DEVELOPMENT ) + Logger::trace( 'generating template with data: '.print_r($data,true) ); + + // Now we have collected all data, lets call the template engine: + + $mustache = new Mustache(); + $mustache->escape = null; // No HTML escaping, this is the job of this CMS ;) + $mustache->partialLoader = function( $name ) use ($template) { + + if ( substr($name,0,5) == 'file:') { + $fileid = intval( substr($name,5) ); + $file = new File( $fileid ); + return $file->loadValue(); + } + + + $project = Project::create( $template->projectid ); + $templateid = array_search($name,$project->getTemplates() ); + + if ( ! $templateid ) + throw new \InvalidArgumentException( TextMessage::create('template ${name} not found',['name'=>$name]) ); + + if ( $templateid == $template->templateid ) + throw new \InvalidArgumentException('Template recursion detected on template-id '.$templateid); + + + $templatemodel = new TemplateModel( $templateid, $this->modelId ); + $templatemodel->load(); + + return $templatemodel->src; + }; + + try { + $mustache->parse($src); + } catch (\Exception $e) { + // Should we throw it to the caller? + // No, because it is not a technical error. So let's only log it. + Logger::warn("Template rendering failed: ".$e->getMessage() ); + return $e->getMessage(); + } + $src = $mustache->render( $data ); + + // now we have the fully generated source. + + // should we do a UTF-8-escaping here? + // Default should be off, because if you are fully using utf-8 (you should do), this is unnecessary. + if ( Configuration::subset('publish' )->is('escape_8bit_characters') ) + if ( substr($this->mimeType(),-4) == 'html' ) + { + /* + * + $src = htmlentities($src,ENT_NOQUOTES,'UTF-8'); + $src = str_replace('&lt;' , '<', $src); + $src = str_replace('&gt;' , '>', $src); + $src = str_replace('&amp;', '&', $src); + */ + $src = translateutf8tohtml($src); + } + + return $src; + } + + + public function getMimeType() + { + $templateModel = new TemplateModel( $this->templateId,$this->modelId ); + $templateModel->load(); + + return $templateModel->mimeType(); + } +} +\ No newline at end of file diff --git a/modules/cms/generator/link/PreviewLink.class.php b/modules/cms/generator/link/PreviewLink.class.php @@ -12,10 +12,7 @@ use cms\model\Url; use util\exception\GeneratorException; /** - * Created by PhpStorm. - * User: dankert - * Date: 10.08.18 - * Time: 23:47 + * Linkformatter for Preview. */ class PreviewLink implements LinkFormat @@ -23,7 +20,7 @@ class PreviewLink implements LinkFormat private $context; /** - * PublicLink constructor. + * PreviewLink constructor. * @param $context BaseContext */ public function __construct($context) @@ -35,8 +32,8 @@ class PreviewLink implements LinkFormat /** * Calculates the Preview Link to an object. * - * @param $from \cms\model\BaseObject unused in preview. - * @param $to \cms\model\BaseObject the target where the link points to. + * @param $from BaseObject unused in preview. + * @param $to BaseObject the target where the link points to. */ public function linkToObject( BaseObject $from, BaseObject $to ) { diff --git a/modules/cms/generator/link/PublicLink.class.php b/modules/cms/generator/link/PublicLink.class.php @@ -32,6 +32,8 @@ use util\Session; /** + * Linkformatter for public links. + * * @author Jan Dankert */ diff --git a/modules/cms/model/Element.class.php b/modules/cms/model/Element.class.php @@ -3,6 +3,9 @@ namespace cms\model; use cms\base\DB as Db; +use cms\generator\FileContext; +use cms\generator\link\PreviewLink; +use cms\generator\Producer; use util\ArrayUtils; use logger\Logger; @@ -441,23 +444,47 @@ SQL } - - function getDefaultValue() + /** + * Default value + * @return string default value + */ + public function getDefaultValue() { - switch( $this->type ) + switch( $this->typeid ) { - case 'text': - case 'longtext': + case self::ELEMENT_TYPE_TEXT: + case self::ELEMENT_TYPE_LONGTEXT: return $this->defaultText; - + case self::ELEMENT_TYPE_INFO: + return '(i)'; + case self::ELEMENT_TYPE_LINKDATE: + case self::ELEMENT_TYPE_INFODATE: + case self::ELEMENT_TYPE_DATE: + return date($this->dateformat); + case self::ELEMENT_TYPE_LINK: + if ( $this->defaultObjectId ) { + $o = new BaseObject($this->defaultObjectId); + $o->load(); + switch( $o->typeid ) { + case BaseObject::TYPEID_FILE: + case BaseObject::TYPEID_IMAGE: + case BaseObject::TYPEID_TEXT: + $linkFormat = new PreviewLink( new FileContext($o->objectid,Producer::SCHEME_PREVIEW)); + return $linkFormat->linkToObject($o,$o); + case BaseObject::TYPEID_LINK: + return ""; + case BaseObject::TYPEID_URL: + $url = new Url( $o->objectid ); + $url->load(); + return $url->url; + } + } + return $this->getName(); case 'number'; return '0'; - default: + return $this->getName(); } - - return \cms\base\Language::lang('EL_TYPE_'.$this->type); - } /** diff --git a/modules/cms/ui/themes/default/html/views/file/show.php b/modules/cms/ui/themes/default/html/views/file/show.php @@ -1 +0,0 @@ -<?php /* THIS FILE IS GENERATED from show.tpl.src.xml - DO NOT CHANGE */ defined('APP_STARTED') || die('Forbidden'); use \template_engine\Output as O; ?><?php echo ''.@$value.'' ?> -\ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/file/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/file/show.tpl.src.xml @@ -1 +0,0 @@ -<text xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openrat.de/template ../../../../../../../template_engine/components/template.xsd" value="${value}" escape="false" type="none" newline="false"/> diff --git a/modules/cms/ui/themes/default/html/views/folder/show.php b/modules/cms/ui/themes/default/html/views/folder/show.php @@ -1,60 +0,0 @@ -<?php /* THIS FILE IS GENERATED from show.tpl.src.xml - DO NOT CHANGE */ defined('APP_STARTED') || die('Forbidden'); use \template_engine\Output as O; ?> - <div class="<?php echo O::escapeHtml('or-table-wrapper') ?>"><?php echo O::escapeHtml('') ?> - <div class="<?php echo O::escapeHtml('or-table-filter') ?>"><?php echo O::escapeHtml('') ?> - <input type="<?php echo O::escapeHtml('search') ?>" name="<?php echo O::escapeHtml('filter') ?>" placeholder="<?php echo O::escapeHtml(''.@O::lang('SEARCH_FILTER').'') ?>" class="<?php echo O::escapeHtml('or-input or-table-filter-input') ?>" /><?php echo O::escapeHtml('') ?> - </div> - <div class="<?php echo O::escapeHtml('or-table-area') ?>"><?php echo O::escapeHtml('') ?> - <table class="<?php echo O::escapeHtml('or-table') ?>"><?php echo O::escapeHtml('') ?> - <tr class="<?php echo O::escapeHtml('or-table-header') ?>"><?php echo O::escapeHtml('') ?> - <th><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('TYPE').'') ?></span> - </th> - <th><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('NAME').'') ?></span> - </th> - <th><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('LASTCHANGE').'') ?></span> - </th> - </tr> - <?php $if3=(isset($up_url)); if($if3) { ?> - <tr class="<?php echo O::escapeHtml('or-data or-act-clickable') ?>"><?php echo O::escapeHtml('') ?> - <td><?php echo O::escapeHtml('') ?> - <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-folder') ?>"><?php echo O::escapeHtml('') ?></i> - </td> - <td><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml('..') ?></span> - </td> - <td><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml('') ?></span> - </td> - </tr> - <?php } ?> - <?php foreach((array)@$object as $list_key=>$list_value) { extract($list_value); ?> - <tr class="<?php echo O::escapeHtml('or-data') ?>"><?php echo O::escapeHtml('') ?> - <td title="<?php echo O::escapeHtml(''.@$desc.'') ?>" data-name="<?php echo O::escapeHtml(''.@$name.'') ?>" data-action="<?php echo O::escapeHtml(''.@$type.'') ?>" data-id="<?php echo O::escapeHtml(''.@$id.'') ?>" class="<?php echo O::escapeHtml('or-'.@$class.'') ?>"><?php echo O::escapeHtml('') ?> - <img src="<?php echo O::escapeHtml('./modules/cms/ui/themes/default/images/icon_'.@$icon.'.png') ?>" /><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@$name.'') ?></span> - <span><?php echo O::escapeHtml(' ') ?></span> - </td> - <td><?php echo O::escapeHtml('') ?> - <?php include_once( 'modules/template_engine/components/html/component_date/component-date.php'); { component_date($date); ?> - <?php } ?> - </td> - </tr> - <?php } ?> - <?php $if3=(($object)==FALSE); if($if3) { ?> - <tr><?php echo O::escapeHtml('') ?> - <td colspan="<?php echo O::escapeHtml('2') ?>"><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('NOT_FOUND').'') ?></span> - </td> - </tr> - <?php } ?> - </table> - </div> - </div> - <div class="<?php echo O::escapeHtml('or-act-clickable') ?>"><?php echo O::escapeHtml('') ?> - <a target="<?php echo O::escapeHtml('_self') ?>" data-type="<?php echo O::escapeHtml('view') ?>" data-action="<?php echo O::escapeHtml('folder') ?>" data-method="<?php echo O::escapeHtml('create') ?>" data-id="<?php echo O::escapeHtml('') ?>" data-extra="<?php echo O::escapeHtml('[]') ?>" href="<?php echo O::escapeHtml('#/folder') ?>" class="<?php echo O::escapeHtml('or-link or-btn') ?>"><?php echo O::escapeHtml('') ?> - <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-new') ?>"><?php echo O::escapeHtml('') ?></i> - <span><?php echo O::escapeHtml(''.@O::lang('add').'') ?></span> - </a> - </div> -\ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/folder/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/folder/show.tpl.src.xml @@ -1,53 +0,0 @@ -<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openrat.de/template ../../../../../../../template_engine/components/template.xsd"> - <table> - <row header="true"> - <column header="true"> - <text value="${message:TYPE}"/> - </column> - <column header="true"> - <text value="${message:NAME}"/> - </column> - <column header="true"> - <text value="${message:LASTCHANGE}"/> - </column> - </row> - <if present="up_url"> - <row class="data,act-clickable"> - <column> - <image action="folder"/> - </column> - <column url="${up_url}"> - <text value=".."/> - </column> - <column> - <text value=""/> - </column> - </row> - </if> - <list list="${object}" extract="true"> - <row class="data"> - <column id="${id}" name="${name}" action="${type}" title="${desc}" class="${class}"> - <image type="${icon}"/> - <text value="${name}"/> - <text value=" "/> - </column> - <column> - <date date="${date}"/> - </column> - </row> - </list> - <if empty="${object}"> - <row> - <column colspan="2"> - <text value="${message:NOT_FOUND}"/> - </column> - </row> - </if> - </table> - <part class="act-clickable"> - <link type="view" action="folder" subaction="create" class="btn"> - <image action="new"/> - <text value="${message:add}"/> - </link> - </part> -</output> diff --git a/modules/cms/ui/themes/default/html/views/image/preview.php b/modules/cms/ui/themes/default/html/views/image/preview.php @@ -8,7 +8,7 @@ <div class="<?php echo O::escapeHtml('or-collapsible-value or-group-value') ?>"><?php echo O::escapeHtml('') ?> <img src="<?php echo O::escapeHtml(''.@$url.'') ?>" class="<?php echo O::escapeHtml('or-image--preview') ?>" /><?php echo O::escapeHtml('') ?> <br /><?php echo O::escapeHtml('') ?> - <a target="<?php echo O::escapeHtml('_self') ?>" data-url="<?php echo O::escapeHtml(''.@$preview_url.'') ?>" data-type="<?php echo O::escapeHtml('popup') ?>" data-action="<?php echo O::escapeHtml('') ?>" data-method="<?php echo O::escapeHtml('') ?>" data-id="<?php echo O::escapeHtml('') ?>" data-extra="<?php echo O::escapeHtml('[]') ?>" href="<?php echo O::escapeHtml('') ?>" class="<?php echo O::escapeHtml('or-link or-action or-act-clickable') ?>"><?php echo O::escapeHtml('') ?> + <a target="<?php echo O::escapeHtml('_self') ?>" data-url="<?php echo O::escapeHtml(''.@$url.'') ?>" data-type="<?php echo O::escapeHtml('popup') ?>" data-action="<?php echo O::escapeHtml('') ?>" data-method="<?php echo O::escapeHtml('') ?>" data-id="<?php echo O::escapeHtml('') ?>" data-extra="<?php echo O::escapeHtml('[]') ?>" href="<?php echo O::escapeHtml('') ?>" class="<?php echo O::escapeHtml('or-link or-action or-act-clickable') ?>"><?php echo O::escapeHtml('') ?> <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--menu-open_in_new') ?>"><?php echo O::escapeHtml('') ?></i> <span><?php echo O::escapeHtml(''.@O::lang('link_open_in_new_window').'') ?></span> </a> diff --git a/modules/cms/ui/themes/default/html/views/image/preview.tpl.src.xml b/modules/cms/ui/themes/default/html/views/image/preview.tpl.src.xml @@ -7,7 +7,7 @@ <newline/> - <link clickable="true" type="popup" class="action" url="${preview_url}"> + <link clickable="true" type="popup" class="action" url="${url}"> <image menu="open_in_new"/> <text value="${message:link_open_in_new_window}"/> </link> diff --git a/modules/cms/ui/themes/default/html/views/image/show.php b/modules/cms/ui/themes/default/html/views/image/show.php @@ -1,14 +0,0 @@ -<?php /* THIS FILE IS GENERATED from show.tpl.src.xml - DO NOT CHANGE */ defined('APP_STARTED') || die('Forbidden'); use \template_engine\Output as O; ?> - <tr><?php echo O::escapeHtml('') ?> - <td colspan="<?php echo O::escapeHtml('2') ?>"><?php echo O::escapeHtml('') ?> - <iframe src="<?php echo O::escapeHtml(''.@$preview_url.'') ?>"><?php echo O::escapeHtml('') ?></iframe> - <a target="<?php echo O::escapeHtml('_self') ?>" data-action="<?php echo O::escapeHtml('file') ?>" data-method="<?php echo O::escapeHtml('edit') ?>" data-id="<?php echo O::escapeHtml('') ?>" data-extra="<?php echo O::escapeHtml('[]') ?>" href="<?php echo O::escapeHtml('#/file') ?>" class="<?php echo O::escapeHtml('or-link or-action') ?>"><?php echo O::escapeHtml('') ?> - <img src="<?php echo O::escapeHtml('./modules/cms/ui/themes/default/images/icon/icon/edit.png') ?>" /><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('menu_file_edit').'') ?></span> - </a> - <a target="<?php echo O::escapeHtml('_self') ?>" data-action="<?php echo O::escapeHtml('file') ?>" data-method="<?php echo O::escapeHtml('editvalue') ?>" data-id="<?php echo O::escapeHtml('') ?>" data-extra="<?php echo O::escapeHtml('[]') ?>" href="<?php echo O::escapeHtml('#/file') ?>" class="<?php echo O::escapeHtml('or-link or-action') ?>"><?php echo O::escapeHtml('') ?> - <img src="<?php echo O::escapeHtml('./modules/cms/ui/themes/default/images/icon/icon/editvalue.png') ?>" /><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('menu_file_editvalue').'') ?></span> - </a> - </td> - </tr> -\ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/image/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/image/show.tpl.src.xml @@ -1,15 +0,0 @@ -<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openrat.de/template ../../../../../../../template_engine/components/template.xsd"> - <row> - <column colspan="2"> - <insert url="${preview_url}"/> - <link class="action" action="file" subaction="edit"> - <image file="icon/edit"/> - <text value="${message:menu_file_edit}"/> - </link> - <link class="action" action="file" subaction="editvalue"> - <image file="icon/editvalue"/> - <text value="${message:menu_file_editvalue}"/> - </link> - </column> - </row> -</output> diff --git a/modules/cms/ui/themes/default/html/views/page/show.php b/modules/cms/ui/themes/default/html/views/page/show.php @@ -1 +0,0 @@ -<?php /* THIS FILE IS GENERATED from show.tpl.src.xml - DO NOT CHANGE */ defined('APP_STARTED') || die('Forbidden'); use \template_engine\Output as O; ?><?php echo ''.@$output.'' ?> -\ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/page/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/page/show.tpl.src.xml @@ -1 +0,0 @@ -<text xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openrat.de/template ../../../../../../../template_engine/components/template.xsd" value="${output}" escape="false" type="none" newline="false"/> diff --git a/modules/cms/ui/themes/default/html/views/template/show.php b/modules/cms/ui/themes/default/html/views/template/show.php @@ -1 +0,0 @@ -<?php /* THIS FILE IS GENERATED from show.tpl.src.xml - DO NOT CHANGE */ defined('APP_STARTED') || die('Forbidden'); use \template_engine\Output as O; ?><?php echo ''.@$text.'' ?> -\ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/template/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/template/show.tpl.src.xml @@ -1 +0,0 @@ -<text xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openrat.de/template ../../../../../../../template_engine/components/template.xsd" value="${text}" escape="false" type="none"/> diff --git a/modules/cms/ui/themes/default/html/views/text/show.php b/modules/cms/ui/themes/default/html/views/text/show.php @@ -1 +0,0 @@ -<?php /* THIS FILE IS GENERATED from show.tpl.src.xml - DO NOT CHANGE */ defined('APP_STARTED') || die('Forbidden'); use \template_engine\Output as O; ?><?php echo ''.@$value.'' ?> -\ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/text/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/text/show.tpl.src.xml @@ -1 +0,0 @@ -<text xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openrat.de/template ../../../../../../../template_engine/components/template.xsd" value="${value}" escape="false" type="none" newline="false"/>