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

Class ilContainerGUI. More...

+ Inheritance diagram for ilContainerGUI:
+ Collaboration diagram for ilContainerGUI:

Public Member Functions

 ilContainerGUI ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
executeCommand ()
 execute command note: this method is overwritten in all container objects
forwardToPageObject ()
 forward command to page object
 getContainerPageHTML ()
 Get container page HTML.
 prepareOutput ($a_show_subobjects=true)
 prepare output
 showTreeFlatIcon ()
 setTitleAndDescription ()
 called by prepare output
 showPossibleSubObjects ()
 show possible sub objects selection list
 renderObject ()
 render the object
 showAdministrationPanel (&$tpl)
 get container content (list of subitems) (this should include multiple lists in the future that together build the blocks of a container page)
 __showTimingsButton (&$tpl)
 showPermanentLink (&$tpl)
 show permanent link
 switchToStdEditorObject ()
 Switch to standard page editor.
 switchToOldEditorObject ()
 Switch to old page editor.
 useNewEditorObject ()
 Use new editor (-> delete xhtml content page)
 editPageFrameObject ()
 show page editor frameset
 editPageContentObject ()
 edit page content (for repository root node and categories)
 savePageContentObject ()
 cancelPageContentObject ()
 renderItemList ($a_type="all")
 showLinkListObject ()
 clearAdminCommandsDetermination ()
 cleaer administration commands determination
newBlockTemplate ()
 determin admin commands
 addHeaderRow (&$a_tpl, $a_type, $a_show_image=true)
 adds a header row to a block template
 addStandardRow (&$a_tpl, $a_html, $a_item_ref_id="", $a_item_obj_id="", $a_image_type="")
 adds a standard row to a block template
 addMessageRow (&$a_tpl, $a_message, $a_type)
 add message row
 resetRowType ()
 addSeparatorRow (&$a_tpl)
 setPageEditorTabs ()
 getTabs (&$tabs_gui)
 common tabs for all container objects (should be called at the end of child getTabs() method
 enableAdministrationPanelObject ()
 enable administration panel
 disableAdministrationPanelObject ()
 enable administration panel
 addToDeskObject ()
 subscribe item
 lockObject ()
 getActions ()
 Get Actions.
 removeFromDeskObject ()
 unsubscribe item
 cutObject ()
 cut object(s) out from a container and write the information to clipboard
 linkObject ()
 create an new reference of an object in tree it's like a hard link of unix
 clearObject ()
 clear clipboard and go back to last object
 pasteObject ()
 paste object from clipboard to current place Depending on the chosen command the object(s) are linked, copied or moved
 copyObject ()
 copy object(s) out from a container and write the information to clipboard
 clipboardObject ()
 show clipboard
 showCustomIconsEditing ($a_input_colspan=1)
 show edit section of custom icons for container
 isActiveAdministrationPanel ()
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 allowBlocksMoving ()
 Standard is to allow blocks moving.
 allowBlocksConfigure ()
 Standard is to allow blocks configuration.
 cloneWizardPageTreeObject ()
 public
 cloneWizardPageListObject ()
 public
 cloneWizardPageObject ($a_tree_view=true)
 Show clone wizard page for container objects.
 cloneAllObject ()
 Clone all object Overwritten method for copying container objects.
 copyWizardHasOptions ($a_mode)
 public
 saveSortingObject ()
 Save Sorting.
 cloneNodes ($srcRef, $dstRef, &$mapping, $newName=null)
 Recursively clones all nodes of the RBAC tree.
 modifyItemGUI (&$a_item_list_gui, $a_item_data, $a_show_path)
 Modify Item ListGUI for presentation in container.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 assignObject ()
 prepareOutput ()
 prepare output
 showUpperIcon ()
 showMountWebfolderIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 setActions ($a_actions="")
 set possible actions for objects in list.
 setSubObjects ($a_sub_objects="")
 set possible subobjects for this object.
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 undeleteObject ()
 get object back from trash
 insertSavedNodes ($a_source_id, $a_dest_id, $a_tree_id, &$a_affected_ids)
 recursive method to insert all saved nodes of the clipboard (maybe this function could be moved to a rbac class ?)
 confirmedDeleteObject ()
 confirmed deletion if object -> objects are moved to trash
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 removeDeletedNodes ($a_node_id, $a_checked, $a_delete_objects, &$a_affected_ids)
 remove already deleted objects within the objects in trash recursive function
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 importObject ()
 import new object form
 editObject ()
 edit object
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 updateObject ()
 updates object entry in object_data
 afterUpdate ()
 permObject ()
 show permissions of current node
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 permSaveObject ()
 save permissions
 isVisible ($a_ref_id, $a_type)
 displayList ()
 display object list
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 display deletion confirmation screen only for referenced objects.
 trashObject ()
 show trash content of object
 addRoleObject ()
 adds a local role This method is only called when choose the option 'you may add local roles'.
 showActions ($with_subobjects=false)
 show possible action (form buttons)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 infoObject ()
 __buildRoleFilterSelect ()
 __filterRoles ($a_roles, $a_filter)
 ownerObject ()
 changeOwnerObject ()
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 checkPermission ($a_perm, $a_cmd="")

Static Public Member Functions

static _buildPath ($a_ref_id, $a_course_ref_id)
 build path

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false
- Protected Member Functions inherited from ilObjectGUI
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)

Detailed Description

Class ilContainerGUI.

This is a base GUI class for all container objects in ILIAS: root folder, course, group, category, folder

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilContainerGUI.php 20362 2009-06-28 14:22:52Z smeyer

Definition at line 40 of file class.ilContainerGUI.php.

Member Function Documentation

ilContainerGUI::__showTimingsButton ( $tpl)

Definition at line 601 of file class.ilContainerGUI.php.

References ilObjectGUI\$tpl, and ilObjectGUI\$tree.

{
global $tree;
if(!$tree->checkForParentType($this->object->getRefId(),'crs'))
{
return false;
}
$tpl->setCurrentBlock("custom_button");
$tpl->setVariable("ADMIN_MODE_LINK",$this->ctrl->getLinkTargetByClass('ilcoursecontentgui','editTimings'));
$tpl->setVariable("TXT_ADMIN_MODE",$this->lng->txt('timings_edit'));
$tpl->parseCurrentBlock();
return true;
}
static ilContainerGUI::_buildPath (   $a_ref_id,
  $a_course_ref_id 
)
static

build path

Definition at line 2412 of file class.ilContainerGUI.php.

References ilObjectGUI\$data, and ilObjectGUI\$tree.

Referenced by ilObjCourseGUI\_modifyItemGUI().

{
global $tree;
$path_arr = $tree->getPathFull($a_ref_id, $a_course_ref_id);
$counter = 0;
foreach($path_arr as $data)
{
if($counter++)
{
$path .= " > ";
}
$path .= $data['title'];
}
return $path;
}

+ Here is the caller graph for this function:

ilContainerGUI::addHeaderRow ( $a_tpl,
  $a_type,
  $a_show_image = true 
)

adds a header row to a block template

Parameters
object$a_tplblock template
string$a_typeobject type private

Definition at line 1119 of file class.ilContainerGUI.php.

References $title, and ilUtil\getImagePath().

Referenced by renderItemList().

