Public Member Functions | |
ilEditClipboardGUI () | |
Constructor public. | |
_forwards () | |
get all gui classes that are called from this one (see class ilCtrl) | |
& | executeCommand () |
execute command | |
setMultipleSelections ($a_multiple=true) | |
set, if multiple selections are enabled | |
getMultipleSelections () | |
check wether multiple selections are enabled | |
view () | |
getObject () | |
get Object | |
remove () | |
remove item from clipboard | |
insert () | |
insert | |
_getSelectedIDs () | |
setTabs () | |
create new medi object in clipboard | |
setPageBackTitle ($a_title) | |
getTabs (&$tabs_gui) | |
adds tabs to tab gui object | |
Data Fields | |
$ilias | |
$tpl | |
$lng | |
$ctrl |
Definition at line 37 of file class.ilEditClipboardGUI.php.
ilEditClipboardGUI::_forwards | ( | ) |
get all gui classes that are called from this one (see class ilCtrl)
array | array of gui classes that are called |
Definition at line 75 of file class.ilEditClipboardGUI.php.
{ return array("ilObjMediaObjectGUI"); }
ilEditClipboardGUI::_getSelectedIDs | ( | ) |
Definition at line 356 of file class.ilEditClipboardGUI.php.
References $_SESSION.
Referenced by ilObjMediaPoolGUI::insertFromClipboard().
{ return $_SESSION["ilEditClipboard_mob_id"]; }
& ilEditClipboardGUI::executeCommand | ( | ) |
execute command
Definition at line 83 of file class.ilEditClipboardGUI.php.
{ // 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::getMultipleSelections | ( | ) |
check wether multiple selections are enabled
Definition at line 133 of file class.ilEditClipboardGUI.php.
Referenced by insert().
{
return $this->multiple;
}
ilEditClipboardGUI::getObject | ( | ) |
get Object
Definition at line 304 of file class.ilEditClipboardGUI.php.
References view().
{ $this->mode = "getObject"; $this->view(); }
ilEditClipboardGUI::getTabs | ( | &$ | tabs_gui | ) |
adds tabs to tab gui object
object | $tabs_gui ilTabsGUI object |
Definition at line 418 of file class.ilEditClipboardGUI.php.
References $_GET.
Referenced by setTabs().
{ if ($this->mode == "getObject") { // back to upper context $tabs_gui->setBackTarget($this->page_back_title, $_GET["returnCommand"]); } else { // back to upper context $tabs_gui->setBackTarget($this->page_back_title, $this->ctrl->getParentReturn($this)); } }
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; $this->multiple = false; $this->page_back_title = $lng->txt("cont_back"); if ($_GET["returnCommand"] != "") { $this->mode = "getObject"; } else { $this->mode = ""; } $this->ctrl->saveParameter($this, array("clip_mob_id", "returnCommand")); }
ilEditClipboardGUI::insert | ( | ) |
insert
Definition at line 335 of file class.ilEditClipboardGUI.php.
References $_GET, $_POST, $_SESSION, ilUtil::appendUrlParameterString(), getMultipleSelections(), 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 (!$this->getMultipleSelections()) { if(count($_POST["id"]) > 1) { $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE); } } $_SESSION["ilEditClipboard_mob_id"] = $_POST["id"]; ilUtil::redirect(ilUtil::appendUrlParameterString( $_GET["returnCommand"], "clip_obj_type=mob&clip_obj_id=".$_POST["id"][0])); }
ilEditClipboardGUI::remove | ( | ) |
remove item from clipboard
Definition at line 314 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::setMultipleSelections | ( | $ | a_multiple = true |
) |
set, if multiple selections are enabled
Definition at line 125 of file class.ilEditClipboardGUI.php.
{ $this->multiple = $a_multiple; }
ilEditClipboardGUI::setPageBackTitle | ( | $ | a_title | ) |
Definition at line 408 of file class.ilEditClipboardGUI.php.
{ $this->page_back_title = $a_title; }
ilEditClipboardGUI::setTabs | ( | ) |
create new medi object in clipboard
save new media object in clipboard output tabs
Definition at line 391 of file class.ilEditClipboardGUI.php.
References ilUtil::getImagePath(), and getTabs().
Referenced by view().
{ global $ilTabs; //$this->tpl->setCurrentBlock("header_image"); $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_clip_b.gif")); //$this->tpl->parseCurrentBlock(); $this->tpl->setTitle($this->lng->txt("clipboard")); $this->tpl->stopTitleFloating(); // catch feedback message #include_once("classes/class.ilTabsGUI.php"); #$tabs_gui =& new ilTabsGUI(); $this->getTabs($ilTabs); #$this->tpl->setVariable("TABS", $tabs_gui->getHTML()); }
ilEditClipboardGUI::view | ( | ) |
Definition at line 141 of file class.ilEditClipboardGUI.php.
References $_GET, $tbl, $tree, ilObjMediaObjectGUI::_getMediaInfoHTML(), 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"))); $tbl->disable("sort"); $cols = array("", "", "title"); $header_params = $this->ctrl->getParameterArray($this, "view"); $tbl->setHeaderVars($cols, $header_params); $tbl->setColumnWidth(array("1%","1%","98%")); // 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", 3); $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", $this->lng->txt("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", $this->lng->txt("insert")); $this->tpl->parseCurrentBlock(); } // footer // //$tbl->disable("footer"); $objs = $this->ilias->account->getClipboardObjects("mob"); $objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]); $tbl->setMaxCount(count($objs)); $objs = array_slice($objs, $_GET["offset"], $_GET["limit"]); $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next")); $tbl->render(); if(count($objs) > 0) { $i=0; foreach($objs as $obj) { // output thumbnail $mob =& new ilObjMediaObject($obj["id"]); $med =& $mob->getMediaItem("Standard"); $target = $med->getThumbnailTarget(); if ($target != "") { $this->tpl->setCurrentBlock("thumbnail"); $this->tpl->setVariable("IMG_THUMB", $target); $this->tpl->parseCurrentBlock(); } // allow editing of media objects if ($this->mode != "getObject") { // output edit link $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 // just list elements for selection { $this->tpl->setCurrentBlock("show"); $this->tpl->setVariable("TEXT_OBJECT2", $obj["title"]. " [".$obj["id"]."]"); $this->tpl->parseCurrentBlock(); } include_once("content/classes/Media/class.ilObjMediaObjectGUI.php"); $this->tpl->setVariable("MEDIA_INFO", ilObjMediaObjectGUI::_getMediaInfoHTML($mob)); $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(); } }
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().