ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarCategoryTableGUI Class Reference

show presentation of calendar category side block More...

+ Inheritance diagram for ilCalendarCategoryTableGUI:
+ Collaboration diagram for ilCalendarCategoryTableGUI:

Public Member Functions

 __construct ($a_parent_obj)
 Constructor.
 parse ()
 parse
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="")
 Constructor.
 getParentObject ()
 Get parent object.
 getParentCmd ()
 Get parent command.
 setNoEntriesText ($a_text)
 Set text for an empty table.
 getNoEntriesText ()
 Get text for an empty table.
 setEnableTitle ($a_enabletitle)
 Set Enable Title.
 getEnableTitle ()
 Get Enable Title.
 setEnableHeader ($a_enableheader)
 Set Enable Header.
 getEnableHeader ()
 Get Enable Header.
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title public
 setOrderField ($a_order_field)
 set order column
 getOrderField ()
 setData ($a_data)
 set table data public
 getData ()
 dataExists ()
 setPrefix ($a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) public
 setFormAction ($a_form_action)
 Set Form action parameter.
 getFormAction ()
 Get Form action parameter.
 setFormName ($a_formname)
 Set Form name.
 getFormName ()
 Get Form name.
 setId ($a_val)
 Set id.
 getId ()
 Get element id.
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button.
 setSelectAllCheckbox ($a_select_all_checkbox)
 Set the name of the checkbox that should be toggled with a select all button.
 setRowTemplate ($a_template, $a_template_dir="")
 Set row template.
 setDefaultOrderField ($a_defaultorderfield)
 Set Default order field.
 getDefaultOrderField ()
 Get Default order field.
 setDefaultOrderDirection ($a_defaultorderdirection)
 Set Default order direction.
 getDefaultOrderDirection ()
 Get Default order direction.
 addCommandButton ($a_cmd, $a_text)
 Add Command button.
 setCloseCommand ($a_link)
 Add command for closing table.
 addMultiCommand ($a_cmd, $a_text)
 Add Command button.
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now)
 addColumn ($a_text, $a_sort_field="", $a_width="")
 Add a column to the header.
 getNavParameter ()
 setOrderLink ($sort_field, $order_dir)
 fillHeader ()
 getHTML ()
 numericOrdering ($a_field)
 Should this field be sorted numeric?
 render ()
 render table public
 fillFooter ()
 Fill footer row.
 getLinkbar ($a_num)
 Get previous/next linkbar.
 fillActionRow ()
 Fill Action Row.
 setHeaderHTML ($html)
 set header html
- Public Member Functions inherited from ilTableGUI
 ilTableGUI ($a_data=0, $a_global_tpl=true)
 Constructor.
 setTemplate (&$a_tpl)
 set template public
getTemplateObject ()
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page public
 setHeaderNames ($a_header_names)
 set table header names public
 getColumnCount ()
 Returns the column count based on the number of the header row columns public.
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars public
 setColumnWidth ($a_column_width)
 set table column widths public
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width public
 setMaxCount ($a_max_count)
 set max.
 setLimit ($a_limit=0, $a_default_limit=0)
 set max.
 getLimit ()
 Get limit.
 setOffset ($a_offset)
 set dataset offset public
 getOffset ()
 Get offset.
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column public
 getOrderColumn ()
 Get order column.
 setOrderDirection ($a_order_direction)
 set order direction public
 getOrderDirection ()
 Get order direction.
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction public
 enable ($a_module_name)
 enables particular modules of table public
 disable ($a_module_name)
 diesables particular modules of table public
 sortData ()
 renderHeader ()
 setStyle ($a_element, $a_style)
 getStyle ($a_element)
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds).
 getBase ()
 Get Base script name (deprecated, only use this for workarounds).
 clearActionButtons ()
 addActionButton ($btn_name, $btn_value)

Protected Member Functions

 fillRow ($a_set)
 fill row
 buildPath ($a_ref_id)

Additional Inherited Members

- Data Fields inherited from ilTableGUI
 $title
 $icon
 $icon_alt
 $help_page
 $help_icon
 $help_icon_alt
 $header_names
 $header_vars
 $linkbar_vars
 $data
 $column_count
 $column_width
 $max_count
 $limit
 $max_limit = false
 $offset
 $order_column
 $order_direction
 $footer_style
 $footer_previous
 $footer_next
 $lang_support = true
 $global_tpl
 $form_name
 $select_all_checkbox
 $action_buttons
 $prefix
 $base = ""
 $enabled
 $styles
