openrat-cms

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

commit bd959ecf72927bf737aa05ad6256b030beeba347
parent 1e4a860893b5de8aa89061ad2e2a23e23f513487
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 13 Jul 2018 01:27:17 +0200

Die Konfiguration kann jetzt als YAML-Code ausgegeben werden (Quelltext).

Diffstat:
modules/cms-core/action/ConfigurationAction.class.php | 23++++++++++++++++++++++-
modules/cms-ui/themes/default/html/views/configuration/src.php | 4++++
modules/cms-ui/themes/default/html/views/configuration/src.tpl.src.xml | 2++
modules/cms-ui/themes/default/html/views/title/show.php | 4++--
modules/cms-ui/themes/default/html/views/title/show.tpl.src.xml | 2+-
5 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/modules/cms-core/action/ConfigurationAction.class.php b/modules/cms-core/action/ConfigurationAction.class.php @@ -41,13 +41,14 @@ class ConfigurationAction extends Action public function editView() { $this->nextSubAction('show'); + } /** * Anzeigen des Elementes */ - function showView() + public function showView() { require_once( OR_MODULES_DIR.'/util/config-default.php'); $conf = createDefaultConfig(); @@ -72,6 +73,26 @@ class ConfigurationAction extends Action $this->setTemplateVar('config',$config ); } + + + + public function srcView() + { + $conf = Session::getConfig(); + unset( $conf['language']); + + array_walk_recursive($conf,function(&$item,$key) + { + if($key=='password'){ + $item='*************'; + } + }); + + $this->setTemplateVar('source',\Spyc::YAMLDump($conf,4,0,true)); + } + + + private function flattenArray( $prefix,$arr ) { $new = array(); diff --git a/modules/cms-ui/themes/default/html/views/configuration/src.php b/modules/cms-ui/themes/default/html/views/configuration/src.php @@ -0,0 +1,3 @@ + + <textarea name="source" class="editor__text-editor"><?php echo ${'source'} ?></textarea> + + \ No newline at end of file diff --git a/modules/cms-ui/themes/default/html/views/configuration/src.tpl.src.xml b/modules/cms-ui/themes/default/html/views/configuration/src.tpl.src.xml @@ -0,0 +1 @@ +<editor type="raw" name="source" />+ \ No newline at end of file diff --git a/modules/cms-ui/themes/default/html/views/title/show.php b/modules/cms-ui/themes/default/html/views/title/show.php @@ -238,7 +238,7 @@ </a> </div> - <div class="entry clickable filtered on-action-template"> + <div class="entry clickable filtered on-action-template on-action-configuration"> <a title="<?php echo lang('menu_src_desc') ?>" target="_self" data-type="dialog" data-action="" data-method="src" data-id="<?php echo OR_ID ?>" href="<?php echo Html::url('','src','') ?>"> <img class="image-icon image-icon--method" title="" src="./modules/cms-ui/themes/default/images/icon/method/code.svg" /> @@ -384,7 +384,7 @@ <?php } ?> <?php $if2=($isLoggedIn); if($if2){?> <div class="toolbar-icon search"> - <div class="inputholder"><input<?php if ('') echo ' disabled="true"' ?> data-hint="<?php echo lang('search') ?>" id="<?php echo REQUEST_ID ?>_text" name="text<?php if ('') echo '_disabled' ?>" type="text" maxlength="256" class="text" value="<?php echo Text::encodeHtml(@$text) ?>" /><?php if ('') { ?><input type="hidden" name="text" value="<?php $text ?>"/><?php } ?><img src="./modules/cms-ui/themes/default/images/icon_search.png" width="16" height="16" /></div> + <div class="inputholder"><input<?php if ('') echo ' disabled="true"' ?> placeholder="<?php echo lang('search') ?>" id="<?php echo REQUEST_ID ?>_text" name="text<?php if ('') echo '_disabled' ?>" type="text" maxlength="256" class="text" value="<?php echo Text::encodeHtml(@$text) ?>" /><?php if ('') { ?><input type="hidden" name="text" value="<?php $text ?>"/><?php } ?><img src="./modules/cms-ui/themes/default/images/icon_search.png" width="16" height="16" /></div> <div class="dropdown"> <span class="text"><?php echo nl2br(encodeHtml(htmlentities(''))); ?></span> diff --git a/modules/cms-ui/themes/default/html/views/title/show.tpl.src.xml b/modules/cms-ui/themes/default/html/views/title/show.tpl.src.xml @@ -205,7 +205,7 @@ </link> </part> - <part class="entry clickable filtered on-action-template"> + <part class="entry clickable filtered on-action-template on-action-configuration"> <link type="dialog" title="message:menu_src_desc" subaction="src"> <image method="code" align="left"></image>