Select Git revision
StudipSemTree.class.php
Forked from
Stud.IP / Stud.IP
Source project has a limited visibility.
-
Closes #1295 Merge request studip/studip!791
Closes #1295 Merge request studip/studip!791
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
StudipSemTree.class.php 12.30 KiB
<?php
# Lifter007: TODO
# Lifter003: TODO
/**
* class to handle the seminar tree
*
* This class provides an interface to the structure of the seminar tree
*
* @access public
* @author André Noack <noack@data-quest.de>
* @license GPL2 or any later version
* @copyright 2003 André Noack <noack@data-quest.de>,
* Suchi & Berg GmbH <info@data-quest.de>
*/
class StudipSemTree extends TreeAbstract
{
public $sem_dates = [];
public $sem_number = null;
public $visible_only = false;
public $sem_status = [];
protected $entries_init_done = false;
/**
* constructor
*
* do not use directly, call TreeAbstract::GetInstance("StudipRangeTree")
* @access private
*/
public function __construct($args)
{
DbView::addView('sem_tree');
$this->root_name = Config::get()->UNI_NAME_CLEAN;
if (isset($args['visible_only'])) {
$this->visible_only = (int) $args['visible_only'];
}
if (isset($args['sem_number']) ){
$this->sem_number = array_map('intval', $args['sem_number']);
}
if ($args['sem_status']){
$this->sem_status = array_map('intval', $args['sem_status']);
} else {
foreach ($GLOBALS['SEM_CLASS'] as $key => $value){
if ($value['bereiche']){
foreach ($GLOBALS['SEM_TYPE'] as $type_key => $type_value) {
if($type_value['class'] == $key)
$this->sem_status[] = $type_key;
}
}
}
}
if (!count($this->sem_status)){
$this->sem_status[] = -1;
}
parent::__construct(); //calling the baseclass constructor
if (isset($args['build_index']) ){
$this->buildIndex();
}
$this->sem_dates = Semester::findAllVisible();
}
/**
* initializes the tree
*
* stores all rows from table sem_tree in array $tree_data
* @access public