- Protected Attributes inherited from ilTable2GUI
 $close_command = ""

Detailed Description

show presentation of calendar category side block

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 35 of file class.ilCalendarCategoryTableGUI.php.

Constructor & Destructor Documentation

ilCalendarCategoryTableGUI::__construct (   $a_parent_obj)

Constructor.

public

Parameters
@return

Definition at line 44 of file class.ilCalendarCategoryTableGUI.php.

References $ilCtrl, $lng, ilTable2GUI\addColumn(), ilTableGUI\disable(), ilTableGUI\enable(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTableGUI\setLimit(), ilTable2GUI\setPrefix(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setSelectAllCheckbox().

{
global $lng,$ilCtrl;
$this->lng = $lng;
$this->lng->loadLanguageModule('dateplaner');
$this->ctrl = $ilCtrl;
parent::__construct($a_parent_obj,'showCategories');
$this->setFormName('categories');
$this->addColumn('','f',"1");
$this->addColumn($this->lng->txt('title'),'title',"100%");
$this->setPrefix('categories');
$this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
$this->setRowTemplate("tpl.show_category_row.html","Services/Calendar");
$this->disable('sort');
$this->disable('header');
$this->disable('numinfo');
$this->enable('select_all');
$this->setSelectAllCheckbox('cat_ids');
$this->setLimit(100);
}

+ Here is the call graph for this function:

Member Function Documentation

ilCalendarCategoryTableGUI::buildPath (   $a_ref_id)
protected

Definition at line 177 of file class.ilCalendarCategoryTableGUI.php.

References ilTableGUI\$data.

Referenced by parse().

{
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:

ilCalendarCategoryTableGUI::fillRow (   $a_set)
protected

fill row

protected

Parameters
@return

Reimplemented from ilTable2GUI.

Definition at line 77 of file class.ilCalendarCategoryTableGUI.php.

References ilObject\_lookupType(), ilUtil\getImagePath(), ilTable2GUI\getParentObject(), ilCalendarCategory\TYPE_GLOBAL, ilCalendarCategory\TYPE_OBJ, and ilCalendarCategory\TYPE_USR.

{
$this->tpl->setVariable('VAL_ID',$a_set['id']);
if(!$a_set['hidden'])
{
$this->tpl->setVariable('VAL_CHECKED','checked="checked"');
}
$this->tpl->setVariable('VAL_TITLE',$a_set['title']);
$this->tpl->setVariable('BGCOLOR',$a_set['color']);
if($a_set['editable'] or 1)
{
#$this->tpl->setCurrentBlock('title_link');
$this->ctrl->setParameter($this->getParentObject(),'category_id',$a_set['id']);
$this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTarget($this->getParentObject(),'edit'));
$this->tpl->setVariable('TXT_EDIT',$this->lng->txt('edit'));
#$this->tpl->parseCurrentBlock();
}
switch($a_set['type'])
{
$this->tpl->setVariable('IMG_SRC',ilUtil::getImagePath('icon_calg_s.gif'));
$this->tpl->setVariable('IMG_ALT',$this->lng->txt('cal_type_system'));
break;
$this->tpl->setVariable('IMG_SRC',ilUtil::getImagePath('icon_usr_s.gif'));
$this->tpl->setVariable('IMG_ALT',$this->lng->txt('cal_type_personal'));
break;
$type = ilObject::_lookupType($a_set['obj_id']);
$this->tpl->setVariable('IMG_SRC',ilUtil::getImagePath('icon_'.$type.'_s.gif'));
$this->tpl->setVariable('IMG_ALT',$this->lng->txt('cal_type_'.$type));
break;
}
if(strlen($a_set['path']))
{
$this->tpl->setCurrentBlock('calendar_path');
$this->tpl->setVariable('ADD_PATH_INFO',$a_set['path']);
$this->tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

ilCalendarCategoryTableGUI::parse ( )

parse

public

Returns

Definition at line 127 of file class.ilCalendarCategoryTableGUI.php.

References $ref_id, ilObject\_getAllReferences(), ilCalendarCategories\_getInstance(), ilCalendarHidden\_getInstanceByUserId(), buildPath(), ilTable2GUI\setData(), and ilCalendarCategory\TYPE_OBJ.

{
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'];
$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;
}
$this->setData($path_categories ? $path_categories : array());
}

+ Here is the call graph for this function:


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