From e1ceb050e19c7574bca146a8da7047ee4ff456b5 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Sun, 10 Jul 2016 05:02:35 -0400
Subject: [PATCH] Merge branch 'stable-3.1'
---
interface/lib/classes/cmstree.inc.php | 65 +++++++++++++++-----------------
1 files changed, 30 insertions(+), 35 deletions(-)
diff --git a/interface/lib/classes/cmstree.inc.php b/interface/lib/classes/cmstree.inc.php
index 7acf224..ead780e 100644
--- a/interface/lib/classes/cmstree.inc.php
+++ b/interface/lib/classes/cmstree.inc.php
@@ -1,7 +1,7 @@
<?
/*
-Copyright (c) 2005, Till Brehm, projektfarm Gmbh
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -29,16 +29,17 @@
*/
class nodetree {
-var $childs;
-var $btext;
-var $id;
+ public $childs;
+ public $btext;
+ public $id;
}
class cmstree
{
-var $_table;
+ //TODO is this used ?? - pedro
+ //var $_table;
- // $vars enth�lt:
+ // $vars enth�lt:
// - parent :id des Elternelementes
// - type :n = node, i = item
// - doctype_id :id des Dokumententyps, wenn nicht im content Feld
@@ -46,25 +47,25 @@
// - status :1 = ok, d = delete
// - icon :icon im node-tree, optional
// - modul :modul des Eintrages, noch nicht verwendet
- // - doc_id :id des zugeh�rigen Dokumentes
-
- function node_list()
+ // - doc_id :id des zugeh�rigen Dokumentes
+
+ public function node_list()
{
- global $app;
-
- $nodes = $app->db->queryAllRecords("SELECT * FROM media_cat order by sort, name");
-
+ global $app;
+
+ $nodes = $app->db->queryAllRecords('SELECT * FROM media_cat order by sort, name');
+
$optionlist = array();
$my0 = new nodetree();
foreach($nodes as $row) {
- $id = "my".$row["media_cat_id"];
- $btext = $row["name"];
- $ordner = 'my'.$row["parent"];
+ $id = 'my'.$row['media_cat_id'];
+ $btext = $row['name'];
+ $ordner = 'my'.$row['parent'];
if(!is_object($$id)) $$id = new nodetree();
$$id->btext = $btext;
- $$id->id = $row["media_cat_id"];
+ $$id->id = $row['media_cat_id'];
if(is_object($$ordner)) {
$$ordner->childs[] = &$$id;
@@ -73,25 +74,20 @@
$$ordner->childs[] = &$$id;
}
}
-
- $this->ptree($my0,0,$optionlist);
-
- if(is_array($nodes)){
- return $optionlist;
- } else {
- return false;
- }
+
+ $this->ptree($my0, 0, $optionlist);
+ return is_array($nodes) ? $optionlist : false;
}
-
- function ptree($myobj, $tiefe, &$optionlist){
+
+ private function ptree($myobj, $tiefe, &$optionlist){
global $_SESSION;
$tiefe += 1;
$id = $myobj->id;
- if(is_array($myobj->childs) and ($_SESSION["s"]["cat_open"][$id] == 1 or $tiefe <= 1)) {
+ if(is_array($myobj->childs) and ($_SESSION['s']['cat_open'][$id] == 1 or $tiefe <= 1)) {
foreach($myobj->childs as $val) {
// kategorie => str_repeat('- ',$tiefe) . $val->btext,
-
+
// Ergebnisse Formatieren
/*
if($tiefe == 0) {
@@ -103,13 +99,12 @@
}
*/
$val_id = $val->id;
- if($_SESSION["s"]["cat_open"][$val_id] == 1) {
- $kategorie = "<div class='mnuLevel".$tiefe."'> <a href='treenavi.php?kat=".$val->id."' class='navtext' onClick=\"parent.content.location='media_list.php?search_media_cat_id=".$val->id."'\" style=\"text-decoration: none;\"><img src='../themes/default/icons/folder.png' border='0'> ".$val->btext."</a></div>";
+ if($_SESSION['s']['cat_open'][$val_id] == 1) {
+ $kategorie = "<div class='mnuLevel".$tiefe."'> <a href='treenavi.php?kat=".$val->id."' class='navtext' onclick=\"parent.content.location='media_list.php?search_media_cat_id=".$val->id."'\" style=\"text-decoration: none;\"><img src='../themes/default/icons/folder.png' border='0'> ".$val->btext."</a></div>";
} else {
- $kategorie = "<div class='mnuLevel".$tiefe."'> <a href='treenavi.php?kat=".$val->id."' class='navtext' onClick=\"parent.content.location='media_list.php?search_media_cat_id=".$val->id."'\" style=\"text-decoration: none;\"><img src='../themes/default/icons/folder_closed.png' border='0'> ".$val->btext."</a></div>";
+ $kategorie = "<div class='mnuLevel".$tiefe."'> <a href='treenavi.php?kat=".$val->id."' class='navtext' onclick=\"parent.content.location='media_list.php?search_media_cat_id=".$val->id."'\" style=\"text-decoration: none;\"><img src='../themes/default/icons/folder_closed.png' border='0'> ".$val->btext."</a></div>";
}
-
-
+
$optionlist[] = array( media_cat => $kategorie,
media_cat_id => $val->id,
depth => $tiefe);
@@ -119,4 +114,4 @@
}
}
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1