{
$icon = ilUtil::getImagePath("icon_".$a_type.".gif");
$title = $this->lng->txt("objs_".$a_type);
if ($a_show_image)
{
$a_tpl->setCurrentBlock("container_header_row_image");
$a_tpl->setVariable("HEADER_IMG", $icon);
$a_tpl->setVariable("HEADER_ALT", $title);
}
else
{
$a_tpl->setCurrentBlock("container_header_row");
}
$a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
$a_tpl->parseCurrentBlock();
$a_tpl->touchBlock("container_row");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerGUI::addMessageRow ( $a_tpl,
  $a_message,
  $a_type 
)

add message row

Definition at line 1210 of file class.ilContainerGUI.php.

Referenced by renderItemList().

{
$this->cur_row_type = ($this->cur_row_type == "row_type_1")
? "row_type_2"
: "row_type_1";
$a_tpl->touchBlock($this->cur_row_type);
$type = $this->lng->txt("obj_".$a_type);
$a_message = str_replace("[type]", $type, $a_message);
$a_tpl->setVariable("ROW_NBSP", " ");
$a_tpl->setCurrentBlock("container_standard_row");
$a_tpl->setVariable("BLOCK_ROW_CONTENT",
$a_message);
$a_tpl->parseCurrentBlock();
$a_tpl->touchBlock("container_row");
}

+ Here is the caller graph for this function:

ilContainerGUI::addSeparatorRow ( $a_tpl)

Definition at line 1235 of file class.ilContainerGUI.php.

Referenced by renderItemList().

{
$a_tpl->touchBlock("separator_row");
$a_tpl->touchBlock("container_row");
}

+ Here is the caller graph for this function:

ilContainerGUI::addStandardRow ( $a_tpl,
  $a_html,
  $a_item_ref_id = "",
  $a_item_obj_id = "",
  $a_image_type = "" 
)

adds a standard row to a block template

Parameters
object$a_tplblock template
string$a_htmlhtml code private

Definition at line 1147 of file class.ilContainerGUI.php.

References ilContainer\_lookupIconPath(), ilContainerSortingSettings\_lookupSortMode(), ilUtil\getImagePath(), isActiveAdministrationPanel(), and ilContainer\SORT_MANUAL.

Referenced by renderItemList().

{
$this->cur_row_type = ($this->cur_row_type == "row_type_1")
? "row_type_2"
: "row_type_1";
$a_tpl->touchBlock($this->cur_row_type);
$nbsp = true;
if ($this->ilias->getSetting("icon_position_in_lists") == "item_rows")
{
$icon = ilUtil::getImagePath("icon_".$a_image_type.".gif");
$alt = $this->lng->txt("obj_".$a_image_type);
// custom icon
if ($this->ilias->getSetting("custom_icons") &&
in_array($a_image_type, array("cat","grp","crs")))
{
require_once("./Services/Container/classes/class.ilContainer.php");
if (($path = ilContainer::_lookupIconPath($a_item_obj_id, "small")) != "")
{
$icon = $path;
}
}
$a_tpl->setCurrentBlock("block_row_image");
$a_tpl->setVariable("ROW_IMG", $icon);
$a_tpl->setVariable("ROW_ALT", $alt);
$a_tpl->parseCurrentBlock();
$nbsp = false;
}
{
$a_tpl->setCurrentBlock("block_row_check");
$a_tpl->setVariable("ITEM_ID", $a_item_ref_id);
$a_tpl->parseCurrentBlock();
$nbsp = false;
}
include_once('Services/Container/classes/class.ilContainerSortingSettings.php');
{
$a_tpl->setCurrentBlock('block_position');
$a_tpl->setVariable('POS_TYPE',$a_image_type);
$a_tpl->setVariable('POS_ID',$a_item_ref_id);
$a_tpl->setVariable('POSITION',sprintf('%.1f',$this->current_position++));
$a_tpl->parseCurrentBlock();
}
if ($nbsp)
{
$a_tpl->setVariable("ROW_NBSP", " ");
}
$a_tpl->setCurrentBlock("container_standard_row");
$a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
$a_tpl->parseCurrentBlock();
$a_tpl->touchBlock("container_row");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerGUI::addToDeskObject ( )

subscribe item

Definition at line 1317 of file class.ilContainerGUI.php.

References $_GET, ilObject\_lookupType(), and renderObject().

{
if ($_GET["item_ref_id"] and $_GET["type"])
{
$this->ilias->account->addDesktopItem($_GET["item_ref_id"], $_GET["type"]);
}
else
{
if ($_POST["items"])
{
foreach ($_POST["items"] as $item)
{
$type = ilObject::_lookupType($item, true);
$this->ilias->account->addDesktopItem($item, $type);
}
}
}
$this->renderObject();
}

+ Here is the call graph for this function:

ilContainerGUI::allowBlocksConfigure ( )

Standard is to allow blocks configuration.

Definition at line 2097 of file class.ilContainerGUI.php.

{
true;
}
ilContainerGUI::allowBlocksMoving ( )

Standard is to allow blocks moving.

Definition at line 2089 of file class.ilContainerGUI.php.

Referenced by setColumnSettings().

{
true;
}

+ Here is the caller graph for this function:

ilContainerGUI::cancelPageContentObject ( )

Definition at line 816 of file class.ilContainerGUI.php.

References ilUtil\sendInfo().

{
ilUtil::sendInfo($this->lng->txt("action_aborted"), true);
$this->ctrl->redirect($this, "");
}

+ Here is the call graph for this function:

ilContainerGUI::clearAdminCommandsDetermination ( )

cleaer administration commands determination

Definition at line 1072 of file class.ilContainerGUI.php.

Referenced by renderItemList().

{
$this->adminCommands = false;
}

+ Here is the caller graph for this function:

ilContainerGUI::clearObject ( )

clear clipboard and go back to last object

public

Definition at line 1563 of file class.ilContainerGUI.php.

References $_SESSION, and ilUtil\sendInfo().

Referenced by pasteObject().

{
unset($_SESSION["clipboard"]);
unset($_SESSION["il_rep_clipboard"]);
//var_dump($this->getReturnLocation("clear",$this->ctrl->getLinkTarget($this)),get_class($this));
// only redirect if clipboard was cleared
if (isset($_POST["cmd"]["clear"]))
{
ilUtil::sendInfo($this->lng->txt("msg_clear_clipboard"),true);
$this->ctrl->returnToParent($this);
//ilUtil::redirect($this->getReturnLocation("clear",$this->ctrl->getLinkTarget($this)),get_class($this));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerGUI::clipboardObject ( )

show clipboard

Definition at line 1956 of file class.ilContainerGUI.php.

References $_SESSION, $ilErr, $ilLog, ilObjectGUI\$ref_id, ilObjectGUI\__showClipboardTable(), and ilObjectFactory\getInstanceByRefId().

{
global $ilErr,$ilLog;
// function should not be called if clipboard is empty
if (empty($_SESSION['clipboard']) or !is_array($_SESSION['clipboard']))
{
$message = sprintf('%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
$ilLog->write($message,$ilLog->FATAL);
$ilErr->raiseError($this->lng->txt("permission_denied"),$ilErr->WARNING);
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.rep_clipboard.html");
// FORMAT DATA
$counter = 0;
$f_result = array();
foreach($_SESSION["clipboard"]["ref_ids"] as $ref_id)
{
if(!$tmp_obj = ilObjectFactory::getInstanceByRefId($ref_id,false))
{
continue;
}
//$f_result[$counter][] = ilUtil::formCheckbox(0,"user[]",$user);
$f_result[$counter][] = $this->lng->txt("obj_".$tmp_obj->getType());
$f_result[$counter][] = $tmp_obj->getTitle();
//$f_result[$counter][] = $tmp_obj->getDescription();
$f_result[$counter][] = ($_SESSION["clipboard"]["cmd"] == "cut") ? $this->lng->txt("move") :$this->lng->txt($_SESSION["clipboard"]["cmd"]);
unset($tmp_obj);
++$counter;
}
$this->__showClipboardTable($f_result, "clipboardObject");
return true;
}

+ Here is the call graph for this function:

ilContainerGUI::cloneAllObject ( )

Clone all object Overwritten method for copying container objects.

public

Reimplemented from ilObjectGUI.

Definition at line 2256 of file class.ilContainerGUI.php.

References $_COOKIE, $_GET, $ilErr, $ilLog, ilObjectGUI\$ref_id, $result, ilObjectGUI\$tree, ilObjectGUI\createObject(), ilObjectFactory\getInstanceByRefId(), ilUtil\redirect(), and ilUtil\sendInfo().

{
global $ilLog;
include_once('classes/class.ilLink.php');
include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
global $ilAccess,$ilErr,$rbacsystem,$tree,$ilUser;
$new_type = $_REQUEST['new_type'];
$ref_id = (int) $_GET['ref_id'];
$clone_source = (int) $_REQUEST['clone_source'];
if(!$rbacsystem->checkAccess('create', $ref_id,$new_type))
{
$ilErr->raiseError($this->lng->txt('permission_denied'));
}
if(!$clone_source)
{
ilUtil::sendInfo($this->lng->txt('select_one'));
$this->createObject();
return false;
}
if(!$ilAccess->checkAccess('write','', $clone_source,$new_type))
{
$ilErr->raiseError($this->lng->txt('permission_denied'));
}
$options = $_POST['cp_options'] ? $_POST['cp_options'] : array();
$orig = ilObjectFactory::getInstanceByRefId($clone_source);
$result = $orig->cloneAllObject($_COOKIE['PHPSESSID'], $_COOKIE['ilClientId'], $new_type, $ref_id, $clone_source, $options);
// Check if copy is in progress
if ($result == $ref_id)
{
ilUtil::sendInfo($this->lng->txt("object_copy_in_progress"),true);
ilUtil::redirect('repository.php?ref_id='.$ref_id);
}
else
{
ilUtil::sendInfo($this->lng->txt("object_duplicated"),true);
ilUtil::redirect('repository.php?ref_id='.$result);
}
}

+ Here is the call graph for this function:

ilContainerGUI::cloneNodes (   $srcRef,
  $dstRef,
$mapping,
  $newName = null 
)

Recursively clones all nodes of the RBAC tree.

private

Parameters
integerref_id of source object
integerref_id of destination object
arraymapping new_ref_id => old_ref_id
stringthe new name of the copy (optional).
Returns
The ref_id pointing to the cloned object.

Definition at line 2347 of file class.ilContainerGUI.php.

References ilObjectGUI\$ilias, and ilObjectGUI\$tree.

Referenced by pasteObject().

{
global $tree;
global $ilias;
// clone the source node
$srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
error_log(__METHOD__.' cloning srcRef='.$srcRef.' dstRef='.$dstRef.'...');
$newRef = $srcObj->cloneObject($dstRef)->getRefId();
error_log(__METHOD__.' ...cloning... newRef='.$newRef.'...');
// We must immediately apply a new name to the object, to
// prevent confusion of WebDAV clients about having two objects with identical
// name in the repository.
if (! is_null($newName))
{
$newObj =& $ilias->obj_factory->getInstanceByRefId($newRef);
$newObj->setTitle($newName);
$newObj->update();
unset($newObj);
}
unset($srcObj);
$mapping[$newRef] = $srcRef;
// clone all children of the source node
$children = $tree->getChilds($srcRef);
foreach ($tree->getChilds($srcRef) as $child)
{
// Don't clone role folders, because it does not make sense to clone local roles
// FIXME - Maybe it does make sense (?)
if ($child["type"] != 'rolf')
{
$this->cloneNodes($child["ref_id"],$newRef,$mapping);
}
else
{
if (count($rolf = $tree->getChildsByType($newRef,"rolf")))
{
$mapping[$rolf[0]["ref_id"]] = $child["ref_id"];
}
}
}
error_log(__METHOD__.' ...cloned srcRef='.$srcRef.' dstRef='.$dstRef.' newRef='.$newRef);
return $newRef;
}

+ Here is the caller graph for this function:

ilContainerGUI::cloneWizardPageListObject ( )

public

Parameters

Definition at line 2121 of file class.ilContainerGUI.php.

References cloneWizardPageObject().

{
$this->cloneWizardPageObject(false);
}

+ Here is the call graph for this function:

ilContainerGUI::cloneWizardPageObject (   $a_tree_view = true)

Show clone wizard page for container objects.

public

Definition at line 2132 of file class.ilContainerGUI.php.

References $_SESSION, ilObjectGUI\$tree, ilCopyWizardPageFactory\_getInstanceByType(), ilObjectGUI\createObject(), ilUtil\getImagePath(), ilObjectGUI\searchCloneSourceObject(), and ilUtil\sendInfo().

Referenced by cloneWizardPageListObject(), and cloneWizardPageTreeObject().

{
include_once('Services/CopyWizard/classes/class.ilCopyWizardPageFactory.php');
global $ilObjDataCache,$tree;
if(!$_REQUEST['clone_source'])
{
ilUtil::sendInfo($this->lng->txt('select_one'));
if(isset($_SESSION['wizard_search_title']))
{
}
else
{
$this->createObject();
}
return false;
}
$source_id = $_REQUEST['clone_source'];
$new_type = $_REQUEST['new_type'];
$this->ctrl->setParameter($this,'clone_source',(int) $_REQUEST['clone_source']);
$this->ctrl->setParameter($this,'new_type',$new_type);
// Generell JavaScript
$this->tpl->addJavaScript('./Services/CopyWizard/js/ilContainer.js');
$this->tpl->setVariable('BODY_ATTRIBUTES','onload="ilDisableChilds(\'cmd\');"');
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.container_wizard_page.html');
$this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
$this->tpl->setVariable('TYPE_IMG',ilUtil::getImagePath('icon_'.$new_type.'.gif'));
$this->tpl->setVariable('ALT_IMG',$this->lng->txt('obj_'.$new_type));
$this->tpl->setVariable('TXT_DUPLICATE',$this->lng->txt($new_type.'_wizard_page'));
$this->tpl->setVariable('INFO_DUPLICATE',$this->lng->txt($new_type.'_copy_threads_info'));
$this->tpl->setVariable('BTN_COPY',$this->lng->txt('obj_'.$new_type.'_duplicate'));
$this->tpl->setVariable('BTN_BACK',$this->lng->txt('btn_back'));
if(isset($_SESSION['wizard_search_title']))
{
$this->tpl->setVariable('CMD_BACK','searchCloneSource');
}
else
{
$this->tpl->setVariable('CMD_BACK','create');
}
$this->tpl->setVariable('BTN_TREE',$this->lng->txt('treeview'));
$this->tpl->setVariable('BTN_LIST',$this->lng->txt('flatview'));
// Fill item rows
// tree view
if($a_tree_view)
{
$first = true;
$has_items = false;
foreach($subnodes = $tree->getSubtree($source_node = $tree->getNodeData($source_id),true) as $node)
{
if($first == true)
{
$first = false;
continue;
}
if($node['type'] == 'rolf')
{
continue;
}
$has_items = true;
for($i = $source_node['depth'];$i < $node['depth']; $i++)
{
$this->tpl->touchBlock('padding');
$this->tpl->touchBlock('end_padding');
}
// fill options
$copy_wizard_page = ilCopyWizardPageFactory::_getInstanceByType($source_id,$node['type']);
$copy_wizard_page->fillTreeSelection($node['ref_id'],$node['type'],$node['depth']);
$this->tpl->setCurrentBlock('tree_row');
$this->tpl->setVariable('TREE_IMG',ilUtil::getImagePath('icon_'.$node['type'].'_s.gif'));
$this->tpl->setVariable('TREE_ALT_IMG',$this->lng->txt('obj_'.$node['type']));
$this->tpl->setVariable('TREE_TITLE',$node['title']);
$this->tpl->parseCurrentBlock();
}
if(!$has_items)
{
$this->tpl->setCurrentBlock('no_content');
$this->tpl->setVariable('TXT_NO_CONTENT',$this->lng->txt('container_no_items'));
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setCurrentBlock('tree_footer');
$this->tpl->setVariable('TXT_COPY_ALL',$this->lng->txt('copy_all'));
$this->tpl->setVariable('TXT_LINK_ALL',$this->lng->txt('link_all'));
$this->tpl->setVariable('TXT_OMIT_ALL',$this->lng->txt('omit_all'));
$this->tpl->parseCurrentBlock();
}
}
else
{
foreach($tree->getSubTreeTypes($source_id,array('rolf','crs')) as $type)
{
$copy_wizard_page = ilCopyWizardPageFactory::_getInstanceByType($source_id,$type);
if(strlen($html = $copy_wizard_page->getWizardPageBlockHTML()))
{
$this->tpl->setCurrentBlock('obj_row');
$this->tpl->setVariable('ITEM_BLOCK',$html);
$this->tpl->parseCurrentBlock();
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerGUI::cloneWizardPageTreeObject ( )

public

Parameters

Definition at line 2109 of file class.ilContainerGUI.php.

References cloneWizardPageObject().

{
$this->cloneWizardPageObject(true);
}

+ Here is the call graph for this function:

ilContainerGUI::copyObject ( )

copy object(s) out from a container and write the information to clipboard

public

Definition at line 1895 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$ref_id, ilObjectGUI\getTitlesByRefId(), and ilUtil\sendInfo().

{
global $rbacsystem;
if ($_GET["item_ref_id"] != "")
{
$_POST["id"] = array($_GET["item_ref_id"]);
}
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
// FOR ALL OBJECTS THAT SHOULD BE COPIED
foreach ($_POST["id"] as $ref_id)
{
// GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
$node_data = $this->tree->getNodeData($ref_id);
$subtree_nodes = $this->tree->getSubTree($node_data);
$all_node_data[] = $node_data;
$all_subtree_nodes[] = $subtree_nodes;
// CHECK VIEW, READ AND COPY PERMISSION OF ALL OBJECTS IN ACTUAL SUBTREE
foreach ($subtree_nodes as $node)
{
if($node['type'] == 'rolf')
{
continue;
}
if (!$rbacsystem->checkAccess('visible,read,copy',$node["ref_id"]))
{
$no_copy[] = $node["ref_id"];
}
}
}
// IF THERE IS ANY OBJECT WITH NO PERMISSION TO 'view,read'
if (count($no_copy))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_copy")." ".implode(',',$this->getTitlesByRefId($no_copy)),
$this->ilias->error_obj->MESSAGE);
}
$_SESSION["clipboard"]["parent"] = $_GET["ref_id"];
$_SESSION["clipboard"]["cmd"] = ($_GET["cmd"] != "" && $_GET["cmd"] != "post")
? $_GET["cmd"]
: key($_POST["cmd"]);
$_SESSION["clipboard"]["ref_ids"] = $_POST["id"];
ilUtil::sendInfo($this->lng->txt("msg_copy_clipboard"),true);
$this->ctrl->returnToParent($this);
} // END COPY

+ Here is the call graph for this function:

ilContainerGUI::copyWizardHasOptions (   $a_mode)

public

Parameters

Reimplemented from ilObjectGUI.

Definition at line 2308 of file class.ilContainerGUI.php.

{
switch($a_mode)
{
case self::COPY_WIZARD_NEEDS_PAGE:
return true;
default:
return false;
}
}
ilContainerGUI::cutObject ( )

cut object(s) out from a container and write the information to clipboard

public

Definition at line 1416 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$ref_id, ilObjectGUI\getTitlesByRefId(), and ilUtil\sendInfo().

{
global $rbacsystem;
if ($_GET["item_ref_id"] != "")
{
$_POST["id"] = array($_GET["item_ref_id"]);
}
//$this->ilias->raiseError("move operation does not work at the moment and is disabled",$this->ilias->error_obj->MESSAGE);
//echo "CUT";
//echo $_SESSION["referer"];
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
// FOR ALL OBJECTS THAT SHOULD BE COPIED
foreach ($_POST["id"] as $ref_id)
{
// GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
$node_data = $this->tree->getNodeData($ref_id);
$subtree_nodes = $this->tree->getSubTree($node_data);
$all_node_data[] = $node_data;
$all_subtree_nodes[] = $subtree_nodes;
// CHECK DELETE PERMISSION OF ALL OBJECTS IN ACTUAL SUBTREE
foreach ($subtree_nodes as $node)
{
if($node['type'] == 'rolf')
{
continue;
}
if (!$rbacsystem->checkAccess('delete',$node["ref_id"]))
{
$no_cut[] = $node["ref_id"];
}
}
}
// IF THERE IS ANY OBJECT WITH NO PERMISSION TO 'delete'
if (count($no_cut))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_cut")." ".implode(',',$this->getTitlesByRefId($no_cut)),
$this->ilias->error_obj->MESSAGE);
}
//echo "GET";var_dump($_GET);echo "POST";var_dump($_POST);
$_SESSION["clipboard"]["parent"] = $_GET["ref_id"];
$_SESSION["clipboard"]["cmd"] = ($_GET["cmd"] != "" && $_GET["cmd"] != "post")
? $_GET["cmd"]
: key($_POST["cmd"]);
//echo "-".$clipboard["cmd"]."-";
$_SESSION["clipboard"]["ref_ids"] = $_POST["id"];
//echo "-".$_SESSION["clipboard"]["cmd"]."-";
ilUtil::sendInfo($this->lng->txt("msg_cut_clipboard"),true);
$this->ctrl->returnToParent($this);
} // END CUT

+ Here is the call graph for this function:

ilContainerGUI::disableAdministrationPanelObject ( )

enable administration panel

Definition at line 1308 of file class.ilContainerGUI.php.

References $_SESSION.

{
$_SESSION["il_cont_admin_panel"] = false;
$this->ctrl->redirect($this, "render");
}
ilContainerGUI::editPageContentObject ( )

edit page content (for repository root node and categories)

public

Definition at line 721 of file class.ilContainerGUI.php.

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$obj_id, ilObjectGUI\$tpl, ilRTE\_getRTEClassname(), ilContainer\_lookupContainerSetting(), ilObject\_lookupObjectId(), ilObject\_lookupType(), ilUtil\getImagePath(), and ilUtil\prepareFormOutput().

{
global $rbacsystem, $tpl, $lng, $ilCtrl;
if (!$rbacsystem->checkAccess("write", $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
}
$xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(),
"xhtml_page");
if ($xpage_id > 0)
{
include_once("Services/XHTMLPage/classes/class.ilXHTMLPage.php");
$xpage = new ilXHTMLPage($xpage_id);
$content = $xpage->getContent();
}
// get template
$tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.container_edit_page_content.html",
"Services/Container");
$tpl->setVariable("VAL_CONTENT", ilUtil::prepareFormOutput($content));
$tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$tpl->setVariable("TXT_EDIT_PAGE_CONTENT",
$this->lng->txt("edit_page_content"));
$tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
$tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$tpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_old_editor_warning"));
$tpl->setVariable("TXT_MIGRATION_OPEN_STD_EDITOR", $lng->txt("cntr_old_editor_open_standard_editor"));
$tpl->setVariable("IMG_WARNING", ilUtil::getImagePath("icon_alert_s.gif"));
$tpl->setVariable("HREF_OPEN_STD_EDITOR", $ilCtrl->getLinkTarget($this, "switchToStdEditor"));
$tpl->setVariable("ALT_WARNING", $lng->txt("warning"));
include_once("./Services/Form/classes/class.ilFormPropertyGUI.php");
include_once("./Services/Form/classes/class.ilTextAreaInputGUI.php");
//$ta = new ilTextAreaInputGUI();
//$tags = $ta->getRteTagSet("extended_table_img");
// add rte support
include_once "./Services/RTE/classes/class.ilRTE.php";
$rtestring = ilRTE::_getRTEClassname();
include_once "./Services/RTE/classes/class.$rtestring.php";
$rte = new $rtestring();
//$rte->addPlugin("latex");
include_once "./classes/class.ilObject.php";
$obj_type = ilObject::_lookupType($_GET["ref_id"], TRUE);
$rte->addRTESupport($obj_id, $obj_type);
//$rte->setStyleSelect(true);
//$rte->addCustomRTESupport($obj_id, $obj_type, $tags);
}

+ Here is the call graph for this function:

ilContainerGUI::editPageFrameObject ( )

show page editor frameset

Definition at line 678 of file class.ilContainerGUI.php.

References $_SESSION, ilContainer\_lookupContainerSetting(), and exit.

{
include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
$fs_gui = new ilFramesetGUI();
$fs_gui->setFramesetTitle($this->object->getTitle());
$fs_gui->setMainFrameName("content");
$fs_gui->setSideFrameName("link_list");
// old tiny stuff
$xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(),
"xhtml_page");
if ($xpage_id > 0 && $_SESSION["il_cntr_editor"] != "std")
{
$fs_gui->setMainFrameSource(
$this->ctrl->getLinkTarget(
$this, "editPageContent"));
$fs_gui->setSideFrameSource(
$this->ctrl->getLinkTarget($this, "showLinkList"));
}
else
{
$fs_gui->setMainWidth("100%");
$fs_gui->setSideWidth("0");
// to do: check this
$fs_gui->setSideFrameSource("");
// page object stuff
$fs_gui->setMainFrameSource(
$this->ctrl->getLinkTargetByClass(
array("ilpageobjectgui"), "edit"));
}
$fs_gui->show();
}

+ Here is the call graph for this function:

ilContainerGUI::enableAdministrationPanelObject ( )

enable administration panel

Definition at line 1299 of file class.ilContainerGUI.php.

References $_SESSION.

{
$_SESSION["il_cont_admin_panel"] = true;
$this->ctrl->redirect($this, "render");
}
& ilContainerGUI::executeCommand ( )

execute command note: this method is overwritten in all container objects

Reimplemented from ilObjectGUI.

Reimplemented in ilObjCourseGUI, ilObjiLincCourseGUI, ilObjRecoveryFolderGUI, ilObjRootFolderGUI, ilObjFolderGUI, ilObjCategoryGUI, and ilObjGroupGUI.

Definition at line 68 of file class.ilContainerGUI.php.

References $cmd, $ret, ilObjectGUI\$tpl, forwardToPageObject(), and ilObjectGUI\prepareOutput().

{
global $tpl;
$next_class = $this->ctrl->getNextClass();
$cmd = $this->ctrl->getCmd("render");
switch($next_class)
{
// page editing
case "ilpageobjectgui":
$tpl->setContent($ret);
break;
default:
$this->prepareOutput();
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

& ilContainerGUI::forwardToPageObject ( )

forward command to page object

Definition at line 95 of file class.ilContainerGUI.php.

References $_GET, $ilCtrl, ilObjectGUI\$lng, $ret, ilPageObject\_exists(), ilContainer\_lookupContainerSetting(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), ilPageObjectGUI\setIntLinkHelpDefault(), and ilPageObject\setParentId().

Referenced by ilObjGroupGUI\executeCommand(), ilObjCategoryGUI\executeCommand(), executeCommand(), ilObjFolderGUI\executeCommand(), ilObjRootFolderGUI\executeCommand(), and ilObjCourseGUI\executeCommand().

{
global $lng, $ilTabs, $ilCtrl;
$ilTabs->clearTargets();
$xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(),
"xhtml_page");
if ($xpage_id > 0)
{
$ilTabs->setBackTarget($lng->txt("cntr_back_to_old_editor"),
$ilCtrl->getLinkTarget($this, "switchToOldEditor"), "_top");
}
else
{
$ilTabs->setBackTarget($lng->txt("back"), "./goto.php?target=".$this->object->getType()."_".
$this->object->getRefId(), "_top");
}
// page object
include_once("./Services/COPage/classes/class.ilPageObject.php");
include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
$lng->loadLanguageModule("content");
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
if (!ilPageObject::_exists($this->object->getType(),
$this->object->getId()))
{
// doesn't exist -> create new one
$new_page_object = new ilPageObject($this->object->getType());
$new_page_object->setParentId($this->object->getId());
$new_page_object->setId($this->object->getId());
$new_page_object->createFromXML();
}
// get page object
// $page_object = new ilPageObject($this->object->getType(),
// $this->object->getId(), 0, true);
$this->ctrl->setReturnByClass("ilpageobjectgui", "edit");
//$page_object =& $this->obj->getPageObject();
// $page_object->buildDom();
//$page_object->addUpdateListener($this, "updateHistory");
// $int_links = $page_object->getInternalLinks();
//$link_xml = $this->getLinkXML($int_links);
$page_gui =& new ilPageObjectGUI($this->object->getType(),
$this->object->getId());
// $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
//$page_gui->setViewPageLink(ILIAS_HTTP_PATH."/goto.php?target=pg_".$this->obj->getId(),
// $view_frame);
$page_gui->setIntLinkHelpDefault("StructureObject", $_GET["ref_id"]);
$page_gui->setTemplateTargetVar("ADM_CONTENT");
$page_gui->setLinkXML($link_xml);
//$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen"));
//$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
$page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, ""));
$page_gui->setPresentationTitle("");
$page_gui->setTemplateOutput(false);
//$page_gui->setLocator($contObjLocator);
$page_gui->setHeader("");
$page_gui->setEnabledRepositoryObjects(true);
$page_gui->setEnabledFileLists(false);
$page_gui->setEnabledMaps(true);
$page_gui->setEnabledPCTabs(true);
// old editor information text
$xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(),
"xhtml_page");
if ($xpage_id > 0)
{
$wtpl = new ilTemplate("tpl.cntr_old_editor_message.html", true,
true, "Services/Container");
$wtpl->setVariable("ALT_WARNING", $lng->txt("warning"));
$wtpl->setVariable("IMG_WARNING",
ilUtil::getImagePath("icon_alert_s.gif"));
$wtpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_switch_to_new_editor_message"));
$wtpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_switch_to_new_editor_message"));
$wtpl->setVariable("HREF_SWITCH_TO_NEW_EDITOR",
$ilCtrl->getLinkTarget($this, "useNewEditor"));
$wtpl->setVariable("TXT_MIGRATION_SWITCH",
$lng->txt("cntr_switch_to_new_editor_cmd"));
$page_gui->setPrependingHtml($wtpl->get());
}
$ret =& $this->ctrl->forwardCommand($page_gui);
//$ret =& $page_gui->executeCommand();
return $ret;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerGUI::getActions ( )

Get Actions.

Reimplemented from ilObjectGUI.

Reimplemented in ilObjRootFolderGUI, and ilObjRecoveryFolderGUI.

Definition at line 1372 of file class.ilContainerGUI.php.

{
// standard actions for container
return array(
"cut" => array("name" => "cut", "lng" => "cut"),
"delete" => array("name" => "delete", "lng" => "delete"),
"link" => array("name" => "link", "lng" => "link"),
"paste" => array("name" => "paste", "lng" => "paste"),
"clear" => array("name" => "clear", "lng" => "clear")
);
}
ilContainerGUI::getContainerPageHTML ( )

Get container page HTML.

Definition at line 195 of file class.ilContainerGUI.php.

References $_GET, $ilSetting, $ret, ilPageObject\_exists(), ilContainer\_lookupContainerSetting(), ilObjStyleSheet\getContentStylePath(), and ilPageObjectGUI\setIntLinkHelpDefault().

Referenced by renderItemList().

{
global $ilSetting;
if (!$ilSetting->get("enable_cat_page_edit"))
{
return;
}
// old page editor content
$xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(),
"xhtml_page");
if ($xpage_id > 0)
{
include_once("Services/XHTMLPage/classes/class.ilXHTMLPage.php");
$xpage = new ilXHTMLPage($xpage_id);
return $xpage->getContent();
}
// page object
include_once("./Services/COPage/classes/class.ilPageObject.php");
include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
// if page does not exist, return nothing
if (!ilPageObject::_exists($this->object->getType(),
$this->object->getId()))
{
return "";
}
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
// get page object
$page_gui =& new ilPageObjectGUI($this->object->getType(),
$this->object->getId());
$page_gui->setIntLinkHelpDefault("StructureObject", $_GET["ref_id"]);
//$page_gui->setTemplateTargetVar("ADM_CONTENT");
$page_gui->setLinkXML($link_xml);
$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
//$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen"));
//$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
$page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, ""));
$page_gui->setPresentationTitle("");
$page_gui->setTemplateOutput(false);
//$page_gui->setLocator($contObjLocator);
$page_gui->setHeader("");
$page_gui->setEnabledRepositoryObjects(true);
$page_gui->setEnabledFileLists(false);
$page_gui->setEnabledPCTabs(true);
$page_gui->setEnabledMaps(true);
$ret = $page_gui->showPage();
//$ret =& $page_gui->executeCommand();
return $ret;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerGUI::getTabs ( $tabs_gui)

common tabs for all container objects (should be called at the end of child getTabs() method

Reimplemented from ilObjectGUI.

Reimplemented in ilObjCourseGUI, ilObjGroupGUI, ilObjFolderGUI, ilObjiLincCourseGUI, ilObjCategoryGUI, and ilObjRootFolderGUI.

Definition at line 1271 of file class.ilContainerGUI.php.

References $_SESSION.

{
global $rbacsystem;
// edit permissions
if ($rbacsystem->checkAccess('edit_permission',$this->ref_id))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
// show clipboard
if ($this->ctrl->getTargetScript() == "repository.php" and !empty($_SESSION["clipboard"]))
{
$tabs_gui->addTarget("clipboard",
$this->ctrl->getLinkTarget($this, "clipboard"), "clipboard", get_class($this));
}
}
ilContainerGUI::ilContainerGUI (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Constructor public.

Definition at line 46 of file class.ilContainerGUI.php.

References ilObjectGUI\$lng, ilObjectGUI\$tree, and ilObjectGUI\ilObjectGUI().

Referenced by ilObjGroupGUI\__construct(), ilObjCategoryGUI\ilObjCategoryGUI(), ilObjCourseGUI\ilObjCourseGUI(), ilObjiLincCourseGUI\ilObjiLincCourseGUI(), and ilObjRootFolderGUI\ilObjRootFolderGUI().

{
global $rbacsystem, $lng, $tree;
$this->rbacsystem =& $rbacsystem;
$lng->loadLanguageModule("cntr");
//$this->ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
// Activate tree cache when rendering the container to improve performance
//$tree->useCache(false);
// prepare output things should generally be made in executeCommand
// method (maybe dependent on current class/command
$this->ilObjectGUI($a_data, $a_id, $a_call_by_reference, false);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilContainerGUI::isActiveAdministrationPanel ( )

Reimplemented in ilObjiLincCourseGUI.

Definition at line 2047 of file class.ilContainerGUI.php.

References $_SESSION.

Referenced by addStandardRow(), renderItemList(), setColumnSettings(), setPageEditorTabs(), and showAdministrationPanel().

{
return $_SESSION["il_cont_admin_panel"];
}

+ Here is the caller graph for this function:

ilContainerGUI::linkObject ( )

create an new reference of an object in tree it's like a hard link of unix

public

Definition at line 1486 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$object, ilObjectGUI\$ref_id, and ilUtil\sendInfo().

{
global $clipboard, $rbacsystem, $rbacadmin;
if ($_GET["item_ref_id"] != "")
{
$_POST["id"] = array($_GET["item_ref_id"]);
}
if (!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
// CHECK ACCESS
foreach ($_POST["id"] as $ref_id)
{
if (!$rbacsystem->checkAccess('delete',$ref_id))
{
$no_cut[] = $ref_id;
}
$object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
if (!$this->objDefinition->allowLink($object->getType()))
{
$no_link[] = $object->getType();
}
}
// NO ACCESS
if (count($no_cut))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_link")." ".
implode(',',$no_cut),$this->ilias->error_obj->MESSAGE);
}
if (count($no_link))
{
$no_link = array_unique($no_link);
foreach ($no_link as $type)
{
$txt_objs[] = $this->lng->txt("objs_".$type);
}
$this->ilias->raiseError(implode(', ',$txt_objs)." ".$this->lng->txt("msg_obj_no_link"),$this->ilias->error_obj->MESSAGE);
//$this->ilias->raiseError($this->lng->txt("msg_not_possible_link")." ".
// implode(',',$no_link),$this->ilias->error_obj->MESSAGE);
}
// WRITE TO CLIPBOARD
$clipboard["parent"] = $_GET["ref_id"];
$clipboard["cmd"] = ($_GET["cmd"] != "" && $_GET["cmd"] != "post")
? $_GET["cmd"]
: key($_POST["cmd"]);
foreach ($_POST["id"] as $ref_id)
{
$clipboard["ref_ids"][] = $ref_id;
}
$_SESSION["clipboard"] = $clipboard;
ilUtil::sendInfo($this->lng->txt("msg_link_clipboard"),true);
$this->ctrl->returnToParent($this);
} // END LINK

+ Here is the call graph for this function:

ilContainerGUI::lockObject ( )

Definition at line 1337 of file class.ilContainerGUI.php.

References $_GET, $result, ilObjectGUI\$tree, ilDAVServer\_isActionsVisible(), ilDAVServer\_isActive(), renderObject(), and ilUtil\sendInfo().

{
global $tree, $ilUser, $rbacsystem;
if (!$rbacsystem->checkAccess("write",$_GET['item_ref_id']))
{
$this->ilErr->raiseError($this->lng->txt('err_no_permission'),$this->ilErr->MESSAGE);
}
require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
{
require_once 'Services/WebDAV/classes/class.ilDAVLocks.php';
$locks = new ilDAVLocks();
$result = $locks->lockRef($_GET['item_ref_id'],
$ilUser->getId(), $ilUser->getLogin(),
'ref_'.$_GET['item_ref_id'].'_usr_'.$ilUser->getId(),
time() + /*30*24*60**/60, 0, 'exclusive'
);
$this->lng->txt(
($result === true) ? 'object_locked' : $result
),
true);
}
$this->renderObject();
}

+ Here is the call graph for this function:

ilContainerGUI::modifyItemGUI ( $a_item_list_gui,
  $a_item_data,
  $a_show_path 
)

Modify Item ListGUI for presentation in container.

Definition at line 2397 of file class.ilContainerGUI.php.

References ilObjectGUI\$lng.

{
global $lng;
if($a_show_path)
{
$a_item_list_gui->addCustomProperty($lng->txt('path'),
ilContainer_buildPath($a_item_data['ref_id'], $this->object->getRefId()),
false, true);
}
}
& ilContainerGUI::newBlockTemplate ( )

determin admin commands

returns a new list block template

private

Returns
object block template

Definition at line 1104 of file class.ilContainerGUI.php.

References ilObjectGUI\$tpl.

Referenced by renderItemList().

{
$tpl = new ilTemplate ("tpl.container_list_block.html", true, true,
"Services/Container");
$this->cur_row_type = "row_type_1";
return $tpl;
}

+ Here is the caller graph for this function:

ilContainerGUI::pasteObject ( )

paste object from clipboard to current place Depending on the chosen command the object(s) are linked, copied or moved

public

Definition at line 1585 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, ilObjectGUI\$lng, $log, ilObjectGUI\$ref_id, ilObjectGUI\$tree, ilConditionHandler\_adjustMovedObjectConditions(), ilObjFileAccess\_appendNumberOfCopyToFilename(), ilChangeEvent\_catchupWriteEvents(), ilChangeEvent\_isActive(), ilChangeEvent\_recordReadEvent(), ilChangeEvent\_recordWriteEvent(), clearObject(), cloneNodes(), and ilUtil\sendInfo().

{
global $rbacsystem, $rbacadmin, $rbacreview, $log,$tree;
global $ilUser, $lng;
// BEGIN ChangeEvent: Record paste event.
require_once('Services/Tracking/classes/class.ilChangeEvent.php');
// END ChangeEvent: Record paste event.
//var_dump($_SESSION["clipboard"]);exit;
if (!in_array($_SESSION["clipboard"]["cmd"],array("cut","link","copy")))
{
$message = get_class($this)."::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
}
// this loop does all checks
foreach ($_SESSION["clipboard"]["ref_ids"] as $ref_id)
{
$obj_data =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
// CHECK ACCESS
if (!$rbacsystem->checkAccess('create',$this->object->getRefId(), $obj_data->getType()))
{
$no_paste[] = $ref_id;
$no_paste_titles[] = $obj_data->getTitle();
}
// CHECK IF REFERENCE ALREADY EXISTS
if ($this->object->getRefId() == $this->tree->getParentId($obj_data->getRefId()))
{
$exists[] = $ref_id;
break;
}
// CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
if ($this->tree->isGrandChild($ref_id,$this->object->getRefId()))
{
$is_child[] = $ref_id;
}
// CHECK IF OBJECT IS ALLOWED TO CONTAIN PASTED OBJECT AS SUBOBJECT
$obj_type = $obj_data->getType();
if (!in_array($obj_type, array_keys($this->objDefinition->getSubObjects($this->object->getType()))))
{
$not_allowed_subobject[] = $obj_data->getType();
}
}
// process checking results
// BEGIN WebDAV: Copying an object into the same container is allowed
if (count($exists) && $_SESSION["clipboard"]["cmd"] != "copy")
// END WebDAV: Copying an object into the same container is allowed
{
$this->ilias->raiseError($this->lng->txt("msg_obj_exists"),$this->ilias->error_obj->MESSAGE);
}
if (count($is_child))
{
$this->ilias->raiseError($this->lng->txt("msg_not_in_itself")." ".implode(',',$is_child),
$this->ilias->error_obj->MESSAGE);
}
if (count($not_allowed_subobject))
{
$this->ilias->raiseError($this->lng->txt("msg_may_not_contain")." ".implode(',',$not_allowed_subobject),
$this->ilias->error_obj->MESSAGE);
}
if (count($no_paste))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_paste")." ".
implode(',',$no_paste),$this->ilias->error_obj->MESSAGE);
}
// log pasteObject call
$log->write("ilObjectGUI::pasteObject(), cmd: ".$_SESSION["clipboard"]["cmd"]);
// everything ok: now paste the objects to new location
// to prevent multiple actions via back/reload button
$ref_ids = $_SESSION["clipboard"]["ref_ids"];
unset($_SESSION["clipboard"]["ref_ids"]);
// BEGIN WebDAV: Support a copy command in the repository
// process COPY command
if ($_SESSION["clipboard"]["cmd"] == "copy")
{
foreach($ref_ids as $ref_id)
{
$revIdMapping = array();
$oldNode_data = $tree->getNodeData($ref_id);
if ($oldNode_data['parent'] == $this->object->getRefId())
{
require_once 'Modules/File/classes/class.ilObjFileAccess.php';
$newTitle = ilObjFileAccess::_appendNumberOfCopyToFilename($oldNode_data['title'],null);
$newRef = $this->cloneNodes($ref_id, $this->object->getRefId(), $refIdMapping, $newTitle);
}
else
{
$newRef = $this->cloneNodes($ref_id, $this->object->getRefId(), $refIdMapping, null);
}
// BEGIN ChangeEvent: Record copy event.
{
$old_parent_data = $tree->getParentNodeData($ref_id);
$newNode_data = $tree->getNodeData($newRef);
ilChangeEvent::_recordReadEvent($oldNode_data['obj_id'], $ilUser->getId());
ilChangeEvent::_recordWriteEvent($newNode_data['obj_id'], $ilUser->getId(), 'add',
$this->object->getId());
ilChangeEvent::_catchupWriteEvents($newNode_data['obj_id'], $ilUser->getId());
}
// END ChangeEvent: Record copy event.
}
$log->write("ilObjectGUI::pasteObject(), copy finished");
}
// END WebDAV: Support a Copy command in the repository
// process CUT command
if ($_SESSION["clipboard"]["cmd"] == "cut")
{
foreach($ref_ids as $ref_id)
{
// Store old parent
$old_parent = $tree->getParentId($ref_id);
$this->tree->moveTree($ref_id,$this->object->getRefId());
$rbacadmin->adjustMovedObjectPermissions($ref_id,$old_parent);
include_once('classes/class.ilConditionHandler.php');
// BEGIN ChangeEvent: Record cut event.
{
$node_data = $tree->getNodeData($ref_id);
$old_parent_data = $tree->getNodeData($old_parent);
ilChangeEvent::_recordWriteEvent($node_data['obj_id'], $ilUser->getId(), 'remove',
$old_parent_data['obj_id']);
ilChangeEvent::_recordWriteEvent($node_data['obj_id'], $ilUser->getId(), 'add',
$this->object->getId());
ilChangeEvent::_catchupWriteEvents($node_data['obj_id'], $ilUser->getId());
}
// END PATCH ChangeEvent: Record cut event.
}
} // END CUT
// process LINK command
if ($_SESSION["clipboard"]["cmd"] == "link")
{
foreach ($ref_ids as $ref_id)
{
// get node data
$top_node = $this->tree->getNodeData($ref_id);
// get subnodes of top nodes
$subnodes[$ref_id] = $this->tree->getSubtree($top_node);
}
// now move all subtrees to new location
foreach ($subnodes as $key => $subnode)
{
// first paste top_node....
$obj_data =& $this->ilias->obj_factory->getInstanceByRefId($key);
$new_ref_id = $obj_data->createReference();
$obj_data->putInTree($_GET["ref_id"]);
$obj_data->setPermissions($_GET["ref_id"]);
// ... remove top_node from list ...
array_shift($subnode);
// ... store mapping of old ref_id => new_ref_id in hash array ...
$mapping[$new_ref_id] = $key;
// save old ref_id & create rolefolder if applicable
$old_ref_id = $obj_data->getRefId();
$obj_data->setRefId($new_ref_id);
$obj_data->initDefaultRoles();
$rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());
if (isset($rolf_data["child"]))
{
// a role folder was created, so map it to old role folder
$rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);
// ... use mapping array to find out the correct new parent node where to put in the node...
//$new_parent = array_search($node["parent"],$mapping);
// ... append node to mapping for further possible subnodes ...
$mapping[$rolf_data["child"]] = (int) $rolf_data_old["child"];
// log creation of role folder
$log->write("ilObjectGUI::pasteObject(), created role folder (ref_id): ".$rolf_data["child"].
", for object ref_id:".$obj_data->getRefId().", obj_id: ".$obj_data->getId().
", type: ".$obj_data->getType().", title: ".$obj_data->getTitle());
}
// BEGIN ChangeEvent: Record link event.
{
$node_data = $tree->getNodeData($new_ref_id);
ilChangeEvent::_recordWriteEvent($node_data['obj_id'], $ilUser->getId(), 'add',
$this->object->getId());
ilChangeEvent::_catchupWriteEvents($node_data['obj_id'], $ilUser->getId());
}
// END PATCH ChangeEvent: Record link event.
// ... insert subtree of top_node if any subnodes exist ...
if (count($subnode) > 0)
{
foreach ($subnode as $node)
{
if ($node["type"] != 'rolf')
{
$obj_data =& $this->ilias->obj_factory->getInstanceByRefId($node["child"]);
$new_ref_id = $obj_data->createReference();
// ... use mapping array to find out the correct new parent node where to put in the node...
$new_parent = array_search($node["parent"],$mapping);
// ... append node to mapping for further possible subnodes ...
$mapping[$new_ref_id] = (int) $node["child"];
$obj_data->putInTree($new_parent);
$obj_data->setPermissions($new_parent);
// save old ref_id & create rolefolder if applicable
$old_ref_id = $obj_data->getRefId();
$obj_data->setRefId($new_ref_id);
$obj_data->initDefaultRoles();
$rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());
if (isset($rolf_data["child"]))
{
// a role folder was created, so map it to old role folder
$rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);
// ... use mapping array to find out the correct new parent node where to put in the node...
//$new_parent = array_search($node["parent"],$mapping);
// ... append node to mapping for further possible subnodes ...
$mapping[$rolf_data["child"]] = (int) $rolf_data_old["child"];
// log creation of role folder
$log->write("ilObjectGUI::pasteObject(), created role folder (ref_id): ".$rolf_data["child"].
", for object ref_id:".$obj_data->getRefId().", obj_id: ".$obj_data->getId().
", type: ".$obj_data->getType().", title: ".$obj_data->getTitle());
}
}
// re-map $subnodes
foreach ($subnodes as $old_ref => $subnode)
{
$new_ref = array_search($old_ref,$mapping);
foreach ($subnode as $node)
{
$node["child"] = array_search($node["child"],$mapping);
$node["parent"] = array_search($node["parent"],$mapping);
$new_subnodes[$ref_id][] = $node;
}
}
}
}
}
$log->write("ilObjectGUI::pasteObject(), link finished");
// inform other objects in hierarchy about link operation
//$this->object->notify("link",$this->object->getRefId(),$_SESSION["clipboard"]["parent_non_rbac_id"],$this->object->getRefId(),$subnodes);
} // END LINK
// save cmd for correct message output after clearing the clipboard
$last_cmd = $_SESSION["clipboard"]["cmd"];
// clear clipboard
$this->clearObject();
if ($last_cmd == "cut")
{
ilUtil::sendInfo($this->lng->txt("msg_cut_copied"),true);
}
// BEGIN WebDAV: Support a copy command in repository
else if ($last_cmd == "copy")
{
ilUtil::sendInfo($this->lng->txt("msg_cloned"),true);
}
else if ($last_command == 'link')
// END WebDAV: Support copy command in repository
{
ilUtil::sendInfo($this->lng->txt("msg_linked"),true);
}
$this->ctrl->returnToParent($this);
} // END PASTE

