2929*/
3030
3131class nodetree {
32- var $ childs ;
33- var $ btext ;
34- var $ id ;
32+ public $ childs ;
33+ public $ btext ;
34+ public $ id ;
3535}
3636
3737class cmstree
3838{
39- var $ _table ;
39+ //TODO is this used ?? - pedro
40+ //var $_table;
4041
41- // $vars enthält :
42+ // $vars enth�lt :
4243 // - parent :id des Elternelementes
4344 // - type :n = node, i = item
4445 // - doctype_id :id des Dokumententyps, wenn nicht im content Feld
4546 // - title :Titel des Eintrages
4647 // - status :1 = ok, d = delete
4748 // - icon :icon im node-tree, optional
4849 // - modul :modul des Eintrages, noch nicht verwendet
49- // - doc_id :id des zugehörigen Dokumentes
50+ // - doc_id :id des zugeh�rigen Dokumentes
5051
51- function node_list ()
52+ public function node_list ()
5253 {
53- global $ app ;
54+ global $ app ;
5455
55- $ nodes = $ app ->db ->queryAllRecords (" SELECT * FROM media_cat order by sort, name " );
56+ $ nodes = $ app ->db ->queryAllRecords (' SELECT * FROM media_cat order by sort, name ' );
5657
5758 $ optionlist = array ();
5859 $ my0 = new nodetree ();
5960
6061 foreach ($ nodes as $ row ) {
6162
62- $ id = " my " .$ row [" media_cat_id " ];
63- $ btext = $ row [" name " ];
64- $ ordner = 'my ' .$ row [" parent " ];
63+ $ id = ' my ' .$ row [' media_cat_id ' ];
64+ $ btext = $ row [' name ' ];
65+ $ ordner = 'my ' .$ row [' parent ' ];
6566 if (!is_object ($ $ id )) $ $ id = new nodetree ();
6667 $ $ id ->btext = $ btext ;
67- $ $ id ->id = $ row [" media_cat_id " ];
68+ $ $ id ->id = $ row [' media_cat_id ' ];
6869
6970 if (is_object ($ $ ordner )) {
7071 $ $ ordner ->childs [] = &$ $ id ;
@@ -74,21 +75,16 @@ function node_list()
7475 }
7576 }
7677
77- $ this ->ptree ($ my0 ,0 ,$ optionlist );
78-
79- if (is_array ($ nodes )){
80- return $ optionlist ;
81- } else {
82- return false ;
83- }
78+ $ this ->ptree ($ my0 , 0 , $ optionlist );
79+ return is_array ($ nodes ) ? $ optionlist : false ;
8480 }
8581
86- function ptree ($ myobj , $ tiefe , &$ optionlist ){
82+ private function ptree ($ myobj , $ tiefe , &$ optionlist ){
8783 global $ _SESSION ;
8884 $ tiefe += 1 ;
8985 $ id = $ myobj ->id ;
9086
91- if (is_array ($ myobj ->childs ) and ($ _SESSION [" s " ][ " cat_open " ][$ id ] == 1 or $ tiefe <= 1 )) {
87+ if (is_array ($ myobj ->childs ) and ($ _SESSION [' s ' ][ ' cat_open ' ][$ id ] == 1 or $ tiefe <= 1 )) {
9288 foreach ($ myobj ->childs as $ val ) {
9389 // kategorie => str_repeat('- ',$tiefe) . $val->btext,
9490
@@ -103,13 +99,12 @@ function ptree($myobj, $tiefe, &$optionlist){
10399 }
104100 */
105101 $ val_id = $ val ->id ;
106- if ($ _SESSION [" s " ][ " cat_open " ][$ val_id ] == 1 ) {
102+ if ($ _SESSION [' s ' ][ ' cat_open ' ][$ val_id ] == 1 ) {
107103 $ 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> " ;
108104 } else {
109105 $ 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> " ;
110106 }
111107
112-
113108 $ optionlist [] = array ( media_cat => $ kategorie ,
114109 media_cat_id => $ val ->id ,
115110 depth => $ tiefe );
0 commit comments