openrat-cms

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

commit c534f4f6860c73a989df7931137aa2a7314a5723
parent 58debcd2a05a9e30c28028d1e057980107a8752d
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 11 Dec 2018 00:56:12 +0100

Fix: Die neuen Node-Types sind wohl noch nicht überall bekannt.

Diffstat:
modules/cms-core/action/ElementAction.class.php | 9++-------
modules/cms-core/model/Project.class.php | 33++++++++++++++++++++-------------
2 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/modules/cms-core/action/ElementAction.class.php b/modules/cms-core/action/ElementAction.class.php @@ -546,18 +546,13 @@ class ElementAction extends Action switch( $this->element->typeid ) { - case ELEMENT_TYPE_INSERT: - if ( !$o->isFolder ) - continue 2; - break; - case ELEMENT_TYPE_LINK: - if ( !$o->isPage && !$o->isFile && !$o->isLink ) + if ( ! in_array( $o->typeid, array(OR_TYPEID_PAGE,OR_TYPEID_IMAGE,OR_TYPEID_FILE,OR_TYPEID_LINK,OR_TYPEID_URL,OR_TYPEID_TEXT ) ) ) continue 2; break; //Change tobias case ELEMENT_TYPE_INSERT: - if ( !$o->isFolder && !$o->isPage && !$o->isFile && !$o->isLink ) + if ( ! in_array( $o->typeid, array(OR_TYPEID_FOLDER,OR_TYPEID_PAGE,OR_TYPEID_IMAGE,OR_TYPEID_FILE,OR_TYPEID_LINK,OR_TYPEID_URL,OR_TYPEID_TEXT ) ) ) continue 2; break; //Change tobias end diff --git a/modules/cms-core/model/Project.class.php b/modules/cms-core/model/Project.class.php @@ -978,23 +978,30 @@ SQL * @param types Array * @return Liste von Object-Ids */ - public function getAllObjectIds( $types=array('folder','page','link','file') ) + public function getAllObjectIds( $types=array('folder','page','link','file','image','url','text') ) { - $db = db_connection(); - - $stmt = $db->sql('SELECT id FROM {{object}}'. - ' WHERE projectid={projectid}'. - ' AND ( typeid ={is_folder}' . - ' OR typeid ={is_file}' . - ' OR typeid ={is_page}' . - ' OR typeid ={is_link} )' . - ' ORDER BY orderid ASC' ); + $stmt = db()->sql( <<<SQL + SELECT id FROM {{object}} + WHERE projectid={projectid} + AND ( typeid ={is_folder} + OR typeid ={is_file} + OR typeid ={is_image} + OR typeid ={is_text} + OR typeid ={is_page} + OR typeid ={is_link} + OR typeid ={is_url} ) + ORDER BY orderid ASC +SQL + ); $stmt->setInt('projectid',$this->projectid ); $stmt->setInt('is_folder',in_array('folder',$types)?OR_TYPEID_FOLDER:0); - $stmt->setInt('is_file' ,in_array('file' ,$types)?OR_TYPEID_FILE:0); - $stmt->setInt('is_page' ,in_array('page' ,$types)?OR_TYPEID_PAGE:0); - $stmt->setInt('is_link' ,in_array('link' ,$types)?OR_TYPEID_LINK:0); + $stmt->setInt('is_file' ,in_array('file' ,$types)?OR_TYPEID_FILE :0); + $stmt->setInt('is_image' ,in_array('image' ,$types)?OR_TYPEID_IMAGE :0); + $stmt->setInt('is_text' ,in_array('text' ,$types)?OR_TYPEID_TEXT :0); + $stmt->setInt('is_page' ,in_array('page' ,$types)?OR_TYPEID_PAGE :0); + $stmt->setInt('is_link' ,in_array('link' ,$types)?OR_TYPEID_LINK :0); + $stmt->setInt('is_url' ,in_array('url' ,$types)?OR_TYPEID_URL :0); return( $stmt->getCol() ); }