Public Member Functions | Data Fields

ilEditClipboardGUI Class Reference

Public Member Functions

 ilEditClipboardGUI ()
 Constructor public.
 _forwards ()
 get all gui classes that are called from this one (see class ilCtrl)
executeCommand ()
 execute command
 view ()
 getObject ()
 get Object
 remove ()
 remove item from clipboard
 insert ()
 insert
 createMediaInClipboard ()
 create new medi object in clipboard
 saveMediaInClipboard ()
 save new media object in clipboard
 setTabs ()
 output tabs
 getTabs (&$tabs_gui)
 adds tabs to tab gui object

Data Fields

 $ilias
 $tpl
 $lng
 $ctrl

Detailed Description

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


Member Function Documentation

ilEditClipboardGUI::_forwards (  ) 

get all gui classes that are called from this one (see class ilCtrl)

Parameters:
array array of gui classes that are called

Definition at line 73 of file class.ilEditClipboardGUI.php.

        {
                return array("ilObjMediaObjectGUI");
        }

ilEditClipboardGUI::createMediaInClipboard (  ) 

create new medi object in clipboard

Definition at line 321 of file class.ilEditClipboardGUI.php.

References $_GET.

        {
                require_once ("content/classes/Pages/class.ilPCMediaObjectGUI.php");
                $mob_gui =& new ilPCMediaObjectGUI($this->obj, $this->lm_obj);
                $mob_gui->setTargetScript("lm_edit.php?ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]);
                $mob_gui->insert("post", "saveMediaInClipboard");
        }

& ilEditClipboardGUI::executeCommand (  ) 

execute command

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

References $_GET, and $cmd.

        {
                // get next class that processes or forwards current command
                $next_class = $this->ctrl->getNextClass($this);

                // get current command
                $cmd = $this->ctrl->getCmd();

                switch($next_class)
                {
                        case "ilobjmediaobjectgui":
//echo "<br>calling objmediaomjgui";
                                $this->ctrl->setReturn($this, "view");
                                require_once("classes/class.ilTabsGUI.php");
                                $tabs_gui =& new ilTabsGUI();
                                $mob_gui =& new ilObjMediaObjectGUI("", $_GET["clip_mob_id"],false, false);
                                //$mob_gui->getTabs($tabs_gui);
                                $mob_gui->setAdminTabs();
                                //$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
                                //$ret =& $mob_gui->executeCommand();
                                $ret =& $this->ctrl->forwardCommand($mob_gui);
                                switch($cmd)
                                {
                                        case "save":
                                                $this->ilias->account->addObjectToClipboard($ret->getId(), "mob", $ret->getTitle());
                                                $this->ctrl->redirect($this, "view");
                                                break;
                                }
                                break;


                        default:
                                $ret =& $this->$cmd();
                                break;
                }

                return $ret;
        }

ilEditClipboardGUI::getObject (  ) 

get Object

Definition at line 269 of file class.ilEditClipboardGUI.php.

References view().

        {
                $this->mode = "getObject";
                $this->view();
        }

Here is the call graph for this function:

ilEditClipboardGUI::getTabs ( &$  tabs_gui  ) 

adds tabs to tab gui object

Parameters:
object $tabs_gui ilTabsGUI object

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

References $_GET.

Referenced by setTabs().

        {
                if ($this->mode == "getObject")
                {
                        // back to upper context
                        $tabs_gui->addTarget("cont_back",
                                $_GET["returnCommand"], "",
                                "");
                }
                else
                {
                        // back to upper context
                        $tabs_gui->addTarget("cont_back",
                                $this->ctrl->getParentReturn($this), "",
                                "");
                }
        }

Here is the caller graph for this function:

ilEditClipboardGUI::ilEditClipboardGUI (  ) 

Constructor public.

Definition at line 48 of file class.ilEditClipboardGUI.php.

References $_GET, $ilCtrl, $ilias, $lng, and $tpl.

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

                $this->ctrl =& $ilCtrl;
                $this->ilias =& $ilias;
                $this->tpl =& $tpl;
                $this->lng =& $lng;
                if ($_GET["returnCommand"] != "")
                {
                        $this->mode = "getObject";
                }
                else
                {
                        $this->mode = "";
                }

                $this->ctrl->saveParameter($this, array("clip_mob_id", "returnCommand"));
        }

ilEditClipboardGUI::insert (  ) 

insert

Definition at line 300 of file class.ilEditClipboardGUI.php.

