ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilColumnGUI Class Reference

Column user interface class. More...

+ Collaboration diagram for ilColumnGUI:

Public Member Functions

 ilColumnGUI ($a_col_type="", $a_side="", $use_std_context=false)
 Constructor.
 setColType ($a_coltype)
 Set Column Type.
 getColType ()
 Get Column Type.
 setSide ($a_side)
 Set Side IL_COL_LEFT | IL_COL_RIGHT.
 getSide ()
 Get Side IL_COL_LEFT | IL_COL_RIGHT.
 setEnableEdit ($a_enableedit)
 Set EnableEdit.
 getEnableEdit ()
 Get EnableEdit.
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode.
 getRepositoryMode ()
 Get RepositoryMode.
 setAdminCommands ($a_admincommands)
 Set Administration Commmands.
 getAdminCommands ()
 Get Administration Commmands.
 setMovementMode ($a_movementmode)
 Set Movement Mode.
 getMovementMode ()
 Get Movement Mode.
 setEnableMovement ($a_enablemovement)
 Set Enable Movement.
 getEnableMovement ()
 Get Enable Movement.
 setBlockProperty ($a_block_type, $a_property, $a_value)
 This function is supposed to be used for block type specific properties, that should be passed to ilBlockGUI->setProperty.
 getBlockProperties ($a_block_type)
 setAllBlockProperties ($a_block_properties)
 setRepositoryItems ($a_repositoryitems)
 Set Repository Items.
 getRepositoryItems ()
 Get Repository Items.
executeCommand ()
 execute command
 getHTML ()
 Get HTML for column.
 showBlocks ()
 Show blocks.
 setPossibleMoves ($a_block_gui, $i, $sum_moveable)
 addHiddenBlockSelector ()
 Add hidden block and create block selectors.
 toggleMovement ()
 updateBlock ()
 Update Block (asynchronous)
 activateBlock ()
 Activate hidden block.
 addBlock ()
 Add a block.
 determineBlocks ()
 Determine which blocks to show.
 moveBlock ()

Static Public Member Functions

static addCustomBlockLocation ($className, $path)
 Adds location information of the custom block gui.
static addCustomBlockType ($className, $identifier)
 Adds the block type of the custom block gui.
static getCmdSide ()
 Get Column Side of Current Command.
static getScreenMode ()
 Get Screen Mode for current command.

Protected Member Functions

 isGloballyActivated ($a_type)
 Check whether a block type is globally activated.
 exceededLimit ($a_type)
 Check whether limit is not exceeded.

Protected Attributes

 $side = IL_COL_RIGHT
 $type
 $enableedit = false
 $repositorymode = false
 $repositoryitems = array()
 $rep_block_types = array("feed")
 $block_property = array()
 $admincommands = null
 $movementmode = null
 $enablemovement = false
 $default_blocks
 $custom_blocks
 $check_global_activation
 $check_nr_limit

Static Protected Attributes

static $locations
static $block_types

Detailed Description

Column user interface class.

This class is used on the personal desktop, the info screen class and witin container classes.

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

ilColumnGUI: ilCalendarGUI ilColumnGUI:

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

Member Function Documentation

ilColumnGUI::activateBlock ( )

Activate hidden block.

Definition at line 871 of file class.ilColumnGUI.php.

References $_POST, $ilCtrl, and ilBlockSetting\_writeDetailLevel().