+ Here is the call graph for this function:

ilContainerGUI::prepareOutput (   $a_show_subobjects = true)

prepare output

Definition at line 259 of file class.ilContainerGUI.php.

References ilObjectGUI\getCreationMode(), and showTreeFlatIcon().

{
if (parent::prepareOutput()) // return false in admin mode
{
if ($this->getCreationMode() != true && $a_show_subobjects)
{
// This method is called directly from ilContainerGUI::renderObject
#$this->showPossibleSubObjects();
$this->showTreeFlatIcon();
}
}
}

+ Here is the call graph for this function:

ilContainerGUI::removeFromDeskObject ( )

unsubscribe item

Definition at line 1388 of file class.ilContainerGUI.php.

References $_GET, ilObject\_lookupType(), and renderObject().

{
if ($_GET["item_ref_id"] and $_GET["type"])
{
$this->ilias->account->dropDesktopItem($_GET["item_ref_id"], $_GET["type"]);
}
else
{
if ($_POST["items"])
{
foreach ($_POST["items"] as $item)
{
$type = ilObject::_lookupType($item, true);
$this->ilias->account->dropDesktopItem($item, $type);
unset($tmp_obj);
}
}
}
$this->renderObject();
}

+ Here is the call graph for this function:

ilContainerGUI::renderItemList (   $a_type = "all")

