Public Member Functions | Data Fields

ilObjectGUIAdapter Class Reference

Inheritance diagram for ilObjectGUIAdapter:

Public Member Functions

 ilObjectGUIAdapter ($a_id, $a_call_by_reference, $a_prepare_output=true, $a_cmd= '')
 Constructor public.
 getId ()
 setCommand ($a_cmd)
 getCommand ()
 getType ()
 setType ($a_type)
 performAction ()
 setAdminTabs ()
 set admin tabs public
 __initGUIObject ($a_call_by_reference, $a_prepare_output=true)

Data Fields

 $gui_obj
 $ilias
 $tpl
 $lng
 $objDefinition
 $cmd
 $id
 $call_by_reference

Detailed Description

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


Member Function Documentation

ilObjectGUIAdapter::__initGUIObject ( a_call_by_reference,
a_prepare_output = true 
)

Definition at line 213 of file class.ilObjectGUIAdapter.php.

References $objDefinition, getId(), ilObjectFactory::getInstanceByObjId(), ilObjectFactory::getInstanceByRefId(), getType(), and setType().

Referenced by ilObjectGUIAdapter().

        {
                global $objDefinition;

                include_once "./classes/class.ilObjectFactory.php";

                // GET TYPE
                if($a_call_by_reference)
                {
                        $tmp_obj =& ilObjectFactory::getInstanceByRefId($this->getId());
                }
                else
                {
                        $tmp_obj =& ilObjectFactory::getInstanceByObjId($this->getId());
                }
                $this->setType($tmp_obj->getType());

                // INITIATE GUI CLASS
                $class_name = $objDefinition->getClassName($this->getType());
                $module_name = $objDefinition->getModule($this->getType());
                
                $module_dir = $module_name ? $module_name."/" : "";
                $class_constr = "ilObj".$class_name."GUI";

                //INCLUDE CLASS
                include_once "./".$module_dir."classes/class.ilObj".$class_name."GUI.php";

                // CALL CONSTRUCTOR
                $this->gui_obj =& new $class_constr(array(),$this->getId(),$a_call_by_reference,$a_prepare_output);
                
                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUIAdapter::getCommand (  ) 

Definition at line 83 of file class.ilObjectGUIAdapter.php.

Referenced by performAction(), and setAdminTabs().

        {
                return $this->cmd;
        }

Here is the caller graph for this function:

ilObjectGUIAdapter::getId (  ) 
ilObjectGUIAdapter::getType (  ) 

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

Referenced by __initGUIObject(), performAction(), and setAdminTabs().

        {
                return $this->type;
        }

Here is the caller graph for this function:

ilObjectGUIAdapter::ilObjectGUIAdapter ( a_id,
a_call_by_reference,
a_prepare_output = true,
a_cmd = '' 
)

Constructor public.

Definition at line 51 of file class.ilObjectGUIAdapter.php.

References $ilias, $lng, $objDefinition, $tpl, __initGUIObject(), and setCommand().

Referenced by ilObjChatGUIAdapter::ilObjChatGUIAdapter(), and ilObjExerciseGUIAdapter::ilObjExerciseGUIAdapter().

        {
                global $ilias,$tpl,$objDefinition,$lng;


                $this->ilias =& $ilias;
                $this->tpl =& $tpl;
                $this->lng =& $lng;
                $this->objDefinition =& $objDefinition;

                $this->setCommand($a_cmd);
                $this->id = $a_id;
                $this->call_by_reference = $a_call_by_reference;

                $this->__initGUIObject($a_call_by_reference,$a_prepare_output);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUIAdapter::performAction (  ) 

Definition at line 96 of file class.ilObjectGUIAdapter.php.

References getCommand(), and getType().

Referenced by ilObjChatGUIAdapter::ilObjChatGUIAdapter(), and ilObjExerciseGUIAdapter::ilObjExerciseGUIAdapter().

        {
                if($this->getCommand())
                {
                        $method = $this->getCommand()."Object";
                }
                else
                {
                        $method = $this->objDefinition->getFirstProperty($this->getType())."Object";
                }
                $this->gui_obj->$method();

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUIAdapter::setAdminTabs (  ) 

set admin tabs public

Definition at line 114 of file class.ilObjectGUIAdapter.php.

References $key, $rbacsystem, $row, $tab, getCommand(), ilUtil::getImagePath(), and getType().

Referenced by ilObjChatGUIAdapter::__prepareOutput().

        {
                global $rbacsystem;

                $tabs = array();
                $this->tpl->addBlockFile("TABS", "tabs", "tpl.tabs.html");

                $properties = $this->objDefinition->getProperties($this->getType());

                foreach($properties as $key => $row)
                {
                        $tabs[] = array($row["lng"], $row["name"]);
                }

                // check for call_by_reference too to avoid hacking
                if ($this->call_by_reference === false)
                {
                        $object_link = "&obj_id=".$_GET["obj_id"];
                }

                foreach ($tabs as $row)
                {
                        $i++;

                        if ($row[1] == $this->getCommand())
                        {
                                $tabtype = "tabactive";
                                $tab = $tabtype;
                        }
                        else
                        {
                                $tabtype = "tabinactive";
                                $tab = "tab";
                        }

                        $show = true;

                        // only check permissions for tabs if object is a permission object
                        if($this->call_by_reference)
                        {
                                // only show tab when the corresponding permission is granted
                                switch ($row[1])
                                {
                                        case 'view':
                                                if (!$rbacsystem->checkAccess('visible',$this->getId()))
                                                {
                                                        $show = false;
                                                }
                                                break;

                                        case 'edit':
                                                if (!$rbacsystem->checkAccess('write',$this->getId()))
                                                {
                                                        $show = false;
                                                }
                                                break;

                                        case 'perm':
                                                if (!$rbacsystem->checkAccess('edit_permission',$this->getId()))
                                                {
                                                        $show = false;
                                                }
                                                break;
                                        case 'trash':
                                                if (!$this->gui_obj->tree->getSavedNodeData($this->getId()))
                                                {
                                                        $show = false;
                                                }
                                                break;

                                        case 'newmembers':
                                        case 'members':
                                                if (!$rbacsystem->checkAccess('write',$this->getId()))
                                                {
                                                        $show = false;
                                                }
                                                break;

                                } //switch
                        }

                        if (!$show)
                        {
                                continue;
                        }

                        $this->tpl->setCurrentBlock("tab");
                        $this->tpl->setVariable("TAB_TYPE", $tabtype);
                        $this->tpl->setVariable("TAB_TYPE2", $tab);
                        $this->tpl->setVariable("IMG_LEFT", ilUtil::getImagePath("eck_l.gif"));
                        $this->tpl->setVariable("IMG_RIGHT", ilUtil::getImagePath("eck_r.gif"));
                        $this->tpl->setVariable("TAB_LINK", $this->gui_obj->tab_target_script."?ref_id=".$this->getId().$object_link."&cmd=".$row[1]);
                        $this->tpl->setVariable("TAB_TEXT", $this->gui_obj->lng->txt($row[0]));
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUIAdapter::setCommand ( a_cmd  ) 

Definition at line 72 of file class.ilObjectGUIAdapter.php.

References $_POST.

Referenced by ilObjectGUIAdapter().

        {
                if($a_cmd == "gateway" || $a_cmd == "post")
                {
                        @$this->cmd = key($_POST["cmd"]);
                }
                else
                {
                        $this->cmd = $a_cmd;
                }
        }

Here is the caller graph for this function:

ilObjectGUIAdapter::setType ( a_type  ) 

Definition at line 91 of file class.ilObjectGUIAdapter.php.

Referenced by __initGUIObject().

        {
                $this->type = $a_type;
        }

Here is the caller graph for this function:


Field Documentation

ilObjectGUIAdapter::$call_by_reference

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

ilObjectGUIAdapter::$cmd

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

ilObjectGUIAdapter::$gui_obj

Definition at line 37 of file class.ilObjectGUIAdapter.php.

ilObjectGUIAdapter::$id

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

ilObjectGUIAdapter::$ilias

Definition at line 38 of file class.ilObjectGUIAdapter.php.

Referenced by ilObjectGUIAdapter().

ilObjectGUIAdapter::$lng

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

Referenced by ilObjectGUIAdapter().

ilObjectGUIAdapter::$objDefinition

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

Referenced by __initGUIObject(), and ilObjectGUIAdapter().

ilObjectGUIAdapter::$tpl

Definition at line 39 of file class.ilObjectGUIAdapter.php.

Referenced by ilObjectGUIAdapter().


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