openrat-cms

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

commit 7b96ceccdd43fe4b072888ee1cb6916c719bb19e
parent 7d9b1d993400a2fc54cf5cde6db4b489ad871e1e
Author: Jan Dankert <devnull@localhost>
Date:   Sat, 21 Jul 2018 00:54:00 +0200

Es gibt kein $project mehr in der Sitzung.

Diffstat:
modules/cms-core/action/Action.class.php | 7+++++--
modules/cms-core/action/LoginAction.class.php | 26--------------------------
modules/cms-core/action/PageAction.class.php | 7++-----
modules/cms-core/action/TemplatelistAction.class.php | 23++++++++++++++---------
modules/cms-core/action/TreeAction.class.php | 255+------------------------------------------------------------------------------
modules/cms-ui/action/TitleAction.class.php | 24------------------------
modules/util/AbstractTree.class.php | 190-------------------------------------------------------------------------------
modules/util/AdministrationTree.class.php | 469+++++--------------------------------------------------------------------------
modules/util/ProjectTree.class.php | 516-------------------------------------------------------------------------------
modules/util/require.php | 2--
10 files changed, 48 insertions(+), 1471 deletions(-)

diff --git a/modules/cms-core/action/Action.class.php b/modules/cms-core/action/Action.class.php @@ -177,9 +177,12 @@ namespace cms\action { * * @return Integer */ - protected function getRequestId() + protected function getRequestId( $name = null ) { - return $this->request->getRequestId(); + if ( is_null($name) ) + return $this->request->getRequestId(); + else + return intval($this->request->getRequestVar($name,OR_FILTER_NUMBER)); } diff --git a/modules/cms-core/action/LoginAction.class.php b/modules/cms-core/action/LoginAction.class.php @@ -1451,32 +1451,6 @@ class LoginAction extends Action } elseif ( isset($vars[REQ_PARAM_LANGUAGE_ID]) && Language::available($vars[REQ_PARAM_LANGUAGE_ID]) ) { - $language = new Language( $vars[REQ_PARAM_LANGUAGE_ID] ); - $language->load(); - Session::setProjectLanguage( $language ); - - $project = new Project( $language->projectid ); - $project->load(); - Session::setProject( $project ); - - $model = Session::getProjectModel(); - if ( !is_object($model) ) - { - $model = new Model( $project->getDefaultModelId() ); - $model->load(); - Session::setProjectModel( $model ); - } - - $object = Session::getObject(); - if ( is_object($object) && $object->projectid == $project->projectid ) - { - $object->objectLoadRaw(); - Session::setObject( $object ); - } - else - { - Session::setObject( '' ); - } } elseif ( isset($vars[REQ_PARAM_MODEL_ID]) && Model::available($vars[REQ_PARAM_MODEL_ID]) ) { diff --git a/modules/cms-core/action/PageAction.class.php b/modules/cms-core/action/PageAction.class.php @@ -680,11 +680,8 @@ class PageAction extends ObjectAction */ function src() { - $language = Session::getProjectLanguage(); - $model = Session::getProjectModel(); - - $this->page->languageid = $language->languageid; - $this->page->modelid = $model->modelid; + $this->page->languageid = $this->getRequestId(REQ_PARAM_LANGUAGE_ID ); + $this->page->modelid = $this->getRequestId(REQ_PARAM_MODEL_ID ); $this->page->withLanguage = config('publish','filename_language') == 'always' || count(Language::count()) > 1; $this->page->withModel = config('publish','filename_type' ) == 'always' || count(Model::count() ) > 1; diff --git a/modules/cms-core/action/TemplatelistAction.class.php b/modules/cms-core/action/TemplatelistAction.class.php @@ -34,11 +34,19 @@ use Session; class TemplatelistAction extends Action { public $security = SECURITY_USER; - - function __construct() + + /** + * @var Project + */ + private $project; + + + function __construct() { parent::__construct(); - } + + $this->project = new Project( $this->request->getProjectId()); + } @@ -60,12 +68,10 @@ class TemplatelistAction extends Action $list = array(); - $project = new Project( $this->request->getProjectId()); - $template = new Template(); - $template->projectid = $this->getRequestId(); + $template->projectid = $this->project->projectid; - foreach( $project->getTemplates() as $id=>$name ) + foreach( $this->project->getTemplates() as $id=>$name ) { $list[$id] = array(); $list[$id]['name'] = $name; @@ -183,8 +189,7 @@ class TemplatelistAction extends Action // Neues Template anlegen. $template = new Template(); - $model = Session::getProjectModel(); - $template->modelid = $model->modelid; + $template->modelid = $this->project->getDefaultModelId(); $template->add( $this->getRequestVar('name') ); diff --git a/modules/cms-core/action/TreeAction.class.php b/modules/cms-core/action/TreeAction.class.php @@ -6,14 +6,8 @@ use AdministrationTree; use cms\model\Language; use cms\model\Model; -use Exception; -use JSqueeze; -use Less_Parser; -use Logger; -use ObjectNotFoundException; -use ProjectTree; use Session; -use \Html; + // OpenRat Content Management System // Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de // @@ -42,259 +36,27 @@ class TreeAction extends Action { public $security = SECURITY_USER; - //var $tree; - - public function __construct() { parent::__construct(); } - /** - * ?ffnen aller Baumelemente - */ - function openall() - { - throw new \LogicException("probably dead code reached"); - $this->tree = Session::getTree(); - $this->tree->all(); - Session::setTree( $this->tree ); - } - - -// function refresh() -// { -// $this->tree = Session::getTree(); -// $this->tree->refresh(); -// Session::setTree( $this->tree ); -// } - - - /** - * ?ffnen eines Baumelementes - */ - function open() - { - throw new \LogicException("probably dead code reached"); - $this->tree = Session::getTree(); - $this->tree->open( $this->getRequestId() ); - Session::setTree( $this->tree ); - } - - - /** - * Schlie?en eines Baumelementes - */ - function close() - { - throw new \LogicException("probably dead code reached"); - $this->tree = Session::getTree(); - $this->tree->close( $this->getRequestId() ); - Session::setTree( $this->tree ); - } - - - /** - * Neues Laden des Baumes - */ - private function load() - { - throw new \LogicException("probably dead code reached"); - global $SESS; - - $project = Session::getProject(); - $projectid = $project->projectid; - - Logger::debug( "Initializing Tree for Project ".$projectid); - - if ( $projectid == -1 ) - { - $this->tree = new AdministrationTree(); - } - else - { - $this->tree = new ProjectTree(); - $this->tree->projectId = $projectid; - } - - Session::setTree( $this->tree ); - } - - - /** - * Liefert ein Array mit allen Zeilen des Baumes. - * - * Ruft sich intern rekursiv auf. - * - * @param $elId - * @param $tiefe - * @param $isLast - * @return unknown_type - */ - function outputElement( $elId,$tiefe,$isLast ) - { - throw new \LogicException("probably dead code reached"); - - $treeElement = $this->tree->elements[$elId]; - - $zeilen = array(); - $zeile = array(); - - global $class; - $zeile['class'] = $class; - if ( $this->getRequestId() == $elId ) - $zeile['class'] = 'opened'; - if ( $this->getRequestId() == $elId ) - $class ='active'; - - if ( !isset($tree_last) ) - $tree_last=array(); - - $zeile['cols'] = array(); - - for ( $i=1; $i<=$tiefe-1; $i++ ) - { - if ( $isLast[$i] ) - $zeile['cols'][] = 'blank'; - else - $zeile['cols'][] = 'line'; - } - - if ( $tiefe == 0 ) - { - } - elseif ( $treeElement->type != "" ) - { - if ( count($treeElement->subElementIds) == 0 ) - { - if ( $isLast[$tiefe] ) - $zeile['image'] = 'plus_end'; - else $zeile['image'] = 'plus'; - - $zeile['image_url' ] = Html::url('tree','open',$elId); - $zeile['image_url_desc'] = lang('TREE_OPEN_ELEMENT'); - } - else - { - if ( $isLast[$tiefe] ) - $zeile['image'] = 'minus_end'; - else $zeile['image'] = 'minus'; - - $zeile['image_url' ] = Html::url('tree','close',$elId); - $zeile['image_url_desc'] = lang('TREE_CLOSE_ELEMENT'); - } - } - else - { - if ( $isLast[$tiefe] ) - $zeile['image'] = 'none_end'; - else $zeile['image'] = 'none'; - } - - - - $zeile['icon'] = $treeElement->icon; - $zeile['text'] = $treeElement->text; - $zeile['desc'] = $treeElement->description; - $zeile['name'] = $elId; - - // Url setzen - if ( $treeElement->url != "" ) - $zeile['url'] = $treeElement->url; - - // HTML-Target setzen - if ( $treeElement->target != "" ) - $zeile['target'] = $treeElement->target; - else - $zeile['target'] = 'cms_main'; - - $zeile['colspan'] = 20 - count( $zeile['cols'] ) - intval(isset($zeile['image'])); - - $zeilen[] = $zeile; - // Rekursiv alle Unter-Elemente lesen - $nr = 0; - foreach( $this->tree->elements[$elId]->subElementIds as $subElementId ) - { - $nr++; - if ( $nr == count($this->tree->elements[$elId]->subElementIds) ) - $isLast[$tiefe+1] = true; - else $isLast[$tiefe+1] = false; - - // Rekursiver Aufruf - $zeilen = array_merge( $zeilen,$this->outputElement( $subElementId,$tiefe+1,$isLast ) ); - } - - if ( $this->getRequestId() == $elId ) - $class =''; - - return $zeilen; - } - - - /** - * Anzeigen des Baumes fuer asynchrone Anfragen. - */ - function loadAll() - { - throw new \LogicException("probably dead code reached"); - - $this->tree = Session::getTree(); - - $this->setTemplateVar( 'lines',$this->outputElement( 0,0,array() ) ); - $this->setTemplateVar( 'tree',$this->tree->elements ); - } - - /** - * Anzeigen des Baumes fuer asynchrone Anfragen. - */ - public function loadEntryView() - { - throw new \LogicException("probably dead code reached"); - - $this->tree = Session::getTree(); - - $this->setTemplateVar( 'lines',$this->outputElement( 0,0,array() ) ); - $this->setTemplateVar( 'tree',$this->tree->elements ); - } - - - /** * Anzeigen des Baumes fuer asynchrone Anfragen. */ public function loadBranchView() { - /* - $project = Session::getProject(); - $projectid = $project->projectid; - - Logger::debug( "Initializing Tree for Project ".$projectid); - - if ( $projectid == -1 ) - { - $tree = new AdministrationTree(); - } - else - { - $tree = new ProjectTree(); - $tree->projectId = $projectid; - } - */ - $tree = new AdministrationTree(); - $type = $this->getRequestVar('type'); - $tree->tempElements = array(); - if ( intval($this->getRequestVar('id')) != 0 ) $tree->$type( $this->getRequestId() ); else $tree->$type(); $branch = array(); - foreach( $tree->tempElements as $element ) + foreach($tree->treeElements as $element ) { $branch[] = get_object_vars($element); } @@ -304,19 +66,6 @@ class TreeAction extends Action /** - * Inhalt des Projektes anzeigen. - */ - private function content() - { - throw new \LogicException("probably dead code reached"); - if ( $this->hasRequestVar('projectid') ) - $this->load(); - - // Nichts - denn der Baum lädt sich über AJAX selbst. - } - - - /** * Projekt-Einstellungen anzeigen. */ public function settingsView() diff --git a/modules/cms-ui/action/TitleAction.class.php b/modules/cms-ui/action/TitleAction.class.php @@ -64,30 +64,6 @@ class TitleAction extends Action $this->setTemplateVar('username' ,$user->name ); $this->setTemplateVar('userfullname',$user->fullname); - $project = Session::getProject(); - if ( is_object($project) ) - { - $this->setTemplateVar('projectname',$project->name); - } - - if ( is_object($user) ) - $this->setTemplateVar('projects' ,Project::getAllProjects() ); - - - $language = Session::getProjectLanguage(); - if ( is_object($language) ) - { - $this->setTemplateVar('languagename',$language->name); - $this->setTemplateVar('languages',Language::getAll() ); - } - - $model = Session::getProjectModel(); - if ( is_object($model) ) - { - $this->setTemplateVar('modelname',$model->name); - $this->setTemplateVar('models' ,Model::getAll() ); - } - // Urls zum Benutzerprofil und zum Abmelden //$this->setTemplateVar('profile_url',Html::url( 'profile' )); //$this->setTemplateVar('logout_url' ,Html::url( 'index','logout' )); diff --git a/modules/util/AbstractTree.class.php b/modules/util/AbstractTree.class.php @@ -1,189 +0,0 @@ -<?php -// OpenRat Content Management System -// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -/** - * Darstellen einer Baumstruktur mit Funktion zum Laden, Oeffnen und Schliessen - * von Teilbaeumen - * @author $Author$ - * @version $Revision$ - * @package openrat.services - */ -class AbstractTree -{ - /** - * Alle Elemente des Baumes - */ - - //var $elements = array(); - - var $tempElements = array(); - var $userIsAdmin = false; - - //var $autoOpen = array(0,1); - - //var $opened = array(); - - /** - * Hoechste Element-Id - * @type Integer - */ - //var $maxId; - - // Konstruktor - function __construct() - { - // Feststellen, ob der angemeldete Benutzer ein Administrator ist - $user = Session::getUser(); - $this->userIsAdmin = $user->isAdmin; - - /* - // Wurzel-Element laden - $this->root(); - $this->elements[0] = $this->tempElements[0]; - $this->tempElements = array(); - $this->maxId = 0; - - foreach( $this->autoOpen as $openId ) - $this->open($openId); - */ - } - - function refresh() { - - throw new \LogicException("probably dead code reached"); - - /* - $this->elements = array(); - - // Wurzel-Element laden - $this->root(); - $this->elements[0] = $this->tempElements[0]; - $this->tempElements = array(); - $this->maxId = 0; - - $oids = $this->opened; - $this->opened = array(); - foreach( $oids as $oid) - { - if ( isset($this->elements[$oid]) ) - $this->open($oid); - } - */ - } - - - - function all() { - - throw new \LogicException("probably dead code reached"); - - /* - $this->elements = array(); - $this->opened = array(); - - // Wurzel-Element laden - $this->root(); - $this->elements[0] = $this->tempElements[0]; - $this->tempElements = array(); - $this->maxId = 0; - - for( $eid=0;isset($this->elements[$eid]); $eid++) - { - $this->open($eid); - } - */ - } - - - /** - * Oeffnen eines Teilbaumes. Es wird der eindeutige Name des zu oeffnenden Teilbaumes als - * Parameter uebergeben - * @param elementName der Name des Elementes, welches zu oeffnen ist - */ - function open( $elementId ) - { - throw new \LogicException("probably dead code reached"); - - - $k = array_search($elementId,$this->opened); - if ( $k !== false ) - return; // Ist schon offen. Evtl. Reload gedrückt? - - $this->opened[] = $elementId; - if ( ! isset($this->elements[$elementId]) ) - return; - $funcName = $this->elements[$elementId]->type; - if ( empty($funcName) ) - return; - - $this->$funcName( $this->elements[$elementId]->internalId ); - - // Wenn keine Unterelemente gefunden, dann die ?ffnen-Funktion deaktivieren - if ( count( $this->tempElements ) == 0 ) - $this->elements[$elementId]->type = ''; - - foreach( $this->tempElements as $treeElement ) - { - $this->maxId++; - $this->elements[$elementId]->subElementIds[] = $this->maxId; - $this->elements[$this->maxId] = $treeElement; - } - - if ( count($this->tempElements)==1 ) - { - $this->tempElements = array(); - $this->open($this->maxId); - } - - $this->tempElements = array(); - } - - - /** - * Schliessen eines Teilbaumes - * @param elementName der Name des Elementes, welches zu schliessen ist - */ - - function close( $elementId ) - { - throw new \LogicException("probably dead code reached"); - - - - $this->elements[$elementId]->subElementIds = array(); - - $k = array_search($elementId,$this->opened); - if ( $k !== false ) - unset($this->opened[$k]); - } - - - /** - * Hinzufuegen eines Baum-Elementes - * @param TreeElement Hinzuzufuegendes Baumelement - */ - function addTreeElement( $treeElement ) - { - $this->tempElements[] = $treeElement; - } - - -} - -?>- \ No newline at end of file diff --git a/modules/util/AdministrationTree.class.php b/modules/util/AdministrationTree.class.php @@ -36,38 +36,35 @@ use cms\model\Value; * @version $Revision$ * @package openrat.services */ -class AdministrationTree extends AbstractTree +class AdministrationTree { + public $treeElements = array(); + + private $userIsAdmin = false; + /** * Alle Elemente des Baumes */ var $elements; var $confCache = array(); - private $userIsProjectAdmin; + // Konstruktor - function root() + function __construct() { - if (!$this->userIsAdmin) - throw new \SecurityException('Administration-Tree is only visible for admins.'); - -// $treeElement = new TreeElement(); -// $treeElement->text = lang('GLOBAL_ADMINISTRATION'); -// $treeElement->description = lang('GLOBAL_ADMINISTRATION'); -// $treeElement->type = 'administration'; -// $treeElement->icon = 'administration'; - - $this->administration(); + // Feststellen, ob der angemeldete Benutzer ein Administrator ist + $user = Session::getUser(); + $this->userIsAdmin = $user->isAdmin; + } - $this->autoOpen[] = 1; + function root() + { + $this->overview(); } - function administration() + function overview() { - global $conf; - $conf_config = $conf['interface']['config']; - $treeElement = new TreeElement(); $treeElement->id = 0; $treeElement->text = lang('GLOBAL_PROJECTS'); @@ -88,36 +85,6 @@ class AdministrationTree extends AbstractTree $treeElement->type = 'userandgroups'; $this->addTreeElement($treeElement); -// $this->userandgroups(0);; - - if ($conf_config['enable']) { - $treeElement = new TreeElement(); - $treeElement->text = lang('PREFERENCES'); - $treeElement->description = lang('PREFERENCES'); - $treeElement->icon = 'configuration'; - //$treeElement->type = 'prefs'; - $treeElement->action = 'configuration'; - - $this->addTreeElement($treeElement); - } - - // Wechseln zu: Projekte... - /* - foreach( Project::getAll() as $id=>$name ) - { - $treeElement = new TreeElement(); - - $treeElement->text = lang('PROJECT').' '.$name; - $treeElement->url = Html::url(array('action' =>'tree', - 'subaction' =>'reload', - 'projectid' =>$id )); - $treeElement->icon = 'project'; - $treeElement->description = ''; - $treeElement->target = 'cms_tree'; - - $this->addTreeElement( $treeElement ); - } - */ } @@ -182,7 +149,7 @@ class AdministrationTree extends AbstractTree // Ermitteln, ob der Benutzer Projektadministrator ist // Projektadministratoren haben das Recht, im Root-Ordner die Eigenschaften zu aendern. if ($folder->hasRight(ACL_PROP)) - $this->userIsProjectAdmin = true; + $userIsProjectAdmin = true; if ($folder->hasRight(ACL_READ)) { $treeElement = new TreeElement(); @@ -203,7 +170,7 @@ class AdministrationTree extends AbstractTree // Templates - if ($this->userIsProjectAdmin) { + if ($userIsProjectAdmin) { $treeElement = new TreeElement(); $treeElement->id = $projectid; $treeElement->extraId[REQ_PARAM_PROJECT_ID] = $projectid; @@ -235,7 +202,7 @@ class AdministrationTree extends AbstractTree $treeElement->target = 'content'; // Nur fuer Projekt-Administratoren aufklappbar - if ($this->userIsProjectAdmin) + if ($userIsProjectAdmin) $treeElement->type = 'languages'; $this->addTreeElement($treeElement); @@ -246,7 +213,7 @@ class AdministrationTree extends AbstractTree $treeElement->description = ''; // Nur fuer Projekt-Administratoren aufklappbar - if ($this->userIsProjectAdmin) + if ($userIsProjectAdmin) $treeElement->type = 'models'; $treeElement->id = $projectid; @@ -261,14 +228,6 @@ class AdministrationTree extends AbstractTree $this->addTreeElement($treeElement); - // Sonstiges - // $treeElement = new TreeElement(); - // $treeElement->text = lang('GLOBAL_OTHER'); - // $treeElement->description= lang('GLOBAL_OTHER_DESC'); - // $treeElement->icon = 'other'; - // $treeElement->type = 'other'; - // $this->addTreeElement( $treeElement ); - // Suche $treeElement = new TreeElement(); $treeElement->id = $projectid; @@ -285,231 +244,6 @@ class AdministrationTree extends AbstractTree } - function prefs_system() - { - $system = array('time' => date('r'), - 'os' => php_uname('s'), - 'host' => php_uname('n'), - 'release' => php_uname('r'), - 'machine' => php_uname('m'), - 'owner' => get_current_user(), - 'pid' => getmypid()); - - foreach ($system as $key => $value) { - $treeElement = new TreeElement(); - $treeElement->text = $key . '=' . $value; - $treeElement->icon = 'config_property'; - $this->addTreeElement($treeElement); - $treeElement->description = lang('SETTING') . " '" . $key . "'" . (!empty($value) ? ': ' . $value : ''); - } - - if (function_exists('getrusage')) // Funktion existiert auf WIN32 nicht. - { - foreach (getrusage() as $name => $value) ; - { - $treeElement = new TreeElement(); - $treeElement->text = $name . ':' . $value; - $treeElement->description = lang('SETTING') . " '" . $name . "'" . (!empty($value) ? ': ' . $value : ''); - $treeElement->icon = 'config_property'; - $this->addTreeElement($treeElement); - } - } - } - - - function prefs_php() - { - $php_prefs = array('version' => phpversion(), - 'SAPI' => php_sapi_name(), - 'session-name' => session_name(), - 'magic_quotes_gpc' => get_magic_quotes_gpc(), - 'magic_quotes_runtime' => get_magic_quotes_runtime()); - - foreach (array('upload_max_filesize', - 'file_uploads', - 'memory_limit', - 'max_execution_time', - 'post_max_size', - 'display_errors', - 'register_globals' - ) as $iniName) - $php_prefs[$iniName] = ini_get($iniName); - - foreach ($php_prefs as $key => $value) { - $treeElement = new TreeElement(); - $treeElement->text = $key . '=' . $value; - $treeElement->description = lang('SETTING') . " '" . $key . "'" . (!empty($value) ? ': ' . $value : ''); - $treeElement->icon = 'config_property'; - $this->addTreeElement($treeElement); - } - } - - - function prefs_extensions() - { - $extensions = get_loaded_extensions(); - asort($extensions); - - foreach ($extensions as $id => $extensionName) { - $treeElement = new TreeElement(); - $treeElement->text = $extensionName; - $treeElement->icon = 'config_property'; - $treeElement->internalId = $id; - $this->addTreeElement($treeElement); - } - } - - - function prefs_extension($id) - { - $extensions = get_loaded_extensions(); - $functions = get_extension_funcs($extensions[$id]); - asort($functions); - - foreach ($functions as $functionName) { - $treeElement = new TreeElement(); - $treeElement->text = $functionName; - $treeElement->icon = 'config_property'; - $this->addTreeElement($treeElement); - } - } - - - /** - * Anzeigen von Einstellungen. - * - * @param $id - */ - function prefs() - { - global $conf; - - if (!@$conf['security']['show_system_info']) - return; - - $conf_config = $conf['interface']['config']; - - - $treeElement = new TreeElement(); - - $treeElement->internalId = -1; - $treeElement->text = 'OpenRat'; - $treeElement->icon = 'configuration'; - - if (!empty($conf_config['file_manager_url'])) - $treeElement->url = $conf_config['file_manager_url']; - $treeElement->target = '_blank'; - $treeElement->description = ''; - $treeElement->type = 'prefs_cms'; - $this->addTreeElement($treeElement); - - - if (!empty($conf_config['show_system'])) { - $treeElement = new TreeElement(); - - $treeElement->internalId = 0; - $treeElement->text = lang('GLOBAL_SYSTEM'); - $treeElement->icon = 'configuration'; - - $treeElement->description = ''; - $treeElement->target = 'cms_main'; - $treeElement->type = 'prefs_system'; - $this->addTreeElement($treeElement); - } - - - if (!empty($conf_config['show_interpreter'])) { - $treeElement = new TreeElement(); - - $treeElement->internalId = 0; - $treeElement->text = lang('GLOBAL_PHP'); - $treeElement->icon = 'configuration'; - - $treeElement->description = ''; - $treeElement->target = 'cms_main'; - $treeElement->type = 'prefs_php'; - $this->addTreeElement($treeElement); - } - - - if (!empty($conf_config['show_extensions'])) { - $treeElement = new TreeElement(); - - $treeElement->internalId = 0; - $treeElement->text = lang('GLOBAL_EXTENSIONS'); - $treeElement->icon = 'configuration'; - - $treeElement->description = ''; - $treeElement->target = 'cms_main'; - $treeElement->type = 'prefs_extensions'; - $this->addTreeElement($treeElement); - } - } - - - function prefs_cms($id) - { - global $conf; - - if ($id < 0) { - $tmpConf = $conf; - } else - $tmpConf = $this->confCache[$id]; - - if (!is_array($tmpConf)) - $tmpConf = array('unknown'); - - foreach ($tmpConf as $key => $value) { - if (is_array($value)) { - $this->confCache[crc32($key)] = $value; - - $treeElement = new TreeElement(); - - $treeElement->internalId = crc32($key); - $treeElement->text = $key; -// if ( $id == 0 ) -// $treeElement->url = Html::url('main','prefs',0,array('conf'=>$key)); - $treeElement->icon = 'configuration'; - - $treeElement->description = count($value) . ' ' . lang('SETTINGS'); - $treeElement->target = 'cms_main'; - $treeElement->type = 'prefs_cms'; - $this->addTreeElement($treeElement); - } else { - // Die PHP-funktion 'parse_ini_file()' liefert alle Einstellungen leider nur als String - // Daher weiß man hier nicht, ob '1' nun '1' oder 'true' heißen soll. - if ($value == '') - // Anzeige 'Leer' - $value = lang('EMPTY'); - elseif ($value == '0') - // Anzeige 'Nein' - $value = $value . ' (' . lang('IS_NO') . ')'; - elseif ($value == '1') - // Anzeige 'Ja' - $value = '+' . $value . ' (' . lang('IS_YES') . ')'; - elseif (is_numeric($value)) - // Anzeige numerische Werte - $value = ($value > 0 ? '+' : '') . $value; - else - // Anzeige von Zeichenketten - $value = $value; - - $this->confCache[crc32($key)] = $value; - - if (strpos($key, 'pass') !== FALSE) - $value = '***'; // Kennwörter nicht anzeigen - - $treeElement = new TreeElement(); - $treeElement->text = $key . ': ' . $value; - $treeElement->icon = 'config_property'; - $treeElement->description = lang('SETTING') . " '" . $key . "'" . (!empty($value) ? ': ' . $value : ''); - - $this->addTreeElement($treeElement); - } - } - } - - function users() { foreach (User::getAllUsers() as $user) { @@ -712,14 +446,9 @@ class AdministrationTree extends AbstractTree /** * Laedt Elemente zu einem Ordner - * @return Array */ function folder($id) { - global - $SESS, - $projectid; - $f = new Folder($id); $t = time(); $f->languageid = $_REQUEST[REQ_PARAM_LANGUAGE_ID]; @@ -779,114 +508,6 @@ class AdministrationTree extends AbstractTree } - function project_old() - { - $language = Session::getProjectLanguage(); - $model = Session::getProjectModel(); - $user = Session::getUser(); - - $project = Session::getProject(); - $this->projectid = $project->projectid; - - // Hoechster Ordner der Projektstruktur - $folder = new Folder($project->getRootObjectId()); - $folder->load(); - - - // Ermitteln, ob der Benutzer Projektadministrator ist - // Projektadministratoren haben das Recht, im Root-Ordner die Eigenschaften zu aendern. - if ($folder->hasRight(ACL_PROP)) - $this->userIsProjectAdmin = true; - - if ($folder->hasRight(ACL_READ)) { - $treeElement = new TreeElement(); - $treeElement->id = $folder->objectid; - // $treeElement->text = $folder->name; - $treeElement->text = lang('FOLDER_ROOT'); - $treeElement->description = lang('FOLDER_ROOT_DESC'); - $treeElement->icon = 'folder'; - $treeElement->action = 'folder'; - $treeElement->url = Html::url('folder', '', $folder->objectid, array(REQ_PARAM_TARGET => 'content')); - $treeElement->target = 'content'; - $treeElement->type = 'folder'; - $treeElement->internalId = $folder->objectid; - $this->addTreeElement($treeElement); - } - - - if ($this->userIsProjectAdmin) { - // Templates - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('GLOBAL_TEMPLATES'); - $treeElement->url = Html::url('template', 'listing', 0, array(REQ_PARAM_TARGETSUBACTION => 'listing', REQ_PARAM_TARGET => 'content')); - $treeElement->description = lang('GLOBAL_TEMPLATES_DESC'); - $treeElement->icon = 'templatelist'; - $treeElement->action = 'templatelist'; - $treeElement->target = 'content'; - $treeElement->type = 'templates'; - $this->addTreeElement($treeElement); - } - - - // Sprachen - $treeElement = new TreeElement(); - $treeElement->description = ''; - $treeElement->id = 0; - $treeElement->action = 'languagelist'; - $treeElement->text = lang('GLOBAL_LANGUAGES'); - $treeElement->url = Html::url('language', 'listing', 0, array(REQ_PARAM_TARGETSUBACTION => 'listing', REQ_PARAM_TARGET => 'content')); - $treeElement->icon = 'languagelist'; - $treeElement->description = lang('GLOBAL_LANGUAGES_DESC'); - $treeElement->target = 'content'; - - // Nur fuer Projekt-Administratoren aufklappbar - if ($this->userIsProjectAdmin) - $treeElement->type = 'languages'; - - $this->addTreeElement($treeElement); - - - // Projektmodelle - $treeElement = new TreeElement(); - $treeElement->description = ''; - - // Nur fuer Projekt-Administratoren aufklappbar - if ($this->userIsProjectAdmin) - $treeElement->type = 'models'; - - $treeElement->id = 0; - $treeElement->description = lang('GLOBAL_MODELS_DESC'); - $treeElement->text = lang('GLOBAL_MODELS'); - $treeElement->url = Html::url('model', 'listing', 0, array(REQ_PARAM_TARGETSUBACTION => 'listing', REQ_PARAM_TARGET => 'content')); - $treeElement->action = 'modellist'; - $treeElement->icon = 'modellist'; - $treeElement->target = 'content'; - $this->addTreeElement($treeElement); - - - // Sonstiges -// $treeElement = new TreeElement(); -// $treeElement->text = lang('GLOBAL_OTHER'); -// $treeElement->description= lang('GLOBAL_OTHER_DESC'); -// $treeElement->icon = 'other'; -// $treeElement->type = 'other'; -// $this->addTreeElement( $treeElement ); - - // Suche - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('GLOBAL_SEARCH'); - $treeElement->url = Html::url('search', '', 0, array(REQ_PARAM_TARGET => 'content')); - $treeElement->action = 'search'; - $treeElement->icon = 'search'; - $treeElement->description = lang('GLOBAL_SEARCH_DESC'); - $treeElement->target = 'content'; - $this->addTreeElement($treeElement); - - } - - function templates($projectid) { $project = new Project($projectid); @@ -992,54 +613,14 @@ class AdministrationTree extends AbstractTree } - function other() + /** + * Hinzufuegen eines Baum-Elementes + * @param TreeElement Hinzuzufuegendes Baumelement + */ + private function addTreeElement( $treeElement ) { -// Deaktiviert, da -// - Dateien auf den Server laden unverst�ndlich/undurchsichtig erscheint -// - M�glichkeit zum Entpacken von ZIP/TAR online besteht. -// if ( $this->userIsProjectAdmin ) -// { -// $treeElement = new TreeElement(); -// $treeElement->text = lang('GLOBAL_FILE_TRANSFER'); -// $treeElement->description = lang('GLOBAL_FILE_TRANSFER_DESC'); -// $treeElement->url = Html::url('main','transfer'); -// $treeElement->icon = 'transfer'; -// $treeElement->target = 'content'; -// $this->addTreeElement( $treeElement ); -// } - - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('GLOBAL_SEARCH'); - $treeElement->url = Html::url('search'); - $treeElement->icon = 'search'; - $treeElement->action = 'search'; - $treeElement->description = lang('GLOBAL_SEARCH_DESC'); - $treeElement->target = 'content'; - $this->addTreeElement($treeElement); - - - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('USER_YOURPROFILE'); - $treeElement->url = Html::url('profile', 'edit', 0, array(REQ_PARAM_TARGET => 'content')); - $treeElement->icon = 'user'; - $treeElement->action = 'profile'; - $treeElement->description = lang('USER_PROFILE_DESC'); - $treeElement->target = 'content'; - $this->addTreeElement($treeElement); - - - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('GLOBAL_PROJECTS'); - $treeElement->url = Html::url('index', 'projectmenu', 0, array(REQ_PARAM_TARGET => 'content')); - $treeElement->icon = 'project'; - $treeElement->description = lang('GLOBAL_PROJECTS'); - $treeElement->target = 'content'; - $this->addTreeElement($treeElement); + $this->treeElements[] = $treeElement; } - } ?> \ No newline at end of file diff --git a/modules/util/ProjectTree.class.php b/modules/util/ProjectTree.class.php @@ -1,515 +0,0 @@ -<?php -use cms\model\Value; -use cms\model\Element; -use cms\model\Template; -use cms\model\Page; -use cms\model\Folder; -use cms\model\BaseObject; -use cms\model\File; -use cms\model\Link; - -// OpenRat Content Management System -// Copyright (C) 2002-2012 Jan Dankert, cms@jandankert.de -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -/** - * Darstellen der Projektstruktur - * @author $Author$ - * @version $Revision$ - * @package openrat.services - */ -class ProjectTree extends AbstractTree -{ - var $projectId; - var $userIsProjectAdmin = false; - - function root() - { - $treeElement = new TreeElement(); - $treeElement->text = lang('GLOBAL_PROJECT'); - $treeElement->description = lang('GLOBAL_PROJECT'); - $treeElement->type = 'project'; - $treeElement->icon = 'project'; - - $this->addTreeElement( $treeElement ); - } - - - - function page( $id ) - { - $page = new Page( $id ); - $page->load(); - - $template = new Template( $page->templateid ); - - foreach( $template->getElementIds() as $elementid ) - { - $element = new Element( $elementid ); - $element->load(); - - if ( $element->isWritable() ) - { - $treeElement = new TreeElement(); - $treeElement->id = $id.'_'.$elementid; - $treeElement->extraId['elementid'] = $elementid; - $treeElement->text = $element->name; - $treeElement->url = Html::url('pageelement','edit', - $id.'_'.$elementid, - array('elementid'=>$elementid, - REQ_PARAM_TARGETSUBACTION=>'edit',REQ_PARAM_TARGET=>'content')); - $treeElement->action = 'pageelement'; - $treeElement->icon = 'el_'.$element->type; - - $treeElement->description = lang('EL_'.$element->type); - if ( $element->desc != '' ) - $treeElement->description .= ' - '.Text::maxLaenge( 25,$element->desc ); - else - $treeElement->description .= ' - '.lang('GLOBAL_NO_DESCRIPTION_AVAILABLE'); - $treeElement->target = 'content'; - - if ( in_array($element->type,array('link','list','include') ) ) - { - $treeElement->type = 'value'; - $value = new Value(); - $value->pageid = $page->pageid; - $value->element = $element; - $value->load(); - $treeElement->internalId = $value->valueid; - } - - $this->addTreeElement( $treeElement ); - } - } - } - - - function value( $id ) - { - //echo "id: $id"; - if ( $id != 0 ) - { - $value = new Value(); - $value->loadWithId( $id ); - - $objectid = intval($value->linkToObjectId); - if ( $objectid != 0 ) - { - $object = new BaseObject( $objectid ); - $object->load(); - - $treeElement = new TreeElement(); - $treeElement->id = $id; - $treeElement->text = $object->name; - if ( in_array($object->getType(),array('page','folder'))) - { - $treeElement->type = $object->getType(); - $treeElement->internalId = $object->objectid; - } - $treeElement->url = Html::url($object->getType(),'',$objectid,array(REQ_PARAM_TARGET=>'content')); - $treeElement->action = $object->getType(); - $treeElement->icon = $object->getType(); - - $treeElement->description = lang('GLOBAL_'.$object->getType()); - if ( $object->desc != '' ) - $treeElement->description .= ' - '.Text::maxLaenge( 25,$object->desc ); - else - $treeElement->description .= ' - '.lang('GLOBAL_NO_DESCRIPTION_AVAILABLE'); - $treeElement->target = 'content'; - - $this->addTreeElement( $treeElement ); - } - } - } - - - function link( $id ) - { - $link = new Link( $id ); - $link->load(); - - if ( $link->isLinkToObject ) - { - $o = new BaseObject( $link->linkedObjectId ); - $o->load(); - - $treeElement = new TreeElement(); - $treeElement->id = $o->objectid; - $treeElement->internalId = $o->objectid; - $treeElement->target = 'content'; - $treeElement->text = $o->name; - $treeElement->description= lang( 'GLOBAL_'.$o->getType() ).' '.$id; - - if ( $o->desc != '' ) - $treeElement->description .= ': '.$o->desc; - else - $treeElement->description .= ' - '.lang('GLOBAL_NO_DESCRIPTION_AVAILABLE'); - - $treeElement->url = Html::url($o->getType(),'',$o->objectid,array(REQ_PARAM_TARGET=>'content') ); - $treeElement->action = $o->getType(); - $treeElement->icon = $o->getType(); - - // Besonderheiten fuer bestimmte Objekttypen - - if ( $o->isPage ) - { - // Nur wenn die Seite beschreibbar ist, werden die - // Elemente im Baum angezeigt - if ( $o->hasRight( ACL_WRITE ) ) - $treeElement->type='pageelements'; - } - $this->addTreeElement( $treeElement ); - } - } - - - /** - * Laedt Elemente zu einem Ordner - * @return Array - */ - function folder( $id ) - { - global - $SESS, - $projectid; - - $f = new Folder( $id ); - $t = time(); - - foreach( $f->getObjects() as $o ) - { - // Wenn keine Leseberechtigung - if ( !$o->hasRight( ACL_READ ) ) - continue; - - $treeElement = new TreeElement(); - $treeElement->id = $o->objectid; - $treeElement->internalId = $o->objectid; - $treeElement->target = 'content'; - $treeElement->text = $o->name; - $treeElement->description= lang( 'GLOBAL_'.$o->getType() ).' '.$o->objectid; - - if ( $o->desc != '' ) - $treeElement->description .= ': '.$o->desc; - else - $treeElement->description .= ' - '.lang('GLOBAL_NO_DESCRIPTION_AVAILABLE'); - - $treeElement->url = Html::url( $o->getType(),'',$o->objectid,array('readit'=>'__OID__'.$o->objectid.'__',REQ_PARAM_TARGET=>'content') ); - $treeElement->action = $o->getType(); - $treeElement->icon = $o->getType(); - - // Besonderheiten fuer bestimmte Objekttypen - - if ( $o->isLink ) - { - $treeElement->type='link'; - } - - if ( $o->isPage ) - { - // Nur wenn die Seite beschreibbar ist, werden die - // Elemente im Baum angezeigt - if ( $o->hasRight( ACL_WRITE ) ) - $treeElement->type='page'; - } - - if ( $o->isFile ) - { - $file = new File( $o->objectid ); - $file->load(); - - if ( substr($file->mimeType(),0,6) == 'image/' ) - $treeElement->icon = 'image'; - else $treeElement->icon = 'file'; - } - - if ( $o->isFolder ) - { - $treeElement->type = 'folder'; - } - - - $this->addTreeElement( $treeElement ); - } - } - - - function project() - { - $language = Session::getProjectLanguage(); - $model = Session::getProjectModel(); - $user = Session::getUser(); - - $project = Session::getProject(); - $this->projectid = $project->projectid; - - // Hoechster Ordner der Projektstruktur - $folder = new Folder( $project->getRootObjectId() ); - $folder->load(); - - - // Ermitteln, ob der Benutzer Projektadministrator ist - // Projektadministratoren haben das Recht, im Root-Ordner die Eigenschaften zu aendern. - if ( $folder->hasRight( ACL_PROP ) ) - $this->userIsProjectAdmin = true; - - if ( $folder->hasRight( ACL_READ ) ) - { - $treeElement = new TreeElement(); - $treeElement->id = $folder->objectid; - // $treeElement->text = $folder->name; - $treeElement->text = lang('FOLDER_ROOT'); - $treeElement->description = lang('FOLDER_ROOT_DESC'); - $treeElement->icon = 'folder'; - $treeElement->action = 'folder'; - $treeElement->url = Html::url( 'folder','',$folder->objectid,array(REQ_PARAM_TARGET=>'content') ); - $treeElement->target = 'content'; - $treeElement->type = 'folder'; - $treeElement->internalId = $folder->objectid; - $this->addTreeElement( $treeElement ); - } - - - if ( $this->userIsProjectAdmin ) - { - // Templates - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('GLOBAL_TEMPLATES'); - $treeElement->url = Html::url('template','listing',0,array(REQ_PARAM_TARGETSUBACTION=>'listing',REQ_PARAM_TARGET=>'content')); - $treeElement->description= lang('GLOBAL_TEMPLATES_DESC'); - $treeElement->icon = 'templatelist'; - $treeElement->action = 'templatelist'; - $treeElement->target = 'content'; - $treeElement->type = 'templates'; - $this->addTreeElement( $treeElement ); - } - - - // Sprachen - $treeElement = new TreeElement(); - $treeElement->description= ''; - $treeElement->id = 0; - $treeElement->action = 'languagelist'; - $treeElement->text = lang('GLOBAL_LANGUAGES'); - $treeElement->url = Html::url('language','listing',0,array(REQ_PARAM_TARGETSUBACTION=>'listing',REQ_PARAM_TARGET=>'content')); - $treeElement->icon = 'languagelist'; - $treeElement->description= lang('GLOBAL_LANGUAGES_DESC'); - $treeElement->target = 'content'; - - // Nur fuer Projekt-Administratoren aufklappbar - if ( $this->userIsProjectAdmin ) - $treeElement->type = 'languages'; - - $this->addTreeElement( $treeElement ); - - - // Projektmodelle - $treeElement = new TreeElement(); - $treeElement->description= ''; - - // Nur fuer Projekt-Administratoren aufklappbar - if ( $this->userIsProjectAdmin ) - $treeElement->type = 'models'; - - $treeElement->id = 0; - $treeElement->description= lang('GLOBAL_MODELS_DESC'); - $treeElement->text = lang('GLOBAL_MODELS'); - $treeElement->url = Html::url('model','listing',0,array(REQ_PARAM_TARGETSUBACTION=>'listing',REQ_PARAM_TARGET=>'content')); - $treeElement->action = 'modellist'; - $treeElement->icon = 'modellist'; - $treeElement->target = 'content'; - $this->addTreeElement( $treeElement ); - - - // Sonstiges -// $treeElement = new TreeElement(); -// $treeElement->text = lang('GLOBAL_OTHER'); -// $treeElement->description= lang('GLOBAL_OTHER_DESC'); -// $treeElement->icon = 'other'; -// $treeElement->type = 'other'; -// $this->addTreeElement( $treeElement ); - - // Suche - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('GLOBAL_SEARCH'); - $treeElement->url = Html::url('search','',0,array(REQ_PARAM_TARGET=>'content')); - $treeElement->action = 'search'; - $treeElement->icon = 'search'; - $treeElement->description = lang('GLOBAL_SEARCH_DESC'); - $treeElement->target = 'content'; - $this->addTreeElement( $treeElement ); - - } - - - function templates() - { - foreach( Template::getAll() as $id=>$name ) - { - $treeElement = new TreeElement(); - - $t = new Template( $id ); - $t->load(); - $treeElement->text = $t->name; - $treeElement->id = $id; - $treeElement->url = Html::url('template','src',$id,array(REQ_PARAM_TARGETSUBACTION=>'src',REQ_PARAM_TARGET=>'content')); - $treeElement->icon = 'template'; - $treeElement->action = 'template'; - $treeElement->target = 'content'; - $treeElement->internalId = $id; - $treeElement->type = 'template'; - $treeElement->description = $t->name.' ('.lang('GLOBAL_TEMPLATE').' '.$id.'): '.htmlentities(Text::maxLaenge( 40,$t->src )); - $this->addTreeElement( $treeElement ); - } - } - - - function template( $id ) - { - - $t = new Template( $id ); - $t->load(); - - // Anzeigen der Template-Elemente - // - foreach( $t->getElementIds() as $elementid ) - { - $e = new Element( $elementid ); - $e->load(); - - // "Code"-Element nur fuer Administratoren - if ( $e->type == 'code' && !$this->userIsAdmin ) - continue; - - $treeElement = new TreeElement(); - $treeElement->id = $elementid; - $treeElement->text = $e->name; - $treeElement->url = Html::url('element','',$elementid,array(REQ_PARAM_TARGET=>'content') ); - $treeElement->icon = 'el_'.$e->type; - $treeElement->action = 'element'; - - if ( $e->desc == '' ) - $desc = lang('GLOBAL_NO_DESCRIPTION_AVAILABLE'); - else - $desc = $e->desc; - $treeElement->description = $e->name.' ('.lang('EL_'.$e->type).'): '.Text::maxLaenge( 40,$desc ); - $treeElement->target = 'content'; - $this->addTreeElement( $treeElement ); - } - } - - - /** - * Sprachen - */ - function languages() - { - // Sprachvarianten - // - $l = Session::getProjectLanguage(); - $languages = $l->getAll(); - - foreach( $languages as $languageid=>$name ) - { - $treeElement = new TreeElement(); - $treeElement->id = $languageid; - $treeElement->text = $name; - $treeElement->url = Html::url('language','edit',$languageid, - array(REQ_PARAM_TARGETSUBACTION=>'edit',REQ_PARAM_TARGET=>'content') ); - $treeElement->icon = 'language'; - $treeElement->action = 'language'; - $treeElement->description = ''; - $treeElement->target = 'content'; - $this->addTreeElement( $treeElement ); - } - } - - - // Projektvarianten - // - function models() - { - $m = Session::getProjectModel(); - $models = $m->getAll(); - - foreach( $models as $id=>$name ) - { - $treeElement = new TreeElement(); - $treeElement->id = $id; - $treeElement->text = $name; - $treeElement->url = Html::url('model','edit',$id, - array(REQ_PARAM_TARGETSUBACTION=>'edit',REQ_PARAM_TARGET=>'content')); - $treeElement->action = 'model'; - $treeElement->icon = 'model'; - $treeElement->description = ''; - $treeElement->target = 'content'; - $this->addTreeElement( $treeElement ); - } - } - - - function other() - { -// Deaktiviert, da -// - Dateien auf den Server laden unverst�ndlich/undurchsichtig erscheint -// - M�glichkeit zum Entpacken von ZIP/TAR online besteht. -// if ( $this->userIsProjectAdmin ) -// { -// $treeElement = new TreeElement(); -// $treeElement->text = lang('GLOBAL_FILE_TRANSFER'); -// $treeElement->description = lang('GLOBAL_FILE_TRANSFER_DESC'); -// $treeElement->url = Html::url('main','transfer'); -// $treeElement->icon = 'transfer'; -// $treeElement->target = 'content'; -// $this->addTreeElement( $treeElement ); -// } - - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('GLOBAL_SEARCH'); - $treeElement->url = Html::url('search'); - $treeElement->icon = 'search'; - $treeElement->action = 'search'; - $treeElement->description = lang('GLOBAL_SEARCH_DESC'); - $treeElement->target = 'content'; - $this->addTreeElement( $treeElement ); - - - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('USER_YOURPROFILE'); - $treeElement->url = Html::url('profile','edit',0,array(REQ_PARAM_TARGET=>'content')); - $treeElement->icon = 'user'; - $treeElement->action = 'profile'; - $treeElement->description = lang('USER_PROFILE_DESC'); - $treeElement->target = 'content'; - $this->addTreeElement( $treeElement ); - - - $treeElement = new TreeElement(); - $treeElement->id = 0; - $treeElement->text = lang('GLOBAL_PROJECTS'); - $treeElement->url = Html::url('index','projectmenu',0,array(REQ_PARAM_TARGET=>'content')); - $treeElement->icon = 'project'; - $treeElement->description = lang('GLOBAL_PROJECTS'); - $treeElement->target = 'content'; - $this->addTreeElement( $treeElement ); - } -} - -?>- \ No newline at end of file diff --git a/modules/util/require.php b/modules/util/require.php @@ -17,9 +17,7 @@ require_once( __DIR__.'/'.'Spyc.class.php' ); require_once( __DIR__.'/'.'exception/OpenRatException.class.php' ); require_once( __DIR__.'/'.'exception/SecurityException.class.php' ); require_once( __DIR__.'/'.'TreeElement.class.php' ); -require_once( __DIR__.'/'.'AbstractTree.class.php' ); require_once( __DIR__.'/'.'AdministrationTree.class.php' ); -require_once( __DIR__.'/'.'ProjectTree.class.php' ); require_once( __DIR__.'/'.'Publish.class.php' ); require_once( __DIR__.'/'.'Ftp.class.php' ); require_once( __DIR__.'/'.'Macro.class.php' );