Definition at line 822 of file class.ilContainerGUI.php.

References $ilBench, $ilSetting, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, ilObjectListGUIFactory\_getListGUIByType(), addHeaderRow(), addMessageRow(), addSeparatorRow(), addStandardRow(), clearAdminCommandsDetermination(), getContainerPageHTML(), isActiveAdministrationPanel(), newBlockTemplate(), and resetRowType().

{
include_once("classes/class.ilObjectListGUIFactory.php");
$output_html = "";
$type_grps = $this->object->getGroupedObjTypes();
switch ($a_type)
{
// render all items list
case "all":
// new behaviour
$output_html.= $this->getContainerPageHTML();
// all item types
/*
$type_ordering = array(
"cat", "fold", "crs","rcrs", "icrs", "icla", "grp", "chat", "frm", "lres",
"glo", "webr", "mcst", "wiki", "file", "exc",
"tst", "svy", "mep", "qpl", "spl");*/
$cur_obj_type = "";
$overall_tpl =& $this->newBlockTemplate();
$this->type_template = array();
$first = true;
// iterate all types
foreach ($type_grps as $type => $v)
{
// set template (overall or type specific)
if (is_int(strpos($output_html, "[list-".$type."]")))
{
$tpl =& $this->newBlockTemplate();
$overall = false; // individual
}
else
{
$tpl =& $overall_tpl;
$overall = true; // put to the rest
}
if (is_array($this->items[$type]))
{
$item_html = array();
foreach($this->items[$type] as $key => $item)
{
// get list gui class for each object type
if ($cur_obj_type != $item["type"])
{
$item_list_gui =& ilObjectListGUIFactory::_getListGUIByType($item["type"]);
$item_list_gui->setContainerObject($this);
}
// render item row
$ilBench->start("ilContainerGUI", "0210_getListHTML");
// show administration command buttons (or not)
{
$item_list_gui->enableDelete(false);
$item_list_gui->enableLink(false);
$item_list_gui->enableCut(false);
}
$html = $item_list_gui->getListItemHTML($item["ref_id"],
$item["obj_id"], $item["title"], $item["description"]);
// check whether any admin command is allowed for
// the items
$this->determineAdminCommands($item["ref_id"],
$item_list_gui->adminCommandsIncluded());
$ilBench->stop("ilContainerGUI", "0210_getListHTML");
if ($html != "")
{
// BEGIN WebDAV: Use $item_list_gui to determine icon image type
$item_html[] = array(
"html" => $html,
"item_ref_id" => $item["ref_id"],
"item_obj_id" => $item["obj_id"],
'item_icon_image_type' => (method_exists($item_list_gui, 'getIconImageType')) ?
$item_list_gui->getIconImageType() :
$item['type']
);
// END WebDAV: Use $item_list_gui to determine icon image type
}
}
// output block for resource type
if (count($item_html) > 0)
{
// separator row
if (!$first && $overall)
{
}
if ($overall)
{
$first = false;
}
// add a header for each resource type
if ($this->ilias->getSetting("icon_position_in_lists") == "item_rows")
{
$this->addHeaderRow($tpl, $type, false);
}
else
{
$this->addHeaderRow($tpl, $type);
}
$this->resetRowType();
// content row
$this->current_position = 1;
foreach($item_html as $item)
{
// BEGIN WebDAV: Use $item_list_gui to determine image type
$this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"], $item['item_icon_image_type']);
// END WebDAV: Use $item_list_gui to determine image type
}
// store type specific templates in array
if (is_int(strpos($output_html, "[list-".$type."]")))
{
$this->type_template[$type] = $tpl;
}
}
else
{
// [list-...] tag available, but no item of type accessible
if (!$overall)
{
$this->addHeaderRow($tpl, $type);
$this->resetRowType();
$this->lng->txt("msg_no_type_accessible"), $type);
$this->type_template[$type] = $tpl;
}
}
}
else
{
// [list-...] tag available, but no item of type exists
if (!$overall)
{
$this->addHeaderRow($tpl, $type);
$this->resetRowType();
$this->lng->txt("msg_no_type_available"), $type);
$this->type_template[$type] = $tpl;
}
}
}
// I don't know why but executing this
// line before the following foreach loop seems to be crucial
if ($output_html != "")
{
//$output_html.= "<br /><br />";
}
$output_html.= $overall_tpl->get();
//$output_html = str_replace("<br>++", "++", $output_html);
//$output_html = str_replace("<br>++", "++", $output_html);
//$output_html = str_replace("++<br>", "++", $output_html);
//$output_html = str_replace("++<br>", "++", $output_html);
foreach ($this->type_template as $type => $tpl)
{
$output_html = eregi_replace("\[list-".$type."\]",
"</p>".$tpl->get()."<p class=\"ilc_Standard\">",
$output_html);
}
//if (ilPageObject::_exists($this->object->getType(),
// $this->object->getId()))
if ($xpage_id > 0)
{
$page_block = new ilTemplate("tpl.container_page_block.html", false, false,
"Services/Container");
$page_block->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
$output_html = $page_block->get();
}
break;
default:
// to do:
break;
}
return $output_html;
}

