openrat-cms

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

commit a2008ea437e96f1859d551cd426460a9083aae99
parent 0cafa4f965daf83cee4f9b4a5afdbad217bccadb
Author: Jan Dankert <devnull@localhost>
Date:   Thu, 14 Dec 2017 23:29:37 +0100

Fix: Beim Generieren von Textabsätzen gab es noch ein Problem mit den Namespaces.

Diffstat:
action/ElementAction.class.php | 10+++++-----
action/LanguagelistAction.class.php | 1+
action/ModellistAction.class.php | 13+++++++++++--
macro/LastChanges.class.php | 12+++++-------
model/Page.class.php | 4+++-
model/Project.class.php | 13+++++++------
6 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/action/ElementAction.class.php b/action/ElementAction.class.php @@ -7,7 +7,7 @@ use cms\model\Element; use cms\model\Template; use cms\model\Folder; use cms\model\Object; - +use Text; // OpenRat Content Management System @@ -38,7 +38,9 @@ class ElementAction extends Action var $element; - /** + private $template; + + /** * Konstruktor */ function __construct() @@ -387,13 +389,11 @@ class ElementAction extends Action $formatlist[$t] = array('lang'=>'EL_PROP_'.$v); $this->setTemplateVar('formatlist', $formatlist ); - //Html::debug($this->templateVars); break; case 'linktype': $this->setTemplateVar('linktype', $this->element->wiki ); $this->setTemplateVar('linktypelist', array('page','file','link') ); - //Html::debug($this->templateVars); break; case 'prefix': @@ -610,7 +610,7 @@ class ElementAction extends Action break; default: - $this->message('ERROR','not an element property: '.$propertyName ); + throw new \LogicException('not an element property: '.$propertyName ); } } } diff --git a/action/LanguagelistAction.class.php b/action/LanguagelistAction.class.php @@ -124,6 +124,7 @@ class LanguagelistAction extends Action asort( $countryList ); $this->setTemplateVar('isocodes' ,$countryList ); + $this->setTemplateVar('isocode' ,'' ); } diff --git a/action/ModellistAction.class.php b/action/ModellistAction.class.php @@ -3,6 +3,8 @@ namespace cms\action; use cms\model\Model; +use Html; +use Session; // OpenRat Content Management System // Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de @@ -30,9 +32,16 @@ use cms\model\Model; */ class ModellistAction extends Action { + /** + * @var Model + */ + public $model; + public $security = SECURITY_USER; - - function __construct() + + private $project; + + function __construct() { if ( $this->getRequestId() != 0 ) { diff --git a/macro/LastChanges.class.php b/macro/LastChanges.class.php @@ -76,18 +76,16 @@ class LastChanges extends Macro if ($o['objectid'] == $this->getObjectId() ) continue; - if ( ($o['is_page']==1 && istrue($this->showPages)) || - ($o['is_link']==1 && istrue($this->showLinks)) ) // Nur wenn gewünschter Typ + if ( ($o['typeid']==OR_TYPEID_PAGE && istrue($this->showPages)) || + ($o['typeid']==OR_TYPEID_LINK && istrue($this->showLinks)) ) // Nur wenn gewünschter Typ { - if ( $o['is_link']==1 ) { + if ( $o['typeid']==OR_TYPEID_LINK ) { $l = new Link( $o['objectid'] ); $l->load(); - if ( !$l->isLinkToObject) - continue; - + $p = new Page( $l->linkedObjectId ); } - elseif ( $o['is_page']==1 ) + elseif ( $o['typeid']==OR_TYPEID_PAGE ) { $p = new Page( $o['objectid'] ); } diff --git a/model/Page.class.php b/model/Page.class.php @@ -65,8 +65,10 @@ class Page extends Object var $publish = null; var $up_path = ''; + public $values; - function __construct( $objectid='' ) + + function __construct( $objectid='' ) { parent::__construct( $objectid ); $this->isPage = true; diff --git a/model/Project.class.php b/model/Project.class.php @@ -3,6 +3,7 @@ namespace cms\model; use database\Database; +use Session; /** @@ -371,7 +372,7 @@ SQL public function getDefaultLanguageId() { - $db = \Session::getDatabase(); + $db = Session::getDatabase(); // ORDER BY deswegen, damit immer mind. eine Sprache // gelesen wird @@ -387,7 +388,7 @@ SQL public function getDefaultModelId() { - $db = \Session::getDatabase(); + $db = Session::getDatabase(); // ORDER BY deswegen, damit immer mind. eine Sprache // gelesen wird @@ -441,7 +442,7 @@ SQL { $this->log = array(); - $db = &\Session::getDatabase(); + $db = &Session::getDatabase(); // Ordnerstruktur prüfen. $sql = $db->sql( <<<EOF @@ -809,10 +810,10 @@ SQL // Variablen setzen. $sql->setInt( 'projectid', $this->projectid ); - $language = \Session::getProjectLanguage(); + $language = Session::getProjectLanguage(); $sql->setInt( 'languageid', $language->languageid ); - $user = \Session::getUser(); + $user = Session::getUser(); $sql->setInt( 'userid', $user->userid ); return $sql->getAll(); @@ -886,7 +887,7 @@ SQL // Variablen setzen. $sql->setInt( 'projectid', $this->projectid ); - $language = \Session::getProjectLanguage(); + $language = Session::getProjectLanguage(); $sql->setInt( 'languageid', $language->languageid ); return $sql->getAll();