Public Member Functions | Data Fields

ilObjectGUI Class Reference

Inheritance diagram for ilObjectGUI:

Public Member Functions

 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
executeCommand ()
 execute command
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 setActions ($a_actions="")
 set possible actions for objects in list.
 setSubObjects ($a_sub_objects="")
 set possible subobjects for this object.
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 undeleteObject ()
 get object back from trash
 insertSavedNodes ($a_source_id, $a_dest_id, $a_tree_id)
 recursive method to insert all saved nodes of the clipboard (maybe this function could be moved to a rbac class ?)
 confirmedDeleteObject ()
 confirmed deletion if object -> objects are moved to trash
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 removeDeletedNodes ($a_node_id, $a_checked, $a_delete_objects=true)
 remove already deleted objects within the objects in trash recursive function
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 importObject ()
 import new object form
 editObject ()
 edit object
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 updateObject ()
 updates object entry in object_data
 afterUpdate ()
 permObject ()
 show permissions of current node
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 permSaveObject ()
 save permissions
 displayList ()
 display object list
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 display deletion confirmation screen only for referenced objects.
 trashObject ()
 show trash content of object
 addRoleObject ()
 adds a local role This method is only called when choose the option 'you may add local roles'.
 showActions ($with_subobjects=false)
 show possible action (form buttons)
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 infoObject ()
 __buildRoleFilterSelect ()
 __filterRoles ($a_roles, $a_filter)
 ownerObject ()
 changeOwnerObject ()
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value

Data Fields

 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false

Detailed Description

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


Member Function Documentation

ilObjectGUI::__buildRoleFilterSelect (  ) 

Definition at line 2415 of file class.ilObjectGUI.php.

References $_SESSION, and formSelect().

        {
                $action[1] = $this->lng->txt('all_roles');
                $action[2] = $this->lng->txt('all_global_roles');
                $action[3] = $this->lng->txt('all_local_roles');
                $action[4] = $this->lng->txt('linked_local_roles');
                $action[5] = $this->lng->txt('local_roles_this_object_only');
                
                return ilUtil::formSelect($_SESSION['perm_filtered_roles'],"filter",$action,false,true);
        }

Here is the call graph for this function:

ilObjectGUI::__filterRoles ( a_roles,
a_filter 
)

Definition at line 2426 of file class.ilObjectGUI.php.

References $rbacreview, and $role_id.

        {
                global $rbacreview;

                switch ($a_filter)
                {
                        case 1: // all roles
                                return $a_roles;
                                break;
                        
                        case 2: // all global roles
                                $arr_global_roles = $rbacreview->getGlobalRoles();
                                $arr_remove_roles = array_diff(array_keys($a_roles),$arr_global_roles);

                                foreach ($arr_remove_roles as $role_id)
                                {
                                        unset($a_roles[$role_id]);
                                }
                                
                                return $a_roles;
                                break;                  

                        case 3: // all local roles
                                $arr_global_roles = $rbacreview->getGlobalRoles();

                                foreach ($arr_global_roles as $role_id)
                                {
                                        unset($a_roles[$role_id]);
                                }
                                
                                return $a_roles;
                                break;
                                
                        case 4: // all roles
                                return $a_roles;
                                break;
                                
                        case 5: // local role only at this position
                                
                                $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
                
                                if (!$role_folder)
                                {
                                        return array();
                                }
                                
                                $arr_local_roles = $rbacreview->getRolesOfRoleFolder($role_folder["ref_id"]);
                                $arr_remove_roles = array_diff(array_keys($a_roles),$arr_local_roles);

                                foreach ($arr_remove_roles as $role_id)
                                {
                                        unset($a_roles[$role_id]);
                                }

                                return $a_roles;
                                break;
                }

                return $a_roles;
        }

& ilObjectGUI::__initTableGUI (  ) 

Reimplemented in ilObjCategoryGUI, ilObjGroupGUI, ilObjRoleFolderGUI, ilObjRoleGUI, ilObjUserFolderGUI, ilObjUserGUI, ilObjCourseGUI, ilObjiLincCourseGUI, and ilObjPaymentSettingsGUI.

Definition at line 2317 of file class.ilObjectGUI.php.

Referenced by __showClipboardTable().

        {
                include_once "./classes/class.ilTableGUI.php";

                return new ilTableGUI(0,false);
        }

Here is the caller graph for this function:

ilObjectGUI::__setTableGUIBasicData ( &$  tbl,
&$  result_set,
a_from = "" 
)

standard implementation for tables use 'from' variable use different initial setting of table

Reimplemented in ilObjGroupGUI, ilObjRoleFolderGUI, ilObjRoleGUI, ilObjUserFolderGUI, ilObjUserGUI, ilObjCourseGUI, ilObjiLincCourseGUI, and ilObjPaymentSettingsGUI.

Definition at line 2329 of file class.ilObjectGUI.php.

References $_GET, and $tbl.

Referenced by __showClipboardTable().

        {
                switch ($a_from)
                {
                        case "clipboardObject":
                                $offset = $_GET["offset"];
                                $order = $_GET["sort_by"];
                                $direction = $_GET["sort_order"];
                                $tbl->disable("footer");
                                break;

                        default:
                                $offset = $_GET["offset"];
                                $order = $_GET["sort_by"];
                                $direction = $_GET["sort_order"];
                                break;
                }

                $tbl->setOrderColumn($order);
                $tbl->setOrderDirection($direction);
                $tbl->setOffset($offset);
                $tbl->setLimit($_GET["limit"]);
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
                $tbl->setData($result_set);
        }

Here is the caller graph for this function:

ilObjectGUI::__showButton ( a_cmd,
a_text,
a_target = '' 
)
ilObjectGUI::__showClipboardTable ( a_result_set,
a_from = "" 
)

Definition at line 2355 of file class.ilObjectGUI.php.

References $_GET, $tbl, $tpl, __initTableGUI(), __setTableGUIBasicData(), and ilUtil::getImagePath().

Referenced by ilContainerGUI::clipboardObject().

        {
        $tbl =& $this->__initTableGUI();
                $tpl =& $tbl->getTemplateObject();

                $tpl->setCurrentBlock("tbl_form_header");
                $tpl->setVariable("FORMACTION",$this->ctrl->getTargetScript()."?".$this->link_params."&cmd=post");
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME","paste");
                $tpl->setVariable("BTN_VALUE",$this->lng->txt("insert_object_here"));
                $tpl->parseCurrentBlock();
                
                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME","clear");
                $tpl->setVariable("BTN_VALUE",$this->lng->txt("clear_clipboard"));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_row");
                $tpl->setVariable("COLUMN_COUNTS",3);
                $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("spacer.gif"));
                $tpl->parseCurrentBlock();
                
                $tbl->setTitle($this->lng->txt("clipboard"),"icon_typ_b.gif",$this->lng->txt("clipboard"));
                $tbl->setHeaderNames(array($this->lng->txt('obj_type'),
                                                                   $this->lng->txt('title'),
                                                                   $this->lng->txt('action')));
                $tbl->setHeaderVars(array('type',
                                  'title',
                                                                  'act'),
                                                        array('ref_id' => $this->object->getRefId(),
                                                                  'cmd' => 'clipboard',
                                                                  'cmdClass' => $_GET['cmdClass'],
                                                                  'cmdNode' => $_GET['cmdNode']));

                $tbl->setColumnWidth(array("","80%","19%"));


                $this->__setTableGUIBasicData($tbl,$a_result_set,$a_from);
                $tbl->render();
                
                $this->tpl->setVariable("RESULT_TABLE",$tbl->tpl->get());

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::addAdminLocatorItems (  ) 

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented in ilObjChatGUI, ilObjRoleGUI, ilObjRoleTemplateGUI, ilObjStyleSheetGUI, and ilObjUserGUI.

Definition at line 764 of file class.ilObjectGUI.php.

References $_GET, and ilFrameTargetInfo::_getFrame().