+ Here is the call graph for this function:

ilContainerGUI::renderObject ( )

render the object

Reimplemented in ilObjCourseGUI.

Definition at line 389 of file class.ilContainerGUI.php.

References ilObjectGUI\$tpl, IL_CRS_VIEW_TIMING, ilContainer\VIEW_BY_TYPE, ilContainer\VIEW_ILINC, ilContainer\VIEW_OBJECTIVE, ilContainer\VIEW_SESSIONS, and ilContainer\VIEW_SIMPLE.

Referenced by addToDeskObject(), ilObjGroupGUI\executeCommand(), ilObjCategoryGUI\executeCommand(), lockObject(), removeFromDeskObject(), ilObjFolderGUI\viewObject(), ilObjGroupGUI\viewObject(), and ilObjiLincCourseGUI\viewObject().

{
global $ilDB, $tpl;
switch ($this->object->getViewMode())
{
// all items in one block
include_once("./Services/Container/classes/class.ilContainerSimpleContentGUI.php");
$container_view = new ilContainerSimpleContentGUI($this);
break;
include_once('./Services/Container/classes/class.ilContainerObjectiveGUI.php');
$container_view = new ilContainerObjectiveGUI($this);
break;
// all items in one block
case IL_CRS_VIEW_TIMING: // not nice this workaround
include_once("./Services/Container/classes/class.ilContainerSessionsContentGUI.php");
$container_view = new ilContainerSessionsContentGUI($this);
break;
// ILinc courses
include_once 'Services/Container/classes/class.ilContainerILincContentGUI.php';
$container_view = new ilContainerILincContentGUI($this);
break;
// all items in one block
default:
include_once("./Services/Container/classes/class.ilContainerByTypeContentGUI.php");
$container_view = new ilContainerByTypeContentGUI($this);
break;
}
$container_view->setOutput();
// 'add object'
//$this->showPossibleSubObjects();
/* Old implementation
// BEGIN ChangeEvent: record read event.
require_once('Services/Tracking/classes/class.ilChangeEvent.php');
if (ilChangeEvent::_isActive())
{
if ($this->object != null)
{
global $ilUser;
ilChangeEvent::_recordReadEvent($this->object->getId(), $ilUser->getId());
}
}
// END ChangeEvent: record read event.
$this->getCenterColumnHTML(true);
if ($this->type == 'cat' || $this->type == 'grp')
{
$this->tpl->setRightContent($this->getRightColumnHTML());
}
*/
}

