Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

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 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")
 $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.killing@gmx.de>
Version:
$Id$

ilColumnGUI:

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


Member Function Documentation

ilColumnGUI::activateBlock (  ) 

Activate hidden block.

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

References $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 791 of file class.ilColumnGUI.php.

References $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:

ilColumnGUI::addHiddenBlockSelector (  ) 

Add hidden block and create block selectors.

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

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

Referenced by getHTML().

        {
                global $lng, $ilUser, $ilCtrl, $ilSetting;
                
                // 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_internal_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"),
                        );
                        

                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"));
                        $this->tpl->setVariable("TXT_ACTIVATE", $lng->txt("show"));
                        $this->tpl->parseCurrentBlock();
                }
                
                // 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");
                                $this->tpl->setVariable("AB_ACTION", $ilCtrl->getFormAction($this));
                                $this->tpl->setVariable("ADD_BLOCK_SEL", ilUtil::formSelect("", "block_type", $add_blocks,
                                        false, true, 0, "ilEditSelect"));
                                $this->tpl->setVariable("TXT_ADD", $lng->txt("create"));
                                $this->tpl->parseCurrentBlock();
                        }
                }
                
                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();
                }
                
                //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 816 of file class.ilColumnGUI.php.

References $ilCtrl, $ilSetting, $side, $type, ilBlockSetting::_lookupNr(), ilBlockSetting::_lookupSide(), getColType(), getRepositoryItems(), getRepositoryMode(), 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];

                                if ($this->isGloballyActivated($type))
                                {
                                        $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 == "pdsysmess")               // always show sys mess first
                                        {
                                                $nr = -15;
                                        }
                                        if ($type == "pdfeedb")         // always show feedback request second
                                        {
                                                $nr = -10;
                                        }
                                        $side = ilBlockSetting::_lookupSide($type, $user_id);
                                        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"];
                                
                                if ($this->isGloballyActivated($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)
                                        {
                                                $side = IL_COL_RIGHT;
                                        }
        
                                        $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)
                                                {
                                                        $side = IL_COL_RIGHT;
                                                }
                        
                                                $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 1055 of file class.ilColumnGUI.php.

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

Referenced by addHiddenBlockSelector().

        {
                global $ilSetting, $ilCtrl;

                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 378 of file class.ilColumnGUI.php.

References $_GET, $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 258 of file class.ilColumnGUI.php.

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

        {
                return $this->admincommands;
        }

Here is the caller graph for this function:

ilColumnGUI::getBlockProperties ( a_block_type  ) 

Definition at line 345 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 158 of file class.ilColumnGUI.php.

References $_GET.

Referenced by 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 178 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 218 of file class.ilColumnGUI.php.

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

        {
                return $this->enableedit;
        }

Here is the caller graph for this function:

ilColumnGUI::getEnableMovement (  ) 

Get Enable Movement.

Returns:
boolean Enable Movement

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

Referenced by addHiddenBlockSelector().

        {
                return $this->enablemovement;
        }

Here is the caller graph for this function:

ilColumnGUI::getHTML (  ) 

Get HTML for column.

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

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

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

                return $this->tpl->get();
        }

Here is the call graph for this function:

ilColumnGUI::getMovementMode (  ) 

Get Movement Mode.

Returns:
boolean Movement Mode

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

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

        {
                return $this->movementmode;
        }

Here is the caller graph for this function:

ilColumnGUI::getRepositoryItems (  ) 

Get Repository Items.

Returns:
array Repository Items

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

Referenced by determineBlocks().

        {
                return $this->repositoryitems;
        }

Here is the caller graph for this function:

ilColumnGUI::getRepositoryMode (  ) 

Get RepositoryMode.

Returns:
boolean RepositoryMode

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

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

        {
                return $this->repositorymode;
        }

Here is the caller graph for this function:

static ilColumnGUI::getScreenMode (  )  [static]

Get Screen Mode for current command.

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

References $_GET, and $ilCtrl.

Referenced by ilCourseContentGUI::__forwardToColumnGUI(), and ilObjectGUI::getCenterColumnHTML().

        {
                global $ilCtrl;

                if ($ilCtrl->getCmdClass() == "ilcolumngui")
                {
                        switch ($ilCtrl->getCmd())
                        {
                                case "addBlock":
                                        return IL_SCREEN_CENTER;
                        }
                }

                $cur_block_type = ($_GET["block_type"])
                        ? $_GET["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'));
                }

                return IL_SCREEN_SIDE;
        }

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 198 of file class.ilColumnGUI.php.

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 135 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 ($_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 1022 of file class.ilColumnGUI.php.

References $ilSetting.

Referenced by addHiddenBlockSelector(), and determineBlocks().

        {
                global $ilSetting;
                if ($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;
                        }
                        return false;
                }
                return true;
        }

Here is the caller graph for this function:

