5 include_once(
"./Services/Block/classes/class.ilBlockGUI.php");
 
   27                 parent::__construct();
 
   28                 $lng->loadLanguageModule(
'pd');
 
   29                 $lng->loadLanguageModule(
'dateplaner');
 
   32                 $this->allow_moving = 
false;
 
   33                 $this->seed = $a_seed;
 
   35                 $this->
setTitle($lng->txt(
'cal_table_categories'));
 
   37                 include_once(
'./Services/Calendar/classes/class.ilCalendarUserSettings.php');
 
   40                 $ilCtrl->setParameterByClass(
"ilcalendarcategorygui",
'seed',$this->seed->get(
IL_CAL_DATE));
 
   42                         $ilCtrl->getLinkTargetByClass(
"ilcalendarcategorygui",
'switchCalendarMode'),
 
   43                         $lng->txt(
'pd_my_offers'), 
"", 
"", 
false,
 
   47                 $ilCtrl->setParameterByClass(
"ilcalendarcategorygui",
'seed',$this->seed->get(
IL_CAL_DATE));
 
   49                         $ilCtrl->getLinkTargetByClass(
"ilcalendarcategorygui",
'switchCalendarMode'),
 
   50                         $lng->txt(
'pd_my_memberships'), 
"", 
"", 
false,
 
   54                 $ilCtrl->setParameterByClass(
"ilcalendarcategorygui",
'calendar_mode',
"");
 
   56                         $ilCtrl->getLinkTargetByClass(
"ilcalendarcategorygui", 
'add'),
 
   57                         $lng->txt(
'cal_add_calendar')
 
   98                 $next_class = $ilCtrl->getNextClass();
 
   99                 $cmd = $ilCtrl->getCmd(
"getHTML");
 
  104                                 return $this->
$cmd();
 
  115                 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
 
  116                 include_once(
'./Services/Calendar/classes/class.ilCalendarHidden.php');
 
  119                 $hidden = $hidden_obj->getHidden();
 
  122                 $all = $cats->getCategoriesInfo();
 
  123                 $tmp_title_counter = array();
 
  124                 $categories = array();
 
  125                 foreach($all as $category)
 
  127                         $tmp_arr[
'obj_id'] = $category[
'obj_id'];
 
  128                         $tmp_arr[
'id'] = $category[
'cat_id'];
 
  129                         $tmp_arr[
'hidden'] = (bool) in_array($category[
'cat_id'],$hidden);
 
  130                         $tmp_arr[
'title'] = $category[
'title'];
 
  131                         $tmp_arr[
'type'] = $category[
'type'];
 
  137                                 $tmp_arr[
'type_sortable'] .= (
'_'.ilObject::_lookupType($category[
'obj_id']));
 
  140                         $tmp_arr[
'color'] = $category[
'color'];
 
  141                         $tmp_arr[
'editable'] = $category[
'editable'];
 
  143                         $categories[] = $tmp_arr;
 
  146                         $tmp_title_counter[$category[
'type'].
'_'.$category[
'title']]++;
 
  150                 $path_categories = array();
 
  151                 foreach($categories as $cat)
 
  155                                 if($tmp_title_counter[$cat[
'type'].
'_'.$cat[
'title']] > 1)
 
  159                                                 $cat[
'path'] = $this->
buildPath($ref_id);
 
  164                         $path_categories[] = $cat;
 
  168                 $this->calendars = $path_categories;
 
  180                 $path_arr = $tree->getPathFull($a_ref_id,ROOT_FOLDER_ID);
 
  182                 unset($path_arr[count($path_arr) - 1]);
 
  184                 foreach($path_arr as 
$data)
 
  190                         $path .= $data[
'title'];
 
  192                 if(strlen(
$path) > 30)
 
  194                         return '...'.substr(
$path,-30);
 
  207                 $tpl = 
new ilTemplate(
"tpl.cal_selection_block_content.html", 
true, 
true, 
"Services/Calendar");
 
  209                 foreach ($this->calendars as $c)
 
  214                 $tpl->setVariable(
"TXT_SHOW", $lng->txt(
"select"));
 
  215                 $tpl->setVariable(
"CMD_SHOW", 
"saveSelection");
 
  216                 $tpl->setVariable(
"TXT_ACTION", $lng->txt(
"select"));
 
  218                 $tpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormActionByClass(
"ilcalendarcategorygui"));
 
  219                 $tpl->setVariable(
"TXT_SELECT_ALL", $lng->txt(
"select_all"));
 
  233                 if(strlen($a_set[
'path']))
 
  235                         $a_tpl->setCurrentBlock(
'calendar_path');
 
  236                         $a_tpl->setVariable(
'ADD_PATH_INFO',$a_set[
'path']);
 
  237                         $a_tpl->parseCurrentBlock();
 
  240                 $a_tpl->setCurrentBlock(
"item");
 
  242                 $a_tpl->setVariable(
'VAL_ID',$a_set[
'id']);
 
  243                 if(!$a_set[
'hidden'])
 
  245                         $a_tpl->setVariable(
'VAL_CHECKED',
'checked="checked"');
 
  247                 $a_tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
 
  248                 $a_tpl->setVariable(
'BGCOLOR',$a_set[
'color']);
 
  250                 $ilCtrl->setParameterByClass(
"ilcalendarcategorygui",
'category_id',$a_set[
'id']);
 
  251                 $a_tpl->setVariable(
'EDIT_LINK',$ilCtrl->getLinkTargetByClass(
"ilcalendarcategorygui", 
'details'));
 
  252                 $a_tpl->setVariable(
'TXT_EDIT',$this->lng->txt(
'edit'));
 
  254                 switch($a_set[
'type'])
 
  258                                 $a_tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_system'));
 
  263                                 $a_tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'cal_type_personal'));
 
  269                                 $a_tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'cal_type_'.$type));
 
  274                                 $a_tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'cal_type_'.$type));
 
  278                 $a_tpl->parseCurrentBlock();