<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

class ComboboxSemester4Kursplanung extends ComboboxSemester
{
  protected function getDatamodulAry()
  {
    $dbwhlsem = new DBWorkHLSemester(1, true);
    $semAry = $dbwhlsem->getAllSemesterSinceDate(DateTimeOperations::getDateNow());

    if (empty($semAry)) {
      $toolSettings = ToolSettingsAPI::getToolSettings(GetOperations::getVarValue('tool_id', 3));
      $semArySettings = explode(',', $toolSettings->kurskopie_semester);
      foreach ($semArySettings as $key => $semester) {
        $semArySettings[$key] = trim($semester);
      }

      $semAry = $dbwhlsem->getSemesterBySemAry($semArySettings, true);
    }

    return $semAry;
  }
}