ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarSelectionBlockGUI Class Reference

BlockGUI class calendar selection. More...

+ Inheritance diagram for ilCalendarSelectionBlockGUI:
+ Collaboration diagram for ilCalendarSelectionBlockGUI:

Public Member Functions

 ilCalendarSelectionBlockGUI ($a_seed)
 Constructor.
executeCommand ()
 execute command
 getCalendars ()
 Get calendars.
 fillDataSection ()
 Fill data section.
 getHTML ()
 Get block HTML code.
- Public Member Functions inherited from ilBlockGUI
 ilBlockGUI ()
 Constructor.
 addHeaderLink ($a_href, $a_text, $status=true)
 getHeaderLinks ()
 setData ($a_data)
 Set Data.
 getData ()
 Get Data.
 setBigMode ($a_bigmode)
 Set Big Mode.
 getBigMode ()
 Get Big Mode.
 setBlockId ($a_block_id=0)
 Set Block Id.
 getBlockId ()
 Get Block Id.
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels.
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level.
 setGuiObject (&$a_gui_object)
 Set GuiObject.
 getGuiObject ()
 Get GuiObject.
 getCurrentDetailLevel ()
 Get Current Detail Level.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setImage ($a_image)
 Set Image.
 getImage ()
 Get Image.
 setOffset ($a_offset)
 Set Offset.
 getOffset ()
 Get Offset.
 correctOffset ()
 setLimit ($a_limit)
 Set Limit.
 getLimit ()
 Get Limit.
 setEnableEdit ($a_enableedit)
 Set EnableEdit.
 getEnableEdit ()
 Get EnableEdit.
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode.
 getRepositoryMode ()
 Get RepositoryMode.
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info.
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info.
 setSubtitle ($a_subtitle)
 Set Subtitle.
 getSubtitle ()
 Get Subtitle.
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true).
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true).
 setAdminCommands ($a_admincommands)
 Set Administration Commmands.
 getAdminCommands ()
 Get Administration Commmands.
 setColSpan ($a_colspan)
 Set Columns Span.
 getColSpan ()
 Get Columns Span.
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow.
 getEnableDetailRow ()
 Get EnableDetailRow.
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info.
 getEnableNumInfo ()
 Get Enable Item Number Info.
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties.
 getProperty ($a_property)
 setProperty ($a_property, $a_value)
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name.
 getNavParameter ()
 getDetailParameter ()
 getConfigParameter ()
 getMoveParameter ()
 getRowTemplateName ()
 Get Row Template Name.
 getRowTemplateDir ()
 Get Row Template Directory.
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false)
 Add Block Command.
 getBlockCommands ()
 Get Block commands.
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command.
 getHeaderCommands ()
 Get Header Block commands.
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link.
 getFooterLinks ()
 Get footer links.
 clearFooterLinks ()
 Clear footer links.
 handleDetailLevel ()
 Handle read/write current detail level.
 fillHeaderCommands ()
 Fill header commands block.
 fillHeaderTitleBlock ()
 Fill header title block (title and.
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used.
 fillRow ($a_set)
 fillFooter ()
 fillPreviousNext ()
 Fill previous/next row.
 setPreviousNextLinks ()
 Get previous/next linkbar.
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links.
 fillDetailRow ()
 Fill Detail Setting Row.

Static Public Member Functions

static isRepositoryObject ()
 Is this a repository object.
static getBlockType ()
 Get block type.
static getScreenMode ()
 Get Screen Mode for current command.

Static Public Attributes

static $block_type = "cal_sel"

Protected Member Functions

 buildPath ($a_ref_id)
 Build path for ref id.
 renderItem ($a_set, $a_tpl)
 Render item.
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 preloadData (array $data)
 Can be overwritten in subclasses.

Additional Inherited Members

- Protected Attributes inherited from ilBlockGUI
 $data = array()
 $colspan = 1
 $enablenuminfo = true
 $detail_min = 0
 $detail_max = 0
 $bigmode = false
 $footer_links = array()
 $block_id = 0
 $header_commands = array()
 $allow_moving = true
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 $enabledetailrow = true
 $header_links = array()
 $footerinfo = false
 $footerinfo_icon = false
 $block_commands = array()
 $max_count = false
 $close_command = false
 $image = false
 $property = false
 $nav_value = ""
 $css_row = ""
 $dropdown

Detailed Description

BlockGUI class calendar selection.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilCalendarSelectionBlockGUI.php.

Member Function Documentation

ilCalendarSelectionBlockGUI::buildPath (   $a_ref_id)
protected

Build path for ref id.

Parameters
int$a_ref_idref id

Definition at line 176 of file class.ilCalendarSelectionBlockGUI.php.

References ilBlockGUI\$data, and $path.

Referenced by getCalendars().

{
global $tree;
$path_arr = $tree->getPathFull($a_ref_id,ROOT_FOLDER_ID);
$counter = 0;
unset($path_arr[count($path_arr) - 1]);
foreach($path_arr as $data)
{
if($counter++)
{
$path .= " -> ";
}
$path .= $data['title'];
}
if(strlen($path) > 30)
{
return '...'.substr($path,-30);
}
return $path;
}

+ Here is the caller graph for this function:

& ilCalendarSelectionBlockGUI::executeCommand ( )

execute command

Definition at line 94 of file class.ilCalendarSelectionBlockGUI.php.

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd("getHTML");
switch ($next_class)
{
default:
return $this->$cmd();
}
}
ilCalendarSelectionBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