Referenced by prepareOutput().

        {
                global $ilLocator;
                
                if ($_GET["admin_mode"] == "settings")  // system settings
                {               
                        $ilLocator->addItem($this->lng->txt("administration"),
                                $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"),
                                ilFrameTargetInfo::_getFrame("MainContent"));
                        if ($this->object->getRefId() != SYSTEM_FOLDER_ID)
                        {
                                $ilLocator->addItem($this->object->getTitle(),
                                        $this->ctrl->getLinkTarget($this, "view"));
                        }
                }
                else                                                    // repository administration
                {
                        $this->ctrl->setParameterByClass("iladministrationgui",
                                "ref_id", "");
                        $this->ctrl->setParameterByClass("iladministrationgui",
                                "admin_mode", "settings");
                        //$ilLocator->addItem($this->lng->txt("administration"),
                        //      $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"),
                        //      ilFrameTargetInfo::_getFrame("MainContent"));
                        $this->ctrl->clearParametersByClass("iladministrationgui");
                        $ilLocator->addAdministrationItems();
                }

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::addLocatorItems (  ) 

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented in ilObjQuestionPoolGUI, ilObjTestGUI, ilObjMediaPoolGUI, ilObjCourseGUI, ilObjSurveyGUI, and ilObjSurveyQuestionPoolGUI.

Definition at line 751 of file class.ilObjectGUI.php.

Referenced by setLocator().

        {
        }

Here is the caller graph for this function:

ilObjectGUI::addRoleObject (  ) 

adds a local role This method is only called when choose the option 'you may add local roles'.

This option is displayed in the permission settings dialogue for an object TODO: this will be changed public

Definition at line 2069 of file class.ilObjectGUI.php.

Referenced by ilObjSAHSLearningModuleGUI::addRole(), ilObjMediaPoolGUI::addRole(), ilObjFileBasedLMGUI::addRole(), and ilObjContentObjectGUI::addRole().

        {
                include_once './classes/class.ilPermissionGUI.php';
                $perm_gui =& new ilPermissionGUI($this);
                
                // dirty work around to forward command in admin panel
                $this->ctrl->current_node = 1;
                $this->ctrl->setCmd('addRole');
                $ret =& $this->ctrl->forwardCommand($perm_gui);
                
                return true;
        }

Here is the caller graph for this function:

ilObjectGUI::afterUpdate (  ) 

Reimplemented in ilObjMediaPoolGUI.

Definition at line 1393 of file class.ilObjectGUI.php.

Referenced by updateObject().

        {
                $this->ctrl->redirect($this);
        }

Here is the caller graph for this function:

ilObjectGUI::assignObject (  ) 

Reimplemented in ilObjAICCLearningModuleGUI, ilObjDlBookGUI, ilObjGlossaryGUI, ilObjHACPLearningModuleGUI, ilObjLearningModuleGUI, ilObjSCORMLearningModuleGUI, ilObjMediaObjectGUI, and ilObjiLincClassroomGUI.

Definition at line 225 of file class.ilObjectGUI.php.

Referenced by ilObjectGUI().

        {
                // TODO: it seems that we always have to pass only the ref_id
//echo "<br>ilObjectGUIassign:".get_class($this).":".$this->id.":<br>";
                if ($this->id != 0)
                {
                        if ($this->call_by_reference)
                        {
                                $this->object =& $this->ilias->obj_factory->getInstanceByRefId($this->id);
                        }
                        else
                        {
                                $this->object =& $this->ilias->obj_factory->getInstanceByObjId($this->id);
                        }
                }
        }

Here is the caller graph for this function:

ilObjectGUI::cancelDeleteObject (  ) 

cancel deletion of object

public

Reimplemented in ilObjStyleSettingsGUI, and ilObjStyleSheetGUI.

Definition at line 1039 of file class.ilObjectGUI.php.

References sendInfo().

        {
                session_unregister("saved_post");

                sendInfo($this->lng->txt("msg_cancel"),true);

                $this->ctrl->returnToParent($this);

        }

Here is the call graph for this function:

ilObjectGUI::cancelObject ( in_rep = false  ) 

cancel action and go back to previous page public

Reimplemented in ilObjQuestionPoolGUI, ilObjTestGUI, ilObjForumGUI, ilObjContentObjectGUI, ilObjFileBasedLMGUI, ilObjGlossaryGUI, ilObjMediaPoolGUI, and ilObjSurveyGUI.

Definition at line 1223 of file class.ilObjectGUI.php.

References $_GET, $return_location, and sendInfo().

        {
                session_unregister("saved_post");

                sendInfo($this->lng->txt("msg_cancel"),true);

                //sendInfo($this->lng->txt("action_aborted"),true);
                $return_location = $_GET["cmd_return_location"];
//echo "-".$_GET["cmd_return_location"]."-".$this->ctrl->getLinkTarget($this,$return_location);
                //ilUtil::redirect($this->ctrl->getLinkTarget($this,$return_location));
//echo "1";
                //if ($in_rep)
                //{
                        $this->ctrl->returnToParent($this);
                //}
                //else
                //{
//echo "3";
                //      ilUtil::redirect($this->getReturnLocation("cancel",$this->ctrl->getTargetScript()."?".$this->link_params));
                //}
        }

Here is the call graph for this function:

ilObjectGUI::changeOwnerObject (  ) 

Definition at line 2500 of file class.ilObjectGUI.php.

        {
                include_once './classes/class.ilPermissionGUI.php';
                $perm_gui =& new ilPermissionGUI($this);
                
                // dirty work around to forward command in admin panel
                $this->ctrl->current_node = 1;
                $this->ctrl->setCmd('changeOwner');
                $ret =& $this->ctrl->forwardCommand($perm_gui);
                
                return true;
        }

ilObjectGUI::confirmedDeleteObject (  ) 

confirmed deletion if object -> objects are moved to trash

However objects are only removed from tree!! That means that the objects itself stay in the database but are not linked in any context within the system. Trash Bin Feature: Objects can be refreshed in trash

public

Reimplemented in ilObjRoleFolderGUI, ilObjStyleSettingsGUI, ilObjStyleSheetFolderGUI, ilObjStyleSheetGUI, and ilObjUserFolderGUI.

Definition at line 887 of file class.ilObjectGUI.php.

References $_GET, $_POST, $_SESSION, $id, $log, $rbacadmin, $rbacsystem, ilPaymentObject::_isBuyable(), deleteObject(), ilObjectFactory::getInstanceByRefId(), removeFromSystemObject(), ilUtil::removeItemFromDesktops(), and sendInfo().

        {
                include_once './payment/classes/class.ilPaymentObject.php';

                global $rbacsystem, $rbacadmin, $log;
        
                // TODO: move checkings to deleteObject
                // TODO: cannot distinguish between obj_id from ref_id with the posted IDs.
                // change the form field and use instead of 'id' 'ref_id' and 'obj_id'. Then switch with varname
                
                // AT LEAST ONE OBJECT HAS TO BE CHOSEN.
                if (!isset($_SESSION["saved_post"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }

                // FOR ALL SELECTED OBJECTS
                foreach ($_SESSION["saved_post"] as $id)
                {
                        // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
                        $node_data = $this->tree->getNodeData($id);
                        $subtree_nodes = $this->tree->getSubTree($node_data);

                        $all_node_data[] = $node_data;
                        $all_subtree_nodes[] = $subtree_nodes;

                        // CHECK DELETE PERMISSION OF ALL OBJECTS
                        foreach ($subtree_nodes as $node)
                        {
                                if($node['type'] == 'rolf')
                                {
                                        continue;
                                }
                                if (!$rbacsystem->checkAccess('delete',$node["child"]))
                                {
                                        $not_deletable[] = $node["child"];
                                        $perform_delete = false;
                                }
                                else if(ilPaymentObject::_isBuyable($node['child']))
                                {
                                        $buyable[] = $node['child'];
                                        $perform_delete = false;
                                }
                        }
                }

                // IF THERE IS ANY OBJECT WITH NO PERMISSION TO DELETE
                if (count($not_deletable))
                {
                        $not_deletable = implode(',',$not_deletable);
                        session_unregister("saved_post");
                        sendInfo($this->lng->txt("msg_no_perm_delete")." ".$not_deletable."<br/>".$this->lng->txt("msg_cancel"),true);

                        $this->ctrl->returnToParent($this);
                }

                if(count($buyable))
                {
                        foreach($buyable as $id)
                        {
                                $tmp_object =& ilObjectFactory::getInstanceByRefId($id);

                                $titles[] = $tmp_object->getTitle();
                        }
                        $title_str = implode(',',$titles);

                        sendInfo($this->lng->txt('msg_obj_not_deletable_sold').' '.$title_str,true);

                        $_POST['id'] = $_SESSION['saved_post'];
                        $this->deleteObject(true);

                        return false;
                }

                // DELETE THEM
                if (!$all_node_data[0]["type"])
                {
                        // OBJECTS ARE NO 'TREE OBJECTS'
                        if ($rbacsystem->checkAccess('delete',$_GET["ref_id"]))
                        {
                                foreach($_SESSION["saved_post"] as $id)
                                {
                                        $obj =& $this->ilias->obj_factory->getInstanceByObjId($id);
                                        $obj->delete();
                                        
                                        // write log entry
                                        $log->write("ilObjectGUI::confirmedDeleteObject(), deleted obj_id ".$obj->getId().
                                                ", type: ".$obj->getType().", title: ".$obj->getTitle());
                                }
                        }
                        else
                        {
                                unset($_SESSION["saved_post"]);
                                sendInfo($this->lng->txt("no_perm_delete")."<br/>".$this->lng->txt("msg_cancel"),true);
                                $this->ctrl->returnToParent($this);
                        }
                }
                else
                {
                        // SAVE SUBTREE AND DELETE SUBTREE FROM TREE
                        foreach ($_SESSION["saved_post"] as $id)
                        {
                                // DELETE OLD PERMISSION ENTRIES
                                $subnodes = $this->tree->getSubtree($this->tree->getNodeData($id));

                                foreach ($subnodes as $subnode)
                                {
                                        $rbacadmin->revokePermission($subnode["child"]);
                                        // remove item from all user desktops
                                        $affected_users = ilUtil::removeItemFromDesktops($subnode["child"]);
                                
                                        // TODO: inform users by mail that object $id was deleted
                                        //$mail->sendMail($id,$msg,$affected_users);
                                }

                                $this->tree->saveSubTree($id, true);
                                $this->tree->deleteTree($this->tree->getNodeData($id));

                                // write log entry
                                $log->write("ilObjectGUI::confirmedDeleteObject(), moved ref_id ".$id.
                                        " to trash");
                                
                                // remove item from all user desktops
                                $affected_users = ilUtil::removeItemFromDesktops($id);

                                // TODO: inform users by mail that object $id was deleted
                                //$mail->sendMail($id,$msg,$affected_users);
                        }
                        // inform other objects in hierarchy about paste operation
                        //$this->object->notify("confirmedDelete", $_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$_SESSION["saved_post"]);
                }
                
                if ($this->ilias->getSetting('enable_trash'))
                {
                        // Feedback
                        sendInfo($this->lng->txt("info_deleted"),true);
                
                        $this->ctrl->returnToParent($this);
                }
                else  // skip trash if 'enable_trash' is 0
                {
                        $_POST["trash_id"] = $_SESSION["saved_post"];
                        
                        $this->removeFromSystemObject();
                }
        }

Here is the call graph for this function:

ilObjectGUI::createObject (  ) 

create new object form

public

Reimplemented in ilObjQuestionPoolGUI, ilObjTestGUI, ilObjCategoryGUI, ilObjExerciseGUI, ilObjFileGUI, ilObjFolderGUI, ilObjForumGUI, ilObjGroupGUI, ilObjRoleFolderGUI, ilObjRoleGUI, ilObjRoleTemplateGUI, ilObjStyleSheetGUI, ilObjUserGUI, ilObjContentObjectGUI, ilObjFileBasedLMGUI, ilObjGlossaryGUI, ilObjMediaPoolGUI, ilObjSAHSLearningModuleGUI, ilObjMediaObjectGUI, ilObjCourseGUI, ilObjiLincCourseGUI, ilObjSurveyGUI, and ilObjSurveyQuestionPoolGUI.

Definition at line 1169 of file class.ilObjectGUI.php.

References $_GET, $_POST, $_SESSION, $data, $key, $rbacsystem, ilUtil::getImagePath(), getTargetFrame(), getTemplateFile(), ilUtil::prepareFormOutput(), and ilUtil::stripSlashes().

        {
                global $rbacsystem;

                $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];

                if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
                {
                        $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
                }
                else
                {
                        // fill in saved values in case of error
                        $data = array();
                        $data["fields"] = array();
                        $data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
                        $data["fields"]["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);

                        $this->getTemplateFile("edit",$new_type);
                        
                        // show obj type image
                        $this->tpl->setCurrentBlock("img");
                        $this->tpl->setVariable("TYPE_IMG",
                                ilUtil::getImagePath("icon_".$new_type.".gif"));
                        $this->tpl->setVariable("ALT_IMG",
                                $this->lng->txt("obj_".$new_type));
                        $this->tpl->parseCurrentBlock();

                        foreach ($data["fields"] as $key => $val)
                        {
                                $this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
                                $this->tpl->setVariable(strtoupper($key), $val);

                                if ($this->prepare_output)
                                {
                                        $this->tpl->parseCurrentBlock();
                                }
                        }
                        $this->ctrl->setParameter($this, "new_type", $new_type);
                        $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
                        $this->tpl->setVariable("TXT_HEADER", $this->lng->txt($new_type."_new"));
                        $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
                        $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($new_type."_add"));
                        $this->tpl->setVariable("CMD_SUBMIT", "save");
                        $this->tpl->setVariable("TARGET", $this->getTargetFrame("save"));
                        $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
                }
        }

Here is the call graph for this function:

ilObjectGUI::deleteObject ( a_error = false  ) 

display deletion confirmation screen only for referenced objects.

For user,role & rolt overwrite this function in the appropriate Object folders classes (ilObjUserFolderGUI,ilObjRoleFolderGUI)

public

Reimplemented in ilObjStyleSheetGUI.

Definition at line 1828 of file class.ilObjectGUI.php.

References $_GET, $_POST, $_SESSION, $counter, $id, $key, ilUtil::getImagePath(), ilUtil::getImageTagByType(), getTemplateFile(), sendInfo(), and ilUtil::switchColor().

Referenced by confirmedDeleteObject().

        {
                if ($_GET["item_ref_id"] != "")
                {
                        $_POST["id"] = array($_GET["item_ref_id"]);
                }

                if (!isset($_POST["id"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }

                // SAVE POST VALUES
                $_SESSION["saved_post"] = $_POST["id"];

                unset($this->data);
                $this->data["cols"] = array("type", "title", "last_change");

                foreach ($_POST["id"] as $id)
                {
                        // TODO: cannot distinguish between obj_id from ref_id with the posted IDs.
                        // change the form field and use instead of 'id' 'ref_id' and 'obj_id'. Then switch with varname
                        //if ($this->call_by_reference)
                        //{
                                $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($id);
                        //}
                        //else
                        //{
                        //      $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($id);
                        //}

                        $this->data["data"]["$id"] = array(
                                                                                                "type"        => $obj_data->getType(),
                                                                                                "title"       => $obj_data->getTitle()."#separator#".$obj_data->getDescription()." ",   // workaround for empty desc
                                                                                                "last_update" => $obj_data->getLastUpdateDate()
                                                                                        );
                }

                $this->data["buttons"] = array( "confirmedDelete"  => $this->lng->txt("confirm"),
                                                                  "cancelDelete"  => $this->lng->txt("cancel"));

                $this->getTemplateFile("confirm");

                if(!$a_error)
                {
                        $msg = $this->lng->txt("info_delete_sure");
                        
                        if (!$this->ilias->getSetting('enable_trash'))
                        {
                                $msg .= "<br/>".$this->lng->txt("info_delete_warning_no_trash");
                        }
                        
                        sendInfo($msg);
                }

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
        
                // BEGIN TABLE HEADER
                foreach ($this->data["cols"] as $key)
                {
                        $this->tpl->setCurrentBlock("table_header");
                        $this->tpl->setVariable("TEXT",$this->lng->txt($key));
                        $this->tpl->parseCurrentBlock();
                }
                // END TABLE HEADER

                // BEGIN TABLE DATA
                $counter = 0;

                foreach ($this->data["data"] as $key => $value)
                {
                        // BEGIN TABLE CELL
                        foreach ($value as $key => $cell_data)
                        {
                                $this->tpl->setCurrentBlock("table_cell");

                                // CREATE TEXT STRING
                                if ($key == "type")
                                {
                                        $this->tpl->setVariable("TEXT_CONTENT",ilUtil::getImageTagByType($cell_data,$this->tpl->tplPath));
                                }
                                elseif ($key == "title")
                                {
                                        $name_field = explode("#separator#",$cell_data);

                                        $this->tpl->setVariable("TEXT_CONTENT", "<b>".$name_field[0]."</b>");
                                                
                                        $this->tpl->setCurrentBlock("subtitle");
                                        $this->tpl->setVariable("DESC", $name_field[1]);
                                        $this->tpl->parseCurrentBlock();
                                        $this->tpl->setCurrentBlock("table_cell");
                                }
                                else
                                {
                                        $this->tpl->setVariable("TEXT_CONTENT",$cell_data);
                                }

                                $this->tpl->parseCurrentBlock();
                        }

                        $this->tpl->setCurrentBlock("table_row");
                        $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
                        $this->tpl->parseCurrentBlock();
                        // END TABLE CELL
                }
                // END TABLE DATA

                // BEGIN OPERATION_BTN
                foreach ($this->data["buttons"] as $name => $value)
                {
                        $this->tpl->setCurrentBlock("operation_btn");
                        $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
                        $this->tpl->setVariable("BTN_NAME",$name);
                        $this->tpl->setVariable("BTN_VALUE",$value);
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::displayEditForm ( fields  ) 

display edit form (usually called by editObject)

private

Parameters:
array $fields key/value pairs of input fields

Reimplemented in ilObjiLincClassroomGUI.

Definition at line 1349 of file class.ilObjectGUI.php.

References $fields, $key, getTargetFrame(), and getTemplateFile().

Referenced by editObject().

        {
                $this->getTemplateFile("edit");

                foreach ($fields as $key => $val)
                {
                        $this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
                        $this->tpl->setVariable(strtoupper($key), $val);
                        $this->tpl->parseCurrentBlock();
                }

                //$obj_str = ($this->call_by_reference) ? "" : "&obj_id=".$this->obj_id;
                if (!$this->call_by_reference)
                {
                        $this->ctrl->setParameter($this, "obj_id", $this->obj_id);
                }

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TXT_HEADER", $this->lng->txt($this->object->getType()."_edit"));
                $this->tpl->setVariable("TARGET", $this->getTargetFrame("update"));
                $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
                $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
                $this->tpl->setVariable("CMD_SUBMIT", "update");
                $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::displayList (  ) 

display object list

public

Reimplemented in ilObjLanguageFolderGUI, ilObjObjectFolderGUI, ilObjSystemFolderGUI, ilObjTypeDefinitionGUI, and ilObjUserFolderGUI.

Definition at line 1539 of file class.ilObjectGUI.php.

References $_GET, $_SESSION, $data, $key, $tbl, ilObject::_lookupType(), ilUtil::getImageTagByType(), ilUtil::shortenText(), showActions(), and ilUtil::switchColor().

Referenced by viewObject().

        {
                include_once "./classes/class.ilTableGUI.php";

                // load template for table
                $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
                // load template for table content data
                $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.obj_tbl_rows.html");

                $num = 0;

                if (!$this->call_by_reference)
                {
                        $this->ctrl->setParameter($this, "obj_id", $this->obj_id); 
                }
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

                // create table
                $tbl = new ilTableGUI();

                // title & header columns
                $tbl->setTitle($this->object->getTitle(),"icon_".$this->object->getType().".gif",
                                           $this->lng->txt("obj_".$this->object->getType()));
                $tbl->setHelp("tbl_help.php","icon_help.gif",$this->lng->txt("help"));

                foreach ($this->data["cols"] as $val)
                {
                        $header_names[] = $this->lng->txt($val);
                }

                $tbl->setHeaderNames($header_names);

                //$header_params = array("ref_id" => $this->ref_id);
                //$header_params = array("ref_id" => $this->ref_id);
                $header_params = $this->ctrl->getParameterArray($this, "view");
                $tbl->setHeaderVars($this->data["cols"],$header_params);
                $tbl->setColumnWidth(array("15","15","75%","25%"));

                // control
                $tbl->setOrderColumn($_GET["sort_by"]);
                $tbl->setOrderDirection($_GET["sort_order"]);
                $tbl->setLimit($_GET["limit"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setMaxCount($this->maxcount);

                $this->tpl->setVariable("COLUMN_COUNTS",count($this->data["cols"]));

                // footer
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));

                if (!empty($this->data["data"][0]))
                {
                        //table cell
                        for ($i=0; $i < count($this->data["data"]); $i++)
                        {
                                $data = $this->data["data"][$i];
                                $ctrl = $this->data["ctrl"][$i];

                                // color changing
                                $css_row = ilUtil::switchColor($i+1,"tblrow2","tblrow1");

                                // surpress checkbox for particular object types AND the system role
                                if (!$this->objDefinition->hasCheckbox($ctrl["type"]) or $ctrl["obj_id"] == SYSTEM_ROLE_ID or $ctrl["obj_id"] == SYSTEM_USER_ID or $ctrl["obj_id"] == ANONYMOUS_ROLE_ID)
                                {
                                        $this->tpl->touchBlock("empty_cell");
                                }
                                else
                                {
                                        // TODO: this object type depending 'if' could become really a problem!!
                                        if ($ctrl["type"] == "usr" or $ctrl["type"] == "role" or $ctrl["type"] == "rolt")
                                        {
                                                $link_id = $ctrl["obj_id"];
                                        }
                                        else
                                        {
                                                $link_id = $ctrl["ref_id"];
                                        }
                                        
                                        // dirty workaround to have ids for function showActions (checkbox toggle option)
                                        $this->ids[] = $link_id;
                                        
                                        $this->tpl->setCurrentBlock("checkbox");
                                        $this->tpl->setVariable("CHECKBOX_ID", $link_id);
                                        $this->tpl->setVariable("CSS_ROW", $css_row);
                                        $this->tpl->parseCurrentBlock();
                                }

                                $this->tpl->setCurrentBlock("table_cell");
                                $this->tpl->setVariable("CELLSTYLE", "tblrow1");
                                $this->tpl->parseCurrentBlock();

                                foreach ($data as $key => $val)
                                {
                                        //build link
                                        $obj_type = ilObject::_lookupType($ctrl["ref_id"],true);
                                        $class_name = $this->objDefinition->getClassName($obj_type);
                                        $class = strtolower("ilObj".$class_name."GUI");
                                        $this->ctrl->setParameterByClass($class, "ref_id", $ctrl["ref_id"]);
                                        $this->ctrl->setParameterByClass($class, "obj_id", $ctrl["obj_id"]);
                                        $link = $this->ctrl->getLinkTargetByClass($class, "view");

                                        /*
                                        $n = 0;

                                        foreach ($ctrl as $key2 => $val2)
                                        {
                                                $link .= $key2."=".$val2;

                                                if ($n < count($ctrl)-1)
                                                {
                                                $link .= "&";
                                                        $n++;
                                                }
                                        }*/

                                        if ($key == "name" || $key == "title")
                                        {
                                                $name_field = explode("#separator#",$val);
                                        }

                                        if ($key == "title" || $key == "name" || $key == "type")
                                        {
                                                $this->tpl->setCurrentBlock("begin_link");
                                                $this->tpl->setVariable("LINK_TARGET", $link);

                                                $this->tpl->parseCurrentBlock();
                                                $this->tpl->touchBlock("end_link");
                                        }

                                        // process clipboard information
                                        if (($key == "title" || $key == "name") and is_array(($_SESSION["clipboard"])))
                                        {
                                                // TODO: broken! fix me
                                                if (in_array($ctrl["ref_id"],$_SESSION["clipboard"]["ref_ids"]))
                                                {
                            switch($_SESSION["clipboard"]["cmd"])
                                                        {
                                case "cut":
                                    $name_field[0] = "<del>".$name_field[0]."</del>";
                                    break;

                                case "copy":
                                    $name_field[0] = "<font color=\"green\">+</font>  ".$name_field[0];
                                    break;
                                        
                                case "link":
                                    $name_field[0] = "<font color=\"black\"><</font> ".$name_field[0];
                                    break;
                            }
                                        }
                                }

                                        $this->tpl->setCurrentBlock("text");

                                        if ($key == "type")
                                        {
                                                $val = ilUtil::getImageTagByType($val,$this->tpl->tplPath);
                                        }

                                        if ($key == "name" || $key == "title")
                                        {
                                                $this->tpl->setVariable("TEXT_CONTENT", $name_field[0]);
                                                
                                                $this->tpl->setCurrentBlock("subtitle");
                                                $this->tpl->setVariable("DESC", ilUtil::shortenText($name_field[1],MAXLENGTH_OBJ_DESC,true));
                                                $this->tpl->parseCurrentBlock();
                                        }
                                        else
                                        {
                                                $this->tpl->setVariable("TEXT_CONTENT", $val);
                                        }
                                        
                                        $this->tpl->parseCurrentBlock();

                                        $this->tpl->setCurrentBlock("table_cell");
                                        $this->tpl->parseCurrentBlock();

                                } //foreach

                                $this->tpl->setCurrentBlock("tbl_content");
                                $this->tpl->setVariable("CSS_ROW", $css_row);
                                $this->tpl->parseCurrentBlock();
                        } //for
                } //if is_array
                else
                {
            $tbl->disable("header");
                        $tbl->disable("footer");
                        
                        $this->tpl->setCurrentBlock("text");
                        
                        // do not display an "error message" here
                        // this confuses people in administratino
                        //$this->tpl->setVariable("TEXT_CONTENT",
                        //      $this->lng->txt("obj_not_found"));
                        $this->tpl->setVariable("CSS_ROW", "tblrow1");
                        $this->tpl->setVariable("TEXT_CONTENT",
                                "&nbsp;");
                        $this->tpl->parseCurrentBlock();
                }
                
                $this->showActions(true);
                
                // render table
                $tbl->render();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::editObject (  ) 

edit object

public

Reimplemented in ilObjChatServerGUI, ilObjCategoryGUI, ilObjExerciseGUI, ilObjFileGUI, ilObjForumGUI, ilObjGroupGUI, ilObjRoleGUI, ilObjRoleTemplateGUI, ilObjStyleSheetGUI, ilObjTypeDefinitionGUI, ilObjUserGUI, ilObjFileBasedLMGUI, ilObjMediaPoolGUI, ilObjMediaObjectGUI, ilObjCourseGUI, and ilObjiLincCourseGUI.

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

References $_SESSION, $fields, $rbacsystem, displayEditForm(), ilUtil::prepareFormOutput(), and ilUtil::stripSlashes().

        {
                global $rbacsystem;

                if (!$rbacsystem->checkAccess("write", $this->ref_id))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
                }

                $fields = array();

                if ($_SESSION["error_post_vars"])
                {
                        // fill in saved values in case of error
                        $fields["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
                        $fields["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);
                }
                else
                {
                        $fields["title"] = ilUtil::prepareFormOutput($this->object->getTitle());
                        $fields["desc"] = ilUtil::stripSlashes($this->object->getLongDescription());
                }

                $this->displayEditForm($fields);
        }

Here is the call graph for this function:

& ilObjectGUI::executeCommand (  ) 
ilObjectGUI::getAdminTabs ( &$  tabs_gui  ) 

administration tabs show only permissions and trash folder

Reimplemented in ilObjChatServerGUI, ilObjAdvancedEditingGUI, ilObjAssessmentFolderGUI, ilObjAuthSettingsGUI, ilObjExternalToolsSettingsGUI, ilObjLanguageFolderGUI, ilObjMailGUI, ilObjRoleGUI, ilObjRoleTemplateGUI, ilObjStyleSettingsGUI, ilObjStyleSheetGUI, ilObjSystemFolderGUI, ilObjUserFolderGUI, ilObjUserGUI, ilObjPaymentSettingsGUI, ilObjSearchSettingsGUI, and ilObjUserTrackingGUI.

Definition at line 516 of file class.ilObjectGUI.php.

References $_GET, $rbacsystem, and ilFrameTargetInfo::_getFrame().

Referenced by setAdminTabs().

        {
                global $rbacsystem;

                if ($_GET["admin_mode"] == "repository")
                {
                        $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "settings");
                        $tabs_gui->setBackTarget($this->lng->txt("administration"),
                                $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"),
                                ilFrameTargetInfo::_getFrame("MainContent"));
                        $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "repository");
                }
                
                if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
                {
                        $tabs_gui->addTarget("view",
                                $this->ctrl->getLinkTarget($this, "view"), array("", "view"), get_class($this));
                }
                
                if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
                {
                        $tabs_gui->addTarget("perm_settings",
                                $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), "", "ilpermissiongui");
                }
                        
                if ($this->tree->getSavedNodeData($this->object->getRefId()))
                {
                        $tabs_gui->addTarget("trash",
                                $this->ctrl->getLinkTarget($this, "trash"), "trash", get_class($this));
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::getCreationMode (  ) 
ilObjectGUI::getFormAction ( a_cmd,
a_formaction = "" 
)

get form action for command (command is method name without "Object", e.g.

"perm")

Parameters:
string $a_cmd command
string $a_formaction default formaction (is returned, if no special formaction was set) public
Returns:
string

Definition at line 1424 of file class.ilObjectGUI.php.

Referenced by ilObjiLincClassroomGUI::create(), ilObjiLincCourseGUI::createObject(), ilObjGroupGUI::createObject(), ilObjFolderGUI::createObject(), ilObjExerciseGUI::deliverObject(), ilObjiLincCourseGUI::displayEditForm(), ilObjiLincClassroomGUI::displayEditForm(), ilObjFileGUI::editObject(), ilObjGroupGUI::exportObject(), ilObjExerciseGUI::membersObject(), and ilObjiLincClassroomGUI::removeClassroom().

        {
                if ($this->formaction[$a_cmd] != "")
                {
                        return $this->formaction[$a_cmd];
                }
                else
                {
                        return $a_formaction;
                }
        }

Here is the caller graph for this function:

ilObjectGUI::getHTML (  ) 

Definition at line 549 of file class.ilObjectGUI.php.

        {
                return $this->html;
        }

ilObjectGUI::getReturnLocation ( a_cmd,
a_location = "" 
)

get return location for command (command is method name without "Object", e.g.

"perm")

Parameters:
string $a_cmd command
string $a_location default return location (is returned, if no special return location was set) public

Definition at line 1456 of file class.ilObjectGUI.php.

Referenced by ilObjTestGUI::backToCourseObject(), ilObjSurveyGUI::backToRepositoryObject(), ilObjTestGUI::backToRepositoryObject(), ilObjStyleSheetFolderGUI::confirmedDeleteObject(), ilObjStyleSettingsGUI::confirmedDeleteObject(), ilObjCourseGUI::importFileObject(), ilObjSurveyGUI::inviteObject(), ilObjForumGUI::performImportObject(), ilObjCourseGUI::saveObject(), GUI::saveObject(), ilObjStyleSheetFolderGUI::saveObject(), ilObjStyleSettingsGUI::saveObject(), ilObjFileGUI::saveObject(), ilObjChatGUI::saveObject(), ilObjAuthSettingsGUI::setAuthModeObject(), ilObjGroupGUI::updateObject(), ilObjFileGUI::updateObject(), ilObjCategoryGUI::updateObject(), and ilObjSurveyGUI::uploadObject().

        {
                if ($this->return_location[$a_cmd] != "")
                {
                        return $this->return_location[$a_cmd];
                }
                else
                {
                        return $a_location;
                }
        }

Here is the caller graph for this function:

ilObjectGUI::getTabs ( &$  tabs_gui  ) 
ilObjectGUI::getTargetFrame ( a_cmd,
a_target_frame = "" 
)

get target frame for command (command is method name without "Object", e.g.

"perm")

Parameters:
string $a_cmd command
string $a_target_frame default target frame (is returned, if no special target frame was set) public

Definition at line 1488 of file class.ilObjectGUI.php.

Referenced by ilObjiLincClassroomGUI::create(), ilObjiLincCourseGUI::createObject(), ilObjUserGUI::createObject(), ilObjRoleTemplateGUI::createObject(), ilObjRoleGUI::createObject(), ilObjGroupGUI::createObject(), ilObjFolderGUI::createObject(), ilObjFileGUI::createObject(), createObject(), ilObjiLincCourseGUI::displayEditForm(), ilObjiLincClassroomGUI::displayEditForm(), displayEditForm(), ilObjUserGUI::editObject(), ilObjRoleTemplateGUI::editObject(), ilObjRoleGUI::editObject(), ilObjFileGUI::editObject(), and ilObjCategoryGUI::editObject().

        {
                if ($this->target_frame[$a_cmd] != "")
                {
                        return $this->target_frame[$a_cmd];
                }
                elseif (!empty($a_target_frame))
                {
                        return "target=\"".$a_target_frame."\"";
                }
                else
                {
                        return;
                }
        }

Here is the caller graph for this function:

ilObjectGUI::getTemplateFile ( a_cmd,
a_type = "" 
)

get a template blockfile format: tpl.

<objtype>_<command>.html

Parameters:
string command
string object type definition public

Definition at line 2239 of file class.ilObjectGUI.php.

Referenced by ilObjAuthSettingsGUI::authSettingsObject(), ilObjSystemFolderGUI::benchmarkObject(), ilObjSystemFolderGUI::checkObject(), ilObjiLincCourseGUI::confirmationObject(), ilObjGroupGUI::confirmationObject(), ilObjUserFolderGUI::confirmDeleteExportFileObject(), ilObjSurveyQuestionPoolGUI::createObject(), ilObjSurveyGUI::createObject(), ilObjGlossaryGUI::createObject(), ilObjFileBasedLMGUI::createObject(), ilObjContentObjectGUI::createObject(), ilObjUserGUI::createObject(), ilObjStyleSheetGUI::createObject(), ilObjRoleTemplateGUI::createObject(), ilObjRoleGUI::createObject(), ilObjGroupGUI::createObject(), ilObjFolderGUI::createObject(), ilObjFileGUI::createObject(), createObject(), ilObjCategoryGUI::createObject(), ilObjTestGUI::createObject(), ilObjQuestionPoolGUI::createObject(), ilObjUserFolderGUI::deleteObject(), ilObjRoleFolderGUI::deleteObject(), deleteObject(), ilObjExerciseGUI::deliverObject(), displayEditForm(), ilObjAuthSettingsGUI::editCASObject(), ilObjExternalToolsSettingsGUI::editiLincObject(), ilObjAuthSettingsGUI::editLDAPObject(), ilObjUserGUI::editObject(), ilObjStyleSheetGUI::editObject(), ilObjRoleTemplateGUI::editObject(), ilObjRoleGUI::editObject(), ilObjGroupGUI::editObject(), ilObjFileGUI::editObject(), ilObjExerciseGUI::editObject(), ilObjCategoryGUI::editObject(), ilObjAuthSettingsGUI::editRADIUSObject(), ilObjAuthSettingsGUI::editScriptObject(), ilObjAuthSettingsGUI::editSHIBObject(), ilObjAuthSettingsGUI::editSOAPObject(), ilObjUserFolderGUI::exportObject(), ilObjSurveyQuestionPoolGUI::importObject(), ilObjSurveyGUI::importObject(), ilObjMailGUI::importObject(), ilObjTestGUI::importObject(), ilObjQuestionPoolGUI::importObject(), ilObjExerciseGUI::membersObject(), ilObjExerciseGUI::newMembersObject(), ilObjiLincClassroomGUI::removeClassroom(), ilObjUserFolderGUI::settingsObject(), ilObjSystemFolderGUI::startValidator(), trashObject(), ilObjExternalToolsSettingsGUI::viewObject(), ilObjExerciseGUI::viewObject(), and ilObjSystemFolderGUI::viewScanLog().

        {
                if (!$a_type)
                {
                        $a_type = $this->type;
                }

                $template = "tpl.".$a_type."_".$a_cmd.".html";

                // try type specific in specific template
                if (!$this->tpl->fileExists($template) &&
                        !file_exists("./templates/default/".$template))
                {
                        $template = "tpl.obj_".$a_cmd.".html";
                }

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", $template,$a_in_module);

        }

Here is the caller graph for this function:

ilObjectGUI::getTitlesByRefId ( a_ref_ids  ) 

get Titles of objects this method is used for error messages in methods cut/copy/paste

Parameters:
array Array of ref_ids (integer)
Returns:
array Array of titles (string) private

Definition at line 2267 of file class.ilObjectGUI.php.

References $id, and $title.

Referenced by ilContainerGUI::cutObject().

        {
                foreach ($a_ref_ids as $id)
                {
                        // GET OBJECT TITLE
                        $tmp_obj =& $this->ilias->obj_factory->getInstanceByRefId($id);
                        $title[] = $tmp_obj->getTitle();
                        unset($tmp_obj);
                }

                return $title ? $title : array();
        }

Here is the caller graph for this function:

ilObjectGUI::hitsperpageObject (  ) 

Reimplemented in ilObjRoleFolderGUI, ilObjUserFolderGUI, and ilObjUserGUI.

Definition at line 2310 of file class.ilObjectGUI.php.

References $_GET, $_POST, and $_SESSION.

        {
        $_SESSION["tbl_limit"] = $_POST["hitsperpage"];
        $_GET["limit"] = $_POST["hitsperpage"];
        }

ilObjectGUI::ilObjectGUI ( a_data,
a_id = 0,
a_call_by_reference = true,
a_prepare_output = true 
)

Constructor public.

Parameters:
array ??
integer object id
boolean call be reference

Definition at line 103 of file class.ilObjectGUI.php.

References $_GET, $ilCtrl, $ilErr, $ilias, $lng, $objDefinition, $tpl, $tree, assignObject(), and prepareOutput().

Referenced by GUI::GUI(), ilContainerGUI::ilContainerGUI(), ilObjAdvancedEditingGUI::ilObjAdvancedEditingGUI(), ilObjAICCLearningModuleGUI::ilObjAICCLearningModuleGUI(), ilObjAssessmentFolderGUI::ilObjAssessmentFolderGUI(), ilObjAuthSettingsGUI::ilObjAuthSettingsGUI(), ilObjChatGUI::ilObjChatGUI(), ilObjChatServerGUI::ilObjChatServerGUI(), ilObjContentObjectGUI::ilObjContentObjectGUI(), ilObjExerciseGUI::ilObjExerciseGUI(), ilObjExternalToolsSettingsGUI::ilObjExternalToolsSettingsGUI(), ilObjFileBasedLMGUI::ilObjFileBasedLMGUI(), ilObjFileGUI::ilObjFileGUI(), ilObjForumGUI::ilObjForumGUI(), ilObjGlossaryGUI::ilObjGlossaryGUI(), ilObjHACPLearningModuleGUI::ilObjHACPLearningModuleGUI(), ilObjLanguageFolderGUI::ilObjLanguageFolderGUI(), ilObjLanguageGUI::ilObjLanguageGUI(), ilObjLibFolderGUI::ilObjLibFolderGUI(), ilObjLinkResourceGUI::ilObjLinkResourceGUI(), ilObjMailGUI::ilObjMailGUI(), ilObjMediaObjectGUI::ilObjMediaObjectGUI(), ilObjMediaPoolGUI::ilObjMediaPoolGUI(), ilObjObjectFolderGUI::ilObjObjectFolderGUI(), ilObjPaymentSettingsGUI::ilObjPaymentSettingsGUI(), ilObjQuestionPoolGUI::ilObjQuestionPoolGUI(), ilObjRecoveryFolderGUI::ilObjRecoveryFolderGUI(), ilObjRoleFolderGUI::ilObjRoleFolderGUI(), ilObjRoleGUI::ilObjRoleGUI(), ilObjRoleTemplateGUI::ilObjRoleTemplateGUI(), ilObjSAHSLearningModuleGUI::ilObjSAHSLearningModuleGUI(), ilObjSCORMLearningModuleGUI::ilObjSCORMLearningModuleGUI(), ilObjSearchSettingsGUI::ilObjSearchSettingsGUI(), ilObjStyleSettingsGUI::ilObjStyleSettingsGUI(), ilObjStyleSheetFolderGUI::ilObjStyleSheetFolderGUI(), ilObjStyleSheetGUI::ilObjStyleSheetGUI(), ilObjSurveyGUI::ilObjSurveyGUI(), ilObjSurveyQuestionPoolGUI::ilObjSurveyQuestionPoolGUI(), ilObjSystemFolderGUI::ilObjSystemFolderGUI(), ilObjTestGUI::ilObjTestGUI(), ilObjTypeDefinitionGUI::ilObjTypeDefinitionGUI(), ilObjUserFolderGUI::ilObjUserFolderGUI(), ilObjUserGUI::ilObjUserGUI(), and ilObjUserTrackingGUI::ilObjUserTrackingGUI().

        {
                global $ilias, $objDefinition, $tpl, $tree, $ilCtrl, $ilErr, $lng, $ilTabs;

                $this->tabs_gui =& $ilTabs;

                if (!isset($ilErr))
                {
                        $ilErr = new ilErrorHandling();
                        $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
                }
                else
                {
                        $this->ilErr =& $ilErr;
                }

                $this->ilias =& $ilias;
                $this->objDefinition =& $objDefinition;
                $this->tpl =& $tpl;
                $this->html = "";
                $this->ctrl =& $ilCtrl;

                $params = array("ref_id");

                if (!$a_call_by_reference)
                {
                        $params = array("ref_id","obj_id");
                }

                $this->ctrl->saveParameter($this, $params);

                $this->lng =& $lng;
                $this->tree =& $tree;
                $this->formaction = array();
                $this->return_location = array();
                $this->target_frame = array();
                $this->actions = "";
                $this->sub_objects = "";

                $this->data = $a_data;
                $this->id = $a_id;
                $this->call_by_reference = $a_call_by_reference;
                $this->prepare_output = $a_prepare_output;
                $this->creation_mode = false;

                $this->ref_id = ($this->call_by_reference) ? $this->id : $_GET["ref_id"];
                $this->obj_id = ($this->call_by_reference) ? $_GET["obj_id"] : $this->id;

                if ($this->id != 0)
                {
                        $this->link_params = "ref_id=".$this->ref_id;
                }

                // get the object
                $this->assignObject();

                // use global $lng instead, when creating new objects object is not available
                //$this->lng =& $this->object->lng;

                //prepare output
                if ($a_prepare_output)
                {
                        $this->prepareOutput();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::importObject (  ) 

import new object form

public

Reimplemented in ilObjQuestionPoolGUI, ilObjTestGUI, ilObjMailGUI, ilObjContentObjectGUI, ilObjGlossaryGUI, ilObjSAHSLearningModuleGUI, ilObjSurveyGUI, and ilObjSurveyQuestionPoolGUI.

Definition at line 1289 of file class.ilObjectGUI.php.

References $_GET, $_POST, and $rbacsystem.

        {
                global $rbacsystem;
                // CHECK ACCESS 'write' of role folder
                // TODO: new_type will never be checked, if queried operation is not 'create'
                if (!$rbacsystem->checkAccess('write', $_GET["ref_id"], $_POST["new_type"]))
                {
                        $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->WARNING);
                }

                $imp_obj =$this->objDefinition->getImportObjects($this->object->getType());

                if (!in_array($_POST["new_type"], $imp_obj))
                {
                        $this->ilias->raiseError($this->lng->txt("no_import_available").
                                " ".$this->lng->txt("obj_".$_POST["new_type"]),
                                $this->ilias->error_obj->MESSAGE);
                }
                // no general implementation of this feature, the specialized classes
                // must provide further processing
        }

ilObjectGUI::infoObject (  ) 

Definition at line 2402 of file class.ilObjectGUI.php.

Referenced by ilObjSAHSLearningModuleGUI::info(), ilObjMediaPoolGUI::info(), ilObjFileBasedLMGUI::info(), and ilObjContentObjectGUI::info().

        {
                include_once './classes/class.ilPermissionGUI.php';
                $perm_gui =& new ilPermissionGUI($this);
                
                // dirty work around to forward command in admin panel
                $this->ctrl->current_node = 1;
                $this->ctrl->setCmd('info');
                $ret =& $this->ctrl->forwardCommand($perm_gui);
                
                return true;
        }

Here is the caller graph for this function:

ilObjectGUI::insertSavedNodes ( a_source_id,
a_dest_id,
a_tree_id 
)

recursive method to insert all saved nodes of the clipboard (maybe this function could be moved to a rbac class ?)

private

Parameters:
integer 
integer 
integer 

Definition at line 850 of file class.ilObjectGUI.php.

References $log, $ops, $rbacadmin, and $rbacreview.

Referenced by undeleteObject().

        {
                global $rbacadmin, $rbacreview, $log;

                $this->tree->insertNode($a_source_id,$a_dest_id, IL_LAST_NODE, true);
                
                // write log entry
                $log->write("ilObjectGUI::insertSavedNodes(), restored ref_id $a_source_id from trash");

                // SET PERMISSIONS
                $parentRoles = $rbacreview->getParentRoleIds($a_dest_id);
                $obj =& $this->ilias->obj_factory->getInstanceByRefId($a_source_id);

                foreach ($parentRoles as $parRol)
                {
                        $ops = $rbacreview->getOperationsOfRole($parRol["obj_id"], $obj->getType(), $parRol["parent"]);
                        $rbacadmin->grantPermission($parRol["obj_id"],$ops,$a_source_id);
                }

                $saved_tree = new ilTree($a_tree_id);
                $childs = $saved_tree->getChilds($a_source_id);

                foreach ($childs as $child)
                {
                        $this->insertSavedNodes($child["child"],$a_source_id,$a_tree_id);
                }
        }

Here is the caller graph for this function:

ilObjectGUI::omitLocator ( a_omit = true  ) 

Definition at line 755 of file class.ilObjectGUI.php.

        {
                $this->omit_locator = $a_omit;
        }

ilObjectGUI::ownerObject (  ) 

Definition at line 2487 of file class.ilObjectGUI.php.

Referenced by ilObjSAHSLearningModuleGUI::owner(), ilObjFileBasedLMGUI::owner(), and ilObjContentObjectGUI::owner().

        {
                include_once './classes/class.ilPermissionGUI.php';
                $perm_gui =& new ilPermissionGUI($this);
                
                // dirty work around to forward command in admin panel
                $this->ctrl->current_node = 1;
                $this->ctrl->setCmd('owner');
                $ret =& $this->ctrl->forwardCommand($perm_gui);
                
                return true;
        }

Here is the caller graph for this function:

ilObjectGUI::permObject (  ) 

show permissions of current node

public

Reimplemented in ilObjRoleGUI, and ilObjRoleTemplateGUI.

Definition at line 1403 of file class.ilObjectGUI.php.

Referenced by ilObjSAHSLearningModuleGUI::perm(), ilObjFileBasedLMGUI::perm(), and ilObjContentObjectGUI::perm().

        {
                include_once './classes/class.ilPermissionGUI.php';
                $perm_gui =& new ilPermissionGUI($this);
                
                // dirty work around to forward command in admin panel
                $this->ctrl->current_node = 1;
                $this->ctrl->setCmd('perm');
                $ret =& $this->ctrl->forwardCommand($perm_gui);
                
                return true;
        }

Here is the caller graph for this function:

ilObjectGUI::permSaveObject (  ) 

save permissions

public

Reimplemented in ilObjRoleGUI, and ilObjRoleTemplateGUI.

Definition at line 1521 of file class.ilObjectGUI.php.

Referenced by ilObjSAHSLearningModuleGUI::permSave(), ilObjMediaPoolGUI::permSave(), ilObjFileBasedLMGUI::permSave(), and ilObjContentObjectGUI::permSave().

        {
                include_once './classes/class.ilPermissionGUI.php';
                $perm_gui =& new ilPermissionGUI($this);
                
                // dirty work around to forward command in admin panel
                $this->ctrl->current_node = 1;
                $this->ctrl->setCmd('permSave');
                $ret =& $this->ctrl->forwardCommand($perm_gui);
                
                return true;
        }

Here is the caller graph for this function:

ilObjectGUI::prepareOutput (  ) 

prepare output

Definition at line 245 of file class.ilObjectGUI.php.

References $_GET, $tpl, ilObject::_lookupType(), addAdminLocatorItems(), getCreationMode(), infoPanel(), sendInfo(), setAdminTabs(), setLocator(), setTabs(), setTitleAndDescription(), and showUpperIcon().

Referenced by ilObjiLincClassroomGUI::create(), ilObjFileBasedLMGUI::edit(), ilObjSurveyQuestionPoolGUI::executeCommand(), ilObjSurveyGUI::executeCommand(), ilObjUserTrackingGUI::executeCommand(), ilObjSearchSettingsGUI::executeCommand(), ilObjPaymentSettingsGUI::executeCommand(), ilObjLinkResourceGUI::executeCommand(), ilObjiLincCourseGUI::executeCommand(), ilObjCourseGUI::executeCommand(), ilObjSAHSLearningModuleGUI::executeCommand(), ilObjMediaPoolGUI::executeCommand(), ilObjGlossaryGUI::executeCommand(), ilObjFileBasedLMGUI::executeCommand(), ilObjContentObjectGUI::executeCommand(), ilObjUserGUI::executeCommand(), ilObjUserFolderGUI::executeCommand(), ilObjSystemFolderGUI::executeCommand(), ilObjStyleSheetGUI::executeCommand(), ilObjStyleSettingsGUI::executeCommand(), ilObjRootFolderGUI::executeCommand(), ilObjRoleTemplateGUI::executeCommand(), ilObjRoleGUI::executeCommand(), ilObjRoleFolderGUI::executeCommand(), ilObjRecoveryFolderGUI::executeCommand(), ilObjObjectFolderGUI::executeCommand(), ilObjMailGUI::executeCommand(), ilObjLanguageFolderGUI::executeCommand(), ilObjGroupGUI::executeCommand(), ilObjForumGUI::executeCommand(), ilObjFolderGUI::executeCommand(), ilObjFileGUI::executeCommand(), ilObjExternalToolsSettingsGUI::executeCommand(), ilObjExerciseGUI::executeCommand(), executeCommand(), ilObjCategoryGUI::executeCommand(), ilObjAuthSettingsGUI::executeCommand(), ilObjAssessmentFolderGUI::executeCommand(), ilObjAdvancedEditingGUI::executeCommand(), ilContainerGUI::executeCommand(), ilObjChatServerGUI::executeCommand(), ilObjChatGUI::executeCommand(), ilObjTestGUI::executeCommand(), ilObjQuestionPoolGUI::executeCommand(), ilObjectGUI(), ilObjiLincClassroomGUI::ilObjiLincClassroomGUI(), ilObjLearningModuleGUI::view(), and ilObjContentObjectGUI::view().

        {
                global $ilLocator, $tpl;

                $this->tpl->getStandardTemplate();
                // administration prepare output
                if (strtolower($_GET["baseClass"]) == "iladministrationgui")
                {
                        $this->addAdminLocatorItems();
                        $tpl->setLocator();

                        sendInfo();
                        infoPanel();

                        $this->setTitleAndDescription();

                        if ($this->getCreationMode() != true)
                        {
                                $this->setAdminTabs();
                                $this->showUpperIcon();
                        }
                        
                        return false;
                }
                // set locator
                $this->setLocator();

                // catch feedback message
                sendInfo();
                infoPanel();

                // in creation mode (parent) object and gui object
                // do not fit
                if ($this->getCreationMode() == true)
                {
                        // get gui class of parent and call their title and description method
                        $obj_type = ilObject::_lookupType($_GET["ref_id"],true);
                        $class_name = $this->objDefinition->getClassName($obj_type);
                        $class = strtolower("ilObj".$class_name."GUI");
                        $class_path = $this->ctrl->lookupClassPath($class);
                        include_once($class_path);
                        $class_name = $this->ctrl->getClassForClasspath($class_path);
//echo "<br>instantiating parent for title and description";
                        $this->parent_gui_obj = new $class_name("", $_GET["ref_id"], true, false);
                        $this->parent_gui_obj->setTitleAndDescription();
                }
                else
                {
                        // set title and description and title icon
                        $this->setTitleAndDescription();
        
                        // set tabs
                        $this->setTabs();
                        $this->showUpperIcon();
                }
                
                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::redirectToRefId ( a_ref_id,
a_cmd = "" 
)

redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value

Parameters:
int $a_ref_id reference id

Definition at line 2522 of file class.ilObjectGUI.php.

References ilObject::_lookupType().

Referenced by ilObjRoleFolderGUI::confirmedDeleteObject(), ilObjiLincCourseGUI::saveObject(), ilObjGroupGUI::saveObject(), and ilObjCategoryGUI::saveObject().

        {
                $obj_type = ilObject::_lookupType($a_ref_id,true);
                $class_name = $this->objDefinition->getClassName($obj_type);
                $class = strtolower("ilObj".$class_name."GUI");
                $this->ctrl->redirectByClass($class, $a_cmd);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::removeDeletedNodes ( a_node_id,
a_checked,
a_delete_objects = true 
)

remove already deleted objects within the objects in trash recursive function

public

Parameters:
integer ref_id of source object
boolean 

Definition at line 1116 of file class.ilObjectGUI.php.

References $log, $q, and $row.

Referenced by ilContainerGUI::pasteObject(), ilObjRecoveryFolderGUI::removeFromSystemObject(), and removeFromSystemObject().

        {
                global $log;
                
                $q = "SELECT tree FROM tree WHERE parent='".$a_node_id."' AND tree < 0";
                
                $r = $this->ilias->db->query($q);

                while($row = $r->fetchRow(DB_FETCHMODE_OBJECT))
                {
                        // only continue recursion if fetched node wasn't touched already!
                        if (!in_array($row->tree,$a_checked))
                        {
                                $deleted_tree = new ilTree($row->tree);
                                $a_checked[] = $row->tree;

                                $row->tree = $row->tree * (-1);
                                $del_node_data = $deleted_tree->getNodeData($row->tree);
                                $del_subtree_nodes = $deleted_tree->getSubTree($del_node_data);

                                $this->removeDeletedNodes($row->tree,$a_checked);
                        
                                if ($a_delete_objects)
                                {
                                        foreach ($del_subtree_nodes as $node)
                                        {
                                                $node_obj =& $this->ilias->obj_factory->getInstanceByRefId($node["ref_id"]);
                                                
                                                // write log entry
                                                $log->write("ilObjectGUI::removeDeletedNodes(), delete obj_id: ".$node_obj->getId().
                                                        ", ref_id: ".$node_obj->getRefId().", type: ".$node_obj->getType().", ".
                                                        "title: ".$node_obj->getTitle());
                                                        
                                                $node_obj->delete();
                                        }
                                }
                        
                                $this->tree->deleteTree($del_node_data);
                                
                                // write log entry
                                $log->write("ilObjectGUI::removeDeletedNodes(), deleted tree, tree_id: ".$del_node_data["tree"].
                                        ", child: ".$del_node_data["child"]);
                        }
                }
                
                return true;
        }

Here is the caller graph for this function:

ilObjectGUI::removeFromSystemObject (  ) 

remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method

public

Reimplemented in ilObjRecoveryFolderGUI.

Definition at line 1054 of file class.ilObjectGUI.php.

References $_POST, $id, $log, $rbacsystem, removeDeletedNodes(), and sendInfo().

Referenced by confirmedDeleteObject().

        {
                global $rbacsystem, $log;
                
                // AT LEAST ONE OBJECT HAS TO BE CHOSEN.
                if (!isset($_POST["trash_id"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }

                //$this->object->notify("removeFromSystem", $_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$_POST["trash_id"]);

                // DELETE THEM
                foreach ($_POST["trash_id"] as $id)
                {
                        // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
                        $saved_tree = new ilTree(-(int)$id);
                        $node_data = $saved_tree->getNodeData($id);
                        $subtree_nodes = $saved_tree->getSubTree($node_data);

                        // remember already checked deleted node_ids
                        $checked[] = -(int) $id;

                        // dive in recursive manner in each already deleted subtrees and remove these objects too
                        $this->removeDeletedNodes($id,$checked);

                        foreach ($subtree_nodes as $node)
                        {
                                $node_obj =& $this->ilias->obj_factory->getInstanceByRefId($node["ref_id"]);

                                // write log entry
                                $log->write("ilObjectGUI::removeFromSystemObject(), delete obj_id: ".$node_obj->getId().
                                        ", ref_id: ".$node_obj->getRefId().", type: ".$node_obj->getType().", ".
                                        "title: ".$node_obj->getTitle());
                                        
                                $node_obj->delete();
                        }

                        // FIRST DELETE ALL ENTRIES IN RBAC TREE
                        #$this->tree->deleteTree($node_data);
                        // Use the saved tree object here (negative tree_id)
                        $saved_tree->deleteTree($node_data);

                        // write log entry
                        $log->write("ilObjectGUI::removeFromSystemObject(), deleted tree, tree_id: ".$node_data["tree"].
                                ", child: ".$node_data["child"]);

                }
                
                sendInfo($this->lng->txt("msg_removed"),true);

                $this->ctrl->returnToParent($this);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::saveObject (  ) 

save object

public

Reimplemented in ilObjQuestionPoolGUI, ilObjTestGUI, ilObjChatGUI, ilObjAdvancedEditingGUI, ilObjAssessmentFolderGUI, ilObjCategoryGUI, ilObjExerciseGUI, ilObjFileGUI, ilObjForumGUI, ilObjGroupGUI, ilObjRecoveryFolderGUI, ilObjRoleFolderGUI, ilObjRoleGUI, ilObjRoleTemplateGUI, ilObjStyleSettingsGUI, ilObjStyleSheetFolderGUI, ilObjStyleSheetGUI, ilObjTypeDefinitionGUI, ilObjUserGUI, GUI, ilObjContentObjectGUI, ilObjFileBasedLMGUI, ilObjGlossaryGUI, ilObjMediaPoolGUI, ilObjSAHSLearningModuleGUI, ilObjMediaObjectGUI, ilObjCourseGUI, ilObjiLincCourseGUI, ilObjLinkResourceGUI, ilObjSurveyGUI, and ilObjSurveyQuestionPoolGUI.

Definition at line 1250 of file class.ilObjectGUI.php.

References $_GET, $_POST, $objDefinition, $rbacsystem, and ilUtil::stripSlashes().

        {
                global $rbacsystem, $objDefinition;

                $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];

                // create permission is already checked in createObject. This check here is done to prevent hacking attempts
                if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
                {
                        $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
                }
//echo ":".$_GET["new_type"].":".$_POST["new_type"].":";
                $module = $objDefinition->getModule($_GET["new_type"]);
                $module_dir = ($module == "")
                        ? ""
                        : $module."/";

                        // create and insert object in objecttree
                $class_name = "ilObj".$objDefinition->getClassName($_GET["new_type"]);
                include_once($module_dir."classes/class.".$class_name.".php");
                $newObj = new $class_name();
                $newObj->setType($_GET["new_type"]);
                $newObj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
                $newObj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
                $newObj->create();
                $newObj->createReference();
                $newObj->putInTree($_GET["ref_id"]);
                $newObj->setPermissions($_GET["ref_id"]);
                //$newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());

                return $newObj;
        }

Here is the call graph for this function:

ilObjectGUI::setActions ( a_actions = ""  ) 

set possible actions for objects in list.

if actions are set via this method, the values of objects.xml are ignored.

Parameters:
array $a_actions array with $command => $lang_var pairs

Definition at line 561 of file class.ilObjectGUI.php.

References $lng.

Referenced by ilObjContentObjectGUI::chapters(), ilObjGlossaryGUI::listTerms(), and ilObjContentObjectGUI::pages().

        {
                if (is_array($a_actions))
                {
                        foreach ($a_actions as $name => $lng)
                        {
                                $this->actions[$name] = array("name" => $name, "lng" => $lng);
                        }
                }
                else
                {
                        $this->actions = "";
                }
        }

Here is the caller graph for this function:

ilObjectGUI::setAdminTabs (  ) 

set admin tabs public

Reimplemented in ilObjMediaObjectGUI.

Definition at line 502 of file class.ilObjectGUI.php.

References getAdminTabs().

Referenced by ilObjRoleGUI::executeCommand(), and prepareOutput().

        {
                #include_once "./classes/class.ilTabsGUI.php";
                #$tabs_gui =& new ilTabsGUI();
                $this->getAdminTabs($this->tabs_gui);

                // output tabs
                #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
                //$this->tpl->setTabs($tabs_gui->getHTML());
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::setCreationMode ( a_mode = true  ) 

if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui

Definition at line 212 of file class.ilObjectGUI.php.

        {
                $this->creation_mode = $a_mode;
        }

ilObjectGUI::setFormAction ( a_cmd,
a_formaction 
)

set specific form action for command

Parameters:
string $a_cmd command
string $a_formaction default formaction (is returned, if no special formaction was set) public

Definition at line 1444 of file class.ilObjectGUI.php.

Referenced by ilObjMediaPoolGUI::edit(), ilObjFileBasedLMGUI::edit(), ilObjSAHSLearningModuleGUI::perm(), ilObjFileBasedLMGUI::perm(), and ilObjContentObjectGUI::perm().

        {
                $this->formaction[$a_cmd] = $a_formaction;
        }

Here is the caller graph for this function:

ilObjectGUI::setLocator (  ) 

set Locator

Parameters:
object tree object
integer reference id
scriptanme that is used for linking; public

Definition at line 605 of file class.ilObjectGUI.php.

References $_GET, $ref_id, $tpl, and addLocatorItems().

Referenced by ilObjSAHSLearningModuleGUI::executeCommand(), ilObjMediaPoolGUI::executeCommand(), ilObjGlossaryGUI::executeCommand(), ilObjFileBasedLMGUI::executeCommand(), ilObjRootFolderGUI::executeCommand(), ilObjCategoryGUI::executeCommand(), prepareOutput(), ilObjSAHSLearningModuleGUI::setLocator(), ilObjGlossaryGUI::setLocator(), and ilObjFileBasedLMGUI::setLocator().

        {
                global $ilLocator, $tpl;
                
                if ($this->omit_locator)
                {
                        return;
                }
                
                // todo: admin workaround
                // in the future, objectgui classes should not be called in
                // admin section anymore (rbac/trash handling in own classes)
                $ref_id = ($_GET["ref_id"] != "")
                        ? $_GET["ref_id"]
                        : $this->object->getRefId();
                $ilLocator->addRepositoryItems($ref_id);
                $this->addLocatorItems();
                
                // not so nice workaround: todo: handle $ilLocator as tabs in ilTemplate
                if ($_GET["admin_mode"] == "" &&
                        strtolower($this->ctrl->getCmdClass()) == "ilobjrolegui")
                {
                        $this->ctrl->setParameterByClass("ilobjrolegui",
                                "rolf_ref_id", $_GET["rolf_ref_id"]);
                        $this->ctrl->setParameterByClass("ilobjrolegui",
                                "obj_id", $_GET["obj_id"]);
                        $ilLocator->addItem($this->lng->txt("role"),
                                $this->ctrl->getLinkTargetByClass(array("ilpermissiongui",
                                        "ilobjrolegui"), "perm"));
                }

                $tpl->setLocator();
                
                return;

/*
                if (!is_object($a_tree))
                {
                        $a_tree =& $this->tree;
                }

                if (!($a_id))
                {
                        $a_id = $_GET["ref_id"];
                }

                $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");

                $path = $a_tree->getPathFull($a_id);

        //check if object isn't in tree, this is the case if parent_parent is set
                // TODO: parent_parent no longer exist. need another marker
                if ($a_parent_parent)
                {
                        //$subObj = getObject($a_ref_id);
                        $subObj =& $this->ilias->obj_factory->getInstanceByRefId($a_ref_id);

                        $path[] = array(
                                "id"     => $a_ref_id,
                                "title"  => $this->lng->txt($subObj->getTitle())
                                );
                }
*/

/*
                // this is a stupid workaround for a bug in PEAR:IT
                $modifier = 1;

                if (isset($_GET["obj_id"]) && $a_output_obj)
                {
                        $modifier = 0;
                }

                // ### AA 03.11.10 added new locator GUI class ###
                $i = 1;

                foreach ($path as $key => $row)
                {
                        if ($key < count($path)-$modifier)
                        {
                                $this->tpl->touchBlock("locator_separator");
                        }

                        $this->tpl->setCurrentBlock("locator_item");

                        if ($a_root_title != "" && ($row["child"] == $a_tree->getRootId()))
                        {
                                $title = $a_root_title;
                        }
                        else
                        {
                                $title = $row["title"];
                        }

                        $this->tpl->setVariable("ITEM", $title);

                        $this->tpl->setVariable("LINK_ITEM",
                                ilUtil::appendUrlParameterString($scriptname, $a_child_param."=".$row["child"]));
                        $this->tpl->parseCurrentBlock();

                        // ### AA 03.11.10 added new locator GUI class ###
                        // navigate locator
                        //$ilias_locator->navigate($i++,$title,
                        //      ilUtil::appendUrlParameterString($scriptname, $a_child_param."=".$row["child"]),"bottom");
                }

                if (($_GET["obj_id"] != "") && $a_output_obj)
                {
                        $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_GET["obj_id"]);

                        $this->tpl->setCurrentBlock("locator_item");
                        $this->tpl->setVariable("ITEM", $obj_data->getTitle());

                        $this->tpl->setVariable("LINK_ITEM",
                                ilUtil::appendUrlParameterString($scriptname, "ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]));
                        $this->tpl->parseCurrentBlock();

                        // ### AA 03.11.10 added new locator GUI class ###
                        // navigate locator
                        //$ilias_locator->navigate($i++,$obj_data->getTitle(),
                        //      ilUtil::appendUrlParameterString($scriptname, "ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]),"bottom");
                }

                $this->tpl->setCurrentBlock("locator");

                if (DEBUG)
                {
                        $debug = "DEBUG: <font color=\"red\">".$this->type."::".$this->id."::".$_GET["cmd"]."</font><br/>";
                }

                $prop_name = $this->objDefinition->getPropertyName($_GET["cmd"],$this->type);

                if ($_GET["cmd"] == "confirmDeleteAdm")
                {
                        $prop_name = "delete_object";
                }

                $this->tpl->setVariable("TXT_LOCATOR",$debug.$this->lng->txt("locator"));
                $this->tpl->parseCurrentBlock();
*/
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::setReturnLocation ( a_cmd,
a_location 
)

set specific return location for command

Parameters:
string $a_cmd command
string $a_location default return location (is returned, if no special return location was set) public

Definition at line 1475 of file class.ilObjectGUI.php.

Referenced by ilObjSAHSLearningModuleGUI::addRole(), ilObjMediaPoolGUI::addRole(), ilObjFileBasedLMGUI::addRole(), ilObjContentObjectGUI::addRole(), ilObjFileBasedLMGUI::cancel(), ilObjSAHSLearningModuleGUI::permSave(), ilObjMediaPoolGUI::permSave(), ilObjFileBasedLMGUI::permSave(), ilObjContentObjectGUI::permSave(), and ilObjFileBasedLMGUI::update().

        {
//echo "-".$a_cmd."-".$a_location."-";
                $this->return_location[$a_cmd] = $a_location;
        }

Here is the caller graph for this function:

ilObjectGUI::setSubObjects ( a_sub_objects = ""  ) 

set possible subobjects for this object.

if subobjects are set via this method, the values of objects.xml are ignored.

Parameters:
array $a_actions array with $command => $lang_var pairs

Definition at line 582 of file class.ilObjectGUI.php.

        {
                if (is_array($a_sub_objects))
                {
                        foreach ($a_sub_objects as $name => $options)
                        {
                                $this->sub_objects[$name] = array("name" => $name, "max" => $options["max"]);
                        }
                }
                else
                {
                        $this->sub_objects = "";
                }
        }

ilObjectGUI::setTabs (  ) 

set admin tabs public

Reimplemented in ilObjStyleSettingsGUI, ilObjStyleSheetGUI, ilObjContentObjectGUI, ilObjFileBasedLMGUI, ilObjGlossaryGUI, ilObjMediaPoolGUI, and ilObjSAHSLearningModuleGUI.

Definition at line 369 of file class.ilObjectGUI.php.

References getTabs().

Referenced by prepareOutput().

        {
                #include_once "./classes/class.ilTabsGUI.php";
                #$tabs_gui =& new ilTabsGUI();
                $this->getTabs($this->tabs_gui);
                
                //var_dump(get_class($this));

                // output tabs
                #$this->tpl->setVariable("TABS", $this->tabs_gui->getHTML());
                        
                /*
                }
                else
                {
                        global $rbacsystem;
        
                        $tabs = array();
                        $this->tpl->addBlockFile("TABS", "tabs", "tpl.tabs.html");
        
                        // for new objects display properties of parent object
                        if ($a_new_type)
                        {
                                $d = $this->objDefinition->getProperties($this->object->getType());
                        }
                        else
                        {
                                $d = $this->objDefinition->getProperties($this->type);
                        }
        
                        foreach ($d as $key => $row)
                        {
                                $tabs[] = array($row["lng"], $row["name"]);
                        }
        
                        // check for call_by_reference too to avoid hacking
                        if (isset($_GET["obj_id"]) and $this->call_by_reference === false)
                        {
                                $object_link = "&obj_id=".$_GET["obj_id"];
                        }
        
                        foreach ($tabs as $row)
                        {
                                $i++;
        
                                if ($row[1] == $_GET["cmd"])
                                {
                                        $tabtype = "tabactive";
                                        $tab = $tabtype;
                                }
                                else
                                {
                                        $tabtype = "tabinactive";
                                        $tab = "tab";
                                }
        
                                $show = true;
        
                                // only check permissions for tabs if object is a permission object
                                // TODO: automize checks by using objects.xml definitions!!
                                if (true)
                                //if ($this->call_by_reference)
                                {
                                        // only show tab when the corresponding permission is granted
                                        switch ($row[1])
                                        {
                                                case 'view':
                                                        if (!$rbacsystem->checkAccess('visible',$this->ref_id))
                                                        {
                                                                $show = false;
                                                        }
                                                        break;
        
                                                case 'edit':
                                                        if (!$rbacsystem->checkAccess('write',$this->ref_id))
                                                        {
                                                                $show = false;
                                                        }
                                                        break;
        
                                                case 'perm':
                                                        if (!$rbacsystem->checkAccess('edit_permission',$this->ref_id))
                                                        {
                                                                $show = false;
                                                        }
                                                        break;
        
                                                case 'trash':
                                                        if (!$this->tree->getSavedNodeData($this->ref_id))
                                                        {
                                                                $show = false;
                                                        }
                                                        break;
        
                                                // user object only
                                                case 'roleassignment':
                                                        if (!$rbacsystem->checkAccess('edit_roleassignment',$this->ref_id))
                                                        {
                                                                $show = false;
                                                        }
                                                        break;

                                                // role object only
                                                case 'userassignment':
                                                        if (!$rbacsystem->checkAccess('edit_userassignment',$this->ref_id))
                                                        {
                                                                $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->tab_target_script."?ref_id=".$_GET["ref_id"].$object_link."&cmd=".$row[1]);
                                $this->tpl->setVariable("TAB_TEXT", $this->lng->txt($row[0]));
                                $this->tpl->parseCurrentBlock();
                        }
                }*/
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::setTargetFrame ( a_cmd,
a_target_frame 
)

set specific target frame for command

Parameters:
string $a_cmd command
string $a_target_frame default target frame (is returned, if no special target frame was set) public

Definition at line 1511 of file class.ilObjectGUI.php.

        {
                $this->target_frame[$a_cmd] = "target=\"".$a_target_frame."\"";
        }

ilObjectGUI::setTitleAndDescription (  ) 

called by prepare output

Reimplemented in ilObjQuestionPoolGUI, ilContainerGUI, and ilObjRootFolderGUI.

Definition at line 308 of file class.ilObjectGUI.php.

References ilUtil::getImagePath().

Referenced by prepareOutput().

        {
                $this->tpl->setTitle($this->object->getTitle());
                $this->tpl->setDescription($this->object->getLongDescription());
                $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.gif"), $this->lng->txt("obj_" . $this->object->getType()));
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::showActions ( with_subobjects = false  ) 

show possible action (form buttons)

Parameters:
boolean public

Reimplemented in ilObjStyleSettingsGUI, ilObjStyleSheetFolderGUI, and ilObjUserFolderGUI.

Definition at line 2088 of file class.ilObjectGUI.php.

References $_SESSION, $d, $row, ilUtil::array_php2js(), and ilUtil::getImagePath().

Referenced by ilObjLanguageFolderGUI::displayList(), displayList(), and ilObjGlossaryGUI::listTerms().

        {
                $notoperations = array();
                // NO PASTE AND CLEAR IF CLIPBOARD IS EMPTY
                if (empty($_SESSION["clipboard"]))
                {
                        $notoperations[] = "copy";                      // disable copy operation!
                        $notoperations[] = "paste";
                        $notoperations[] = "clear";
                }
                // CUT COPY PASTE LINK DELETE IS NOT POSSIBLE IF CLIPBOARD IS FILLED
                if ($_SESSION["clipboard"])
                {
                        $notoperations[] = "cut";
                        $notoperations[] = "copy";
                        $notoperations[] = "link";
                }

                $operations = array();

                if ($this->actions == "")
                {
                        $d = $this->objDefinition->getActions($this->object->getType());
                        //$d = $this->objDefinition->getActions($_GET["type"]);
                }
                else
                {
                        $d = $this->actions;
                }

                foreach ($d as $row)
                {
                        if (!in_array($row["name"], $notoperations))
                        {
                                $operations[] = $row;
                        }
                }

                if (count($operations) > 0)
                {
                        foreach ($operations as $val)
                        {
                                $this->tpl->setCurrentBlock("tbl_action_btn");
                                $this->tpl->setVariable("BTN_NAME", $val["name"]);
                                $this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
                                $this->tpl->parseCurrentBlock();
                        }
                }

                if ($with_subobjects === true)
                {
                        //$this->showPossibleSubObjects();
                }
                
                if (!empty($this->ids) && count($operations) > 0)
                {
                        // set checkbox toggles
                        $this->tpl->setCurrentBlock("tbl_action_toggle_checkboxes");
                        $this->tpl->setVariable("JS_VARNAME","id");                     
                        $this->tpl->setVariable("JS_ONCLICK",ilUtil::array_php2js($this->ids));
                        $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
                        $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
                        $this->tpl->parseCurrentBlock();
                }
                
                if (count($operations) > 0)
                {
                        $this->tpl->setCurrentBlock("tbl_action_row");
                        $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::showPossibleSubObjects (  ) 

show possible subobjects (pulldown menu)

public

Reimplemented in ilContainerGUI, ilObjRecoveryFolderGUI, and ilObjUserFolderGUI.

Definition at line 2166 of file class.ilObjectGUI.php.

References $d, $row, and formSelect().

Referenced by ilObjRoleFolderGUI::__showRolesTable(), ilObjStyleSheetFolderGUI::showActions(), and ilObjStyleSettingsGUI::showActions().

        {
                if ($this->sub_objects == "")
                {
                        $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
                }
                else
                {
                        $d = $this->sub_objects;
                }

                $import = false;

                if (count($d) > 0)
                {
                        foreach ($d as $row)
                        {
                            $count = 0;

                                if ($row["max"] > 0)
                                {
                                        //how many elements are present?
                                        for ($i=0; $i<count($this->data["ctrl"]); $i++)
                                        {
                                                if ($this->data["ctrl"][$i]["type"] == $row["name"])
                                                {
                                                    $count++;
                                                }
                                        }
                                }

                                if ($row["max"] == "" || $count < $row["max"])
                                {
                                        $subobj[] = $row["name"];

                                        if ($row["import"] == "1")      // import allowed?
                                        {
                                                $import = true;
                                        }
                                }
                        }
                }

                if (is_array($subobj))
                {
                        // show import button if at least one
                        // object type can be imported
                        if ($import)
                        {
                                $this->tpl->setCurrentBlock("import_object");
                                $this->tpl->setVariable("BTN_IMP", "import");
                                $this->tpl->setVariable("TXT_IMP", $this->lng->txt("import"));
                                $this->tpl->parseCurrentBlock();
                        }

                        //build form
                        $opts = ilUtil::formSelect(12,"new_type",$subobj);
                        $this->tpl->setCurrentBlock("add_object");
                        $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
                        $this->tpl->setVariable("BTN_NAME", "create");
                        $this->tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::showUpperIcon (  ) 

Reimplemented in ilObjRoleGUI, ilObjRoleTemplateGUI, ilObjStyleSheetGUI, ilObjUserGUI, and ilObjMediaPoolGUI.

Definition at line 315 of file class.ilObjectGUI.php.

References $_GET, $objDefinition, $tpl, $tree, ilFrameTargetInfo::_getFrame(), and ilObject::_lookupType().

Referenced by prepareOutput().

        {
                global $tree, $tpl, $objDefinition;

                if ($this->object->getRefId() == "")
                {
                        return;
                }

                if (strtolower($_GET["baseClass"]) == "iladministrationgui")
                {               
                        if ($this->object->getRefId() != ROOT_FOLDER_ID &&
                                $this->object->getRefId() != SYSTEM_FOLDER_ID)
                        {
                                $par_id = $tree->getParentId($this->object->getRefId());
                                $obj_type = ilObject::_lookupType($par_id,true);
                                $class_name = $objDefinition->getClassName($obj_type);
                                $class = strtolower("ilObj".$class_name."GUI");
                                $this->ctrl->setParameterByClass($class, "ref_id", $par_id);
                                $tpl->setUpperIcon($this->ctrl->getLinkTargetByClass($class, "view"));
                                $this->ctrl->clearParametersByClass($class);
                        }
                        // link repository admin to admin settings
                        else if ($this->object->getRefId() == ROOT_FOLDER_ID)
                        {
                                $this->ctrl->setParameterByClass("iladministrationgui", "ref_id", "");
                                $this->ctrl->setParameterByClass("iladministrationgui", "admin_mode", "settings");
                                $tpl->setUpperIcon($this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"),
                                        ilFrameTargetInfo::_getFrame("MainContent"));
                                $this->ctrl->clearParametersByClass("iladministrationgui");
                        }
                }
                else
                {
                        if ($this->object->getRefId() != ROOT_FOLDER_ID &&
                                $this->object->getRefId() != SYSTEM_FOLDER_ID &&
                                $_GET["obj_id"] == "")
                        {
                                if (defined("ILIAS_MODULE"))
                                {
                                        $prefix = "../";
                                }
                                $par_id = $tree->getParentId($this->object->getRefId());
                                $tpl->setUpperIcon($prefix."repository.php?cmd=frameset&ref_id=".$par_id,
                                        ilFrameTargetInfo::_getFrame("MainContent"));
                        }
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::trashObject (  ) 

show trash content of object

public

Definition at line 1951 of file class.ilObjectGUI.php.

References $_GET, $counter, $key, ilUtil::getImagePath(), ilUtil::getImageTagByType(), getTemplateFile(), sendInfo(), and ilUtil::switchColor().

        {
                $objects = $this->tree->getSavedNodeData($_GET["ref_id"]);

                if (count($objects) == 0)
                {
                        sendInfo($this->lng->txt("msg_trash_empty"));
                        $this->data["empty"] = true;
                }
                else
                {
                        $this->data["empty"] = false;
                        $this->data["cols"] = array("","type", "title", "last_change");

                        foreach ($objects as $obj_data)
                        {
                                $this->data["data"]["$obj_data[child]"] = array(
                                                                                                                        "checkbox"              => "",
                                                                                                                        "type"                  => $obj_data["type"],
                                                                                                                        "title"                 => $obj_data["title"]."#separator#".$obj_data["desc"],
                                                                                                                        "last_update"   => $obj_data["last_update"]
                                                                        );
                        }

                        $this->data["buttons"] = array( "undelete"  => $this->lng->txt("btn_undelete"),
                                                                          "removeFromSystem"  => $this->lng->txt("btn_remove_system"));
                }

                $this->getTemplateFile("confirm");

                if ($this->data["empty"] == true)
                {
                        return;
                }
                
                /* TODO: fix message display in conjunction with sendInfo & raiseError functionality
                $this->tpl->addBlockfile("MESSAGE", "adm_trash", "tpl.message.html");
                $this->tpl->setCurrentBlock("adm_trash");
                $this->tpl->setVariable("MSG",$this->lng->txt("info_trash"));
                $this->tpl->parseCurrentBlock();
                */
                //sendInfo($this->lng->txt("info_trash"));
                $this->tpl->setVariable("FORMACTION",
                        $this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TPLPATH",$this->tpl->tplPath);
                $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));

                // BEGIN TABLE HEADER
                foreach ($this->data["cols"] as $key)
                {
                        $this->tpl->setCurrentBlock("table_header");
                        $this->tpl->setVariable("TEXT",$this->lng->txt($key));
                        $this->tpl->parseCurrentBlock();
                }
                // END TABLE HEADER

                // BEGIN TABLE DATA
                $counter = 0;

                foreach ($this->data["data"] as $key1 => $value)
                {
                        // BEGIN TABLE CELL
                        foreach ($value as $key2 => $cell_data)
                        {
                                $this->tpl->setCurrentBlock("table_cell");
                                // CREATE CHECKBOX
                                if ($key2 == "checkbox")
                                {
                                        $this->tpl->setVariable("TEXT_CONTENT",ilUtil::formCheckBox(0,"trash_id[]",$key1));
                                }
                                // CREATE TEXT STRING
                                elseif ($key2 == "type")
                                {
                                        $this->tpl->setVariable("TEXT_CONTENT",ilUtil::getImageTagByType($cell_data,$this->tpl->tplPath));
                                }
                                elseif ($key2 == "title")
                                {
                                        $name_field = explode("#separator#",$cell_data);

                                        $this->tpl->setVariable("TEXT_CONTENT", "<b>".$name_field[0]."</b>");
                                                
                                        $this->tpl->setCurrentBlock("subtitle");
                                        $this->tpl->setVariable("DESC", $name_field[1]);
                                        $this->tpl->parseCurrentBlock();
                                        $this->tpl->setCurrentBlock("table_cell");
                                }
                                else
                                {
                                        $this->tpl->setVariable("TEXT_CONTENT",$cell_data);
                                }

                                $this->tpl->parseCurrentBlock();
                        }

                        $this->tpl->setCurrentBlock("table_row");
                        $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
                        $this->tpl->parseCurrentBlock();
                        // END TABLE CELL
                }
                // END TABLE DATA

                // BEGIN OPERATION_BTN
                foreach ($this->data["buttons"] as $name => $value)
                {
                        $this->tpl->setCurrentBlock("operation_btn");
                        $this->tpl->setVariable("BTN_NAME",$name);
                        $this->tpl->setVariable("BTN_VALUE",$value);
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

ilObjectGUI::undeleteObject (  ) 

get object back from trash

public

Definition at line 799 of file class.ilObjectGUI.php.

References $_GET, $_POST, $id, $log, $rbacsystem, insertSavedNodes(), and sendInfo().

        {
                global $rbacsystem, $log;

                // AT LEAST ONE OBJECT HAS TO BE CHOSEN.
                if (!isset($_POST["trash_id"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }

                foreach ($_POST["trash_id"] as $id)
                {
                        $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($id);

                        if (!$rbacsystem->checkAccess('create',$_GET["ref_id"],$obj_data->getType()))
                        {
                                $no_create[] = $id;
                        }
                }

                if (count($no_create))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_paste")." ".
                                                                         implode(',',$no_paste),$this->ilias->error_obj->MESSAGE);
                }
                foreach ($_POST["trash_id"] as $id)
                {
                        // INSERT AND SET PERMISSIONS
                        $this->insertSavedNodes($id,$_GET["ref_id"],-(int) $id);
                        // DELETE SAVED TREE
                        $saved_tree = new ilTree(-(int)$id);
                        $saved_tree->deleteTree($saved_tree->getNodeData($id));
                        
                }

                //$this->object->notify("undelete", $_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$_POST["trash_id"]);
                
                sendInfo($this->lng->txt("msg_undeleted"),true);
                
                $this->ctrl->redirect($this, "view");
        }

Here is the call graph for this function:

ilObjectGUI::updateObject (  ) 

updates object entry in object_data

public

Reimplemented in ilObjQuestionPoolGUI, ilObjChatServerGUI, ilObjCategoryGUI, ilObjExerciseGUI, ilObjFileGUI, ilObjForumGUI, ilObjGroupGUI, ilObjRoleGUI, ilObjRoleTemplateGUI, ilObjStyleSheetGUI, ilObjUserGUI, ilObjCourseGUI, ilObjiLincCourseGUI, and ilObjSurveyQuestionPoolGUI.

Definition at line 1382 of file class.ilObjectGUI.php.

References $_POST, afterUpdate(), sendInfo(), and ilUtil::stripSlashes().

Referenced by ilObjMediaPoolGUI::update(), and ilObjFileBasedLMGUI::update().

        {
                $this->object->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
                $this->object->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
                $this->update = $this->object->update();

                sendInfo($this->lng->txt("msg_obj_modified"),true);
                
                $this->afterUpdate();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::viewObject (  ) 

list childs of current object

public

Reimplemented in ilObjChatGUI, ilObjAuthSettingsGUI, ilObjExerciseGUI, ilObjExternalToolsSettingsGUI, ilObjFolderGUI, ilObjGroupGUI, ilObjLanguageFolderGUI, ilObjMailGUI, ilObjObjectFolderGUI, ilObjRoleFolderGUI, ilObjStyleSheetFolderGUI, ilObjStyleSheetGUI, ilObjSystemFolderGUI, ilObjTypeDefinitionGUI, ilObjUserFolderGUI, ilObjGlossaryGUI, ilObjSAHSLearningModuleGUI, ilObjCourseGUI, ilObjiLincCourseGUI, and ilObjLinkResourceGUI.

Definition at line 1751 of file class.ilObjectGUI.php.

References $_GET, $key, $rbacsystem, displayList(), formatDate(), and ilUtil::sortArray().

Referenced by ilObjMediaPoolGUI::view(), ilObjLearningModuleGUI::view(), and ilObjContentObjectGUI::view().

        {
                global $rbacsystem;

                if (!$rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
                }

                //prepare objectlist
                $this->objectList = array();
                $this->data["data"] = array();
                $this->data["ctrl"] = array();
                $this->data["cols"] = array("", "type", "title", "last_change");

                $childs = $this->tree->getChilds($_GET["ref_id"], $_GET["order"], $_GET["direction"]);

                foreach ($childs as $key => $val)
            {
                        // visible
                        if (!$rbacsystem->checkAccess("visible",$val["ref_id"]))
                        {
                                continue;
                        }
                        
                        // hide object types in devmode
                        if ($this->objDefinition->getDevMode($val["type"]))
                        {
                                continue;
                        }
                        
                        // don't show administration in root node list
                        if ($val["type"] == "adm")
                        {
                                continue;
                        }

                        //visible data part
                        $this->data["data"][] = array(
                                                                                "type" => $val["type"],
                                                                                "title" => $val["title"]."#separator#".$val["desc"],
                                                                                //"description" => $val["desc"],
                                                                                "last_change" => $val["last_update"],
                                                                                "ref_id" => $val["ref_id"]
                                                                                );

                        //control information is set below

            } //foreach

                $this->maxcount = count($this->data["data"]);
                // sorting array
                $this->data["data"] = ilUtil::sortArray($this->data["data"],$_GET["sort_by"],$_GET["sort_order"]);
                $this->data["data"] = array_slice($this->data["data"],$_GET["offset"],$_GET["limit"]);

                // now compute control information
                foreach ($this->data["data"] as $key => $val)
                {
                        $this->data["ctrl"][$key] = array(
                                                                                        "type" => $val["type"],
                                                                                        "ref_id" => $val["ref_id"]
                                                                                        );

                        unset($this->data["data"][$key]["ref_id"]);
                                                $this->data["data"][$key]["last_change"] = ilFormat::formatDate($this->data["data"][$key]["last_change"]);
                }

                $this->displayList();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjectGUI::withReferences (  ) 

determines wether objects are referenced or not (got ref ids or not)

Definition at line 201 of file class.ilObjectGUI.php.

Referenced by ilObjFolderGUI::saveObject().

        {
                return $this->call_by_reference;
        }

Here is the caller graph for this function:


Field Documentation

ilObjectGUI::$actions
ilObjectGUI::$data

Definition at line 76 of file class.ilObjectGUI.php.

Referenced by ilObjRoleGUI::__formatPath(), ilObjCourseGUI::__readMemberData(), ilObjFileBasedLMGUI::addBibItemObject(), ilObjContentObjectGUI::addBibItemObject(), ilObjSurveyGUI::browseForQuestionsObject(), ilObjSystemFolderGUI::changeHeaderTitleObject(), ilObjSurveyGUI::constraintsObject(), ilObjiLincClassroomGUI::create(), ilObjSurveyQuestionPoolGUI::createObject(), ilObjSurveyGUI::createObject(), ilObjiLincCourseGUI::createObject(), ilObjGlossaryGUI::createObject(), ilObjFileBasedLMGUI::createObject(), ilObjContentObjectGUI::createObject(), ilObjUserGUI::createObject(), ilObjRoleTemplateGUI::createObject(), ilObjGroupGUI::createObject(), ilObjFolderGUI::createObject(), ilObjFileGUI::createObject(), createObject(), ilObjCategoryGUI::createObject(), ilObjTestGUI::createObject(), ilObjQuestionPoolGUI::createObject(), ilObjSurveyQuestionPoolGUI::deleteQuestionsObject(), ilObjiLincClassroomGUI::displayEditForm(), ilObjUserFolderGUI::displayList(), ilObjTypeDefinitionGUI::displayList(), ilObjSystemFolderGUI::displayList(), ilObjObjectFolderGUI::displayList(), ilObjLanguageFolderGUI::displayList(), displayList(), ilObjUserGUI::editObject(), ilObjTypeDefinitionGUI::editObject(), ilObjGroupGUI::editObject(), ilObjCategoryGUI::editObject(), ilObjGroupGUI::exportMembersObject(), ilObjUserFolderGUI::learningProgressObject(), ilObjCourseGUI::listStructureObject(), ilObjUserTrackingGUI::outputTrackingDataObject(), ilObjTestGUI::outUserGroupTable(), ilObjSurveyQuestionPoolGUI::pasteObject(), ilObjTestGUI::propertiesObject(), ilObjTestGUI::questionBrowser(), ilObjSurveyQuestionPoolGUI::questionsObject(), ilObjSurveyGUI::questionsObject(), ilObjTestGUI::questionsObject(), ilObjQuestionPoolGUI::questionsObject(), ilObjChatGUI::recordingsObject(), ilObjSurveyGUI::removeQuestionsForm(), ilObjTestGUI::removeQuestionsForm(), ilObjSystemFolderGUI::saveHeaderTitleObject(), ilObjFileGUI::saveObject(), ilObjCategoryGUI::saveObject(), ilObjTestGUI::savePropertiesObject(), ilObjSurveyGUI::searchQuestionsObject(), ilObjUserFolderGUI::searchUserObject(), ilObjDlBookGUI::showCitation(), ilObjForumGUI::showStatisticsObject(), ilObjSCORMLearningModuleGUI::showTrackingItem(), ilObjSCORMLearningModuleGUI::showTrackingItemPerUser(), ilObjFileGUI::updateObject(), and ilObjCategoryGUI::updateObject().

ilObjectGUI::$formaction

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

ilObjectGUI::$ilias
ilObjectGUI::$lng

Reimplemented in ilPaymentPurchaseGUI, and ilObjUserTrackingGUI.

Definition at line 69 of file class.ilObjectGUI.php.

Referenced by ilObjMediaObjectGUI::_getMediaInfoHTML(), ilObjSurveyGUI::_goto(), ilObjLinkResourceGUI::_goto(), ilObjCourseGUI::_goto(), ilObjSAHSLearningModuleGUI::_goto(), ilObjGlossaryGUI::_goto(), ilObjFileBasedLMGUI::_goto(), ilObjContentObjectGUI::_goto(), ilObjGroupGUI::_goto(), ilObjForumGUI::_goto(), ilObjFolderGUI::_goto(), ilObjFileGUI::_goto(), ilObjExerciseGUI::_goto(), ilObjCategoryGUI::_goto(), ilObjChatGUI::_goto(), ilObjTestGUI::_goto(), ilObjCategoryGUI::_importCategories(), ilObjCategoryGUI::_importCategoriesForm(), ilObjContentObjectGUI::addLocations(), ilObjStyleSheetGUI::cancelObject(), ilObjStyleSheetGUI::createObject(), ilObjFolderGUI::createObject(), ilObjStyleSheetGUI::editObject(), ilObjStyleSheetGUI::editTagStyleObject(), ilObjGlossaryGUI::executeCommand(), ilContainerGUI::forwardToPageObject(), ilObjSAHSLearningModuleGUI::getTemplate(), ilObjFileBasedLMGUI::getTemplate(), ilObjAICCLearningModuleGUI::ilObjAICCLearningModuleGUI(), ilObjContentObjectGUI::ilObjContentObjectGUI(), ilObjectGUI(), ilObjExerciseGUI::ilObjExerciseGUI(), ilObjFileBasedLMGUI::ilObjFileBasedLMGUI(), ilObjGlossaryGUI::ilObjGlossaryGUI(), ilObjHACPLearningModuleGUI::ilObjHACPLearningModuleGUI(), ilObjiLincClassroomGUI::ilObjiLincClassroomGUI(), ilObjMediaObjectGUI::ilObjMediaObjectGUI(), ilObjMediaPoolGUI::ilObjMediaPoolGUI(), ilObjQuestionPoolGUI::ilObjQuestionPoolGUI(), ilObjSAHSLearningModuleGUI::ilObjSAHSLearningModuleGUI(), ilObjSCORMLearningModuleGUI::ilObjSCORMLearningModuleGUI(), ilObjStyleSettingsGUI::ilObjStyleSettingsGUI(), ilObjStyleSheetGUI::ilObjStyleSheetGUI(), ilObjSurveyGUI::ilObjSurveyGUI(), ilObjSurveyQuestionPoolGUI::ilObjSurveyQuestionPoolGUI(), ilObjTestGUI::ilObjTestGUI(), ilObjMailGUI::importObject(), ilObjUserFolderGUI::importUserRoleAssignmentObject(), ilObjUserFolderGUI::importUsersObject(), ilObjiLincCourseGUI::membersObject(), ilObjUserFolderGUI::newAccountMailObject(), ilObjMailGUI::performImportObject(), ilObjContentObjectGUI::properties(), ilObjUserFolderGUI::saveNewAccountMailObject(), ilObjFolderGUI::saveObject(), setActions(), ilContainerGUI::setPageEditorTabs(), ilObjStyleSheetGUI::setTabs(), ilObjRootFolderGUI::setTitleAndDescription(), and ilObjMailGUI::uploadObject().

ilObjectGUI::$maxcount

Definition at line 86 of file class.ilObjectGUI.php.

ilObjectGUI::$obj_id
ilObjectGUI::$objDefinition
ilObjectGUI::$object
ilObjectGUI::$omit_locator = false

Definition at line 94 of file class.ilObjectGUI.php.

ilObjectGUI::$ref_id
ilObjectGUI::$return_location
ilObjectGUI::$sub_objects

Definition at line 93 of file class.ilObjectGUI.php.

ilObjectGUI::$tab_target_script

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

ilObjectGUI::$target_frame

Definition at line 89 of file class.ilObjectGUI.php.

ilObjectGUI::$tpl

Reimplemented in ilPaymentPurchaseGUI, and ilObjUserTrackingGUI.

Definition at line 55 of file class.ilObjectGUI.php.

Referenced by ilObjDlBookGUI::__applyCitationText(), ilObjChatGUI::__formatMessage(), ilObjUserFolderGUI::__showAppliedUsersTable(), ilObjRoleGUI::__showAssignedUsersTable(), __showClipboardTable(), ilObjCourseGUI::__showDeleteMembersTable(), ilObjCourseGUI::__showDeleteSubscriberTable(), ilObjCourseGUI::__showEditMemberTable(), ilObjiLincCourseGUI::__showMembersTable(), ilObjGroupGUI::__showMembersTable(), ilObjCourseGUI::__showRemoveFromWaitingListTable(), ilObjUserGUI::__showRolesTable(), ilObjRoleFolderGUI::__showRolesTable(), ilObjCategoryGUI::__showRolesTable(), ilObjiLincCourseGUI::__showSearchGroupTable(), ilObjCourseGUI::__showSearchGroupTable(), ilObjRoleGUI::__showSearchGroupTable(), ilObjGroupGUI::__showSearchGroupTable(), ilObjiLincCourseGUI::__showSearchRoleTable(), ilObjCourseGUI::__showSearchRoleTable(), ilObjRoleGUI::__showSearchRoleTable(), ilObjGroupGUI::__showSearchRoleTable(), ilObjPaymentSettingsGUI::__showSearchUserSPTable(), ilObjPaymentSettingsGUI::__showSearchUserTable(), ilObjiLincCourseGUI::__showSearchUserTable(), ilObjCourseGUI::__showSearchUserTable(), ilObjRoleGUI::__showSearchUserTable(), ilObjGroupGUI::__showSearchUserTable(), ilObjPaymentSettingsGUI::__showStatisticTable(), ilObjCourseGUI::__showSubscribersTable(), ilContainerGUI::__showTimingsButton(), ilObjCategoryGUI::__showUsersTable(), ilObjPaymentSettingsGUI::__showVendorsTable(), ilObjCourseGUI::__showWaitingListTable(), ilObjMediaObjectGUI::_getMediaInfoHTML(), ilObjStyleSheetGUI::createObject(), ilObjLinkResourceGUI::editItemsObject(), ilObjMediaPoolGUI::editObject(), ilObjFileBasedLMGUI::editObject(), ilContainerGUI::editPageContentObject(), ilObjUserGUI::getPublicProfile(), ilObjectGUI(), ilObjiLincClassroomGUI::ilObjiLincClassroomGUI(), ilObjStyleSheetGUI::ilObjStyleSheetGUI(), ilObjCourseGUI::infoScreen(), ilObjLinkResourceGUI::listItemsObject(), ilContainerGUI::newBlockTemplate(), prepareOutput(), ilObjCourseGUI::printMembersObject(), ilObjSCORMLearningModuleGUI::properties(), ilObjGlossaryGUI::properties(), ilObjFileBasedLMGUI::properties(), ilObjiLincCourseGUI::renderItemList(), ilContainerGUI::renderItemList(), ilContainerGUI::renderObject(), setLocator(), ilContainerGUI::showAdministrationPanel(), ilContainerGUI::showPermanentLink(), ilContainerGUI::showTreeFlatIcon(), ilObjMediaPoolGUI::showUpperIcon(), ilObjUserGUI::showUpperIcon(), ilObjStyleSheetGUI::showUpperIcon(), ilObjRoleTemplateGUI::showUpperIcon(), ilObjRoleGUI::showUpperIcon(), and showUpperIcon().

ilObjectGUI::$tree

Definition at line 62 of file class.ilObjectGUI.php.

Referenced by ilObjLinkResourceGUI::__setLocator(), ilObjRoleGUI::__setLocator(), ilObjChatGUI::__setLocator(), ilContainerGUI::__showTimingsButton(), ilObjChatGUI::addAdminLocatorItems(), ilObjContentObjectGUI::addLocations(), ilObjMediaPoolGUI::addLocatorItems(), ilObjRoleGUI::adoptPermSaveObject(), ilObjAdvancedEditingGUI::categoryObject(), ilObjContentObjectGUI::chapters(), ilObjContentObjectGUI::confirmedDelete(), ilObjTestGUI::createQuestionPool(), ilObjLanguageFolderGUI::displayList(), ilObjMediaPoolGUI::editObject(), ilObjFileBasedLMGUI::editObject(), ilPaymentPurchaseGUI::executeCommand(), ilObjMediaPoolGUI::executeCommand(), ilObjGlossaryGUI::exportList(), ilObjContentObjectGUI::exportList(), ilObjSurveyQuestionPoolGUI::exportObject(), ilObjSurveyGUI::exportObject(), ilObjTestGUI::exportObject(), ilObjQuestionPoolGUI::exportObject(), ilObjDlBookGUI::getContextPath(), ilObjRoleFolderGUI::getTabs(), ilObjectGUI(), ilObjiLincClassroomGUI::ilObjiLincClassroomGUI(), ilObjRoleGUI::ilObjRoleGUI(), ilPaymentPurchaseGUI::ilPaymentPurchaseGUI(), ilObjUserFolderGUI::importUserRoleAssignmentObject(), ilObjUserFolderGUI::importUsersObject(), ilObjRoleGUI::listDesktopItemsObject(), ilObjMediaPoolGUI::listMedia(), ilObjiLincCourseGUI::listUsersGroupObject(), ilObjCourseGUI::listUsersGroupObject(), ilObjRoleGUI::listUsersGroupObject(), ilObjGroupGUI::listUsersGroupObject(), ilObjCourseGUI::listUsersRoleObject(), ilObjContentObjectGUI::pages(), ilObjRoleGUI::permObject(), ilObjRoleGUI::permSaveObject(), ilObjSCORMLearningModuleGUI::properties(), ilObjGlossaryGUI::properties(), ilObjFileBasedLMGUI::properties(), ilContainerGUI::renderObject(), ilObjPaymentSettingsGUI::searchObject(), ilObjiLincCourseGUI::searchObject(), ilObjCourseGUI::searchObject(), ilObjRoleGUI::searchObject(), ilObjGroupGUI::searchObject(), ilObjRoleGUI::selectDesktopItemObject(), ilObjSAHSLearningModuleGUI::setLocator(), ilObjFileBasedLMGUI::setLocator(), ilObjPaymentSettingsGUI::showObjectSelectorObject(), ilObjUserGUI::showUpperIcon(), ilObjStyleSheetGUI::showUpperIcon(), ilObjRoleTemplateGUI::showUpperIcon(), ilObjRoleGUI::showUpperIcon(), showUpperIcon(), ilObjRoleGUI::updateObject(), ilObjGlossaryGUI::viewExportLog(), ilObjContentObjectGUI::viewExportLog(), ilObjGroupGUI::viewObject(), and ilObjFolderGUI::viewObject().


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