Skip to content
Snippets Groups Projects
Select Git revision
  • 2054b4c0815aa508623165d7fc0b810bafc16cc0
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

StudipSemTree.class.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    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