{
global $ilUser, $ilCtrl;
if ($_POST["block"] != "")
{
$block = explode("_", $_POST["block"]);
include_once("Services/Block/classes/class.ilBlockSetting.php");
ilBlockSetting::_writeDetailLevel($block[0], 2, $ilUser->getId(), $block[1]);
}
$ilCtrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilColumnGUI::addBlock ( )

Add a block.

Definition at line 888 of file class.ilColumnGUI.php.

References $_POST, $ilCtrl, getAdminCommands(), getEnableEdit(), getMovementMode(), and getRepositoryMode().

{
global $ilCtrl;
$class = array_search($_POST["block_type"], self::$block_types);
$ilCtrl->setCmdClass($class);
$ilCtrl->setCmd("create");
include_once("./".self::$locations[$class]."classes/class.".$class.".php");
$block_gui = new $class();
$block_gui->setProperties($this->block_property[$_POST["block_type"]]);
$block_gui->setRepositoryMode($this->getRepositoryMode());
$block_gui->setEnableEdit($this->getEnableEdit());
$block_gui->setAdminCommands($this->getAdminCommands());
$block_gui->setConfigMode($this->getMovementMode());
$ilCtrl->setParameter($this, "block_type", $_POST["block_type"]);
$html = $ilCtrl->forwardCommand($block_gui);
$ilCtrl->setParameter($this, "block_type", "");
return $html;
}

+ Here is the call graph for this function:

static ilColumnGUI::addCustomBlockLocation (   $className,
  $path 
)
static

Adds location information of the custom block gui.

public

Parameters
stringThe name of the custom block gui class
stringThe path of the custom block gui class

Definition at line 172 of file class.ilColumnGUI.php.

References $path.

{
self::$locations[$className] = $path;
}
static ilColumnGUI::addCustomBlockType (   $className,
  $identifier 
)
static

Adds the block type of the custom block gui.

public

Parameters
stringThe name of the custom block gui class
stringThe identifier (block type) of the custom block gui

Definition at line 187 of file class.ilColumnGUI.php.

{
self::$block_types[$className] = $identifier;
}
ilColumnGUI::addHiddenBlockSelector ( )

Add hidden block and create block selectors.

Definition at line 620 of file class.ilColumnGUI.php.

References $_SESSION, $ilCtrl, $ilSetting, $lng, ilBlockSetting\_lookupDetailLevel(), exceededLimit(), ilUtil\formSelect(), getColType(), getEnableEdit(), getEnableMovement(), getRepositoryMode(), getSide(), IL_COL_RIGHT, and isGloballyActivated().

Referenced by getHTML().

{
global $lng, $ilUser, $ilCtrl, $ilSetting;
$bl_management = false;
// show selector for hidden blocks
include_once("Services/Block/classes/class.ilBlockSetting.php");
$hidden_blocks = array();
$blocks = array("pdmail" => $lng->txt("mail"),
"pdnotes" => $lng->txt("notes"),
"pdusers" => $lng->txt("users_online"),
"pdnews" => $lng->txt("news"),
"pdbookm" => $lng->txt("my_bms"),
"news" => $lng->txt("news_internal_news"),
"feed" => $lng->txt("feed"),
"pdfeed" => $lng->txt("feed"),
"html" => $lng->txt("html_block"),
"pdtag" => $lng->txt("tagging_my_tags"),
"pdcal" => $lng->txt('calendar'),
"chatviewer" => $lng->txt('chat_chatviewer'),
);
foreach($this->blocks[$this->getSide()] as $block)
{
include_once("./".self::$locations[$block["class"]]."classes/".
"class.".$block["class"].".php");
if ($block["custom"] == false)
{
if ($ilCtrl->getContextObjType() == "user") // personal desktop
{
if (ilBlockSetting::_lookupDetailLevel($block["type"], $ilUser->getId()) == 0)
{
$hidden_blocks[$block["type"]] = $blocks[$block["type"]];
}
}
else if ($ilCtrl->getContextObjType() != "")
{
if (ilBlockSetting::_lookupDetailLevel($block["type"], $ilUser->getId(),
$ilCtrl->getContextObjId()) == 0)
{
$hidden_blocks[$block["type"]."_".$ilCtrl->getContextObjId()] = $blocks[$block["type"]];
}
}
}
else
{
if (ilBlockSetting::_lookupDetailLevel($block["type"], $ilUser->getId(),
$block["id"]) == 0)
{
include_once("./Services/Block/classes/class.ilCustomBlock.php");
$cblock = new ilCustomBlock($block["id"]);
$hidden_blocks[$block["type"]."_".$block["id"]] =
$cblock->getTitle();
}
}
}
if (count($hidden_blocks) > 0)
{
$this->tpl->setCurrentBlock("hidden_block_selector");
$this->tpl->setVariable("HB_ACTION", $ilCtrl->getFormAction($this));
$this->tpl->setVariable("BLOCK_SEL", ilUtil::formSelect("", "block", $hidden_blocks,
false, true, 0, "ilEditSelect", array("id" => "il_show_bl_sel_".$this->getSide())));
$this->tpl->setVariable("LAB_ID", "il_show_bl_sel_".$this->getSide());
$this->tpl->setVariable("TXT_ACTIVATE", $lng->txt("show"));
$this->tpl->setVariable("TXT_SHOW_HIDDEN_BLOCK",
$lng->txt("show_hidden_block"));
$this->tpl->parseCurrentBlock();
$bl_management = true;
}
// create block selection list
if (!$this->getRepositoryMode() || $this->getEnableEdit())
{
$add_blocks = array();
if ($this->getSide() == IL_COL_RIGHT)
{
if (is_array($this->custom_blocks[$this->getColType()]))
{
foreach($this->custom_blocks[$this->getColType()] as $block_class)
{
include_once("./".self::$locations[$block_class]."classes/".
"class.".$block_class.".php");
$block_type = call_user_func(array($block_class, 'getBlockType'));
// check if block type is globally (de-)activated
if ($this->isGloballyActivated($block_type))
{
// check if number of blocks is limited
if (!$this->exceededLimit($block_type))
{
$add_blocks[$block_type] = $blocks[$block_type];
}
}
}
}
}
if (count($add_blocks) > 0)
{
$this->tpl->setCurrentBlock("add_block_selector");
$ilCtrl->setParameter($this, "block_type", "");
$this->tpl->setVariable("AB_ACTION", $ilCtrl->getFormAction($this));
$this->tpl->setVariable("ADD_BLOCK_SEL", ilUtil::formSelect("", "block_type", $add_blocks,
false, true, 0, "ilEditSelect", array("id" => "il_add_bl_sel_".$this->getSide())));
$this->tpl->setVariable("LAB_ID", "il_add_bl_sel_".$this->getSide());
$this->tpl->setVariable("TXT_ADD", $lng->txt("create"));
$this->tpl->setVariable("TXT_CREATE_BLOCK",
$lng->txt("create_block"));
$this->tpl->parseCurrentBlock();
$bl_management = true;
}
}
if ($this->getSide() == IL_COL_RIGHT && $this->getEnableMovement())
{
$this->tpl->setCurrentBlock("toggle_movement");
$this->tpl->setVariable("HREF_TOGGLE_MOVEMENT",
$ilCtrl->getLinkTarget($this, "toggleMovement"));
if ($_SESSION["col_".$this->getColType()."_movement"] == "on")
{
$this->tpl->setVariable("TXT_TOGGLE_MOVEMENT",
$lng->txt("stop_moving_blocks"));
}
else
{
$this->tpl->setVariable("TXT_TOGGLE_MOVEMENT",
$lng->txt("move_blocks"));
}
$this->tpl->parseCurrentBlock();
$bl_management = true;
}
if ($bl_management)
{
$this->tpl->setCurrentBlock("block_management");
$this->tpl->setVariable("TXT_BLOCK_MANAGEMENT",
$lng->txt("block_management"));
$this->tpl->parseCurrentBlock();
}
//return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilColumnGUI::determineBlocks ( )

Determine which blocks to show.

Definition at line 913 of file class.ilColumnGUI.php.

References $ilCtrl, $ilSetting, $side, $type, ilBlockSetting\_lookupNr(), ilBlockSetting\_lookupSide(), getColType(), getRepositoryItems(), getRepositoryMode(), IL_COL_CENTER, IL_COL_LEFT, IL_COL_RIGHT, isGloballyActivated(), and ilUtil\sortArray().

Referenced by getHTML(), moveBlock(), and updateBlock().

{
global $ilUser, $ilCtrl, $ilSetting;
include_once("./Services/Block/classes/class.ilBlockSetting.php");
$this->blocks[IL_COL_LEFT] = array();
$this->blocks[IL_COL_RIGHT] = array();
$this->blocks[IL_COL_CENTER] = array();
$user_id = ($this->getColType() == "pd")
? $ilUser->getId()
: 0;
$def_nr = 1000;
if (is_array($this->default_blocks[$this->getColType()]))
{
foreach($this->default_blocks[$this->getColType()] as $class => $def_side)
{
$type = self::$block_types[$class];
{
$nr = ilBlockSetting::_lookupNr($type, $user_id);
if ($nr === false)
{
$nr = $def_nr++;
}
// extra handling for system messages, feedback block and news
if ($type == "news") // always show news first
{
$nr = -15;
}
if ($type == "cal") // show calendar after news
{
$nr = -8;
}
if ($type == "pdsysmess") // always show sys mess first
{
$nr = -15;
}
if ($type == "pdfeedb") // always show feedback request second
{
$nr = -10;
}
if ($side === false)
{
$side = $def_side;
}
$this->blocks[$side][] = array(
"nr" => $nr,
"class" => $class,
"type" => $type,
"id" => 0,
"custom" => false);
}
}
}
if (!$this->getRepositoryMode())
{
include_once("./Services/Block/classes/class.ilCustomBlock.php");
$costum_block = new ilCustomBlock();
$costum_block->setContextObjId($ilCtrl->getContextObjId());
$costum_block->setContextObjType($ilCtrl->getContextObjType());
$c_blocks = $costum_block->queryBlocksForContext();
foreach($c_blocks as $c_block)
{
$type = $c_block["type"];
{
$class = array_search($type, self::$block_types);
$nr = ilBlockSetting::_lookupNr($type, $user_id, $c_block["id"]);
if ($nr === false)
{
$nr = $def_nr++;
}
$side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
if ($side === false)
{
}
$this->blocks[$side][] = array(
"nr" => $nr,
"class" => $class,
"type" => $type,
"id" => $c_block["id"],
"custom" => true);
}
}
}
else // get all subitems
{
include_once("./Services/Block/classes/class.ilCustomBlock.php");
$rep_items = $this->getRepositoryItems();
foreach($this->rep_block_types as $block_type)
{
if ($this->isGloballyActivated($block_type))
{
if (!is_array($rep_items[$block_type]))
{
continue;
}
foreach($rep_items[$block_type] as $item)
{
$costum_block = new ilCustomBlock();
$costum_block->setContextObjId($item["obj_id"]);
$costum_block->setContextObjType($block_type);
$c_blocks = $costum_block->queryBlocksForContext();
$c_block = $c_blocks[0];
$type = $block_type;
$class = array_search($type, self::$block_types);
$nr = ilBlockSetting::_lookupNr($type, $user_id, $c_block["id"]);
if ($nr === false)
{
$nr = $def_nr++;
}
$side = ilBlockSetting::_lookupSide($type, $user_id, $c_block["id"]);
if ($side === false)
{
}
$this->blocks[$side][] = array(
"nr" => $nr,
"class" => $class,
"type" => $type,
"id" => $c_block["id"],
"custom" => true,
"ref_id" => $item["ref_id"]);
}
}
}
}
$this->blocks[IL_COL_LEFT] =
ilUtil::sortArray($this->blocks[IL_COL_LEFT], "nr", "asc", true);
$this->blocks[IL_COL_RIGHT] =
ilUtil::sortArray($this->blocks[IL_COL_RIGHT], "nr", "asc", true);
$this->blocks[IL_COL_CENTER] =
ilUtil::sortArray($this->blocks[IL_COL_CENTER], "nr", "asc", true);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilColumnGUI::exceededLimit (   $a_type)
protected

Check whether limit is not exceeded.

Definition at line 1161 of file class.ilColumnGUI.php.

References $ilCtrl, $ilSetting, $res, and getRepositoryMode().

Referenced by addHiddenBlockSelector().

{
if ($this->check_nr_limit[$a_type])
{
if (!$this->getRepositoryMode())
{
include_once("./Services/Block/classes/class.ilCustomBlock.php");
$costum_block = new ilCustomBlock();
$costum_block->setContextObjId($ilCtrl->getContextObjId());
$costum_block->setContextObjType($ilCtrl->getContextObjType());
$costum_block->setType($a_type);
$res = $costum_block->queryCntBlockForContext();
$cnt = (int) $res[0]["cnt"];
}
else
{
return false; // not implemented for repository yet
}
if ($ilSetting->get("block_limit_".$a_type) > $cnt)
{
return false;
}
else
{
return true;
}
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilColumnGUI::executeCommand ( )

execute command

Definition at line 423 of file class.ilColumnGUI.php.

References $_GET, $_POST, $cmd, $ilCtrl, getAdminCommands(), getColType(), getEnableEdit(), getMovementMode(), getRepositoryMode(), and getSide().

{
global $ilCtrl;
$ilCtrl->setParameter($this, "col_side" ,$this->getSide());
//$ilCtrl->saveParameter($this, "col_side");
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd("getHTML");
$cur_block_type = ($_GET["block_type"])
? $_GET["block_type"]
: $_POST["block_type"];
if ($next_class != "")
{
// forward to block
if ($gui_class = array_search($cur_block_type, self::$block_types))
{
include_once("./".self::$locations[$gui_class]."classes/".
"class.".$gui_class.".php");
$ilCtrl->setParameter($this, "block_type", $cur_block_type);
$block_gui = new $gui_class();
$block_gui->setProperties($this->block_property[$cur_block_type]);
$block_gui->setRepositoryMode($this->getRepositoryMode());
$block_gui->setEnableEdit($this->getEnableEdit());
$block_gui->setAdminCommands($this->getAdminCommands());
$block_gui->setConfigMode($this->getMovementMode());
if (in_array($gui_class, $this->custom_blocks[$this->getColType()]) ||
in_array($cur_block_type, $this->rep_block_types))
{
$block_class = substr($gui_class, 0, strlen($gui_class)-3);
include_once("./".self::$locations[$gui_class]."classes/".
"class.".$block_class.".php");
$app_block = new $block_class($_GET["block_id"]);
$block_gui->setBlock($app_block);
}
$html = $ilCtrl->forwardCommand($block_gui);
$ilCtrl->setParameter($this, "block_type", "");
return $html;
}
}
else
{
return $this->$cmd();
}
}

+ Here is the call graph for this function:

ilColumnGUI::getAdminCommands ( )

Get Administration Commmands.

Returns
boolean Administration Commmands

Definition at line 297 of file class.ilColumnGUI.php.

References $admincommands.

Referenced by addBlock(), executeCommand(), showBlocks(), and updateBlock().

{
}

+ Here is the caller graph for this function:

ilColumnGUI::getBlockProperties (   $a_block_type)

Definition at line 390 of file class.ilColumnGUI.php.

{
return $this->block_property[$a_block_type];
}
static ilColumnGUI::getCmdSide ( )
static

Get Column Side of Current Command.

Returns
string Column Side

Definition at line 197 of file class.ilColumnGUI.php.

References $_GET.

Referenced by ilContainerContentGUI\__forwardToColumnGUI(), ilCourseContentGUI\__forwardToColumnGUI(), ilObjectGUI\getCenterColumnHTML(), and moveBlock().

{
return $_GET["col_side"];
}

+ Here is the caller graph for this function:

ilColumnGUI::getColType ( )

Get Column Type.

Returns
string Column Type

Definition at line 217 of file class.ilColumnGUI.php.

Referenced by addHiddenBlockSelector(), determineBlocks(), executeCommand(), ilColumnGUI(), moveBlock(), and toggleMovement().

{
return $this->coltype;
}

+ Here is the caller graph for this function:

ilColumnGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean EnableEdit

Definition at line 257 of file class.ilColumnGUI.php.

References $enableedit.

Referenced by addBlock(), addHiddenBlockSelector(), executeCommand(), getHTML(), showBlocks(), and updateBlock().

{
}

+ Here is the caller graph for this function:

ilColumnGUI::getEnableMovement ( )

Get Enable Movement.

Returns
boolean Enable Movement

Definition at line 337 of file class.ilColumnGUI.php.

References $enablemovement.

Referenced by addHiddenBlockSelector().

{
}

+ Here is the caller graph for this function:

ilColumnGUI::getHTML ( )

Get HTML for column.

Definition at line 476 of file class.ilColumnGUI.php.

References $ilBench, $ilCtrl, addHiddenBlockSelector(), determineBlocks(), getEnableEdit(), getRepositoryMode(), getSide(), and showBlocks().

{
global $ilCtrl, $ilBench;
$ilBench->start("Column", "getHTML");
$ilCtrl->setParameter($this, "col_side" ,$this->getSide());
$this->tpl = new ilTemplate("tpl.column.html", true, true, "Services/Block");
$ilBench->start("Column", "determineBlocks");
$this->determineBlocks();
$ilBench->stop("Column", "determineBlocks");
$ilBench->start("Column", "showBlocks");
$this->showBlocks();
$ilBench->stop("Column", "showBlocks");
if ($this->getEnableEdit() || !$this->getRepositoryMode())
{
}
$ilBench->stop("Column", "getHTML");
return $this->tpl->get();
}

+ Here is the call graph for this function:

ilColumnGUI::getMovementMode ( )

Get Movement Mode.

Returns
boolean Movement Mode

Definition at line 317 of file class.ilColumnGUI.php.

References $movementmode.

Referenced by addBlock(), executeCommand(), showBlocks(), and updateBlock().

{
}

+ Here is the caller graph for this function:

ilColumnGUI::getRepositoryItems ( )

Get Repository Items.

Returns
array Repository Items

Definition at line 415 of file class.ilColumnGUI.php.

References $repositoryitems.

Referenced by determineBlocks().

+ Here is the caller graph for this function:

ilColumnGUI::getRepositoryMode ( )

Get RepositoryMode.

Returns
boolean RepositoryMode

Definition at line 277 of file class.ilColumnGUI.php.

References $repositorymode.

Referenced by addBlock(), addHiddenBlockSelector(), determineBlocks(), exceededLimit(), executeCommand(), getHTML(), moveBlock(), setPossibleMoves(), showBlocks(), and updateBlock().

{
}

+ Here is the caller graph for this function:

static ilColumnGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 345 of file class.ilColumnGUI.php.

References $_GET, $_POST, $ilCtrl, IL_SCREEN_CENTER, and IL_SCREEN_SIDE.

Referenced by ilContainerContentGUI\__forwardToColumnGUI(), ilCourseContentGUI\__forwardToColumnGUI(), and ilObjectGUI\getCenterColumnHTML().

{
global $ilCtrl;
if ($ilCtrl->getCmdClass() == "ilcolumngui")
{
switch ($ilCtrl->getCmd())
{
case "addBlock":
}
}
$cur_block_type = "";
if (isset($_GET["block_type"]) && $_GET["block_type"])
{
$cur_block_type = $_GET["block_type"];
}
else if (isset($_POST["block_type"]))
{
$cur_block_type = $_POST["block_type"];
}
if ($class = array_search($cur_block_type, self::$block_types))
{
include_once("./".self::$locations[$class]."classes/".
"class.".$class.".php");
return call_user_func(array($class, 'getScreenMode'));
}
}

+ Here is the caller graph for this function:

ilColumnGUI::getSide ( )

Get Side IL_COL_LEFT | IL_COL_RIGHT.

Returns
string Side IL_COL_LEFT | IL_COL_RIGHT

Definition at line 237 of file class.ilColumnGUI.php.

References $side.

Referenced by addHiddenBlockSelector(), executeCommand(), getHTML(), setPossibleMoves(), showBlocks(), and updateBlock().

{
return $this->side;
}

+ Here is the caller graph for this function:

ilColumnGUI::ilColumnGUI (   $a_col_type = "",
  $a_side = "",
  $use_std_context = false 
)

Constructor.

Parameters

Definition at line 143 of file class.ilColumnGUI.php.

References $_SESSION, $ilCtrl, $tpl, getColType(), setColType(), setMovementMode(), and setSide().

{
global $ilUser, $tpl, $ilCtrl;
$this->setColType($a_col_type);
//if ($a_side == "")
//{
// $a_side = $_GET["col_side"];
//}
if (isset($_SESSION["col_".$this->getColType()."_movement"]) &&
$_SESSION["col_".$this->getColType()."_movement"] == "on")
{
$this->setMovementMode(true);
}
$this->setSide($a_side);
}

+ Here is the call graph for this function:

ilColumnGUI::isGloballyActivated (   $a_type)
protected

Check whether a block type is globally activated.

Definition at line 1123 of file class.ilColumnGUI.php.

References $ilSetting, and ilCalendarSettings\_getInstance().

Referenced by addHiddenBlockSelector(), and determineBlocks().

{
global $ilSetting;
if (isset($this->check_global_activation[$a_type]) && $this->check_global_activation[$a_type])
{
if ($a_type == 'pdbookm')
{
if (!$ilSetting->get("disable_bookmarks"))
{
return true;
}
return false;
}
else if ($a_type == 'pdnotes')
{
if (!$ilSetting->get("disable_notes"))
{
return true;
}
return false;
}
else if ($ilSetting->get("block_activated_".$a_type))
{
return true;
}
elseif($a_type == 'cal' || $a_type == 'pdcal')
{
include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
return ilCalendarSettings::_getInstance()->isEnabled();
}
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilColumnGUI::moveBlock ( )

Definition at line 1066 of file class.ilColumnGUI.php.

References $_GET, $ilCtrl, ilBlockSetting\_lookupDetailLevel(), ilBlockSetting\_writeNumber(), ilBlockSetting\_writeSide(), determineBlocks(), getCmdSide(), getColType(), getRepositoryMode(), IL_COL_LEFT, and IL_COL_RIGHT.

{
global $ilUser, $ilCtrl;
$this->determineBlocks();
if (in_array($this->getColType(), array("pd", "crs", "cat", "grp")))
{
$bid = explode("_", $_GET["block_id"]);
$i = 2;
foreach($this->blocks[$this->getCmdSide()] as $block)
{
// only handle non-hidden blocks (or repository mode, here we cannot hide blocks)
if ($this->getRepositoryMode() || ilBlockSetting::_lookupDetailLevel($block["type"],
$ilUser->getId(), $block["id"]) != 0)
{
$user_id = ($this->getRepositoryMode())
? 0
: $ilUser->getId();
ilBlockSetting::_writeNumber($block["type"], $i, $user_id, $block["id"]);
if ($block["type"] == $bid[0] && $block["id"] == $bid[1])
{
if ($_GET["move_dir"] == "up")
{
ilBlockSetting::_writeNumber($block["type"], $i-3, $user_id, $block["id"]);
}
if ($_GET["move_dir"] == "down")
{
ilBlockSetting::_writeNumber($block["type"], $i+3, $user_id, $block["id"]);
}
if ($_GET["move_dir"] == "left")
{
ilBlockSetting::_writeNumber($block["type"], 200, $user_id, $block["id"]);
ilBlockSetting::_writeSide($block["type"], IL_COL_LEFT, $user_id, $block["id"]);
}
if ($_GET["move_dir"] == "right")
{
ilBlockSetting::_writeNumber($block["type"], 200, $user_id, $block["id"]);
ilBlockSetting::_writeSide($block["type"], IL_COL_RIGHT, $user_id, $block["id"]);
}
}
else
{
ilBlockSetting::_writeNumber($block["type"], $i, $user_id, $block["id"]);
}
$i+=2;
}
}
}
$ilCtrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilColumnGUI::setAdminCommands (   $a_admincommands)

Set Administration Commmands.

Parameters
boolean$a_admincommandsAdministration Commmands

Definition at line 287 of file class.ilColumnGUI.php.

{
$this->admincommands = $a_admincommands;
}
ilColumnGUI::setAllBlockProperties (   $a_block_properties)

Definition at line 395 of file class.ilColumnGUI.php.

{
$this->block_property = $a_block_properties;
}
ilColumnGUI::setBlockProperty (   $a_block_type,
  $a_property,
  $a_value 
)

This function is supposed to be used for block type specific properties, that should be passed to ilBlockGUI->setProperty.

Parameters
string$a_propertyproperty name
string$a_valueproperty value

Definition at line 385 of file class.ilColumnGUI.php.

{
$this->block_property[$a_block_type][$a_property] = $a_value;
}
ilColumnGUI::setColType (   $a_coltype)

Set Column Type.

Parameters
string$a_coltypeColumn Type

Definition at line 207 of file class.ilColumnGUI.php.

Referenced by ilColumnGUI().

{
$this->coltype = $a_coltype;
}

+ Here is the caller graph for this function:

ilColumnGUI::setEnableEdit (   $a_enableedit)

Set EnableEdit.

Parameters
boolean$a_enableeditEnableEdit

Definition at line 247 of file class.ilColumnGUI.php.

{
$this->enableedit = $a_enableedit;
}
ilColumnGUI::setEnableMovement (   $a_enablemovement)

Set Enable Movement.

Parameters
boolean$a_enablemovementEnable Movement

Definition at line 327 of file class.ilColumnGUI.php.

{
$this->enablemovement = $a_enablemovement;
}
ilColumnGUI::setMovementMode (   $a_movementmode)

Set Movement Mode.

Parameters
boolean$a_movementmodeMovement Mode

Definition at line 307 of file class.ilColumnGUI.php.

Referenced by ilColumnGUI().

{
$this->movementmode = $a_movementmode;
}

+ Here is the caller graph for this function:

ilColumnGUI::setPossibleMoves (   $a_block_gui,
  $i,
  $sum_moveable 
)

Definition at line 597 of file class.ilColumnGUI.php.

References getRepositoryMode(), getSide(), IL_COL_LEFT, and IL_COL_RIGHT.

Referenced by showBlocks().

{
if ($this->getSide() == IL_COL_LEFT)
{
$a_block_gui->setAllowMove("right");
}
else if ($this->getSide() == IL_COL_RIGHT && !$this->getRepositoryMode())
{
$a_block_gui->setAllowMove("left");
}
if ($i > 1)
{
$a_block_gui->setAllowMove("up");
}
if ($i < $sum_moveable)
{
$a_block_gui->setAllowMove("down");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilColumnGUI::setRepositoryItems (   $a_repositoryitems)

Set Repository Items.

Parameters
array$a_repositoryitemsRepository Items

Definition at line 405 of file class.ilColumnGUI.php.

{
$this->repositoryitems = $a_repositoryitems;
}
ilColumnGUI::setRepositoryMode (   $a_repositorymode)

Set RepositoryMode.

Parameters
boolean$a_repositorymodeRepositoryMode

Definition at line 267 of file class.ilColumnGUI.php.

{
$this->repositorymode = $a_repositorymode;
}
ilColumnGUI::setSide (   $a_side)

Set Side IL_COL_LEFT | IL_COL_RIGHT.

Parameters
string$a_sideSide IL_COL_LEFT | IL_COL_RIGHT

Definition at line 227 of file class.ilColumnGUI.php.

Referenced by ilColumnGUI().

{
$this->side = $a_side;
}

+ Here is the caller graph for this function:

ilColumnGUI::showBlocks ( )

Show blocks.

Definition at line 507 of file class.ilColumnGUI.php.

References $ilBench, $ilCtrl, $lng, ilBlockSetting\_lookupDetailLevel(), getAdminCommands(), getEnableEdit(), getMovementMode(), getRepositoryMode(), getSide(), and setPossibleMoves().

Referenced by getHTML().

{
global $ilCtrl, $lng, $ilUser, $ilBench;
$blocks = array();
$i = 1;
$sum_moveable = count($this->blocks[$this->getSide()]);
foreach($this->blocks[$this->getSide()] as $block)
{
if ($ilCtrl->getContextObjType() != "user" ||
$ilUser->getId(), $block["id"]) > 0)
{
$gui_class = $block["class"];
$block_class = substr($block["class"], 0, strlen($block["class"])-3);
// get block gui class
include_once("./".self::$locations[$gui_class]."classes/".
"class.".$gui_class.".php");
$ilBench->start("Column", "instantiate-".$block["type"]);
$block_gui = new $gui_class();
$ilBench->stop("Column", "instantiate-".$block["type"]);
if (isset($this->block_property[$block["type"]]))
{
$block_gui->setProperties($this->block_property[$block["type"]]);
}
$block_gui->setRepositoryMode($this->getRepositoryMode());
$block_gui->setEnableEdit($this->getEnableEdit());
$block_gui->setAdminCommands($this->getAdminCommands());
$block_gui->setConfigMode($this->getMovementMode());
$this->setPossibleMoves($block_gui, $i, $sum_moveable);
// get block for custom blocks
if ($block["custom"])
{
include_once("./".self::$locations[$gui_class]."classes/".
"class.".$block_class.".php");
$app_block = new $block_class($block["id"]);
$block_gui->setBlock($app_block);
if (isset($block["ref_id"]))
{
$block_gui->setRefId($block["ref_id"]);
}
}
$ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
$this->tpl->setCurrentBlock("col_block");
$ilBench->start("Column", "showBlocks-".$block_gui->getBlockType());
$html = $ilCtrl->getHTML($block_gui);
$ilBench->stop("Column", "showBlocks-".$block_gui->getBlockType());
// dummy block, if non visible, but movement is ongoing
if ($html == "" && $this->getRepositoryMode() &&
$this->getMovementMode())
{
include_once("./Services/Block/classes/class.ilDummyBlockGUI.php");
$bl = new ilDummyBlockGUI();
$bl->setBlockId($block["id"]);
$bl->setBlockType($block["type"]);
$bl->setTitle($lng->txt("invisible_block"));
$this->setPossibleMoves($bl, $i, $sum_moveable);
$bl->setConfigMode($this->getMovementMode());
$html = $bl->getHTML();
}
// don't render a block if it's empty
if ($html != "")
{
$this->tpl->setVariable("BLOCK", $html);
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this, "block_type", "");
}
// count (moveable) blocks
if ($block["type"] != "pdsysmess" && $block["type"] != "pdfeedb" &&
$block["type"] != "news")
{
$i++;
}
else
{
$sum_moveable--;
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilColumnGUI::toggleMovement ( )

Definition at line 765 of file class.ilColumnGUI.php.

References $_SESSION, $ilCtrl, and getColType().

{
global $ilCtrl;
if ($_SESSION["col_".$this->getColType()."_movement"] == "on")
{
$_SESSION["col_".$this->getColType()."_movement"] = "off";
}
else
{
$_SESSION["col_".$this->getColType()."_movement"] = "on";
}
$ilCtrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilColumnGUI::updateBlock ( )

Update Block (asynchronous)

Definition at line 783 of file class.ilColumnGUI.php.

References $_GET, $ilBench, $ilCtrl, determineBlocks(), exit, getAdminCommands(), getEnableEdit(), getMovementMode(), getRepositoryMode(), getSide(), IL_COL_LEFT, and IL_COL_RIGHT.

{
global $ilCtrl, $ilBench;
$this->determineBlocks();
$i = 1;
$sum_moveable = count($this->blocks[$this->getSide()]);
foreach ($this->blocks[$this->getSide()] as $block)
{
include_once("./".self::$locations[$block["class"]]."classes/".
"class.".$block["class"].".php");
// set block id to context obj id,
// if block is not a custom block and context is not personal desktop
if (!$block["custom"] && $ilCtrl->getContextObjType() != "" && $ilCtrl->getContextObjType() != "user")
{
$block["id"] = $ilCtrl->getContextObjId();
}
//if (is_int(strpos($_GET["block_id"], "block_".$block["type"]."_".$block["id"])))
if ($_GET["block_id"] == "block_".$block["type"]."_".$block["id"])
{
$gui_class = $block["class"];
$block_class = substr($block["class"], 0, strlen($block["class"])-3);
$block_gui = new $gui_class();
$block_gui->setProperties($this->block_property[$block["type"]]);
$block_gui->setRepositoryMode($this->getRepositoryMode());
$block_gui->setEnableEdit($this->getEnableEdit());
$block_gui->setAdminCommands($this->getAdminCommands());
$block_gui->setConfigMode($this->getMovementMode());
if ($this->getSide() == IL_COL_LEFT)
{
$block_gui->setAllowMove("right");
}
else if ($this->getSide() == IL_COL_RIGHT &&
!$this->getRepositoryMode())
{
$block_gui->setAllowMove("left");
}
if ($i > 1)
{
$block_gui->setAllowMove("up");
}
if ($i < $sum_moveable)
{
$block_gui->setAllowMove("down");
}
// get block for custom blocks
if ($block["custom"])
{
include_once("./".self::$locations[$gui_class]."classes/".
"class.".$block_class.".php");
$app_block = new $block_class($block["id"]);
$block_gui->setBlock($app_block);
$block_gui->setRefId($block["ref_id"]);
}
$ilCtrl->setParameter($this, "block_type", $block["type"]);
echo $ilCtrl->getHTML($block_gui);
$ilBench->save();
}
// count (moveable) blocks
if ($block["type"] != "pdsysmess" && $block["type"] != "pdfeedb"
&& $block["type"] != "news")
{
$i++;
}
else
{
$sum_moveable--;
}
}
echo "Error: ilColumnGUI::updateBlock: Block '".
$_GET["block_id"]."' unknown.";
}

+ Here is the call graph for this function:

Field Documentation

ilColumnGUI::$admincommands = null
protected

Definition at line 33 of file class.ilColumnGUI.php.

Referenced by getAdminCommands().

ilColumnGUI::$block_property = array()
protected

Definition at line 32 of file class.ilColumnGUI.php.

ilColumnGUI::$block_types
staticprotected
Initial value:
array(
"ilPDMailBlockGUI" => "pdmail",
"ilPDNotesBlockGUI" => "pdnotes",
"ilUsersOnlineBlockGUI" => "pdusers",
"ilPDNewsBlockGUI" => "pdnews",
"ilBookmarkBlockGUI" => "pdbookm",
"ilNewsForContextBlockGUI" => "news",
"ilCalendarBlockGUI" => "cal",
"ilPDCalendarBlockGUI" => "pdcal",
"ilExternalFeedBlockGUI" => "feed",
"ilPDExternalFeedBlockGUI" => "pdfeed",
"ilPDFeedbackBlockGUI" => "pdfeedb",
"ilPDSysMessageBlockGUI" => "pdsysmess",
"ilPDSelectedItemsBlockGUI" => "pditems",
"ilHtmlBlockGUI" => "html",
'ilPDTaggingBlockGUI' => 'pdtag',
'ilChatroomBlockGUI' => 'chatviewer'
)

Definition at line 61 of file class.ilColumnGUI.php.

ilColumnGUI::$check_global_activation
protected
Initial value:
array("news" => true,
"cal" => true,
"pdcal" => true,
"pdnews" => true,
"pdfeed" => true,
"pdusers" => true,
"pdbookm" => true,
"pdtag" => true,
"pdnotes" => true,
"chatviewer" => true)

Definition at line 123 of file class.ilColumnGUI.php.

ilColumnGUI::$check_nr_limit
protected
Initial value:
array("pdfeed" => true)

Definition at line 135 of file class.ilColumnGUI.php.

ilColumnGUI::$custom_blocks
protected
Initial value:
array(
"cat" => array(),
"crs" => array(),
"grp" => array(),
"frm" => array(),
"root" => array(),
"info" => array(),
"pd" => array("ilPDExternalFeedBlockGUI")
)

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

ilColumnGUI::$default_blocks
protected
Initial value:
array(
"cat" => array("ilNewsForContextBlockGUI" => IL_COL_RIGHT),
"crs" => array(
"ilNewsForContextBlockGUI" => IL_COL_RIGHT,
"ilCalendarBlockGUI" => IL_COL_RIGHT
),
"grp" => array(
"ilNewsForContextBlockGUI" => IL_COL_RIGHT,
"ilCalendarBlockGUI" => IL_COL_RIGHT),
"frm" => array("ilNewsForContextBlockGUI" => IL_COL_RIGHT),
"root" => array(),
"info" => array(
"ilNewsForContextBlockGUI" => IL_COL_RIGHT),
"pd" => array(
"ilPDCalendarBlockGUI" => IL_COL_RIGHT,
"ilPDSysMessageBlockGUI" => IL_COL_LEFT,
"ilPDFeedbackBlockGUI" => IL_COL_LEFT,
"ilPDNewsBlockGUI" => IL_COL_LEFT,
"ilPDSelectedItemsBlockGUI" => IL_COL_CENTER,
"ilPDMailBlockGUI" => IL_COL_RIGHT,
"ilPDNotesBlockGUI" => IL_COL_RIGHT,
"ilUsersOnlineBlockGUI" => IL_COL_RIGHT,
"ilBookmarkBlockGUI" => IL_COL_RIGHT,
"ilPDTaggingBlockGUI" => IL_COL_RIGHT,
"ilChatroomBlockGUI" => IL_COL_RIGHT
)
)

Definition at line 81 of file class.ilColumnGUI.php.

ilColumnGUI::$enableedit = false
protected

Definition at line 26 of file class.ilColumnGUI.php.

Referenced by getEnableEdit().

ilColumnGUI::$enablemovement = false
protected

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

Referenced by getEnableMovement().

ilColumnGUI::$locations
staticprotected
Initial value:
array(
"ilNewsForContextBlockGUI" => "Services/News/",
"ilCalendarBlockGUI" => "Services/Calendar/",
"ilPDCalendarBlockGUI" => "Services/Calendar/",
"ilPDNotesBlockGUI" => "Services/Notes/",
"ilPDMailBlockGUI" => "Services/Mail/",
"ilUsersOnlineBlockGUI" => "Services/PersonalDesktop/",
"ilPDSysMessageBlockGUI" => "Services/Mail/",
"ilPDSelectedItemsBlockGUI" => "Services/PersonalDesktop/",
"ilBookmarkBlockGUI" => "Services/PersonalDesktop/",
"ilPDNewsBlockGUI" => "Services/News/",
"ilExternalFeedBlockGUI" => "Services/Block/",
"ilPDExternalFeedBlockGUI" => "Services/Feeds/",
"ilHtmlBlockGUI" => "Services/Block/",
"ilPDFeedbackBlockGUI" => "Services/Feedback/",
'ilPDTaggingBlockGUI' => 'Services/Tagging/',
'ilChatroomBlockGUI' => 'Modules/Chatroom/'
)

Definition at line 42 of file class.ilColumnGUI.php.

ilColumnGUI::$movementmode = null
protected

Definition at line 34 of file class.ilColumnGUI.php.

Referenced by getMovementMode().

ilColumnGUI::$rep_block_types = array("feed")
protected

Definition at line 31 of file class.ilColumnGUI.php.

ilColumnGUI::$repositoryitems = array()
protected

Definition at line 28 of file class.ilColumnGUI.php.

Referenced by getRepositoryItems().

ilColumnGUI::$repositorymode = false
protected

Definition at line 27 of file class.ilColumnGUI.php.

Referenced by getRepositoryMode().

ilColumnGUI::$side = IL_COL_RIGHT
protected

Definition at line 24 of file class.ilColumnGUI.php.

Referenced by determineBlocks(), and getSide().

ilColumnGUI::$type
protected

Definition at line 25 of file class.ilColumnGUI.php.

Referenced by determineBlocks().


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