+ Here is the caller graph for this function:

ilContainerGUI::resetRowType ( )

Definition at line 1230 of file class.ilContainerGUI.php.

Referenced by renderItemList().

{
$this->cur_row_type = "";
}

+ Here is the caller graph for this function:

ilContainerGUI::savePageContentObject ( )

Definition at line 773 of file class.ilContainerGUI.php.

References ilRTE\_cleanupMediaObjectUsage(), ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), ilContainer\_lookupContainerSetting(), ilContainer\_writeContainerSetting(), ilUtil\sendInfo(), and ilUtil\stripSlashes().

{
include_once("Services/XHTMLPage/classes/class.ilXHTMLPage.php");
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(),
"xhtml_page");
/*include_once("./Services/Form/classes/class.ilFormPropertyGUI.php");
include_once("./Services/Form/classes/class.ilTextAreaInputGUI.php");
$ta = new ilTextAreaInputGUI();
$ta->setRteTagSet("extended_table_img");
$tags = $ta->getRteTagString();*/
//$text = ilUtil::stripSlashes($_POST["page_content"],
// true,
// $tags);
$text = ilUtil::stripSlashes($_POST["page_content"],
true,
if ($xpage_id > 0)
{
$xpage = new ilXHTMLPage($xpage_id);
$xpage->setContent($text);
$xpage->save();
}
else
{
$xpage = new ilXHTMLPage();
$xpage->setContent($text);
$xpage->save();
ilContainer::_writeContainerSetting($this->object->getId(),
"xhtml_page", $xpage->getId());
}
include_once("Services/RTE/classes/class.ilRTE.php");
ilRTE::_cleanupMediaObjectUsage($text, $this->object->getType().":html",
$this->object->getId());
ilUtil::sendInfo($this->lng->txt("msg_obj_modified"), true);
$this->ctrl->redirect($this, "");
}