ilColumnGUI::moveBlock (  ) 

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

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

        {
                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_admincommands Administration Commmands

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

        {
                $this->admincommands = $a_admincommands;
        }

ilColumnGUI::setAllBlockProperties ( a_block_properties  ) 

Definition at line 350 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_property property name
string $a_value property value

Definition at line 340 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_coltype Column Type

Definition at line 168 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_enableedit EnableEdit

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

        {
                $this->enableedit = $a_enableedit;
        }

ilColumnGUI::setEnableMovement ( a_enablemovement  ) 

Set Enable Movement.

Parameters:
boolean $a_enablemovement Enable Movement

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

        {
                $this->enablemovement = $a_enablemovement;
        }

ilColumnGUI::setMovementMode ( a_movementmode  ) 

Set Movement Mode.

Parameters:
boolean $a_movementmode Movement Mode

Definition at line 268 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 523 of file class.ilColumnGUI.php.

References getRepositoryMode(), and getSide().

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_repositoryitems Repository Items

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

        {
                $this->repositoryitems = $a_repositoryitems;
        }

ilColumnGUI::setRepositoryMode ( a_repositorymode  ) 

Set RepositoryMode.

Parameters:
boolean $a_repositorymode RepositoryMode

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

        {
                $this->repositorymode = $a_repositorymode;
        }

ilColumnGUI::setSide ( a_side  ) 

Set Side IL_COL_LEFT | IL_COL_RIGHT.

Parameters:
string $a_side Side IL_COL_LEFT | IL_COL_RIGHT

Definition at line 188 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 453 of file class.ilColumnGUI.php.

References $ilCtrl, $lng, getAdminCommands(), getEnableEdit(), getMovementMode(), getRepositoryMode(), getSide(), and setPossibleMoves().

Referenced by getHTML().

        {
                global $ilCtrl, $lng;
                
                $blocks = array();
                
                $i = 1;
                $sum_moveable = count($this->blocks[$this->getSide()]);

                foreach($this->blocks[$this->getSide()] as $block)
                {
                        $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");
                        $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());
                        $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);
                                $block_gui->setRefId($block["ref_id"]);
                        }

                        $ilCtrl->setParameter($this, "block_type", $block_gui->getBlockType());
                        $this->tpl->setCurrentBlock("col_block");
                        $html = $ilCtrl->getHTML($block_gui);

                        // 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();
                        }
                        
                        $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 669 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 687 of file class.ilColumnGUI.php.

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

        {
                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();
                                exit;
                        }
                        
                        // 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.";
                exit;
        }

Here is the call graph for this function:


Field Documentation

ilColumnGUI::$block_types [static, protected]
Initial value:
 array(
                        "ilPDMailBlockGUI" => "pdmail",
                        "ilPDNotesBlockGUI" => "pdnotes",
                        "ilUsersOnlineBlockGUI" => "pdusers",
                        "ilPDNewsBlockGUI" => "pdnews",
                        "ilBookmarkBlockGUI" => "pdbookm",
                        "ilNewsForContextBlockGUI" => "news",
                        "ilExternalFeedBlockGUI" => "feed",
                        "ilPDExternalFeedBlockGUI" => "pdfeed",
                        "ilPDFeedbackBlockGUI" => "pdfeedb",
                        "ilPDSysMessageBlockGUI" => "pdsysmess",
                        "ilPDSelectedItemsBlockGUI" => "pditems",
                        "ilHtmlBlockGUI" => "html"
                )

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

ilColumnGUI::$check_global_activation [protected]
Initial value:
 
                array("news" => true,
                        "pdnews" => true,
                        "pdfeed" => true,                       
                        "pdusers" => true,
                        "pdbookm" => true,
                        "pdnotes" => true)

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

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

Definition at line 127 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 108 of file class.ilColumnGUI.php.

ilColumnGUI::$default_blocks [protected]
Initial value:
 array(
                "cat" => array("ilNewsForContextBlockGUI" => IL_COL_RIGHT),
                "crs" => array("ilNewsForContextBlockGUI" => IL_COL_RIGHT),
                "grp" => array("ilNewsForContextBlockGUI" => IL_COL_RIGHT),
                "frm" => array("ilNewsForContextBlockGUI" => IL_COL_RIGHT),
                "root" => array(),
                "info" => array(
                        "ilNewsForContextBlockGUI" => IL_COL_RIGHT),
                "pd" => array(
                        "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)
                )

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

ilColumnGUI::$enableedit = false [protected]

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

ilColumnGUI::$locations [static, protected]
Initial value:
 array(
                "ilNewsForContextBlockGUI" => "Services/News/",
                "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/")

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

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

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

ilColumnGUI::$repositoryitems = array() [protected]

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

ilColumnGUI::$repositorymode = false [protected]

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

ilColumnGUI::$side = IL_COL_RIGHT [protected]

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

Referenced by determineBlocks().

ilColumnGUI::$type [protected]

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

Referenced by determineBlocks().


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