openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs | README

commit ba34dca293dfb1f1a5df0a323a4a23fac3f0fb15
parent a0dbf5139cdd3661056e42b77e817db89271eae7
Author: Jan Dankert <develop@jandankert.de>
Date:   Thu, 25 Feb 2021 01:22:10 +0100

New: Edit all page elements in 1 view.

Diffstat:
Mmodules/cms/action/RequestParams.class.php | 2+-
Amodules/cms/action/page/PageAllAction.class.php | 338+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmodules/cms/action/page/PageEditAction.class.php | 6++++++
Mmodules/cms/action/pageelement/PageelementValueAction.class.php | 2+-
Mmodules/cms/generator/ValueGenerator.class.php | 2+-
Amodules/cms/ui/themes/default/html/views/page/all.php | 181+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/cms/ui/themes/default/html/views/page/all.tpl.src.xml | 143+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmodules/cms/ui/themes/default/html/views/page/edit.php | 128++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------
Mmodules/cms/ui/themes/default/html/views/page/edit.tpl.src.xml | 86++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
Mmodules/cms/ui/themes/default/style/theme/openrat-theme.less | 4++++
Mmodules/template_engine/components/html/component_editor/EditorComponent.class.php | 6+++++-
Mmodules/template_engine/components/html/component_group/GroupComponent.class.php | 7+++++++
12 files changed, 827 insertions(+), 78 deletions(-)

