openrat-cms

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

commit fbf804f4006d3cdbb51e062ca9963d151f2bf0af
parent 384804d0698ad0b1603bed404faec8905e8dadb6
Author: Jan Dankert <develop@jandankert.de>
Date:   Thu, 19 Nov 2020 12:36:44 +0100

Fix: nextSubAction() is depracated and should not be used.

Diffstat:
Mmodules/cms/action/Action.class.php | 27---------------------------
Mmodules/cms/action/file/FileCompressAction.class.php | 1-
Mmodules/cms/action/file/FileExtractAction.class.php | 1-
Mmodules/cms/action/file/FileUncompressAction.class.php | 1-
Mmodules/cms/action/folder/FolderAddAction.class.php | 15+++++++++++----
Dmodules/cms/action/folder/FolderCreateAction.class.php | 23-----------------------
Mmodules/cms/action/grouplist/GrouplistAddAction.class.php | 2--
Mmodules/cms/action/grouplist/GrouplistEditAction.class.php | 18+++++++++++++++---
Dmodules/cms/action/grouplist/GrouplistShowAction.class.php | 24------------------------
Mmodules/cms/action/image/ImageSizeAction.class.php | 1-
Mmodules/cms/action/languagelist/LanguagelistEditAction.class.php | 36+++++++++++++++++++++++++++++++++---
Dmodules/cms/action/languagelist/LanguagelistShowAction.class.php | 41-----------------------------------------
Mmodules/cms/action/modellist/ModellistEditAction.class.php | 25++++++++++++++++++++++---
Dmodules/cms/action/modellist/ModellistShowAction.class.php | 31-------------------------------
Mmodules/cms/action/object/ObjectAclformAction.class.php | 3---
Mmodules/cms/action/page/PageChangetemplateselectelementsAction.class.php | 4----
Mmodules/cms/action/page/PageEditAction.class.php | 6------
Mmodules/cms/action/page/PageFormAction.class.php | 4----
Mmodules/cms/action/pageelement/PageelementDiffAction.class.php | 1-
Mmodules/cms/action/project/ProjectPropAction.class.php | 1-
Mmodules/cms/action/template/TemplatePropAction.class.php | 1-
Mmodules/cms/action/templatelist/TemplatelistEditAction.class.php | 19++++++++++++++++---
Dmodules/cms/action/templatelist/TemplatelistShowAction.class.php | 23-----------------------
Rmodules/cms/ui/themes/default/html/views/folder/create.php -> modules/cms/ui/themes/default/html/views/folder/add.php | 0
Rmodules/cms/ui/themes/default/html/views/folder/create.tpl.src.xml -> modules/cms/ui/themes/default/html/views/folder/add.tpl.src.xml | 0
Rmodules/cms/ui/themes/default/html/views/grouplist/show.php -> modules/cms/ui/themes/default/html/views/grouplist/edit.php | 0
Rmodules/cms/ui/themes/default/html/views/grouplist/show.tpl.src.xml -> modules/cms/ui/themes/default/html/views/grouplist/edit.tpl.src.xml | 0
Rmodules/cms/ui/themes/default/html/views/languagelist/show.php -> modules/cms/ui/themes/default/html/views/languagelist/edit.php | 0
Rmodules/cms/ui/themes/default/html/views/languagelist/show.tpl.src.xml -> modules/cms/ui/themes/default/html/views/languagelist/edit.tpl.src.xml | 0
Rmodules/cms/ui/themes/default/html/views/modellist/show.php -> modules/cms/ui/themes/default/html/views/modellist/edit.php | 0
Rmodules/cms/ui/themes/default/html/views/modellist/show.tpl.src.xml -> modules/cms/ui/themes/default/html/views/modellist/edit.tpl.src.xml | 0
Rmodules/cms/ui/themes/default/html/views/templatelist/show.php -> modules/cms/ui/themes/default/html/views/templatelist/edit.php | 0
Rmodules/cms/ui/themes/default/html/views/templatelist/show.tpl.src.xml -> modules/cms/ui/themes/default/html/views/templatelist/edit.tpl.src.xml | 0
33 files changed, 97 insertions(+), 211 deletions(-)