Definition at line 203 of file class.ilCalendarSelectionBlockGUI.php.

References $ilCtrl, $lng, $tpl, ilUtil\getImagePath(), renderItem(), and ilBlockGUI\setDataSection().

{
global $lng, $ilCtrl;
$tpl = new ilTemplate("tpl.cal_selection_block_content.html", true, true, "Services/Calendar");
foreach ($this->calendars as $c)
{
$this->renderItem($c, $tpl);
}
$tpl->setVariable("TXT_SHOW", $lng->txt("select"));
$tpl->setVariable("CMD_SHOW", "saveSelection");
$tpl->setVariable("TXT_ACTION", $lng->txt("select"));
$tpl->setVariable("SRC_ACTION", ilUtil::getImagePath("arrow_downright.png"));
$tpl->setVariable("FORM_ACTION", $ilCtrl->getFormActionByClass("ilcalendarcategorygui"));
$tpl->setVariable("TXT_SELECT_ALL", $lng->txt("select_all"));
$this->setDataSection($tpl->get());
}

+ Here is the call graph for this function:

static ilCalendarSelectionBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Definition at line 76 of file class.ilCalendarSelectionBlockGUI.php.

References $block_type.

{
}
ilCalendarSelectionBlockGUI::getCalendars ( )

Get calendars.

Definition at line 111 of file class.ilCalendarSelectionBlockGUI.php.

References $ilUser, $ref_id, ilObject\_getAllReferences(), ilCalendarCategories\_getInstance(), ilCalendarHidden\_getInstanceByUserId(), buildPath(), ilCalendarCategory\lookupCategorySortIndex(), ilUtil\sortArray(), and ilCalendarCategory\TYPE_OBJ.

Referenced by getHTML().

{
global $ilUser,$tree;
include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
include_once('./Services/Calendar/classes/class.ilCalendarHidden.php');
$hidden_obj = ilCalendarHidden::_getInstanceByUserId($ilUser->getId());
$hidden = $hidden_obj->getHidden();
$cats = ilCalendarCategories::_getInstance($ilUser->getId());
$all = $cats->getCategoriesInfo();
$tmp_title_counter = array();
$categories = array();
foreach($all as $category)
{
$tmp_arr['obj_id'] = $category['obj_id'];
$tmp_arr['id'] = $category['cat_id'];
$tmp_arr['hidden'] = (bool) in_array($category['cat_id'],$hidden);
$tmp_arr['title'] = $category['title'];
$tmp_arr['type'] = $category['type'];
// Append object type to make type sortable
$tmp_arr['type_sortable'] = ilCalendarCategory::lookupCategorySortIndex($category['type']);
if($category['type'] == ilCalendarCategory::TYPE_OBJ)
{
$tmp_arr['type_sortable'] .= ('_'.ilObject::_lookupType($category['obj_id']));
}
$tmp_arr['color'] = $category['color'];
$tmp_arr['editable'] = $category['editable'];
$categories[] = $tmp_arr;
// count title for appending the parent container if there is more than one entry.
$tmp_title_counter[$category['type'].'_'.$category['title']]++;
}
$path_categories = array();
foreach($categories as $cat)
{
if($cat['type'] == ilCalendarCategory::TYPE_OBJ)
{
if($tmp_title_counter[$cat['type'].'_'.$cat['title']] > 1)
{
foreach(ilObject::_getAllReferences($cat['obj_id']) as $ref_id)
{
$cat['path'] = $this->buildPath($ref_id);
break;
}
}
}
$path_categories[] = $cat;
}
$path_categories = ilUtil::sortArray($path_categories, 'title', "asc");
$this->calendars = $path_categories;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarSelectionBlockGUI::getHTML ( )

Get block HTML code.

Reimplemented from ilBlockGUI.

Definition at line 284 of file class.ilCalendarSelectionBlockGUI.php.

References $ilCtrl, $ilSetting, $ilUser, $lng, and getCalendars().

{
global $ilCtrl, $lng, $ilUser, $ilAccess, $ilSetting;
$this->getCalendars();
return parent::getHTML();
}

+ Here is the call graph for this function:

static ilCalendarSelectionBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 84 of file class.ilCalendarSelectionBlockGUI.php.

References $ilCtrl, and IL_SCREEN_SIDE.

{
global $ilCtrl;
}
ilCalendarSelectionBlockGUI::ilCalendarSelectionBlockGUI (   $a_seed)

Constructor.

Definition at line 22 of file class.ilCalendarSelectionBlockGUI.php.

References $ilCtrl, $lng, ilCalendarUserSettings\_getInstance(), ilBlockGUI\addBlockCommand(), ilCalendarUserSettings\CAL_SELECTION_ITEMS, ilCalendarUserSettings\CAL_SELECTION_MEMBERSHIP, IL_CAL_DATE, ilBlockGUI\setLimit(), and ilBlockGUI\setTitle().

{
global $ilCtrl, $lng;
$this->lng = $lng;
parent::__construct();
$lng->loadLanguageModule('pd');
$lng->loadLanguageModule('dateplaner');
$this->setLimit(5);
$this->allow_moving = false;
$this->seed = $a_seed;
$this->setTitle($lng->txt('cal_table_categories'));
include_once('./Services/Calendar/classes/class.ilCalendarUserSettings.php');
$sel_type = ilCalendarUserSettings::_getInstance()->getCalendarSelectionType();
$ilCtrl->setParameterByClass("ilcalendarcategorygui",'calendar_mode',ilCalendarUserSettings::CAL_SELECTION_ITEMS);
$ilCtrl->setParameterByClass("ilcalendarcategorygui",'seed',$this->seed->get(IL_CAL_DATE));
$ilCtrl->getLinkTargetByClass("ilcalendarcategorygui",'switchCalendarMode'),
$lng->txt('pd_my_offers'), "", "", false,
);
$ilCtrl->setParameterByClass("ilcalendarcategorygui",'calendar_mode',ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP);
$ilCtrl->setParameterByClass("ilcalendarcategorygui",'seed',$this->seed->get(IL_CAL_DATE));
$ilCtrl->getLinkTargetByClass("ilcalendarcategorygui",'switchCalendarMode'),
$lng->txt('pd_my_memberships'), "", "", false,
);
$ilCtrl->setParameterByClass("ilcalendarcategorygui",'calendar_mode',"");
$ilCtrl->getLinkTargetByClass("ilcalendarcategorygui", 'add'),
$lng->txt('cal_add_calendar')
);
}

