// Suchi & Berg GmbH // +---------------------------------------------------------------------------+ // 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 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. // +---------------------------------------------------------------------------+ /** * class to print out the "range tree" * * This class prints out a html representation of the whole or part of the tree * * @access public * @author André Noack * @package */ class StudipRangeTreeView extends TreeView{ /** * constructor * * @access public */ function __construct(){ $this->root_content = $GLOBALS['UNI_INFO']; parent::__construct("StudipRangeTree"); //calling the baseclass constructor } function getItemContent($item_id){ $content = "\n"; if ($item_id == "root"){ $content .= "\n"; $content .= "\n"; $content .= "\n
" . htmlReady($this->tree->root_name) ."
" . htmlReady($this->root_content) ."
"; return $content; } $range_object = RangeTreeObject::GetInstance($item_id); $name = ($range_object->item_data['type']) ? $range_object->item_data['type'] . ": " : ""; $name .= $range_object->item_data['name']; $content .= "\n" . htmlReady($name) ." "; if (is_array($range_object->item_data_mapping)){ $content .= "\n"; foreach ($range_object->item_data_mapping as $key => $value){ if ($range_object->item_data[$key]){ $content .= "" . htmlReady($value) . ": "; $content .= formatLinks($range_object->item_data[$key]) . "  "; } } $content .= "" . "item_data['studip_object_id'])."\"" . tooltip(_("Seite dieser Einrichtung in Stud.IP aufrufen")) . ">" . htmlReady($range_object->item_data['name']) . " " ._("in Stud.IP") .""; } elseif (!$range_object->item_data['studip_object']){ $content .= "\n" . _("Dieses Element ist keine Stud.IP-Einrichtung, es hat daher keine Grunddaten.") . ""; } else { $content .= "\n" . _("Keine Grunddaten vorhanden!") . ""; } $content .= "\n "; $kategorien =& $range_object->getCategories(); if ($kategorien->numRows){ while($kategorien->nextRow()){ $content .= "\n" . htmlReady($kategorien->getField("name")) . ""; $content .= "\n" . formatReady($kategorien->getField("content")) . ""; } } else { $content .= "\n" . _("Keine weiteren Daten vorhanden!") . ""; } $content .= ""; return $content; } } //test //page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Default_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User")); //include 'lib/include/html_head.inc.php'; //$test = new StudipRangeTreeView(); //$test->showTree(); //echo ""; //page_close();