diff --git a/modules/cms/action/Action.class.php b/modules/cms/action/Action.class.php @@ -268,33 +268,6 @@ class Action return $this->templateVars; } - /** - * Ruft eine weitere Subaction auf. - * - * @param String $subActionName Name der n�chsten Subaction. Es muss eine Methode mit diesem Namen geben. - * @deprecated - */ - protected function callSubAction($subActionName) - { - return; - } - - - /** - * Calling another action method. - * - * @param String $method Name of next method to call. - */ - protected function nextSubAction($method) - { - Logger::trace("next subaction is '$method'"); - - $this->request->method = $method; - - $methodName = $method . ($_SERVER['REQUEST_METHOD'] == 'POST' ? 'Post' : 'View'); - $this->$methodName(); - } - /** * Ermitteln, ob Benutzer Administratorrechte besitzt diff --git a/modules/cms/action/file/FileCompressAction.class.php b/modules/cms/action/file/FileCompressAction.class.php @@ -66,6 +66,5 @@ class FileCompressAction extends FileAction implements Method { } $this->addNotice('file', 0, $this->file->name, 'DONE', Action::NOTICE_OK); - $this->callSubAction('edit'); } } diff --git a/modules/cms/action/file/FileExtractAction.class.php b/modules/cms/action/file/FileExtractAction.class.php @@ -82,6 +82,5 @@ class FileExtractAction extends FileAction implements Method { default: throw new \util\exception\UIException('cannot extract file with extension: ' . $this->file->extension ); } - $this->callSubAction('edit'); } } diff --git a/modules/cms/action/file/FileUncompressAction.class.php b/modules/cms/action/file/FileUncompressAction.class.php @@ -68,6 +68,5 @@ class FileUncompressAction extends FileAction implements Method { } $this->addNotice('file', 0, $this->file->name, 'DONE', Action::NOTICE_OK); - $this->callSubAction('edit'); } } diff --git a/modules/cms/action/folder/FolderAddAction.class.php b/modules/cms/action/folder/FolderAddAction.class.php @@ -2,15 +2,22 @@ namespace cms\action\folder; use cms\action\FolderAction; use cms\action\Method; +use cms\model\Acl; class FolderAddAction extends FolderAction implements Method { - public function view() { - $this->nextSubAction('create'); - } + public function view() { + $this->setTemplateVar('mayCreateFolder',$this->folder->hasRight( Acl::ACL_CREATE_FOLDER ) ); + $this->setTemplateVar('mayCreateFile' ,$this->folder->hasRight( Acl::ACL_CREATE_FILE ) ); + $this->setTemplateVar('mayCreateText' ,$this->folder->hasRight( Acl::ACL_CREATE_FILE ) ); + $this->setTemplateVar('mayCreateImage' ,$this->folder->hasRight( Acl::ACL_CREATE_FILE ) ); + $this->setTemplateVar('mayCreatePage' ,$this->folder->hasRight( Acl::ACL_CREATE_PAGE ) ); + $this->setTemplateVar('mayCreateUrl' ,$this->folder->hasRight( Acl::ACL_CREATE_LINK ) ); + $this->setTemplateVar('mayCreateLink' ,$this->folder->hasRight( Acl::ACL_CREATE_LINK ) ); + + } public function post() { - $this->nextSubAction('create'); } } diff --git a/modules/cms/action/folder/FolderCreateAction.class.php b/modules/cms/action/folder/FolderCreateAction.class.php @@ -1,23 +0,0 @@ -<?php -namespace cms\action\folder; -use cms\action\FolderAction; -use cms\action\Method; -use cms\model\Acl; - - -class FolderCreateAction extends FolderAction implements Method { - public function view() { - $this->setTemplateVar('mayCreateFolder',$this->folder->hasRight( Acl::ACL_CREATE_FOLDER ) ); - $this->setTemplateVar('mayCreateFile' ,$this->folder->hasRight( Acl::ACL_CREATE_FILE ) ); - $this->setTemplateVar('mayCreateText' ,$this->folder->hasRight( Acl::ACL_CREATE_FILE ) ); - $this->setTemplateVar('mayCreateImage' ,$this->folder->hasRight( Acl::ACL_CREATE_FILE ) ); - $this->setTemplateVar('mayCreatePage' ,$this->folder->hasRight( Acl::ACL_CREATE_PAGE ) ); - $this->setTemplateVar('mayCreateUrl' ,$this->folder->hasRight( Acl::ACL_CREATE_LINK ) ); - $this->setTemplateVar('mayCreateLink' ,$this->folder->hasRight( Acl::ACL_CREATE_LINK ) ); - - } - - - public function post() { - } -} diff --git a/modules/cms/action/grouplist/GrouplistAddAction.class.php b/modules/cms/action/grouplist/GrouplistAddAction.class.php @@ -14,12 +14,10 @@ class GrouplistAddAction extends GrouplistAction implements Method { $this->group->name = $this->getRequestVar('name'); $this->group->persist(); $this->addNotice('group', 0, $this->group->name, 'ADDED', 'ok'); - $this->callSubAction('listing'); } else { $this->addValidationError('name'); - $this->callSubAction('add'); } } } diff --git a/modules/cms/action/grouplist/GrouplistEditAction.class.php b/modules/cms/action/grouplist/GrouplistEditAction.class.php @@ -2,12 +2,24 @@ namespace cms\action\grouplist; use cms\action\GrouplistAction; use cms\action\Method; +use cms\model\Group; class GrouplistEditAction extends GrouplistAction implements Method { - public function view() { - $this->nextSubAction('show'); - } + + public function view() { + $list = array(); + + foreach( Group::getAll() as $id=>$name ) + { + $list[$id] = array(); + $list[$id]['id' ] = $id; + $list[$id]['name'] = $name; + } + + $this->setTemplateVar('el', $list); + } + public function post() { } } diff --git a/modules/cms/action/grouplist/GrouplistShowAction.class.php b/modules/cms/action/grouplist/GrouplistShowAction.class.php @@ -1,24 +0,0 @@ -<?php -namespace cms\action\grouplist; -use cms\action\GrouplistAction; -use cms\action\Method; -use cms\model\Group; - -class GrouplistShowAction extends GrouplistAction implements Method { - public function view() { - $list = array(); - - foreach( Group::getAll() as $id=>$name ) - { - $list[$id] = array(); - $list[$id]['id' ] = $id; - $list[$id]['name'] = $name; - } - - $this->setTemplateVar('el', $list); - } - - - public function post() { - } -} diff --git a/modules/cms/action/image/ImageSizeAction.class.php b/modules/cms/action/image/ImageSizeAction.class.php @@ -55,7 +55,6 @@ class ImageSizeAction extends ImageAction implements Method { { $this->addValidationError('width','INPUT_NEW_IMAGE_SIZE' ); $this->addValidationError('height',''); - $this->callSubAction('size'); return; } diff --git a/modules/cms/action/languagelist/LanguagelistEditAction.class.php b/modules/cms/action/languagelist/LanguagelistEditAction.class.php @@ -2,12 +2,42 @@ namespace cms\action\languagelist; use cms\action\LanguagelistAction; use cms\action\Method; +use cms\base\Configuration; +use cms\model\Language; +use util\Html; class LanguagelistEditAction extends LanguagelistAction implements Method { - public function view() { - $this->nextSubAction('show'); - } + + public function view() { + $countryList = Configuration::Conf()->get('countries',[]); + + $list = array(); + + $this->setTemplateVar('act_languageid',0 ); + + + + foreach( $this->project->getLanguageIds() as $id ) + { + $l = new Language( $id ); + $l->load(); + + unset( $countryList[strtoupper($l->isoCode)] ); + + $list[$id] = array(); + $list[$id]['name' ] = $l->name; + $list[$id]['isocode'] = $l->isoCode; + $list[$id]['id' ] = $id; + + $list[$id]['is_default'] = $l->isDefault; + + $list[$id]['select_url'] = Html::url( 'index','language',$id ); + } + + $this->setTemplateVar('el',$list); + } + public function post() { } } diff --git a/modules/cms/action/languagelist/LanguagelistShowAction.class.php b/modules/cms/action/languagelist/LanguagelistShowAction.class.php @@ -1,41 +0,0 @@ -<?php -namespace cms\action\languagelist; -use cms\action\LanguagelistAction; -use cms\action\Method; -use cms\base\Configuration; -use cms\model\Language; -use util\Html; - - -class LanguagelistShowAction extends LanguagelistAction implements Method { - public function view() { - $countryList = Configuration::Conf()->get('countries',[]); - - $list = array(); - - $this->setTemplateVar('act_languageid',0 ); - - - - foreach( $this->project->getLanguageIds() as $id ) - { - $l = new Language( $id ); - $l->load(); - - unset( $countryList[strtoupper($l->isoCode)] ); - - $list[$id] = array(); - $list[$id]['name' ] = $l->name; - $list[$id]['isocode'] = $l->isoCode; - $list[$id]['id' ] = $id; - - $list[$id]['is_default'] = $l->isDefault; - - $list[$id]['select_url'] = Html::url( 'index','language',$id ); - } - - $this->setTemplateVar('el',$list); - } - public function post() { - } -} diff --git a/modules/cms/action/modellist/ModellistEditAction.class.php b/modules/cms/action/modellist/ModellistEditAction.class.php @@ -2,11 +2,30 @@ namespace cms\action\modellist; use cms\action\Method; use cms\action\ModellistAction; +use cms\model\Model; +use cms\model\Project; +use util\Html; class ModellistEditAction extends ModellistAction implements Method { - public function view() { - $this->nextSubAction('show'); - } + + public function view() { + $project = new Project( $this->project->projectid ); + + $list = array(); + foreach( $project->getModelIds() as $id ) + { + $m = new Model( $id ); + $m->load(); + + $list[$id]['id' ] = $id; + $list[$id]['name'] = $m->name; + + $list[$id]['is_default'] = $m->isDefault; + $list[$id]['select_url'] = Html::url('index','model',$id); + } + $this->setTemplateVar( 'el',$list ); + $this->setTemplateVar( 'add',$this->userIsAdmin() ); + } public function post() { } diff --git a/modules/cms/action/modellist/ModellistShowAction.class.php b/modules/cms/action/modellist/ModellistShowAction.class.php @@ -1,31 +0,0 @@ -<?php -namespace cms\action\modellist; -use cms\action\Method; -use cms\action\ModellistAction; -use cms\model\Model; -use cms\model\Project; -use util\Html; - -class ModellistShowAction extends ModellistAction implements Method { - public function view() { - $project = new Project( $this->project->projectid ); - - $list = array(); - foreach( $project->getModelIds() as $id ) - { - $m = new Model( $id ); - $m->load(); - - $list[$id]['id' ] = $id; - $list[$id]['name'] = $m->name; - - $list[$id]['is_default'] = $m->isDefault; - $list[$id]['select_url'] = Html::url('index','model',$id); - } - $this->setTemplateVar( 'el',$list ); - $this->setTemplateVar( 'add',$this->userIsAdmin() ); - } - - public function post() { - } -} diff --git a/modules/cms/action/object/ObjectAclformAction.class.php b/modules/cms/action/object/ObjectAclformAction.class.php @@ -53,7 +53,6 @@ class ObjectAclformAction extends ObjectAction implements Method { { $this->addValidationError('type' ); $this->addValidationError('userid',''); - $this->callSubAction('aclform'); return; } break; @@ -63,7 +62,6 @@ class ObjectAclformAction extends ObjectAction implements Method { { $this->addValidationError('type' ); $this->addValidationError('groupid',''); - $this->callSubAction('aclform'); return; } break; @@ -71,7 +69,6 @@ class ObjectAclformAction extends ObjectAction implements Method { break; default: $this->addValidationError('type'); - $this->callSubAction('aclform'); return; } diff --git a/modules/cms/action/page/PageChangetemplateselectelementsAction.class.php b/modules/cms/action/page/PageChangetemplateselectelementsAction.class.php @@ -49,10 +49,6 @@ class PageChangetemplateselectelementsAction extends PageAction implements Metho } $this->setTemplateVar('elements',$oldElements ); } - else - { - $this->callSubAction('prop'); - } } diff --git a/modules/cms/action/page/PageEditAction.class.php b/modules/cms/action/page/PageEditAction.class.php @@ -175,11 +175,5 @@ class PageEditAction extends PageAction implements Method { } $this->page->setTimestamp(); // "Letzte Aenderung" setzen - - // Falls ausgewaehlt die Seite sofort veroeffentlichen - if ( $this->hasRequestVar('publish') ) - $this->callSubAction( 'pubnow' ); // Weiter zum veroeffentlichen - else - $this->callSubAction( 'el' ); // Element-Liste anzeigen } } diff --git a/modules/cms/action/page/PageFormAction.class.php b/modules/cms/action/page/PageFormAction.class.php @@ -172,9 +172,5 @@ class PageFormAction extends PageAction implements Method { } $this->page->setTimestamp(); // "Letzte Aenderung" setzen - if ( $this->hasRequestVar('publish') ) - $this->callSubAction( 'pubnow' ); - else - $this->callSubAction( 'el' ); } } diff --git a/modules/cms/action/pageelement/PageelementDiffAction.class.php b/modules/cms/action/pageelement/PageelementDiffAction.class.php @@ -18,7 +18,6 @@ class PageelementDiffAction extends PageelementAction implements Method { { $this->addValidationError('compareid' ); $this->addValidationError('withid' ,''); - $this->callSubAction('archive'); return; } diff --git a/modules/cms/action/project/ProjectPropAction.class.php b/modules/cms/action/project/ProjectPropAction.class.php @@ -40,7 +40,6 @@ class ProjectPropAction extends ProjectAction implements Method { else { $this->addValidationError('name'); - $this->callSubAction('edit'); } } } diff --git a/modules/cms/action/template/TemplatePropAction.class.php b/modules/cms/action/template/TemplatePropAction.class.php @@ -17,7 +17,6 @@ class TemplatePropAction extends TemplateAction implements Method { if ($this->getRequestVar('name') == "") { $this->addValidationError('name'); - $this->callSubAction('name'); return; } else diff --git a/modules/cms/action/templatelist/TemplatelistEditAction.class.php b/modules/cms/action/templatelist/TemplatelistEditAction.class.php @@ -4,9 +4,22 @@ use cms\action\Method; use cms\action\TemplatelistAction; class TemplatelistEditAction extends TemplatelistAction implements Method { - public function view() { - $this->nextSubAction('show'); - } + + + public function view() { + $list = array(); + + foreach( $this->project->getTemplates() as $id=>$name ) + { + $list[$id] = array(); + $list[$id]['name'] = $name; + $list[$id]['id' ] = $id; + } + + $this->setTemplateVar('templates',$list); + } + + public function post() { } } diff --git a/modules/cms/action/templatelist/TemplatelistShowAction.class.php b/modules/cms/action/templatelist/TemplatelistShowAction.class.php @@ -1,23 +0,0 @@ -<?php -namespace cms\action\templatelist; -use cms\action\Method; -use cms\action\TemplatelistAction; - -class TemplatelistShowAction extends TemplatelistAction implements Method { - public function view() { - $list = array(); - - foreach( $this->project->getTemplates() as $id=>$name ) - { - $list[$id] = array(); - $list[$id]['name'] = $name; - $list[$id]['id' ] = $id; - } - - $this->setTemplateVar('templates',$list); - } - - - public function post() { - } -} diff --git a/modules/cms/ui/themes/default/html/views/folder/create.php b/modules/cms/ui/themes/default/html/views/folder/add.php diff --git a/modules/cms/ui/themes/default/html/views/folder/create.tpl.src.xml b/modules/cms/ui/themes/default/html/views/folder/add.tpl.src.xml diff --git a/modules/cms/ui/themes/default/html/views/grouplist/show.php b/modules/cms/ui/themes/default/html/views/grouplist/edit.php diff --git a/modules/cms/ui/themes/default/html/views/grouplist/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/grouplist/edit.tpl.src.xml diff --git a/modules/cms/ui/themes/default/html/views/languagelist/show.php b/modules/cms/ui/themes/default/html/views/languagelist/edit.php diff --git a/modules/cms/ui/themes/default/html/views/languagelist/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/languagelist/edit.tpl.src.xml diff --git a/modules/cms/ui/themes/default/html/views/modellist/show.php b/modules/cms/ui/themes/default/html/views/modellist/edit.php diff --git a/modules/cms/ui/themes/default/html/views/modellist/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/modellist/edit.tpl.src.xml diff --git a/modules/cms/ui/themes/default/html/views/templatelist/show.php b/modules/cms/ui/themes/default/html/views/templatelist/edit.php diff --git a/modules/cms/ui/themes/default/html/views/templatelist/show.tpl.src.xml b/modules/cms/ui/themes/default/html/views/templatelist/edit.tpl.src.xml