+ Here is the call graph for this function:

static ilCalendarSelectionBlockGUI::isRepositoryObject ( )
static

Is this a repository object.

Returns
string Block type.

Reimplemented from ilBlockGUI.

Definition at line 66 of file class.ilCalendarSelectionBlockGUI.php.

{
return false;
}
ilCalendarSelectionBlockGUI::renderItem (   $a_set,
  $a_tpl 
)
protected

Render item.

Parameters
array$a_setitem datat

Definition at line 229 of file class.ilCalendarSelectionBlockGUI.php.

References $ilCtrl, ilObject\_lookupType(), ilUtil\getImagePath(), ilCalendarCategory\TYPE_BOOK, ilCalendarCategory\TYPE_GLOBAL, ilCalendarCategory\TYPE_OBJ, and ilCalendarCategory\TYPE_USR.

Referenced by fillDataSection().

{
global $ilCtrl;
if(strlen($a_set['path']))
{
$a_tpl->setCurrentBlock('calendar_path');
$a_tpl->setVariable('ADD_PATH_INFO',$a_set['path']);
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock("item");
$a_tpl->setVariable('VAL_ID',$a_set['id']);
if(!$a_set['hidden'])
{
$a_tpl->setVariable('VAL_CHECKED','checked="checked"');
}
$a_tpl->setVariable('VAL_TITLE',$a_set['title']);
$a_tpl->setVariable('BGCOLOR',$a_set['color']);
$ilCtrl->setParameterByClass("ilcalendarcategorygui",'category_id',$a_set['id']);
$a_tpl->setVariable('EDIT_LINK',$ilCtrl->getLinkTargetByClass("ilcalendarcategorygui", 'details'));
$a_tpl->setVariable('TXT_EDIT',$this->lng->txt('edit'));
switch($a_set['type'])
{
$a_tpl->setVariable('IMG_SRC',ilUtil::getImagePath('icon_calg_s.png'));
$a_tpl->setVariable('IMG_ALT', $this->lng->txt('cal_type_system'));
break;
$a_tpl->setVariable('IMG_SRC',ilUtil::getImagePath('icon_usr_s.png'));
$a_tpl->setVariable('IMG_ALT',$this->lng->txt('cal_type_personal'));
break;
$type = ilObject::_lookupType($a_set['obj_id']);
$a_tpl->setVariable('IMG_SRC',ilUtil::getImagePath('icon_'.$type.'_s.png'));
$a_tpl->setVariable('IMG_ALT',$this->lng->txt('cal_type_'.$type));
break;
$a_tpl->setVariable('IMG_SRC',ilUtil::getImagePath('icon_book_s.png'));
$a_tpl->setVariable('IMG_ALT',$this->lng->txt('cal_type_'.$type));
break;
}
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilCalendarSelectionBlockGUI::$block_type = "cal_sel"
static

Definition at line 17 of file class.ilCalendarSelectionBlockGUI.php.

Referenced by getBlockType().


The documentation for this class was generated from the following file: