File modules/cms/ui/action/title/TitleHistoryAction.class.php

Last commit: Sun Dec 5 20:33:24 2021 +0100	dankert	Cleanup: Removed unusable properties from class 'Value' and 'BaseObject'.
1 <?php 2 namespace cms\ui\action\title; 3 use cms\action\Method; 4 use cms\model\BaseObject; 5 use cms\ui\action\TitleAction; 6 use util\Html; 7 use util\Session; 8 9 class TitleHistoryAction extends TitleAction implements Method { 10 public function view() { 11 $resultList = array(); 12 13 $history = Session::get('history'); 14 15 if ( is_array($history) ) 16 { 17 foreach( array_reverse($history) as $objectid ) 18 { 19 $o = new BaseObject( $objectid ); 20 $o->load(); 21 $resultList[$objectid] = array(); 22 $resultList[$objectid]['url'] = Html::url($o->getType(),'',$objectid); 23 $resultList[$objectid]['type'] = $o->getType(); 24 $resultList[$objectid]['name'] = $o->getDefaultName()->name; 25 $resultList[$objectid]['lastchange_date'] = $o->lastchangeDate; 26 27 $defaultName = $o->getDefaultName(); 28 if ( $defaultName->description != '' ) 29 $resultList[$objectid]['desc'] = $defaultName->description; 30 else 31 $resultList[$objectid]['desc'] = \cms\base\Language::lang('NO_DESCRIPTION_AVAILABLE'); 32 } 33 } 34 35 $this->setTemplateVar( 'history',$resultList ); 36 } 37 public function post() { 38 } 39 }
Download modules/cms/ui/action/title/TitleHistoryAction.class.php
History Sun, 5 Dec 2021 20:33:24 +0100 dankert Cleanup: Removed unusable properties from class 'Value' and 'BaseObject'. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.