5include_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();
 
  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)
 
  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();
 
  290                return parent::getHTML();
 
This class represents a block method of a block.
setLimit($a_limit)
Set Limit.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
setTitle($a_title)
Set Title.
static _getInstance($a_usr_id=0)
get singleton instance
static lookupCategorySortIndex($a_type_id)
Lookup sort index of calendar type.
static _getInstanceByUserId($a_user_id)
get instance by user id
BlockGUI class calendar selection.
static getScreenMode()
Get Screen Mode for current command.
renderItem($a_set, $a_tpl)
Render item.
static isRepositoryObject()
Is this a repository object.
fillDataSection()
Fill data section.
getCalendars()
Get calendars.
buildPath($a_ref_id)
Build path for ref id.
getHTML()
Get block HTML code.
ilCalendarSelectionBlockGUI($a_seed)
Constructor.
static getBlockType()
Get block type.
& executeCommand()
execute command
const CAL_SELECTION_ITEMS
static _getInstance()
get instance for logged in user
const CAL_SELECTION_MEMBERSHIP
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
special template class to simplify handling of ITX/PEAR
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)