+ Here is the call graph for this function:

ilContainerGUI::saveSortingObject ( )

Save Sorting.

public

Parameters

Definition at line 2327 of file class.ilContainerGUI.php.

References ilContainerSorting\_getInstance(), and ilUtil\sendInfo().

{
include_once('Services/Container/classes/class.ilContainerSorting.php');
$sorting = ilContainerSorting::_getInstance($this->object->getId());
$sorting->savePost($_POST['position']);
ilUtil::sendInfo($this->lng->txt('sorting_saved',true));
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilContainerGUI::setColumnSettings (   $column_gui)

May be overwritten in subclasses.

Reimplemented from ilObjectGUI.

Definition at line 2055 of file class.ilContainerGUI.php.

References allowBlocksMoving(), and isActiveAdministrationPanel().

{
global $ilAccess;
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
{
$column_gui->setEnableMovement(true);
}
$column_gui->setRepositoryItems(
$this->object->getSubItems($this->isActiveAdministrationPanel(), true));
//if ($ilAccess->checkAccess("write", "", $this->object->getRefId())
// && $this->allowBlocksConfigure())
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$column_gui->setBlockProperty("news", "settings", true);
//$column_gui->setBlockProperty("news", "public_notifications_option", true);
$column_gui->setBlockProperty("news", "default_visibility_option", true);
$column_gui->setBlockProperty("news", "hide_news_block_option", true);
}
{
$column_gui->setAdminCommands(true);
}
}

+ Here is the call graph for this function:

ilContainerGUI::setPageEditorTabs ( )

Definition at line 1241 of file class.ilContainerGUI.php.

References ilObjectGUI\$lng, ilFrameTargetInfo\_getFrame(), and isActiveAdministrationPanel().

{
global $lng;
|| strtolower($this->ctrl->getCmdClass()) != "ilpageobjectgui")
{
return;
}
$lng->loadLanguageModule("content");
//$tabs_gui = new ilTabsGUI();
//$tabs_gui->setSubTabs();
// back to upper context
$this->tabs_gui->setBackTarget($this->lng->txt("obj_cat"),
$this->ctrl->getLinkTarget($this, "frameset"),
$this->tabs_gui->addTarget("edit", $this->ctrl->getLinkTargetByClass("ilpageobjectgui", "view")
, array("", "view"), "ilpageobjectgui");
//$this->tpl->setTabs($tabs_gui->getHTML());
}

+ Here is the call graph for this function:

ilContainerGUI::setTitleAndDescription ( )

called by prepare output

Reimplemented from ilObjectGUI.

Reimplemented in ilObjRootFolderGUI.

Definition at line 292 of file class.ilContainerGUI.php.

References ilObjectGUI\$ilias, ilContainer\_lookupContainerSetting(), ilContainer\_lookupIconPath(), and ilUtil\getImagePath().

{
global $ilias;
if (!ilContainer::_lookupContainerSetting($this->object->getId(), "hide_header_icon_and_title"))
{
$this->tpl->setTitle($this->object->getTitle());
$this->tpl->setDescription($this->object->getLongDescription());
// set tile icon
$icon = ilUtil::getImagePath("icon_".$this->object->getType()."_b.gif");
if ($ilias->getSetting("custom_icons") &&
in_array($this->object->getType(), array("cat","grp","crs", "root")))
{
require_once("./Services/Container/classes/class.ilContainer.php");
if (($path = ilContainer::_lookupIconPath($this->object->getId(), "big")) != "")
{
$icon = $path;
}
}
$this->tpl->setTitleIcon($icon, $this->lng->txt("obj_".$this->object->getType()));
}
}

+ Here is the call graph for this function:

ilContainerGUI::showAdministrationPanel ( $tpl)

get container content (list of subitems) (this should include multiple lists in the future that together build the blocks of a container page)

show administration panel

Definition at line 518 of file class.ilContainerGUI.php.

References $_SESSION, $GLOBALS, $ilSetting, ilFrameTargetInfo\_getFrame(), isActiveAdministrationPanel(), and ilContainer\SORT_MANUAL.