diff --git a/modules/cms/action/RequestParams.class.php b/modules/cms/action/RequestParams.class.php @@ -157,7 +157,7 @@ class RequestParams public function getRequiredRequestId( $varName ) { - $id = intval($this->getRequestVar($this->getRequestVar( $varName ))); + $id = intval($this->getRequestVar( $varName )); if ( $id == 0 ) throw new ValidationException($varName); diff --git a/modules/cms/action/page/PageAllAction.class.php b/modules/cms/action/page/PageAllAction.class.php @@ -0,0 +1,338 @@ +<?php +namespace cms\action\page; + +use cms\action\Method; +use cms\action\PageAction; +use cms\base\Language as L; +use cms\generator\PageContext; +use cms\generator\PageGenerator; +use cms\generator\Producer; +use cms\generator\Publisher; +use cms\generator\PublishOrder; +use cms\model\BaseObject; +use cms\model\Element; +use cms\model\Folder; +use cms\model\Language; +use cms\model\Page; +use cms\model\Permission; +use cms\model\Project; +use cms\model\Value; +use language\Messages; +use util\exception\ValidationException; +use util\Session; +use util\Text; + +class PageAllAction extends PageAction implements Method { + + public function view() + { + + $languageid = $this->request->getRequiredRequestId('languageid'); + $language = new Language($languageid); + $language->load(); + + $this->setTemplateVar('language_name', $language->getName()); + $this->setTemplateVar('languageid' , $language->languageid ); + + $this->setTemplateVar('value_time',time() ); + + $elements = []; + + /** @var Element $element */ + foreach ($this->getElements() as $element) { + $value = new Value(); + $value->languageid = $languageid; + $value->objectid = $this->page->objectid; + $value->pageid = $this->page->pageid; + $value->element = &$element; + $value->elementid = &$element->elementid; + $value->element->load(); + $value->publish = false; + $value->load(); + + $output = []; + $output += $element->getProperties(); + $output += $value->getProperties(); + + $content = ''; + + switch( $element->typeid) { + + case Element::ELEMENT_TYPE_LINK: + $project = new Project($this->page->projectid); + $output['rootfolderid'] = $project->getRootObjectId(); + + // Ermitteln, welche Objekttypen verlinkt werden d�rfen. + $type = $element->subtype; + + if (substr($type, 0, 5) == 'image') + $type = 'file'; + + if (!in_array($type, array('file', 'page', 'link', 'folder'))) + $types = array('file', 'page', 'link'); // Fallback: Der Link kann auf Seiten,Dateien und Verknüpfungen zeigen + else + $types = array($type); // gewünschten Typ verwenden + + $oid = $value->linkToObjectId; + $name = ''; + + if ($oid) { + $o = new BaseObject($oid); + $o->load(); + $name = $o->filename; + } + + $output['objects'] = array(); + $output['linkobjectid']= $oid; + $content = $oid; + $output['linkname']= $name; + + $output['types'] = implode(',', $types); + + break; + + case Element::ELEMENT_TYPE_SELECT: + $output['items'] = $value->element->getSelectItems(); + $content = $value->text; + break; + + case Element::ELEMENT_TYPE_INSERT: + // Auswahl ueber alle Elementtypen + $objects = array(); + //Änderung der möglichen Types + $types = array('file', 'page', 'link'); + $objects[0] = \cms\base\Language::lang('LIST_ENTRY_EMPTY'); // Wert "nicht ausgewählt" + + $project = new Project($this->page->projectid); + $folder = new Folder($project->getRootObjectId()); + $folder->load(); + + //Auch Dateien dazu + foreach ($project->getAllObjectIds($types) as $id) { + $f = new Folder($id); + $f->load(); + + $objects[$id] = \cms\base\Language::lang($f->getType()) . ': '; + $objects[$id] .= implode(' &raquo; ', $f->parentObjectNames(false, true)); + } + + foreach ($project->getAllFolders() as $id) { + $f = new Folder($id); + $f->load(); + + $objects[$id] = \cms\base\Language::lang($f->getType()) . ': '; + $objects[$id] .= implode(' &raquo; ', $f->parentObjectNames(false, true)); + } + + asort($objects); // Sortieren + + $output['objects'] = $objects; + $content = $value->linkToObjectId; + + break; + + case Element::ELEMENT_TYPE_NUMBER: + $content = $value->number / pow(10, $value->element->decimals); + break; + + case Element::ELEMENT_TYPE_LONGTEXT: + if ($this->hasRequestVar('format')) + // Individual format from request. + $format = $this->getRequestId('format'); + elseif ($value->format != null) + $format = $value->format; + else + // There is no saved value. Get the format from the template element. + $format = $element->format; + + $output['format'] = $format; + $output['editor'] = Element::getAvailableFormats()[$format]; + + $content = $this->linkifyOIDs($value->text); + break; + + case Element::ELEMENT_TYPE_TEXT: + + $content = $value->text; + break; + } + + $output[ 'name' ] = $element->name; + $output[ 'value' ] = $content; + $this->setTemplateVar( $element->name, $content ); + + $elements[ $element->elementid ] = $output; + } + + if ($this->page->hasRight(Permission::ACL_RELEASE)) + $this->setTemplateVar('release', true); + if ($this->page->hasRight(Permission::ACL_PUBLISH)) + $this->setTemplateVar('publish', false); + + $this->setTemplateVar('elements', $elements ); + //echo "<pre>" . print_r($elements,true) . '</pre>'; + } + + + + public function post() + { + + + $languageid = $this->request->getRequiredRequestId('languageid'); + $language = new Language($languageid); + $language->load(); + + /** @var Element $element */ + foreach ($this->getElements() as $element) { + + $value = new Value(); + $value->languageid = $languageid; + $value->objectid = $this->page->objectid; + $value->pageid = $this->page->pageid; + $value->element = &$element; + $value->elementid = &$element->elementid; + $value->element->load(); + $value->publish = false; + $value->load(); + + switch ($element->typeid) { + + case Element::ELEMENT_TYPE_TEXT: + $value->text = $this->getRequestVar($element->name, 'raw'); + break; + case Element::ELEMENT_TYPE_LONGTEXT: + $value->text = $this->compactOIDs($this->getRequestVar($element->name, 'raw')); + break; + + case Element::ELEMENT_TYPE_DATE: + $value->date = strtotime($this->getRequestVar($element->name.'_date') . $this->getRequestVar($element->name.'_time')); + break; + + case Element::ELEMENT_TYPE_SELECT: + $value->text = $this->getRequestVar($element->name); + break; + case Element::ELEMENT_TYPE_LINK: + case Element::ELEMENT_TYPE_INSERT: + $value->linkToObjectId = intval($this->getRequestVar($element->name)); + break; + + case Element::ELEMENT_TYPE_NUMBER: + $value->number = $this->getRequestVar($element->name) * pow(10, $value->element->decimals); + break; + default: + throw new \LogicException('Unknown element type: '.$element->getTypeName() ); + } + $value->page = new Page($value->objectid); + $value->page->load(); + + + // Inhalt sofort freigegeben, wenn + // - Recht vorhanden + // - Freigabe gewuenscht + $value->publish = $value->page->hasRight(Permission::ACL_RELEASE) && $this->hasRequestVar('release'); + + // Up-To-Date-Check + $lastChangeTime = $value->getLastChangeSinceByAnotherUser($this->getRequestVar('value_time'), Session::getUser()->userid); + if ($lastChangeTime) + $this->addWarningFor($value, Messages::CONCURRENT_VALUE_CHANGE, array('last_change_time' => date(L::lang('DATE_FORMAT'), $lastChangeTime))); + + // Inhalt speichern + + // Wenn Inhalt in allen Sprachen gleich ist, dann wird der Inhalt + // fuer jede Sprache einzeln gespeichert. + if ($value->element->allLanguages) { + $project = new Project($this->page->projectid); + foreach ($project->getLanguageIds() as $languageid) { + $value->languageid = $languageid; + $value->add(); + } + } else { + // sonst nur 1x speichern (fuer die aktuelle Sprache) + $value->add(); + } + + + } + + // Falls ausgewaehlt die Seite sofort veroeffentlichen + if ($value->page->hasRight(Permission::ACL_PUBLISH) && $this->hasRequestVar('publish')) { + $this->publishPage( $languageid ); + } + + $this->page->setTimestamp(); // "Letzte Aenderung" setzen + + $this->addNoticeFor($this->page, Messages::SAVED); + } + + + /** + * Gets all elements of the current page. + * + * @return array + */ + protected function getElements() { + + return $this->page->getWritableElements(); + } + + + protected function linkifyOIDs( $text ) + { + $pageContext = $this->createPageContext( Producer::SCHEME_PREVIEW ); + + $linkFormat = $pageContext->getLinkScheme(); + + foreach( Text::parseOID($text) as $oid=>$t ) + { + $url = $linkFormat->linkToObject($this->page, (new BaseObject($oid))->load() ); + foreach( $t as $match) + $text = str_replace($match,$url,$text); + } + + return $text; + } + + + + + protected function compactOIDs( $text ) + { + foreach( Text::parseOID($text) as $oid=>$t ) + { + foreach( $t as $match) + $text = str_replace($match,'?__OID__'.$oid.'__',$text); + } + + return $text; + } + + + + protected function publishPage( $languageid ) { + + $project = $this->page->getProject(); + + // Nothing is written to the session from this point. so we should free the session. + Session::close(); + + $publisher = new Publisher( $project->projectid ); + + foreach( $project->getModelIds() as $modelId ) { + + $pageContext = new PageContext( $this->page->objectid, Producer::SCHEME_PUBLIC ); + $pageContext->modelId = $modelId; + $pageContext->languageId = $languageid; + + $pageGenerator = new PageGenerator( $pageContext ); + + $publisher->addOrderForPublishing( new PublishOrder( $pageGenerator->getCache()->load()->getFilename(),$pageGenerator->getPublicFilename(), $this->page->lastchangeDate ) ); + } + + $publisher->publish(); + + $this->addNoticeFor( $this->page,Messages::PUBLISHED,[], + implode("\n",$publisher->getDestinationFilenames() ) ); + + } +} diff --git a/modules/cms/action/page/PageEditAction.class.php b/modules/cms/action/page/PageEditAction.class.php @@ -13,6 +13,7 @@ use cms\model\Value; class PageEditAction extends PageAction implements Method { public function view() { + $template = new Template( $this->page->templateid ); $template->load(); @@ -31,6 +32,11 @@ class PageEditAction extends PageAction implements Method { }, $elements); $this->setTemplateVar('elements',$elements); + + $project = $this->page->getProject(); + $languages = $project->getLanguages(); + + $this->setTemplateVar('languages',$languages); } public function post() { diff --git a/modules/cms/action/pageelement/PageelementValueAction.class.php b/modules/cms/action/pageelement/PageelementValueAction.class.php @@ -45,7 +45,7 @@ class PageelementValueAction extends PageelementAction implements Method { if ( $this->value->page->hasRight(Permission::ACL_PUBLISH) ) $this->setTemplateVar( 'publish',false ); - $funktionName = 'edit'.$this->value->element->type; + $funktionName = 'edit'.$this->value->element->getTypeName(); if ( ! method_exists($this,$funktionName) ) throw new \LogicException('Method does not exist: PageElementAction#'.$funktionName ); diff --git a/modules/cms/generator/ValueGenerator.class.php b/modules/cms/generator/ValueGenerator.class.php @@ -1015,7 +1015,7 @@ class ValueGenerator extends BaseGenerator if ( $this->context->pageContext->scheme == Producer::SCHEME_PREVIEW && $element->withIcon && $page->isHtml() ) { // Anklickbaren Link voranstellen. - $iconLink = '<a href="javascript:parent.openNewAction(\''.$element->name.'\',\'pageelement\',\''.$page->objectid.'_'.$element->elementid.'\');" title="'.$element->desc.'"><i class="or-image-icon or-image-icon--el-'.$element->getTypeName().'"></i></a>'; + $iconLink = '<a href="javascript:parent.Openrat.Workbench.openNewAction(\''.$element->name.'\',\'pageelement\',\''.$page->objectid.'_'.$element->elementid.'\');" title="'.$element->desc.'">&rarr;<i class="or-image-icon or-image-icon--el-'.$element->getTypeName().'"></i></a>'; $inhalt = $iconLink.$inhalt; } diff --git a/modules/cms/ui/themes/default/html/views/page/all.php b/modules/cms/ui/themes/default/html/views/page/all.php @@ -0,0 +1,180 @@ +<?php /* THIS FILE IS GENERATED from all.tpl.src.xml - DO NOT CHANGE */ defined('APP_STARTED') || die('Forbidden'); use \template_engine\Output as O; ?> + <form name="<?php echo O::escapeHtml('') ?>" target="<?php echo O::escapeHtml('_self') ?>" data-target="<?php echo O::escapeHtml('view') ?>" action="<?php echo O::escapeHtml('./') ?>" data-method="<?php echo O::escapeHtml('all') ?>" data-action="<?php echo O::escapeHtml('page') ?>" data-id="<?php echo O::escapeHtml(''.@$_id.'') ?>" method="<?php echo O::escapeHtml('post') ?>" enctype="<?php echo O::escapeHtml('application/x-www-form-urlencoded') ?>" data-async="<?php echo O::escapeHtml('') ?>" data-autosave="<?php echo O::escapeHtml('') ?>" class="<?php echo O::escapeHtml('or-form or-page') ?>"><?php echo O::escapeHtml('') ?> + <div class="<?php echo O::escapeHtml('or-form-headline') ?>"><?php echo O::escapeHtml('') ?></div> + <div class="<?php echo O::escapeHtml('or-form-content') ?>"><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('token') ?>" value="<?php echo O::escapeHtml(''.@$_token.'') ?>" /><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('action') ?>" value="<?php echo O::escapeHtml('page') ?>" /><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('subaction') ?>" value="<?php echo O::escapeHtml('all') ?>" /><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('id') ?>" value="<?php echo O::escapeHtml(''.@$_id.'') ?>" /><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('languageid') ?>" value="<?php echo O::escapeHtml(''.@$languageid.'') ?>" /><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('value_time') ?>" value="<?php echo O::escapeHtml(''.@$value_time.'') ?>" /><?php echo O::escapeHtml('') ?> + <?php foreach((array)$elements as $list_key=>$list_value) { extract($list_value); ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('elementid') ?>" value="<?php echo O::escapeHtml(''.@$elementid.'') ?>" /><?php echo O::escapeHtml('') ?> + <section class="<?php echo O::escapeHtml('or-group or-collapsible--is-open or-collapsible--show') ?>"><?php echo O::escapeHtml('') ?> + <h2 class="<?php echo O::escapeHtml('or-collapsible-title or-group-title or-collapsible-act-switch') ?>"><?php echo O::escapeHtml('') ?> + <span><?php echo O::escapeHtml(''.@$label.'') ?></span> + </h2> + <p class="<?php echo O::escapeHtml('or-group-description') ?>"><?php echo O::escapeHtml(''.@$desc.'') ?></p> + <div class="<?php echo O::escapeHtml('or-collapsible-value or-group-value') ?>"><?php echo O::escapeHtml('') ?> + <?php $if5=($type=='date'); if($if5) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <label class="<?php echo O::escapeHtml('or-form-row or-form-input') ?>"><?php echo O::escapeHtml('') ?> + <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml('date') ?></span> + <input name="<?php echo O::escapeHtml(''.@$name.'_date') ?>" type="<?php echo O::escapeHtml('date') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$value.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> + </label> + <label class="<?php echo O::escapeHtml('or-form-row or-form-input') ?>"><?php echo O::escapeHtml('') ?> + <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml('time') ?></span> + <input name="<?php echo O::escapeHtml(''.@$name.'_time') ?>" type="<?php echo O::escapeHtml('time') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$value.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> + </label> + </div> + </section> + <?php } ?> + <?php $if5=($type=='text'); if($if5) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <input name="<?php echo O::escapeHtml('text') ?>" type="<?php echo O::escapeHtml('text') ?>" maxlength="<?php echo O::escapeHtml('255') ?>" value="<?php echo O::escapeHtml(''.@$value.'') ?>" class="<?php echo O::escapeHtml('or-text or-input') ?>" /><?php echo O::escapeHtml('') ?> + </div> + </section> + <?php } ?> + <?php $if5=($type=='longtext'); if($if5) { ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('format') ?>" value="<?php echo O::escapeHtml(''.@$format.'') ?>" /><?php echo O::escapeHtml('') ?> + <?php $if6=($editor=='markdown'); if($if6) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <textarea name="<?php echo O::escapeHtml(''.@$name.'') ?>" class="<?php echo O::escapeHtml('or-input or-editor or-markdown-editor') ?>"><?php echo O::escapeHtml(''.@$value.'') ?></textarea> + </div> + </section> + <?php } ?> + <?php $if6=($editor=='html'); if($if6) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <textarea name="<?php echo O::escapeHtml(''.@$name.'') ?>" id="<?php echo O::escapeHtml('pageelement_edit_editor') ?>" class="<?php echo O::escapeHtml('or-input or-editor or-html-editor') ?>"><?php echo ''.@$value.'' ?></textarea> + </div> + </section> + <?php } ?> + <?php $if6=($editor=='wiki'); if($if6) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <textarea name="<?php echo O::escapeHtml(''.@$name.'') ?>" class="<?php echo O::escapeHtml('or-input or-editor or-wiki-editor') ?>"><?php echo ''.@$value.'' ?></textarea> + </div> + </section> + <?php } ?> + <?php $if6=($editor=='text'); if($if6) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <textarea name="<?php echo O::escapeHtml(''.@$name.'') ?>" class="<?php echo O::escapeHtml('or-input or-editor raw-editor') ?>"><?php echo O::escapeHtml(''.@$value.'') ?></textarea> + </div> + </section> + <?php } ?> + <?php } ?> + <?php $if5=($type=='link'); if($if5) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml(''.@O::lang('link_target').'') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <div class="<?php echo O::escapeHtml('or-selector or-droppable-selector') ?>"><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('linkobjectid') ?>" value="<?php echo O::escapeHtml(''.@$linkobjectid.'') ?>" class="<?php echo O::escapeHtml('or-selector-link-value') ?>" /><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('text') ?>" name="<?php echo O::escapeHtml('linkobjectid_text') ?>" placeholder="<?php echo O::escapeHtml(''.@$name.'') ?>" value="<?php echo O::escapeHtml(''.@$name.'') ?>" class="<?php echo O::escapeHtml('or-input or-selector-link-name or-act-selector-search') ?>" /><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--menu-tree or-act-selector-tree-button') ?>"><?php echo O::escapeHtml('') ?></i> + <div class="<?php echo O::escapeHtml('or-dropdown or-act-selector-search-results') ?>"><?php echo O::escapeHtml('') ?></div> + <div type="<?php echo O::escapeHtml('hidden') ?>" data-types="<?php echo O::escapeHtml(''.@$types.'') ?>" data-init-id="<?php echo O::escapeHtml(''.@$linkobjectid.'') ?>" data-init-folderid="<?php echo O::escapeHtml(''.@$rootfolderid.'') ?>" class="<?php echo O::escapeHtml('or-navtree or-selector-tree or-act-load-selector-tree') ?>"><?php echo O::escapeHtml('') ?></div> + </div> + </div> + </section> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml(''.@O::lang('link_url').'') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <input name="<?php echo O::escapeHtml('linkurl') ?>" type="<?php echo O::escapeHtml('text') ?>" maxlength="<?php echo O::escapeHtml('256') ?>" value="<?php echo O::escapeHtml(''.@$linkurl.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> + </div> + </section> + <?php } ?> + </div> + </section> + <?php $if4=($type=='insert'); if($if4) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <select name="<?php echo O::escapeHtml(''.@$name.'') ?>" size="<?php echo O::escapeHtml('1') ?>" class="<?php echo O::escapeHtml('or-input') ?>"><?php echo O::escapeHtml('') ?> + <?php foreach($objects as $_key=>$_value) { ?> + <option value="<?php echo O::escapeHtml(''.@$_key.'') ?>" <?php if($_key==$value){ ?>selected="<?php echo O::escapeHtml('selected') ?>"<?php } ?>><?php echo O::escapeHtml(''.@$_value.'') ?></option> + <?php } ?> + </select> + </div> + </section> + <?php } ?> + <?php $if4=($type=='number'); if($if4) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <div class="<?php echo O::escapeHtml('or-') ?>"><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('hidden') ?>" name="<?php echo O::escapeHtml('decimals') ?>" value="<?php echo O::escapeHtml('decimals') ?>" /><?php echo O::escapeHtml('') ?> + <input name="<?php echo O::escapeHtml(''.@$name.'') ?>" type="<?php echo O::escapeHtml('text') ?>" maxlength="<?php echo O::escapeHtml('20') ?>" value="<?php echo O::escapeHtml(''.@$value.'') ?>" class="<?php echo O::escapeHtml('or-input') ?>" /><?php echo O::escapeHtml('') ?> + </div> + </div> + </section> + <?php } ?> + <?php $if4=($type=='select'); if($if4) { ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <select name="<?php echo O::escapeHtml(''.@$name.'') ?>" size="<?php echo O::escapeHtml('1') ?>" class="<?php echo O::escapeHtml('or-input') ?>"><?php echo O::escapeHtml('') ?> + <?php foreach($items as $_key=>$_value) { ?> + <option value="<?php echo O::escapeHtml(''.@$_key.'') ?>" <?php if($_key==$value){ ?>selected="<?php echo O::escapeHtml('selected') ?>"<?php } ?>><?php echo O::escapeHtml(''.@$_value.'') ?></option> + <?php } ?> + </select> + </div> + </section> + <?php } ?> + <?php } ?> + <section class="<?php echo O::escapeHtml('or-group or-collapsible or-collapsible--is-open or-collapsible--show') ?>"><?php echo O::escapeHtml('') ?> + <h2 class="<?php echo O::escapeHtml('or-collapsible-title or-group-title or-collapsible-act-switch') ?>"><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--node-closed or-collapsible--on-closed') ?>"><?php echo O::escapeHtml('') ?></i> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--node-open or-collapsible--on-open') ?>"><?php echo O::escapeHtml('') ?></i> + <span><?php echo O::escapeHtml(''.@O::lang('options').'') ?></span> + </h2> + <div class="<?php echo O::escapeHtml('or-collapsible-value or-group-value') ?>"><?php echo O::escapeHtml('') ?> + <section class="<?php echo O::escapeHtml('or-fieldset') ?>"><?php echo O::escapeHtml('') ?> + <h3 class="<?php echo O::escapeHtml('or-fieldset-label') ?>"><?php echo O::escapeHtml('') ?></h3> + <div class="<?php echo O::escapeHtml('or-fieldset-value') ?>"><?php echo O::escapeHtml('') ?> + <?php $if5=(isset($release)); if($if5) { ?> + <div class="<?php echo O::escapeHtml('or-') ?>"><?php echo O::escapeHtml('') ?> + <label><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('checkbox') ?>" name="<?php echo O::escapeHtml('release') ?>" value="<?php echo O::escapeHtml('1') ?>" <?php if(@$release){ ?>checked="<?php echo O::escapeHtml('checked') ?>"<?php } ?> class="<?php echo O::escapeHtml('or-form-checkbox') ?>" /><?php echo O::escapeHtml('') ?> + <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml(''.@O::lang('RELEASE').'') ?></span> + </label> + </div> + <?php } ?> + <?php $if5=(isset($publish)); if($if5) { ?> + <div class="<?php echo O::escapeHtml('or-') ?>"><?php echo O::escapeHtml('') ?> + <label><?php echo O::escapeHtml('') ?> + <input type="<?php echo O::escapeHtml('checkbox') ?>" name="<?php echo O::escapeHtml('publish') ?>" value="<?php echo O::escapeHtml('1') ?>" <?php if(@$publish){ ?>checked="<?php echo O::escapeHtml('checked') ?>"<?php } ?> class="<?php echo O::escapeHtml('or-form-checkbox') ?>" /><?php echo O::escapeHtml('') ?> + <span class="<?php echo O::escapeHtml('or-form-label') ?>"><?php echo O::escapeHtml(''.@O::lang('PAGE_PUBLISH_AFTER_SAVE').'') ?></span> + </label> + </div> + <?php } ?> + </div> + </section> + </div> + </section> + </div> + <div class="<?php echo O::escapeHtml('or-form-actionbar') ?>"><?php echo O::escapeHtml('') ?> + <div class="<?php echo O::escapeHtml('or-btn or-btn--control or-btn--secondary or-act-form-cancel') ?>"><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--form-cancel') ?>"><?php echo O::escapeHtml('') ?></i> + <span class="<?php echo O::escapeHtml('or-form-btn-label') ?>"><?php echo O::escapeHtml(''.@O::lang('CANCEL').'') ?></span> + </div> + <div class="<?php echo O::escapeHtml('or-btn or-btn--control or-btn--primary or-act-form-apply') ?>"><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--form-apply') ?>"><?php echo O::escapeHtml('') ?></i> + <span class="<?php echo O::escapeHtml('or-form-btn-label') ?>"><?php echo O::escapeHtml(''.@O::lang('APPLY').'') ?></span> + </div> + <div class="<?php echo O::escapeHtml('or-btn or-btn--control or-btn--primary or-act-form-save') ?>"><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--form-ok') ?>"><?php echo O::escapeHtml('') ?></i> + <span class="<?php echo O::escapeHtml('or-form-btn-label') ?>"><?php echo O::escapeHtml(''.@O::lang('save').'') ?></span> + </div> + </div> + </form>+ \ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/page/all.tpl.src.xml b/modules/cms/ui/themes/default/html/views/page/all.tpl.src.xml @@ -0,0 +1,143 @@ +<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"> + <form method="post" label="${message:save}" apply="true"> + <hidden name="languageid"/> + <hidden name="value_time" /> + + + <list list="${elements}" extract="true"> + + + <hidden name="elementid" /> + + <group title="${label}" collapsible="false" description="${desc}"> + <if value="${type}" equals="date"> + <fieldset label=""> + <input type="date" name="${name}_date" label="date" default="${value}" /> + <input type="time" name="${name}_time" label="time" default="${value}" /> + </fieldset> + </if> + <if value="${type}" equals="text"> + <fieldset> + <input size="50" maxlength="255" class="text" name="text" default="${value}" /> + </fieldset> + </if> + <if value="${type}" equals="longtext"> + <hidden name="format"/> + <if value="${editor}" equals="markdown"> + <fieldset> + <editor type="markdown" name="${name}" default="${value}" /> + </fieldset> + </if> + <if value="${editor}" equals="html"> + <fieldset> + <editor type="html" name="${name}" default="${value}" /> + </fieldset> + </if> + <if value="${editor}" equals="wiki"> + <fieldset> + <editor type="wiki" name="${name}" default="${value}"/> + + <!-- + <group title="${message:help}" open="false"> + <table filter="false"> + <column> + <text value="${config:editor/text-markup/strong-begin}"/> + <text value="${message:text_markup_strong}"/> + <text value="${config:editor/text-markup/strong-end}"/> + <newline/> + <text value="${config:editor/text-markup/emphatic-begin}"/> + <text value="${message:text_markup_emphatic}"/> + <text value="${config:editor/text-markup/emphatic-end}"/> + </column> + <column> + <text value="${config:editor/text-markup/list-numbered}"/> + <text value="${message:text_markup_numbered_list}"/> + <newline/> + <text value="${config:editor/text-markup/list-numbered}"/> + <text value="..."/> + <newline/> + </column> + <column> + <text value="${config:editor/text-markup/list-unnumbered}"/> + <text value="${message:text_markup_unnumbered_list}"/> + <newline/> + <text value="${config:editor/text-markup/list-unnumbered}"/> + <text value="..."/> + <newline/> + </column> + <column> + <text value="${config:editor/text-markup/table-cell-sep}"/> + <text value="${message:text_markup_table}"/> + <text value="${config:editor/text-markup/table-cell-sep}"/> + <text value="..."/> + <text value="${config:editor/text-markup/table-cell-sep}"/> + <text value="..."/> + <text value="${config:editor/text-markup/table-cell-sep}"/> + <newline/> + <text value="${config:editor/text-markup/table-cell-sep}"/> + <text value="..."/> + <text value="${config:editor/text-markup/table-cell-sep}"/> + <text value="..."/> + <text value="${config:editor/text-markup/table-cell-sep}"/> + <text value="..."/> + <text value="${config:editor/text-markup/table-cell-sep}"/> + <newline/> + </column> + </table> + </group>--> + </fieldset> + </if> + <if value="${editor}" equals="text"> + <fieldset> + <inputarea class="editor raw-editor" name="${name}" default="${value}" rows="25" cols="70" /> + </fieldset> + </if> + </if> + <if value="${type}" equals="link"> + <fieldset label="${message:link_target}"> + <selector param="linkobjectid" types="${types}" name="${name}" id="${linkobjectid}" + folderid="${rootfolderid}"/> + </fieldset> + <fieldset label="${message:link_url}"> + <input name="linkurl"/> + </fieldset> + </if> + </group> + <if value="${type}" equals="insert"> + <fieldset> + <selectbox list="objects" name="${name}" default="${value}" /> + </fieldset> + </if> + <if value="${type}" equals="number"> + <fieldset> + <part> + <hidden name="decimals" default="decimals"/> + <input size="15" maxlength="20" name="${name}" default="${value}"/> + </part> + </fieldset> + </if> + <if value="${type}" equals="select"> + <fieldset> + <selectbox list="items" name="${name}" default="${value}" /> + </fieldset> + </if> + </list> + + + <group title="${message:options}"> + <fieldset> + <if present="release"> + <part> + <checkbox name="release" label="${message:RELEASE}"/> + </part> + </if> + <if present="publish"> + <part> + <checkbox name="publish" label="${message:PAGE_PUBLISH_AFTER_SAVE}"/> + </part> + </if> + </fieldset> + </group> + </form> +</output> diff --git a/modules/cms/ui/themes/default/html/views/page/edit.php b/modules/cms/ui/themes/default/html/views/page/edit.php @@ -1,45 +1,87 @@ <?php /* THIS FILE IS GENERATED from edit.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('') ?> + <section class="<?php echo O::escapeHtml('or-group or-collapsible or-collapsible--is-open or-collapsible--show') ?>"><?php echo O::escapeHtml('') ?> + <h2 class="<?php echo O::escapeHtml('or-collapsible-title or-group-title or-collapsible-act-switch') ?>"><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--node-closed or-collapsible--on-closed') ?>"><?php echo O::escapeHtml('') ?></i> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--node-open or-collapsible--on-open') ?>"><?php echo O::escapeHtml('') ?></i> + <span><?php echo O::escapeHtml(''.@O::lang('LANGUAGES').'') ?></span> + </h2> + <div class="<?php echo O::escapeHtml('or-collapsible-value or-group-value') ?>"><?php echo O::escapeHtml('') ?> + <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 width="<?php echo O::escapeHtml('100%') ?>" 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('LANGUAGE').'') ?></span> + </th> + </tr> + <?php foreach((array)$languages as $id=>$name) { ?> + <tr class="<?php echo O::escapeHtml('or-data or-act-clickable') ?>"><?php echo O::escapeHtml('') ?> + <td><?php echo O::escapeHtml('') ?> + <a title="<?php echo O::escapeHtml(''.@$desc.'') ?>" target="<?php echo O::escapeHtml('_self') ?>" data-name="<?php echo O::escapeHtml(''.@$name.'') ?>" name="<?php echo O::escapeHtml(''.@$name.'') ?>" data-type="<?php echo O::escapeHtml('dialog') ?>" data-action="<?php echo O::escapeHtml('') ?>" data-method="<?php echo O::escapeHtml('all') ?>" data-id="<?php echo O::escapeHtml('') ?>" data-extra-languageid="<?php echo O::escapeHtml(''.@$id.'') ?>" data-extra-dialogAction="<?php echo O::escapeHtml('') ?>" data-extra-dialogMethod="<?php echo O::escapeHtml('all') ?>" data-extra="<?php echo O::escapeHtml('{\'languageid\':\''.@$id.'\',\'dialogAction\':null,\'dialogMethod\':\'all\'}') ?>" href="<?php echo O::escapeHtml('') ?>" class="<?php echo O::escapeHtml('or-link') ?>"><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-pageelement') ?>"><?php echo O::escapeHtml('') ?></i> + <span><?php echo O::escapeHtml(''.@$name.'') ?></span> + </a> + </td> + </tr> + <?php } ?> + </table> + </div> + </div> </div> - <div class="<?php echo O::escapeHtml('or-table-area') ?>"><?php echo O::escapeHtml('') ?> - <table width="<?php echo O::escapeHtml('100%') ?>" 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('NAME').'') ?></span> - </th> - <th><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('DESCRIPTION').'') ?></span> - </th> - <th><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('TYPE').'') ?></span> - </th> - </tr> - <?php $if3=(($elements)==FALSE); if($if3) { ?> - <tr><?php echo O::escapeHtml('') ?> - <td><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('NOT_FOUND').'') ?></span> - </td> - </tr> - <?php } ?> - <?php foreach((array)$elements as $list_key=>$list_value) { extract($list_value); ?> - <tr class="<?php echo O::escapeHtml('or-data or-act-clickable') ?>"><?php echo O::escapeHtml('') ?> - <td><?php echo O::escapeHtml('') ?> - <a title="<?php echo O::escapeHtml(''.@$desc.'') ?>" target="<?php echo O::escapeHtml('_self') ?>" data-name="<?php echo O::escapeHtml(''.@$name.'') ?>" name="<?php echo O::escapeHtml(''.@$name.'') ?>" data-type="<?php echo O::escapeHtml('open') ?>" data-action="<?php echo O::escapeHtml('pageelement') ?>" data-method="<?php echo O::escapeHtml('') ?>" data-id="<?php echo O::escapeHtml(''.@$pageelementid.'') ?>" data-extra="<?php echo O::escapeHtml('[]') ?>" href="<?php echo O::escapeHtml('#/pageelement/'.@$pageelementid.'') ?>" class="<?php echo O::escapeHtml('or-link') ?>"><?php echo O::escapeHtml('') ?> - <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-pageelement') ?>"><?php echo O::escapeHtml('') ?></i> - <span><?php echo O::escapeHtml(''.@$label.'') ?></span> - </a> - </td> - <td title="<?php echo O::escapeHtml(''.@$desc.'') ?>"><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@$desc.'') ?></span> - </td> - <td><?php echo O::escapeHtml('') ?> - <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-el_'.@$typename.'') ?>"><?php echo O::escapeHtml('') ?></i> - <span><?php echo O::escapeHtml(''.@O::lang('el_'.@$typename.'').'') ?></span> - </td> - </tr> - <?php } ?> - </table> + </section> + <section class="<?php echo O::escapeHtml('or-group or-collapsible or-collapsible--is-open or-collapsible--show') ?>"><?php echo O::escapeHtml('') ?> + <h2 class="<?php echo O::escapeHtml('or-collapsible-title or-group-title or-collapsible-act-switch') ?>"><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--node-closed or-collapsible--on-closed') ?>"><?php echo O::escapeHtml('') ?></i> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--node-open or-collapsible--on-open') ?>"><?php echo O::escapeHtml('') ?></i> + <span><?php echo O::escapeHtml(''.@O::lang('PAGE_PAGEELEMENTS').'') ?></span> + </h2> + <div class="<?php echo O::escapeHtml('or-collapsible-value or-group-value') ?>"><?php echo O::escapeHtml('') ?> + <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 width="<?php echo O::escapeHtml('100%') ?>" 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('NAME').'') ?></span> + </th> + <th><?php echo O::escapeHtml('') ?> + <span><?php echo O::escapeHtml(''.@O::lang('DESCRIPTION').'') ?></span> + </th> + <th><?php echo O::escapeHtml('') ?> + <span><?php echo O::escapeHtml(''.@O::lang('TYPE').'') ?></span> + </th> + </tr> + <?php $if4=(($elements)==FALSE); if($if4) { ?> + <tr><?php echo O::escapeHtml('') ?> + <td><?php echo O::escapeHtml('') ?> + <span><?php echo O::escapeHtml(''.@O::lang('NOT_FOUND').'') ?></span> + </td> + </tr> + <?php } ?> + <?php foreach((array)$elements as $list_key=>$list_value) { extract($list_value); ?> + <tr class="<?php echo O::escapeHtml('or-data or-act-clickable') ?>"><?php echo O::escapeHtml('') ?> + <td><?php echo O::escapeHtml('') ?> + <a title="<?php echo O::escapeHtml(''.@$desc.'') ?>" target="<?php echo O::escapeHtml('_self') ?>" data-name="<?php echo O::escapeHtml(''.@$name.'') ?>" name="<?php echo O::escapeHtml(''.@$name.'') ?>" data-type="<?php echo O::escapeHtml('open') ?>" data-action="<?php echo O::escapeHtml('pageelement') ?>" data-method="<?php echo O::escapeHtml('') ?>" data-id="<?php echo O::escapeHtml(''.@$pageelementid.'') ?>" data-extra="<?php echo O::escapeHtml('[]') ?>" href="<?php echo O::escapeHtml('#/pageelement/'.@$pageelementid.'') ?>" class="<?php echo O::escapeHtml('or-link') ?>"><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-pageelement') ?>"><?php echo O::escapeHtml('') ?></i> + <span><?php echo O::escapeHtml(''.@$label.'') ?></span> + </a> + </td> + <td title="<?php echo O::escapeHtml(''.@$desc.'') ?>"><?php echo O::escapeHtml('') ?> + <span><?php echo O::escapeHtml(''.@$desc.'') ?></span> + </td> + <td><?php echo O::escapeHtml('') ?> + <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-el_'.@$typename.'') ?>"><?php echo O::escapeHtml('') ?></i> + <span><?php echo O::escapeHtml(''.@O::lang('el_'.@$typename.'').'') ?></span> + </td> + </tr> + <?php } ?> + </table> + </div> + </div> </div> - </div>- \ No newline at end of file + </section>+ \ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/page/edit.tpl.src.xml b/modules/cms/ui/themes/default/html/views/page/edit.tpl.src.xml @@ -1,40 +1,64 @@ <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:NAME}"/> - </column> - <column header="true"> - <text value="${message:DESCRIPTION}"/> - </column> - <column header="true"> - <text value="${message:TYPE}"/> - </column> - </row> - <if empty="${elements}"> - <row> - <column> - <text value="${message:NOT_FOUND}"/> + + <group title="${message:LANGUAGES}"> + + <table> + <row header="true"> + <column header="true"> + <text value="${message:LANGUAGE}"/> </column> </row> - </if> - <list list="${elements}" extract="true"> - <row class="data,act-clickable"> - <column> - <link type="open" title="${desc}" name="${name}" action="pageelement" id="${pageelementid}"> - <image action="pageelement"/> - <text value="${label}"/> - </link> + <list list="${languages}" key="id" value="name"> + <row class="data,act-clickable"> + <column> + <link type="dialog" title="${desc}" name="${name}" subaction="all" var1="languageid" value1="${id}"> + <image action="pageelement"/> + <text value="${name}"/> + </link> + </column> + </row> + </list> + </table> + </group> + + <group title="${message:PAGE_PAGEELEMENTS}"> + <table> + <row header="true"> + <column header="true"> + <text value="${message:NAME}"/> </column> - <column title="${desc}"> - <text value="${desc}"/> + <column header="true"> + <text value="${message:DESCRIPTION}"/> </column> - <column> - <image elementtype="${typename}"/> - <text value="${message:el_${typename}}"/> + <column header="true"> + <text value="${message:TYPE}"/> </column> </row> - </list> - </table> + <if empty="${elements}"> + <row> + <column> + <text value="${message:NOT_FOUND}"/> + </column> + </row> + </if> + <list list="${elements}" extract="true"> + <row class="data,act-clickable"> + <column> + <link type="open" title="${desc}" name="${name}" action="pageelement" id="${pageelementid}"> + <image action="pageelement"/> + <text value="${label}"/> + </link> + </column> + <column title="${desc}"> + <text value="${desc}"/> + </column> + <column> + <image elementtype="${typename}"/> + <text value="${message:el_${typename}}"/> + </column> + </row> + </list> + </table> + </group> </output> diff --git a/modules/cms/ui/themes/default/style/theme/openrat-theme.less b/modules/cms/ui/themes/default/style/theme/openrat-theme.less @@ -302,6 +302,10 @@ html.or-theme-@{cms-theme-id} { &-group { border-color: mix(@cms-main-text-color, @cms-main-background-color); + &-description { + color: mix(@cms-main-text-color, @cms-main-background-color); + font-size: 0.9em; + } } &-act-clickable { diff --git a/modules/template_engine/components/html/component_editor/EditorComponent.class.php b/modules/template_engine/components/html/component_editor/EditorComponent.class.php @@ -11,6 +11,7 @@ class EditorComponent extends FieldComponent { public $type; public $name; + public $default; public $mode ='htmlmixed'; public $extension =''; public $mimetype = ''; @@ -56,7 +57,10 @@ class EditorComponent extends FieldComponent throw new \LogicException("Unknown editor type: ".$this->type); } - $textarea->content(Value::createExpression(ValueExpression::TYPE_DATA_VAR,$this->name)); + if ( $this->default ) + $textarea->content( $this->default ); + else + $textarea->content(Value::createExpression(ValueExpression::TYPE_DATA_VAR,$this->name)); return $textarea; } diff --git a/modules/template_engine/components/html/component_group/GroupComponent.class.php b/modules/template_engine/components/html/component_group/GroupComponent.class.php @@ -18,6 +18,7 @@ class GroupComponent extends Component public $show = true; public $collapsible = true; public $title; + public $description; public $icon; public function createElement() @@ -63,6 +64,12 @@ class GroupComponent extends Component (new HtmlElement('span'))->content( $this->title )->asChildOf($headline); } + if ( $this->description ) + (new HtmlElement('p')) + ->addStyleClass(['group-description']) + ->content( $this->description ) + ->asChildOf($group); + $value = (new HtmlElement('div')) ->addStyleClass(['collapsible-value','group-value']) ->asChildOf($group);