References $_GET, $_POST, ilUtil::appendUrlParameterString(), and ilUtil::redirect().

        {
                // check number of objects
                if (!isset($_POST["id"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }
                if(count($_POST["id"]) > 1)
                {
                        $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
                }

                ilUtil::redirect(ilUtil::appendUrlParameterString(
                        $_GET["returnCommand"], "clip_obj_type=mob&clip_obj_id=".$_POST["id"][0]));


        }

Here is the call graph for this function:

ilEditClipboardGUI::remove (  ) 

remove item from clipboard

Definition at line 279 of file class.ilEditClipboardGUI.php.

References $_POST, and $obj_id.

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

                foreach($_POST["id"] AS $obj_id)
                {
                        $this->ilias->account->removeObjectFromClipboard($obj_id, "mob");
                        include_once("content/classes/Media/class.ilObjMediaObject.php");
                        $mob = new ilObjMediaObject($obj_id);
                        $mob->delete();                 // this method don't delete, if mob is used elsewhere
                }
                $this->ctrl->redirect($this, "view");
        }

ilEditClipboardGUI::saveMediaInClipboard (  ) 

save new media object in clipboard

Definition at line 332 of file class.ilEditClipboardGUI.php.

        {
                require_once ("content/classes/Pages/class.ilPCMediaObjectGUI.php");
                $mob_gui =& new ilPCMediaObjectGUI($this->obj, $this->lm_obj);
                $mob =& $mob_gui->create(false);
                $this->ilias->account->addObjectToClipboard($mob->getId(), "mob", $mob->getTitle());
                $this->clipboard();
        }

ilEditClipboardGUI::setTabs (  ) 

output tabs

Definition at line 344 of file class.ilEditClipboardGUI.php.

References getTabs().

Referenced by view().

        {
                $this->tpl->setVariable("HEADER", $this->lng->txt("clipboard"));

                // catch feedback message
                include_once("classes/class.ilTabsGUI.php");
                $tabs_gui =& new ilTabsGUI();
                $this->getTabs($tabs_gui);
                $this->tpl->setVariable("TABS", $tabs_gui->getHTML());
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilEditClipboardGUI::view (  ) 

Definition at line 124 of file class.ilEditClipboardGUI.php.

References $_GET, $num, $obj, $tbl, $tree, ilUtil::getImagePath(), setTabs(), ilUtil::sortArray(), and ilUtil::switchColor().

Referenced by getObject().

        {
                global $tree;

                $this->setTabs();
                
                $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
//echo "HH";
                // create mob form button
                if ($this->mode != "getObject")
                {
                        $this->tpl->setCurrentBlock("btn_cell");
                        $this->tpl->setVariable("BTN_LINK",
                                $this->ctrl->getLinkTargetByClass("ilobjmediaobjectgui", "create"));
                        $this->tpl->setVariable("BTN_TXT",$this->lng->txt("cont_create_mob"));
                        $this->tpl->parseCurrentBlock();
                }


                include_once "./classes/class.ilTableGUI.php";          
                
//echo ":".$_GET["returnCommand"].":";
                // 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.clipboard_tbl_row.html", "content");

                $num = 0;

                $obj_str = ($this->call_by_reference) ? "" : "&obj_id=".$this->obj_id;
                if ($this->mode == "getObject")
                {
                        $this->ctrl->setParameter($this, "returnCommand",
                                rawurlencode($_GET["returnCommand"]));
                }
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

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

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

                $tbl->setHeaderNames(array("", $this->lng->txt("cont_object")));

                $cols = array("", "title");
                $header_params = array("ref_id" => $_GET["ref_id"], "obj_id" => $_GET["obj_id"],
                        "cmd" => "view", "cmdClass" => get_class($this));
                $tbl->setHeaderVars($cols, $header_params);
                $tbl->setColumnWidth(array("1%","99%"));

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

                $this->tpl->setVariable("COLUMN_COUNTS", 2);

                $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                if ($this->mode != "getObject")
                {
                        // delete button
                        $this->tpl->setCurrentBlock("tbl_action_btn");
                        $this->tpl->setVariable("BTN_NAME", "remove");
                        $this->tpl->setVariable("BTN_VALUE", "remove");
                        $this->tpl->parseCurrentBlock();

                        // add list
                        /*
                        $opts = ilUtil::formSelect("","new_type",array("mob" => "mob"));
                        $this->tpl->setCurrentBlock("add_object");
                        $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
                        $this->tpl->setVariable("BTN_NAME", "createMediaInClipboard");
                        $this->tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
                        $this->tpl->parseCurrentBlock();*/
                }
                else
                {
                        // insert button
                        $this->tpl->setCurrentBlock("tbl_action_btn");
                        $this->tpl->setVariable("BTN_NAME", "insert");
                        $this->tpl->setVariable("BTN_VALUE", "insert");
                        $this->tpl->parseCurrentBlock();
                }

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

                $objs = $this->ilias->account->getClipboardObjects("mob");
                $objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
                $objs = array_slice($objs, $_GET["offset"], $_GET["limit"]);
                $tbl->setMaxCount(count($objs));

                $tbl->render();
                if(count($objs) > 0)
                {
                        $i=0;
                        foreach($objs as $obj)
                        {
                                if ($this->mode != "getObject")
                                {
                                        $this->tpl->setCurrentBlock("edit");
                                        $this->ctrl->setParameter($this, "clip_mob_id", $obj["id"]);
                                        $this->tpl->setVariable("EDIT_LINK",
                                                $this->ctrl->getLinkTargetByClass("ilObjMediaObjectGUI", "edit",
                                                        array("ilEditClipboardGUI")));
                                        $this->tpl->setVariable("TEXT_OBJECT", $obj["title"].
                                                " [".$obj["id"]."]");
                                        $this->tpl->parseCurrentBlock();
                                }
                                else
                                {
                                        $this->tpl->setCurrentBlock("show");
                                        $this->tpl->setVariable("TEXT_OBJECT2", $obj["title"].
                                                " [".$obj["id"]."]");
                                        $this->tpl->parseCurrentBlock();
                                }

                                $this->tpl->setCurrentBlock("tbl_content");
                                $css_row = ilUtil::switchColor($i++,"tblrow1","tblrow2");
                                $this->tpl->setVariable("CSS_ROW", $css_row);
                                $this->tpl->setVariable("CHECKBOX_ID", $obj["id"]);
                                $this->tpl->parseCurrentBlock();
                        }
                } //if is_array
                else
                {
                        $this->tpl->setCurrentBlock("notfound");
                        $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
                        $this->tpl->setVariable("NUM_COLS", $num);
                        $this->tpl->parseCurrentBlock();
                }

        }

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

ilEditClipboardGUI::$ctrl

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

ilEditClipboardGUI::$ilias

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

Referenced by ilEditClipboardGUI().

ilEditClipboardGUI::$lng

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

Referenced by ilEditClipboardGUI().

ilEditClipboardGUI::$tpl

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

Referenced by ilEditClipboardGUI().


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