{
global $ilAccess, $ilSetting;
global $ilUser;
{
$GLOBALS["tpl"]->setAdminViewButton(
$this->ctrl->getLinkTarget($this, "disableAdministrationPanel"),
$this->lng->txt("basic_commands"));
// administration panel
if ($ilAccess->checkAccess("write", "", $this->object->getRefId())
&& $this->object->enablePageEditing())
{
$GLOBALS["tpl"]->setEditPageButton(
$this->ctrl->getLinkTarget($this, "editPageFrame"),
$this->lng->txt("edit_page"),
);
}
if ($this->object->gotItems())
{
$GLOBALS["tpl"]->addAdminPanelCommand("delete",
$this->lng->txt("delete_selected_items"));
}
if (!$_SESSION["clipboard"])
{
if ($this->object->gotItems())
{
$GLOBALS["tpl"]->addAdminPanelCommand("cut",
$this->lng->txt("move_selected_items"));
// BEGIN WebDAV: Support a copy command in the repository
// does currently not work
// $GLOBALS["tpl"]->addAdminPanelCommand("copy",
// $this->lng->txt("copy_selected_items"));
// END WebDAV: Support a copy command in the repository
$GLOBALS["tpl"]->addAdminPanelCommand("link",
$this->lng->txt("link_selected_items"));
}
}
else
{
$GLOBALS["tpl"]->addAdminPanelCommand("paste",
$this->lng->txt("paste_clipboard_items"));
$GLOBALS["tpl"]->addAdminPanelCommand("clear",
$this->lng->txt("clear_clipboard"));
}
if($this->object->gotItems() and $ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
include_once('./Services/Container/classes/class.ilContainer.php');
if ($this->object->getOrderType() == ilContainer::SORT_MANUAL)
{
$GLOBALS["tpl"]->addAdminPanelCommand("saveSorting",
$this->lng->txt('sorting_save'));
}
}
$this->ctrl->setParameter($this, "type", "");
$this->ctrl->setParameter($this, "item_ref_id", "");
$GLOBALS["tpl"]->setPageFormAction($this->ctrl->getFormAction($this));
}
else if (
$ilUser->getId() != ANONYMOUS_USER_ID &&
($this->adminCommands ||
(is_object($this->object) &&
($ilAccess->checkAccess("write", "", $this->object->getRefId())))
||
(is_object($this->object) &&
($this->object->getHiddenFilesFound())) ||
$_SESSION["clipboard"]
)
)
{
$GLOBALS["tpl"]->setAdminViewButton(
$this->ctrl->getLinkTarget($this, "enableAdministrationPanel"),
$this->lng->txt("all_commands"));
}
}

+ Here is the call graph for this function:

ilContainerGUI::showCustomIconsEditing (   $a_input_colspan = 1)

show edit section of custom icons for container

Definition at line 2001 of file class.ilContainerGUI.php.

Referenced by ilObjCourseGUI\editCourseIconsObject(), ilObjGroupGUI\editGroupIconsObject(), ilObjRootFolderGUI\editObject(), and ilObjCategoryGUI\editObject().

{
if ($this->ilias->getSetting("custom_icons"))
{
$this->tpl->addBlockFile("CONTAINER_ICONS", "container_icon_settings",
"tpl.container_icon_settings.html");
if (($big_icon = $this->object->getBigIconPath()) != "")
{
$this->tpl->setCurrentBlock("big_icon");
$this->tpl->setVariable("SRC_BIG_ICON", $big_icon);
$this->tpl->parseCurrentBlock();
}
if (($small_icon = $this->object->getSmallIconPath()) != "")
{
$this->tpl->setCurrentBlock("small_icon");
$this->tpl->setVariable("SRC_SMALL_ICON", $small_icon);
$this->tpl->parseCurrentBlock();
}
if (($tiny_icon = $this->object->getTinyIconPath()) != "")
{
$this->tpl->setCurrentBlock("tiny_icon");
$this->tpl->setVariable("SRC_TINY_ICON", $tiny_icon);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("container_icon_settings");
$this->tpl->setVariable("SPAN_TITLE", $a_input_colspan + 1);
$this->tpl->setVariable("SPAN_INPUT", $a_input_colspan);
$this->tpl->setVariable("ICON_SETTINGS", $this->lng->txt("icon_settings"));
$this->tpl->setVariable("BIG_ICON", $this->lng->txt("big_icon"));
$this->tpl->setVariable("SMALL_ICON", $this->lng->txt("standard_icon"));
$this->tpl->setVariable("TINY_ICON", $this->lng->txt("tiny_icon"));
$this->tpl->setVariable("BIG_SIZE", "(".
$this->ilias->getSetting("custom_icon_big_width")."x".
$this->ilias->getSetting("custom_icon_big_height").")");
$this->tpl->setVariable("SMALL_SIZE", "(".
$this->ilias->getSetting("custom_icon_small_width")."x".
$this->ilias->getSetting("custom_icon_small_height").")");
$this->tpl->setVariable("TINY_SIZE", "(".
$this->ilias->getSetting("custom_icon_tiny_width")."x".
$this->ilias->getSetting("custom_icon_tiny_height").")");
$this->tpl->setVariable("TXT_REMOVE", $this->lng->txt("remove"));
$this->tpl->parseCurrentBlock();
}
}

+ Here is the caller graph for this function:

ilContainerGUI::showLinkListObject ( )

Definition at line 1021 of file class.ilContainerGUI.php.

References $_GET, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\$tree, exit, and ilUtil\getStyleSheetLocation().

{
global $lng, $tree;
$tpl = new ilTemplate("tpl.container_link_help.html", true, true);
$type_ordering = array(
"cat", "fold", "crs", "icrs", "icla", "grp", "chat", "frm", "lres",
"glo", "webr", "file", "exc",
"tst", "svy", "mep", "qpl", "spl");
$childs = $tree->getChilds($_GET["ref_id"]);
foreach($childs as $child)
{
if (in_array($child["type"], array("lm", "dbk", "sahs", "htlm")))
{
$cnt["lres"]++;
}
else
{
$cnt[$child["type"]]++;
}
}
$tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$tpl->setVariable("TXT_HELP_HEADER", $lng->txt("help"));
foreach($type_ordering as $type)
{
$tpl->setCurrentBlock("row");
$tpl->setVariable("ROWCOL", "tblrow".((($i++)%2)+1));
if ($type != "lres")
{
$tpl->setVariable("TYPE", $lng->txt("objs_".$type).
" (".((int)$cnt[$type]).")");
}
else
{
$tpl->setVariable("TYPE", $lng->txt("learning_resources").
" (".((int)$cnt["lres"]).")");
}
$tpl->setVariable("TXT_LINK", "[list-".$type."]");
$tpl->parseCurrentBlock();
}
$tpl->show();
}

+ Here is the call graph for this function:

ilContainerGUI::showPermanentLink ( $tpl)

show permanent link

Definition at line 618 of file class.ilContainerGUI.php.

References $GLOBALS.

{
$GLOBALS["tpl"]->setPermanentLink($this->object->getType(),
$this->object->getRefId(), "", "_top");
}
ilContainerGUI::showPossibleSubObjects ( )

show possible sub objects selection list

Reimplemented from ilObjectGUI.

Reimplemented in ilObjRecoveryFolderGUI.

Definition at line 320 of file class.ilContainerGUI.php.

References $cmd, $d, ilObjectGUI\$formaction, $ilCtrl, and formSelect().

{
global $ilAccess,$ilCtrl;
$found = false;
$cmd = ($this->cmd != "")
? $this->cmd
: $this->ctrl->getCmd();
#if ($cmd != "" && $cmd != "showList" && $cmd != "render"
# && $cmd != "view")
#{
# return;
#}
$type = $this->object->getType();
$d = $this->objDefinition->getCreatableSubObjects($type);
if (count($d) > 0)
{
foreach ($d as $row)
{
$count = 0;
if ($row["max"] > 0)
{
//how many elements are present?
//var_dump($this->data);
// this is broken
/*
for ($i=0; $i<count($this->data["ctrl"]); $i++)
{
if ($this->data["ctrl"][$i]["type"] == $row["name"])
{
$count++;
}
}*/
}
if ($row["max"] == "" || $count < $row["max"])
{
//if (in_array($row["name"], array("sahs", "alm", "hlm", "lm", "grp", "frm", "mep","crs", "mcst", "wiki",
// "cat", "glo", "dbk","exc", "qpl", "tst", "svy", "spl", "chat",
// "htlm","fold","linkr","file","icrs","icla","crsg",'webr',"feed",'rcrs')))
//{
if (!in_array($row["name"], array("rolf")))
{
if ($this->rbacsystem->checkAccess("create", $this->object->getRefId(), $row["name"]))
{
$subobj[] = $row["name"];
}
}
}
}
}
if (is_array($subobj))
{
$formaction = "repository.php?ref_id=".$this->object->getRefId()."&cmd=post";
$formaction = $ilCtrl->appendRequestTokenParameterString($formaction);
$formaction = $this->ctrl->getFormAction($this);
$opts = ilUtil::formSelect("", "new_type", $subobj);
$this->tpl->setCreationSelector($formaction,
$opts, "create", $this->lng->txt("add"));
}
}

+ Here is the call graph for this function:

ilContainerGUI::showTreeFlatIcon ( )

Definition at line 272 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, and ilObjectGUI\$tpl.

Referenced by prepareOutput().

{
global $tpl;
// dont show icon, if role (permission gui->rolegui) is edited
if ($_GET["obj_id"] != "")
{
return;
}
$mode = ($_SESSION["il_rep_mode"] == "flat")
? "tree"
: "flat";
$link = "repository.php?cmd=frameset&set_mode=".$mode."&ref_id=".$this->object->getRefId();
$tpl->setTreeFlatIcon($link, $mode);
}

+ Here is the caller graph for this function:

ilContainerGUI::switchToOldEditorObject ( )

Switch to old page editor.

Definition at line 638 of file class.ilContainerGUI.php.

References $_SESSION, and $ilCtrl.

{
global $ilCtrl;
$_SESSION["il_cntr_editor"] = "old";
$ilCtrl->redirect($this, "editPageFrame");
}
ilContainerGUI::switchToStdEditorObject ( )

Switch to standard page editor.

Definition at line 627 of file class.ilContainerGUI.php.

References $_SESSION, and $ilCtrl.

{
global $ilCtrl;
$_SESSION["il_cntr_editor"] = "std";
$ilCtrl->redirect($this, "editPageFrame");
}
ilContainerGUI::useNewEditorObject ( )

Use new editor (-> delete xhtml content page)

Definition at line 649 of file class.ilContainerGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilContainer\_writeContainerSetting(), and ilUtil\sendInfo().

{
global $ilCtrl, $ilAccess, $lng, $ilCtrl;
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
include_once("./Services/XHTMLPage/classes/class.ilXHTMLPage.php");
/* keep old page content for now...
$xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(),
"xhtml_page");
if ($xpage_id)
{
$xpage = new ilXHTMLPage($xpage_id);
}
*/
ilContainer::_writeContainerSetting($this->object->getId(),
"xhtml_page", 0);
ilUtil::sendInfo($lng->txt("cntr_switched_editor"), true);
}
$ilCtrl->redirect($this, "editPageFrame");
}

+ Here is the call graph for this function:


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