File modules/cms/action/configuration/ConfigurationEditAction.class.php
Last commit: Wed May 15 00:55:16 2024 +0200 Jan Dankert New support for mapper in the Set-Component for better abstraction between UI and Actions
1 <?php 2 namespace cms\action\configuration; 3 use cms\action\ConfigurationAction; 4 use cms\action\Method; 5 use cms\base\DefaultConfig; 6 use util\ArrayUtils; 7 use util\Request; 8 use util\Session; 9 10 class ConfigurationEditAction extends ConfigurationAction { 11 12 13 public function view() { 14 15 $defaultConfig = DefaultConfig::get();; 16 $currentConfig = Request::getConfig(); 17 18 $currentConfig['system'] = $this->getSystemConfiguration(); 19 20 // Language are to much entries 21 unset($currentConfig['language']); 22 23 //$flatDefaultConfig = ArrayUtils::flatArray( $defaultConfig ); 24 //$flatCMSConfig = ArrayUtils::flatArray( Request::getConfig() ); 25 //$flatConfig = ArrayUtils::flatArray( $currentConfig ); 26 $flatConfig = $currentConfig; 27 28 array_walk_recursive($flatConfig,function(&$item,$key) 29 { 30 if ( strpos($key,'password') !== false) { 31 $item='*************'; 32 } 33 }); 34 35 /* 36 $config = array_map( function($key,$value) use ($flatConfig,$flatCMSConfig,$flatDefaultConfig) { 37 38 if ( ) 39 $value['value'] = '**********'; 40 41 return ['label'=>$label,'key'=>$key,'value'=>$value['value'],'class'=>(empty($flatCMSConfig[$key])?'readonly':(isset($flatDefaultConfig[$key]) && $flatDefaultConfig[$key]==$flatConfig[$key]?'default':'changed'))]; 42 43 },array_keys($flatConfig),$flatConfig); 44 */ 45 46 $this->setTemplateVar('config',$flatConfig ); 47 } 48 }
Downloadmodules/cms/action/configuration/ConfigurationEditAction.class.php
History Wed, 15 May 2024 00:55:16 +0200 Jan Dankert New support for mapper in the Set-Component for better abstraction between UI and Actions Tue, 14 May 2024 23:48:28 +0200 Jan Dankert Enabling Fulltext-Search in Settings Fri, 15 Apr 2022 14:51:22 +0200 dankert Refactoring: User,Config and Database info is now stored in the Request, because so there is no session required for clients which are using Basic Authorization. Sun, 20 Mar 2022 22:34:34 +0100 dankert Fix: Mask passwords in configuration output. Thu, 19 Nov 2020 12:28:33 +0100 Jan Dankert Fix: nextSubAction() is depracated and should not be used. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.