openrat-cms

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

commit 3e48551cb276aee15db0c0148350e85fc740ca07
parent f4953b32dddc06db297150919c81d30a81c003fa
Author: dankert <openrat@jandankert.de>
Date:   Sat,  4 Dec 2021 01:27:06 +0100

Fix: Pageelement has no language

Diffstat:
Mmodules/cms/action/pageelement/PageelementInfoAction.class.php | 41+++++++++++++----------------------------
Mmodules/cms/ui/themes/default/html/views/pageelement/info.php | 45++++++++++-----------------------------------
Mmodules/cms/ui/themes/default/html/views/pageelement/info.tpl.src.xml | 139++++++++++++++++++++++++++++++++++---------------------------------------------
3 files changed, 83 insertions(+), 142 deletions(-)

diff --git a/modules/cms/action/pageelement/PageelementInfoAction.class.php b/modules/cms/action/pageelement/PageelementInfoAction.class.php @@ -3,40 +3,25 @@ namespace cms\action\pageelement; use cms\action\Method; use cms\action\PageelementAction; use cms\model\Element; +use cms\model\PageContent; use cms\model\Template; use cms\model\User; class PageelementInfoAction extends PageelementAction implements Method { public function view() { - $this->value->languageid = $this->page->languageid; - $this->value->objectid = $this->page->objectid; - $this->value->pageid = $this->page->pageid; - $this->value->page = $this->page; - $this->value->simple = false; - $this->value->element = &$this->element; - $this->value->element->load(); - $this->value->load(); - - $this->setTemplateVar('name' ,$this->value->element->name ); - $this->setTemplateVar('description' ,$this->value->element->desc ); - $this->setTemplateVar('elementid' ,$this->value->element->elementid); - $this->setTemplateVar('element_id' ,$this->value->element->elementid ); - $this->setTemplateVar('element_name' ,$this->value->element->name ); - $this->setTemplateVar('element_type' ,$this->value->element->getTypeName() ); - $this->setTemplateVar('element_format',Element::getAvailableFormats()[ $this->value->element->format] ); - $this->setTemplateVar('format' ,@Element::getAvailableFormats()[ $this->value->format ] ); - - $user = new User( $this->value->lastchangeUserId ); - - try{ - $user->load(); - }catch (\util\exception\ObjectNotFoundException $e) { - $user = new User(); // Empty User. - } - - $this->setTemplateVar('lastchange_user',$user->getProperties()); - $this->setTemplateVar('lastchange_date',$this->value->lastchangeTimeStamp); + + $this->element->load(); + + $this->setTemplateVar('name' ,$this->element->name ); + $this->setTemplateVar('description' ,$this->element->desc ); + $this->setTemplateVar('elementid' ,$this->element->elementid); + $this->setTemplateVar('element_id' ,$this->element->elementid ); + $this->setTemplateVar('element_name' ,$this->element->name ); + $this->setTemplateVar('element_type' ,$this->element->getTypeName() ); + $this->setTemplateVar('element_format',Element::getAvailableFormats()[ $this->element->format] ); + + $this->setTemplateVar('lastchange_date',0); $t = new Template( $this->page->templateid ); $t->load(); diff --git a/modules/cms/ui/themes/default/html/views/pageelement/info.php b/modules/cms/ui/themes/default/html/views/pageelement/info.php @@ -1,19 +1,16 @@ <?php /* THIS FILE IS GENERATED from info.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-data') ?>"><?php echo O::escapeHtml('') ?> - <td><?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> - </td> - <td class="<?php echo O::escapeHtml('or-name') ?>"><?php echo O::escapeHtml('') ?> + </th> + <th><?php echo O::escapeHtml('') ?> <span><?php echo O::escapeHtml(''.@$name.'') ?></span> - </td> + </th> </tr> - <tr class="<?php echo O::escapeHtml('or-data') ?>"><?php echo O::escapeHtml('') ?> + <tr><?php echo O::escapeHtml('') ?> <td><?php echo O::escapeHtml('') ?> <span><?php echo O::escapeHtml(''.@O::lang('description').'') ?></span> </td> @@ -21,7 +18,7 @@ <span><?php echo O::escapeHtml(''.@$description.'') ?></span> </td> </tr> - <tr class="<?php echo O::escapeHtml('or-data') ?>"><?php echo O::escapeHtml('') ?> + <tr><?php echo O::escapeHtml('') ?> <td><?php echo O::escapeHtml('') ?> <span><?php echo O::escapeHtml(''.@O::lang('type').'') ?></span> </td> @@ -30,7 +27,7 @@ <span><?php echo O::escapeHtml(''.@O::lang('el_'.@$element_type.'').'') ?></span> </td> </tr> - <tr class="<?php echo O::escapeHtml('or-data') ?>"><?php echo O::escapeHtml('') ?> + <tr><?php echo O::escapeHtml('') ?> <td><?php echo O::escapeHtml('') ?> <span><?php echo O::escapeHtml(''.@O::lang('template').'') ?></span> </td> @@ -41,7 +38,7 @@ </a> </td> </tr> - <tr class="<?php echo O::escapeHtml('or-data') ?>"><?php echo O::escapeHtml('') ?> + <tr><?php echo O::escapeHtml('') ?> <td><?php echo O::escapeHtml('') ?> <span><?php echo O::escapeHtml(''.@O::lang('element').'') ?></span> </td> @@ -52,7 +49,7 @@ </a> </td> </tr> - <tr class="<?php echo O::escapeHtml('or-data') ?>"><?php echo O::escapeHtml('') ?> + <tr><?php echo O::escapeHtml('') ?> <td><?php echo O::escapeHtml('') ?> <span><?php echo O::escapeHtml(''.@O::lang('format').'') ?></span> <span><?php echo O::escapeHtml(''.@O::lang('element').'') ?></span> @@ -61,28 +58,6 @@ <span><?php echo O::escapeHtml(''.@$element_format.'') ?></span> </td> </tr> - <tr class="<?php echo O::escapeHtml('or-data') ?>"><?php echo O::escapeHtml('') ?> - <td><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('format').'') ?></span> - </td> - <td><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@$format.'') ?></span> - </td> - </tr> - <tr class="<?php echo O::escapeHtml('or-data') ?>"><?php echo O::escapeHtml('') ?> - <td><?php echo O::escapeHtml('') ?> - <span><?php echo O::escapeHtml(''.@O::lang('lastchange').'') ?></span> - </td> - <td><?php echo O::escapeHtml('') ?> - <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-el_date') ?>"><?php echo O::escapeHtml('') ?></i> - <?php include_once( 'modules/template_engine/components/html/component_date/component-date.php'); { component_date($lastchange_date); ?> - <?php } ?> - <span><?php echo O::escapeHtml(', ') ?></span> - <i class="<?php echo O::escapeHtml('or-image-icon or-image-icon--action-user') ?>"><?php echo O::escapeHtml('') ?></i> - <?php include_once( 'modules/template_engine/components/html/component_user/component-user.php'); { component_user($lastchange_user); ?> - <?php } ?> - </td> - </tr> </table> </div> </div> \ No newline at end of file diff --git a/modules/cms/ui/themes/default/html/views/pageelement/info.tpl.src.xml b/modules/cms/ui/themes/default/html/views/pageelement/info.tpl.src.xml @@ -1,80 +1,61 @@ -<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 class="data"> - <column> - <text value="${message:name}"/> - </column> - <column class="name"> - <text value="${name}"/> - </column> - </row> - <row class="data"> - <column> - <text value="${message:description}"/> - </column> - <column> - <text value="${description}"/> - </column> - </row> - <row class="data"> - <column> - <text value="${message:type}"/> - </column> - <column class="filename"> - <image elementtype="${element_type}"/> - <text value="${message:el_${element_type}}"/> - </column> - </row> - <row class="data"> - <column> - <text value="${message:template}"/> - </column> - <column class="act-clickable"> - <link type="open" action="template" id="${template_id}"> - <image action="template"/> - <text value="${template_name}"/> - </link> - </column> - </row> - <row class="data"> - <column> - <text value="${message:element}"/> - </column> - <column class="act-clickable"> - <link id="${element_id}" name="${element_name}" action="element" type="open"> - <image elementtype="${element_type}"/> - <text value="${element_name}"/> - </link> - </column> - </row> - <row class="data"> - <column> - <text value="${message:format}"/> - <text value="${message:element}"/> - </column> - <column> - <text value="${element_format}"/> - </column> - </row> - <row class="data"> - <column> - <text value="${message:format}"/> - </column> - <column> - <text value="${format}"/> - </column> - </row> - <row class="data"> - <column> - <text value="${message:lastchange}"/> - </column> - <column> - <image elementtype="date"/> - <date date="${lastchange_date}"/> - <text value=", "/> - <image action="user"/> - <user user="${lastchange_user}"/> - </column> - </row> - </table> +<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 filter="false"> + <row header="true"> + <column header="true"> + <text value="${message:name}"/> + </column> + <column header="true"> + <text value="${name}"/> + </column> + </row> + <row> + <column> + <text value="${message:description}"/> + </column> + <column> + <text value="${description}"/> + </column> + </row> + <row> + <column> + <text value="${message:type}"/> + </column> + <column class="filename"> + <image elementtype="${element_type}"/> + <text value="${message:el_${element_type}}"/> + </column> + </row> + <row> + <column> + <text value="${message:template}"/> + </column> + <column class="act-clickable"> + <link type="open" action="template" id="${template_id}"> + <image action="template"/> + <text value="${template_name}"/> + </link> + </column> + </row> + <row> + <column> + <text value="${message:element}"/> + </column> + <column class="act-clickable"> + <link id="${element_id}" name="${element_name}" action="element" type="open"> + <image elementtype="${element_type}"/> + <text value="${element_name}"/> + </link> + </column> + </row> + <row> + <column> + <text value="${message:format}"/> + <text value="${message:element}"/> + </column> + <column> + <text value="${element_format}"/> + </column> + </row> + </table> </output>