From dd0130670fe3cab4c7e2c1ab4f3bf0d2b2d512b0 Mon Sep 17 00:00:00 2001
From: Denny Bortfeldt <denny@bortfeldt.net>
Date: Mon, 27 Jun 2016 18:02:16 -0400
Subject: [PATCH] When uploading a logo which is smaller than the current ispconfig one, then the logo will be on the left side of the header. In my opinion it will look better when it's centered. You could vote about it ;)
---
interface/lib/classes/tree.inc.php | 374 ++++++++++++++++++++++++++--------------------------
1 files changed, 187 insertions(+), 187 deletions(-)
diff --git a/interface/lib/classes/tree.inc.php b/interface/lib/classes/tree.inc.php
index af030ae..8d29a67 100644
--- a/interface/lib/classes/tree.inc.php
+++ b/interface/lib/classes/tree.inc.php
@@ -1,7 +1,7 @@
<?php
/*
-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,
@@ -38,218 +38,218 @@
class tree
{
- var $obj;
- var $events;
-
- // Feld Definitionen
- var $data_field = 'name';
- var $primary_field = 'media_cat_id';
- var $parent_field = 'parent';
- var $root_id = '0';
- var $opt_spacer = ' ';
-
+ var $obj;
+ var $events;
+
+ // Feld Definitionen
+ var $data_field = 'name';
+ var $primary_field = 'media_cat_id';
+ var $parent_field = 'parent';
+ var $root_id = '0';
+ var $opt_spacer = ' ';
+
// interne Vars
var $_last_id;
-
+
/*
Funktion zum laden des Baumes aus Array
*/
-
- function loadFromArray ($nodes) {
-
- $this->obj[$this->root_id] = new node();
+
+ function loadFromArray ($nodes) {
+
+ $this->obj[$this->root_id] = new node();
if(is_array($nodes)) {
- foreach($nodes as $row) {
+ foreach($nodes as $row) {
- $id = $row[$this->primary_field];
- $data = $row[$this->data_field];
- $ordner = $row[$this->parent_field];
-
- //$this->raw_data[$id] = $row;
-
- if($id > $this->_last_id) $this->_last_id = $id;
-
- if(!is_object($this->obj[$id])) $this->obj[$id] = new node();
-
- $this->obj[$id]->data = $data;
- $this->obj[$id]->id = $row[$this->primary_field];
- $this->obj[$id]->parent = $row[$this->parent_field];
+ $id = $row[$this->primary_field];
+ $data = $row[$this->data_field];
+ $ordner = $row[$this->parent_field];
- if(is_object($this->obj[$ordner])) {
- $this->obj[$ordner]->childs[$id] = &$this->obj[$id];
- } else {
- $this->obj[$ordner] = new node();
- $this->obj[$ordner]->childs[$id] = &$this->obj[$id];
- }
- }
+ //$this->raw_data[$id] = $row;
+
+ if($id > $this->_last_id) $this->_last_id = $id;
+
+ if(!is_object($this->obj[$id])) $this->obj[$id] = new node();
+
+ $this->obj[$id]->data = $data;
+ $this->obj[$id]->id = $row[$this->primary_field];
+ $this->obj[$id]->parent = $row[$this->parent_field];
+
+ if(is_object($this->obj[$ordner])) {
+ $this->obj[$ordner]->childs[$id] = &$this->obj[$id];
+ } else {
+ $this->obj[$ordner] = new node();
+ $this->obj[$ordner]->childs[$id] = &$this->obj[$id];
+ }
+ }
}
- }
-
- function optionlist($nroot = '')
- {
-
- if($nroot == '') $nroot = $this->obj[$this->root_id];
+ }
+
+ function optionlist($nroot = '')
+ {
+
+ if($nroot == '') $nroot = $this->obj[$this->root_id];
$opt_spacer = $this->opt_spacer;
-
- $this->ptree($nroot,'',$optionlist, $opt_spacer);
-
- if(is_array($optionlist)){
+
+ $this->ptree($nroot, '', $optionlist, $opt_spacer);
+
+ if(is_array($optionlist)){
return $optionlist;
} else {
return false;
}
- }
-
- function ptree($myobj, $ebene, &$optionlist, $opt_spacer){
- $ebene .= $opt_spacer;
+ }
- if(is_array($myobj->childs)) {
- foreach($myobj->childs as $val) {
- $id = $val->id;
- if(!empty($id)) $optionlist[$id] = array( data => $ebene . $val->data,
- id => $id);
- $this->ptree($val,$ebene, $optionlist, $opt_spacer);
- }
- }
- }
-
- function add($parent,$data) {
-
- $id = $this->_last_id + 1;
- $this->obj[$id] = new node;
- $this->obj[$id]->data = $data;
- $this->obj[$id]->id = $id;
- $this->obj[$id]->parent = $parent;
- $this->obj[$parent]->childs[$id] = &$this->obj[$id];
-
- // Event Aufrufen
- $this->_callEvent('insert',$this->obj[$id]);
-
- }
-
- /*
- L�schen von Eintr�gen ohne Child's
- */
-
- function del($id) {
- if(count($this->obj[$id]->childs) == 0) {
- $this->obj[$id] = NULL;
- unset($this->obj[$id]);
- return true;
- } else {
- return false;
- }
- }
-
- /*
- Rekursives l�schen von Eintr�gen
- */
-
- function deltree($tree_id) {
- // l�sche Eintr�ge recursiv
- $this->_deltree_recurse(&$this->obj[$this->root_id],$tree_id, 0);
- }
-
- /*
- Hilfsfunktion f�r deltree
- */
-
- function _deltree_recurse($myobj,$tree_id,$delete) {
+ function ptree($myobj, $ebene, &$optionlist, $opt_spacer){
+ $ebene .= $opt_spacer;
+
if(is_array($myobj->childs)) {
- foreach($myobj->childs as $val) {
-
- // Setze Delete Flag
- if($val->id == $tree_id) {
- $delete = 1;
- }
-
- // recurse durch Objekte
- $this->_deltree_recurse(&$val,$tree_id,$delete);
-
- // l�sche Eintrag
- if($delete == 1) {
- $tmp_id = $val->id;
- $this->obj[$tmp_id] = NULL;
- unset($this->obj[$tmp_id]);
- $this->_callEvent('delete',$val);
- //echo "Deleting ID: $tmp_id \r\n";
- }
-
- // entferne Delete Flag
- if($val->id == $tree_id) {
- $delete = 0;
- }
- }
- }
- }
-
-
- /*
+ foreach($myobj->childs as $val) {
+ $id = $val->id;
+ if(!empty($id)) $optionlist[$id] = array( data => $ebene . $val->data,
+ id => $id);
+ $this->ptree($val, $ebene, $optionlist, $opt_spacer);
+ }
+ }
+ }
+
+ function add($parent, $data) {
+
+ $id = $this->_last_id + 1;
+ $this->obj[$id] = new node;
+ $this->obj[$id]->data = $data;
+ $this->obj[$id]->id = $id;
+ $this->obj[$id]->parent = $parent;
+ $this->obj[$parent]->childs[$id] = &$this->obj[$id];
+
+ // Event Aufrufen
+ $this->_callEvent('insert', $this->obj[$id]);
+
+ }
+
+ /*
+ Löschen von Einträgen ohne Child's
+ */
+
+ function del($id) {
+ if(count($this->obj[$id]->childs) == 0) {
+ $this->obj[$id] = NULL;
+ unset($this->obj[$id]);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ Rekursives löschen von Einträgen
+ */
+
+ function deltree($tree_id) {
+ // lösche Einträge recursiv
+ $this->_deltree_recurse($this->obj[$this->root_id], $tree_id, 0);
+ }
+
+ /*
+ Hilfsfunktion für deltree
+ */
+
+ function _deltree_recurse(&$myobj, $tree_id, $delete) {
+ if(is_array($myobj->childs)) {
+ foreach($myobj->childs as $val) {
+
+ // Setze Delete Flag
+ if($val->id == $tree_id) {
+ $delete = 1;
+ }
+
+ // recurse durch Objekte
+ $this->_deltree_recurse($val, $tree_id, $delete);
+
+ // lösche Eintrag
+ if($delete == 1) {
+ $tmp_id = $val->id;
+ $this->obj[$tmp_id] = NULL;
+ unset($this->obj[$tmp_id]);
+ $this->_callEvent('delete', $val);
+ //echo "Deleting ID: $tmp_id \r\n";
+ }
+
+ // entferne Delete Flag
+ if($val->id == $tree_id) {
+ $delete = 0;
+ }
+ }
+ }
+ }
+
+
+ /*
private Funktion zum aufrufen der eventHandler
*/
-
- function _callEvent($event, $myobj, $myobj_old = '') {
- global $app;
+
+ function _callEvent($event, $myobj, $myobj_old = '') {
+ global $app;
if(is_array($this->events)) {
- foreach($this->events as $val) {
- if($val["event"] == $event) {
- $class_name = $val["class_name"];
- $function_name = $val["function_name"];
- if($val["class_name"] != '') {
- $app->uses($class_name);
- $app->$class_name->$function_name($myobj,$myobj_old);
- } else {
- call_user_func ($function_name, $myobj, $myobj_old);
- }
- }
+ foreach($this->events as $val) {
+ if($val["event"] == $event) {
+ $class_name = $val["class_name"];
+ $function_name = $val["function_name"];
+ if($val["class_name"] != '') {
+ $app->uses($class_name);
+ $app->$class_name->$function_name($myobj, $myobj_old);
+ } else {
+ call_user_func($function_name, $myobj, $myobj_old);
+ }
+ }
}
- }
- }
-
- /*
- Funktion zum Verschieben von Eintr�gen
+ }
+ }
+
+ /*
+ Funktion zum Verschieben von Einträgen
*/
-
- function move($id, $new_parent) {
-
- $obj_old = $this->obj[$id];
- $parent = $this->obj[$id]->parent;
- $this->obj[$new_parent]->childs[$id] = &$this->obj[$id];
- $this->obj[$id]->parent = $new_parent;
- unset($this->obj[$parent]->childs[$id]);
-
- // event aufrufen
- $this->_callEvent('update',$this->obj[$id],$obj_old);
-
- }
-
- /*
+
+ function move($id, $new_parent) {
+
+ $obj_old = $this->obj[$id];
+ $parent = $this->obj[$id]->parent;
+ $this->obj[$new_parent]->childs[$id] = &$this->obj[$id];
+ $this->obj[$id]->parent = $new_parent;
+ unset($this->obj[$parent]->childs[$id]);
+
+ // event aufrufen
+ $this->_callEvent('update', $this->obj[$id], $obj_old);
+
+ }
+
+ /*
Funktion zum updaten der Daten eines Nodes
*/
-
- function update($id,$data) {
-
- $obj_old = $this->obj[$id];
- $this->obj[$id]->data = $data;
- $this->_callEvent('update',$this->obj[$id],$obj_old);
-
- }
-
- /*
+
+ function update($id, $data) {
+
+ $obj_old = $this->obj[$id];
+ $this->obj[$id]->data = $data;
+ $this->_callEvent('update', $this->obj[$id], $obj_old);
+
+ }
+
+ /*
Funktion zum registrieren von Events
- m�gliche events: insert, update, delete
-
+ mögliche events: insert, update, delete
+
*/
-
- function regEvent($event,$class_name,$function_name) {
-
- $this->events[] = array( event => $event,
- class_name => $class_name,
- function_name => $function_name);
-
- }
+
+ function regEvent($event, $class_name, $function_name) {
+
+ $this->events[] = array( event => $event,
+ class_name => $class_name,
+ function_name => $function_name);
+
+ }
}
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1