4include_once(
"./Services/Object/classes/class.ilObject2GUI.php");
 
    5include_once(
"./Modules/MediaPool/classes/class.ilObjMediaPool.php");
 
    6include_once(
"./Services/Table/classes/class.ilTableGUI.php");
 
    7include_once(
"./Modules/Folder/classes/class.ilObjFolderGUI.php");
 
    8include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
 
    9include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
   10include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
 
   45    public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 
   47        parent::__construct($a_id, $a_id_type, $a_parent_node_id);
 
   50        $this->tabs = 
$DIC->tabs();
 
   51        $this->
error = $DIC[
"ilErr"];
 
   52        $this->locator = 
$DIC[
"ilLocator"];
 
   53        $this->help = 
$DIC[
"ilHelp"];
 
   65        $lng->loadLanguageModule(
"mep");
 
   67        if ($this->ctrl->getCmd() == 
"explorer") {
 
   68            $this->ctrl->saveParameter($this, array(
"ref_id"));
 
   70            $this->ctrl->saveParameter($this, array(
"ref_id", 
"mepitem_id"));
 
   72        $this->ctrl->saveParameter($this, array(
"mep_mode"));
 
   74        $lng->loadLanguageModule(
"content");
 
   96        if ($this->ctrl->getRedirectSource() == 
"ilinternallinkgui") {
 
  101        $next_class = $this->ctrl->getNextClass($this);
 
  102        $cmd = $this->ctrl->getCmd();
 
  103        $new_type = 
$_POST[
"new_type"]
 
  107        if ($new_type != 
"" && ($cmd != 
"confirmRemove" && $cmd != 
"copyToClipboard" 
  108            && $cmd != 
"pasteFromClipboard")) {
 
  113            $tree = $this->
object->getTree();
 
  114            if (
$_GET[
"mepitem_id"] == 
"") {
 
  118        if ($cmd == 
"create") {
 
  119            switch (
$_POST[
"new_type"]) {
 
  121                    $this->ctrl->redirectByClass(
"ilobjmediaobjectgui", 
"create");
 
  125                    $this->ctrl->redirectByClass(
"ilobjfoldergui", 
"create");
 
  130        switch ($next_class) {
 
  131            case 'ilmediapoolpagegui':
 
  135                $ilTabs->clearTargets();
 
  136                include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
 
  139                if (!$ilAccess->checkAccess(
"write", 
"", $this->object->getRefId())) {
 
  140                    $mep_page_gui->setEnableEditing(
false);
 
  142                $ret = $this->ctrl->forwardCommand($mep_page_gui);
 
  150            case "ilobjmediaobjectgui":
 
  153                if ($cmd == 
"create" || $cmd == 
"save" || $cmd == 
"cancel") {
 
  154                    $ret_obj = 
$_GET[
"mepitem_id"];
 
  156                    $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
 
  157                    $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
 
  159                    $ret_obj = 
$tree->getParentId(
$_GET[
"mepitem_id"]);
 
  162                    $ilTabs->setBackTarget(
 
  164                        $this->ctrl->getLinkTarget(
 
  166                            $_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia" 
  170                if ($this->ctrl->getCmdClass() == 
"ilinternallinkgui") {
 
  171                    $this->ctrl->setReturn($this, 
"explorer");
 
  173                    $this->ctrl->setParameter($this, 
"mepitem_id", $ret_obj);
 
  174                    $this->ctrl->setReturn(
 
  176                        $_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia" 
  178                    $this->ctrl->setParameter($this, 
"mepitem_id", 
$_GET[
"mepitem_id"]);
 
  181                $ilObjMediaObjectGUI->setTabs();
 
  184                $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
 
  186                if ($cmd == 
"save" && 
$ret != 
false) {
 
  188                    $mep_item->setTitle(
$ret->getTitle());
 
  189                    $mep_item->setType(
"mob");
 
  190                    $mep_item->setForeignId(
$ret->getId());
 
  193                    $parent = (
$_GET[
"mepitem_id"] == 
"")
 
  195                        : 
$_GET[
"mepitem_id"];
 
  196                    $tree->insertNode($mep_item->getId(), $parent);
 
  197                    ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
 
  198                        $_GET[
"ref_id"] . 
"&mepitem_id=" . 
$_GET[
"mepitem_id"]);
 
  204            case "ilobjfoldergui":
 
  208                $this->ctrl->setReturn($this, 
"listMedia");
 
  214                        $folder_gui->setFormAction(
 
  216                            $this->ctrl->getFormActionByClass(
"ilobjfoldergui")
 
  218                        $folder_gui->createObject();
 
  224                        $parent = (
$_GET[
"mepitem_id"] == 
"")
 
  226                            : 
$_GET[
"mepitem_id"];
 
  227                        $folder_gui->setFolderTree(
$tree);
 
  228                        $folder_gui->saveObject($parent);
 
  235                        $this->ctrl->setParameter($this, 
"foldereditmode", 
"1");
 
  236                        $folder_gui->setFormAction(
"update", $this->ctrl->getFormActionByClass(
"ilobjfoldergui"));
 
  237                        $folder_gui->editObject();
 
  244                        $this->ctrl->setReturn($this, 
"listMedia");
 
  245                        $folder_gui->updateObject(
true);                
 
  249                        if (
$_GET[
"foldereditmode"]) {
 
  252                        $this->ctrl->redirect($this, 
"listMedia");
 
  257            case "ileditclipboardgui":
 
  260                $this->ctrl->setReturn($this, 
$_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia");
 
  262                $clip_gui->setMultipleSelections(
true);
 
  263                $clip_gui->setInsertButtonTitle(
$lng->txt(
"mep_copy_to_mep"));
 
  264                $ilTabs->setTabActive(
"clipboard");
 
  265                $this->ctrl->forwardCommand($clip_gui);
 
  269            case 'ilinfoscreengui':
 
  276            case 'ilpermissiongui':
 
  280                include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  282                $this->ctrl->forwardCommand($perm_gui);
 
  290                include_once(
"./Services/Export/classes/class.ilExportGUI.php");
 
  292                $exp_gui->addFormat(
"xml");
 
  293                include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
 
  295                if ($ot->getContentActivated()) {
 
  296                    $exp_gui->addFormat(
"xml_master", 
"XML (" . 
$lng->txt(
"mep_master_language_only") . 
")", $this, 
"export");
 
  297                    $exp_gui->addFormat(
"xml_masternomedia", 
"XML (" . 
$lng->txt(
"mep_master_language_only_no_media") . 
")", $this, 
"export");
 
  299                $this->ctrl->forwardCommand($exp_gui);
 
  303            case "ilfilesystemgui":
 
  307                $ilTabs->clearTargets();
 
  308                $ilTabs->setBackTarget(
 
  310                    $ilCtrl->getLinkTarget($this, 
"listMedia")
 
  313                if (trim($mset->get(
"upload_dir")) != 
"") {
 
  314                    include_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
 
  316                    $fs_gui->setPostDirPath(
true);
 
  317                    $fs_gui->setTableId(
"mepud" . $this->object->getId());
 
  318                    $fs_gui->setAllowFileCreation(
false);
 
  319                    $fs_gui->setAllowDirectoryCreation(
false);
 
  320                    $fs_gui->clearCommands();
 
  323                        "selectUploadDirFiles",
 
  324                        $this->lng->txt(
"mep_sel_upload_dir_files"),
 
  328                    $this->ctrl->forwardCommand($fs_gui);
 
  333            case "ilcommonactiondispatchergui":
 
  334                include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
 
  336                $this->ctrl->forwardCommand($gui);
 
  339            case 'ilobjecttranslationgui':
 
  343                $ilTabs->activateTab(
"settings");
 
  345                include_once(
"./Services/Object/classes/class.ilObjectTranslationGUI.php");
 
  347                $transgui->setTitleDescrOnlyMode(
false);
 
  348                $this->ctrl->forwardCommand($transgui);
 
  352            case "ilmediapoolimportgui":
 
  355                $ilTabs->activateTab(
"import");
 
  356                include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolImportGUI.php");
 
  358                $this->ctrl->forwardCommand($gui);
 
  362            case "ilmobmultisrtuploadgui":
 
  368                include_once(
"./Services/MediaObjects/classes/class.ilMobMultiSrtUploadGUI.php");
 
  369                include_once(
"./Modules/MediaPool/classes/class.ilMepMultiSrt.php");
 
  371                $this->ctrl->forwardCommand($gui);
 
  379                $cmd = $this->ctrl->getCmd(
"listMedia");
 
  393        $this->ctrl->redirectByClass(
"ilobjmediaobjectgui", 
"create");
 
  398        $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
 
  413        ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $newObj->
getRefId() . 
"&cmd=listMedia");
 
  419        $ni = 
new ilNumberInputGUI($this->lng->txt(
"mep_default_width"), 
"default_width");
 
  421        $ni->setSuffix(
"px");
 
  422        $ni->setMaxLength(5);
 
  427        $ni = 
new ilNumberInputGUI($this->lng->txt(
"mep_default_height"), 
"default_height");
 
  428        $ni->setSuffix(
"px");
 
  430        $ni->setMaxLength(5);
 
  432        $ni->setInfo($this->lng->txt(
"mep_default_width_height_info"));
 
  451        if ($this->object->getDefaultWidth() > 0) {
 
  452            $a_values[
"default_width"] = $this->
object->getDefaultWidth();
 
  454        if ($this->object->getDefaultHeight() > 0) {
 
  455            $a_values[
"default_height"] = $this->
object->getDefaultHeight();
 
  461        $this->
object->setDefaultWidth($a_form->
getInput(
"default_width"));
 
  462        $this->
object->setDefaultHeight($a_form->
getInput(
"default_height"));
 
  477        $ilCtrl->setParameter($this, 
"mep_mode", 
"listMedia");
 
  481        $ilTabs->setTabActive(
"content");
 
  484        if ($ilAccess->checkAccess(
"write", 
"", $this->object->getRefId())) {
 
  485            $ilToolbar->addButton(
 
  486                $lng->txt(
"mep_create_mob"),
 
  487                $ilCtrl->getLinkTarget($this, 
"createMediaObject")
 
  491            if ($mset->get(
"mep_activate_pages")) {
 
  492                $ilToolbar->addButton(
 
  493                    $lng->txt(
"mep_create_content_snippet"),
 
  494                    $ilCtrl->getLinkTarget($this, 
"createMediaPoolPage")
 
  498            $ilToolbar->addButton(
 
  499                $lng->txt(
"mep_create_folder"),
 
  500                $ilCtrl->getLinkTarget($this, 
"createFolderForm")
 
  504                $ilToolbar->addButton(
 
  505                    $lng->txt(
"mep_create_from_upload_dir"),
 
  506                    $ilCtrl->getLinkTargetByClass(
"ilfilesystemgui", 
"listFiles")
 
  512        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
 
  514        if (!$exp->handleCommand()) {
 
  515            $this->tpl->setLeftNavContent($exp->getHTML());
 
  520        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
 
  522        $tpl->setContent($mep_table_gui->getHTML());
 
  535        $ilCtrl->setParameter($this, 
"mep_mode", 
"allMedia");
 
  538        $ilTabs->setTabActive(
"content");
 
  542        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
 
  553        if (isset(
$_GET[
'force_filter']) and 
$_GET[
'force_filter']) {
 
  556            include_once(
"./Services/Table/classes/class.ilTablePropertiesStorage.php");
 
  558            $tprop->storeProperty(
 
  559                $mep_table_gui->getId(),
 
  564            $mep_table_gui->resetFilter();
 
  565            $mep_table_gui->resetOffset();
 
  566            $mep_table_gui->writeFilterToSession();
 
  579        $tpl->setContent($mep_table_gui->getHTML());
 
  587        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
 
  596        $mtab->writeFilterToSession();
 
  597        $mtab->resetOffset();
 
  606        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
 
  615        $mtab->resetFilter();
 
  616        $mtab->resetOffset();
 
  625        $this->tpl->getStandardTemplate();
 
  634        if (
$_GET[
"mepitem_id"] == 
"") {
 
  637        $par_id = $this->
object->getPoolTree()->getParentId(
$_GET[
"mepitem_id"]);
 
  638        if ($par_id != $this->object->getPoolTree()->getRootId()) {
 
  653        $mob_id = $item->getForeignId();
 
  655        $this->tpl = 
new ilTemplate(
"tpl.fullscreen.html", 
true, 
true, 
"Services/COPage");
 
  656        include_once(
"Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  658        $this->tpl->setVariable(
 
  659            "LOCATION_CONTENT_STYLESHEET",
 
  664        require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  665        require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
 
  670        $this->tpl->setVariable(
"TITLE", 
" - " . $media_obj->getTitle());
 
  680        $xsl = file_get_contents(
"./Services/COPage/xsl/page.xsl");
 
  681        $args = array( 
'/_xml' => 
$xml, 
'/_xsl' => $xsl );
 
  686        $mode = (
$_GET[
"cmd"] != 
"showPreview")
 
  691            $this->ctrl->getLinkTarget($this, 
"showFullscreen", 
"", 
false, 
false);
 
  692        $params = array(
'mode' => $mode, 
'enlarge_path' => $enlarge_path,
 
  693            'link_params' => 
"ref_id=" . 
$_GET[
"ref_id"],
'fullscreen_link' => $fullscreen_link,
 
  694            'ref_id' => 
$_GET[
"ref_id"], 
'pg_frame' => $pg_frame, 
'webspace_path' => $wb_path);
 
  695        $output = xslt_process($xh, 
"arg:/_xml", 
"arg:/_xsl", 
null, $args, 
$params);
 
  699        $this->tpl->setVariable(
"MEDIA_CONTENT", 
$output);
 
  714        include_once(
"./Services/Container/classes/class.ilContainerPage.php");
 
  715        include_once(
"./Services/Container/classes/class.ilContainerPageGUI.php");
 
  717        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  720            "LOCATION_CONTENT_STYLESHEET",
 
  723        $tpl->setCurrentBlock(
"SyntaxStyle");
 
  725            "LOCATION_SYNTAX_STYLESHEET",
 
  728        $tpl->parseCurrentBlock();
 
  734        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
 
  736        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  740        $page_gui->setTemplateOutput(
false);
 
  741        $page_gui->setHeader(
"");
 
  742        $ret = $page_gui->showPage(
true);
 
  744        $tpl->setBodyClass(
"ilMediaPoolPagePreviewBody");
 
  763        switch ($item->getType()) {
 
  794        if (!isset(
$_POST[
"id"])) {
 
  795            $ilErr->raiseError($this->lng->txt(
"no_checkbox"), 
$ilErr->MESSAGE);
 
  799        include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  801        $cgui->setFormAction($this->ctrl->getFormAction($this));
 
  802        $cgui->setHeaderText($this->lng->txt(
"info_remove_sure"));
 
  803        $cgui->setCancel($this->lng->txt(
"cancel"), 
"cancelRemove");
 
  804        $cgui->setConfirm($this->lng->txt(
"confirm"), 
"remove");
 
  813                include_once(
"./Services/COPage/classes/class.ilPageContentUsage.php");
 
  815                if (count($usages) > 0) {
 
  817                    $ilCtrl->redirect($this, 
"listMedia");
 
  821                    if (count($usages) > 0) {
 
  822                        $add = 
"<div class='small'>" . 
$lng->txt(
"mep_content_snippet_used_in_older_versions") . 
"</div>";
 
  830            $cgui->addItem(
"id[]", 
$obj_id, $caption);
 
  833        $this->tpl->setContent($cgui->getHTML());
 
  847            "ileditclipboardgui",
 
  849            rawurlencode(
$ilCtrl->getLinkTarget(
 
  851                "insertFromClipboard",
 
  857        $ilCtrl->redirectByClass(
"ilEditClipboardGUI", 
"getObject");
 
  870        include_once(
"./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
 
  872        $not_inserted = array();
 
  873        if (is_array($ids)) {
 
  874            foreach ($ids as $id2) {
 
  875                $id = explode(
":", $id2);
 
  879                if (
$type == 
"mob") {           
 
  880                    if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), 
$id)) {
 
  885                        $item->setType(
"mob");
 
  886                        $item->setForeignId(
$id);
 
  889                        if ($item->getId() > 0) {
 
  890                            $this->
object->insertInTree($item->getId(), 
$_GET[
"mepitem_id"]);
 
  894                if (
$type == 
"incl") {          
 
  895                    include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
 
  896                    include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
 
  897                    if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), 
$id)) {
 
  905                        $item->setType(
"pg");
 
  908                        if ($item->getId() > 0) {
 
  909                            $this->
object->insertInTree($item->getId(), 
$_GET[
"mepitem_id"]);
 
  912                            include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
 
  914                            $page->setId($item->getId());
 
  915                            $page->setParentId($this->object->getId());
 
  919                            $original->copy($page->getId(), $page->getParentType(), $page->getParentId(), 
true);
 
  925        if (count($not_inserted) > 0) {
 
  927                implode($not_inserted, 
"<br>"), 
true);
 
  929        $this->ctrl->redirect($this, 
$_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia");
 
  938        $this->ctrl->redirect($this, 
$_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia");
 
  944    public function remove()
 
  951            $this->
object->deleteChild($obj_id);
 
  955        $this->ctrl->redirect($this, 
$_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia");
 
  969        if (!isset(
$_POST[
"id"])) {
 
  971            $this->ctrl->redirect($this, 
$_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia");
 
  976            if (
$type == 
"fold") {
 
  978                $this->ctrl->redirect($this, 
$_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia");
 
  984            if (
$type == 
"mob") {
 
  985                $ilUser->addObjectToClipboard($fid, 
"mob", 
"");
 
  992        $this->ctrl->redirect($this, 
$_GET[
"mep_mode"] ? 
$_GET[
"mep_mode"] : 
"listMedia");
 
 1003        if (!$this->
getCreationMode() && $this->ctrl->getCmd() != 
"explorer") {
 
 1004            $tree = $this->
object->getTree();
 
 1006                ? 
$tree->getRootId()
 
 1007                : 
$_GET[
"mepitem_id"];
 
 1009            foreach (
$path as $node) {
 
 1010                if ($node[
"child"] == 
$tree->getRootId()) {
 
 1011                    $this->ctrl->setParameter($this, 
"mepitem_id", 
"");
 
 1012                    if ($ilAccess->checkAccess(
"read", 
"", $this->object->getRefId())) {
 
 1013                        $link = $this->ctrl->getLinkTarget($this, 
"listMedia");
 
 1014                    } elseif ($ilAccess->checkAccess(
"visible", 
"", $this->object->getRefId())) {
 
 1015                        $link = $this->ctrl->getLinkTarget($this, 
"infoScreen");
 
 1017                    $title = $this->
object->getTitle();
 
 1018                    $this->ctrl->setParameter($this, 
"mepitem_id", 
$_GET[
"mepitem_id"]);
 
 1019                    $ilLocator->addItem(
$title, $link, 
"", 
$_GET[
"ref_id"]);
 
 1040        $tpl->setContent($this->form->getHTML());
 
 1057        $tpl->setContent($this->form->getHTML());
 
 1069        $this->form->setValuesByArray($values);
 
 1084        if ($this->form->checkInput()) {
 
 1085            if ($this->object->createFolder(
$_POST[
"title"], (
int) 
$_GET[
"mepitem_id"])) {
 
 1088            $ilCtrl->redirect($this, 
"listMedia");
 
 1091        $this->form->setValuesByPost();
 
 1092        $tpl->setContent($this->form->getHtml());
 
 1107        if ($this->form->checkInput()) {
 
 1109            $item->setTitle(
$_POST[
"title"]);
 
 1115                $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"])
 
 1117            $ilCtrl->redirect($this, 
"listMedia");
 
 1120        $this->form->setValuesByPost();
 
 1121        $tpl->setContent($this->form->getHtml());
 
 1134        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1139        $ti->setMaxLength(128);
 
 1140        $ti->setRequired(
true);
 
 1141        $this->form->addItem($ti);
 
 1144        if ($a_mode == 
"create") {
 
 1145            $this->form->addCommandButton(
"saveFolder", 
$lng->txt(
"save"));
 
 1146            $this->form->addCommandButton(
"cancelSave", 
$lng->txt(
"cancel"));
 
 1147            $this->form->setTitle(
$lng->txt(
"mep_new_folder"));
 
 1149            $this->form->addCommandButton(
"updateFolder", 
$lng->txt(
"save"));
 
 1150            $this->form->addCommandButton(
"cancelFolderUpdate", 
$lng->txt(
"cancel"));
 
 1151            $this->form->setTitle(
$lng->txt(
"mep_edit_folder"));
 
 1154        $this->form->setFormAction(
$ilCtrl->getFormAction($this));
 
 1166            $this->object->getTree()->getParentId(
$_GET[
"mepitem_id"])
 
 1168        $ilCtrl->redirect($this, 
"listMedia");
 
 1177        $ilCtrl->redirect($this, 
"listMedia");
 
 1194        $tpl->setContent($this->form->getHTML());
 
 1210        $ilTabs->clearTargets();
 
 1212        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
 
 1214        $mep_page_gui->getTabs();
 
 1220        $tpl->setContent($this->form->getHTML());
 
 1235        if ($this->form->checkInput()) {
 
 1237            include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
 
 1239            $item->setTitle(
$_POST[
"title"]);
 
 1240            $item->setType(
"pg");
 
 1243            if ($item->getId() > 0) {
 
 1245                $tree = $this->
object->getTree();
 
 1246                $parent = 
$_GET[
"mepitem_id"] > 0
 
 1247                    ? 
$_GET[
"mepitem_id"]
 
 1248                    : 
$tree->getRootId();
 
 1249                $this->
object->insertInTree($item->getId(), $parent);
 
 1252                include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
 
 1254                $page->setId($item->getId());
 
 1255                $page->setParentId($this->object->getId());
 
 1258                $ilCtrl->setParameterByClass(
"ilmediapoolpagegui", 
"mepitem_id", $item->getId());
 
 1259                $ilCtrl->redirectByClass(
"ilmediapoolpagegui", 
"edit");
 
 1261            $ilCtrl->redirect($this, 
"listMedia");
 
 1264        $this->form->setValuesByPost();
 
 1265        $tpl->setContent($this->form->getHtml());
 
 1280        if ($this->form->checkInput()) {
 
 1282            $item->setTitle(
$_POST[
"title"]);
 
 1285            $ilCtrl->redirect($this, 
"editMediaPoolPage");
 
 1288        $this->form->setValuesByPost();
 
 1289        $tpl->setContent($this->form->getHtml());
 
 1301        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1306        $ti->setMaxLength(128);
 
 1307        $ti->setRequired(
true);
 
 1308        $this->form->addItem($ti);
 
 1311        if ($a_mode == 
"create") {
 
 1312            $this->form->addCommandButton(
"saveMediaPoolPage", 
$lng->txt(
"save"));
 
 1313            $this->form->addCommandButton(
"cancelSave", 
$lng->txt(
"cancel"));
 
 1314            $this->form->setTitle(
$lng->txt(
"mep_new_content_snippet"));
 
 1316            $this->form->addCommandButton(
"updateMediaPoolPage", 
$lng->txt(
"save"));
 
 1317            $this->form->setTitle(
$lng->txt(
"mep_edit_content_snippet"));
 
 1320        $this->form->setFormAction(
$ilCtrl->getFormAction($this));
 
 1330        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
 
 1333        $this->form->setValuesByArray($values);
 
 1353            $ilCtrl->getLinkTarget($this, 
"showMediaPoolPageUsages"),
 
 1354            array(
"showMediaPoolPageUsages", 
"showAllMediaPoolPageUsages"),
 
 1359            $ilCtrl->getLinkTarget($this, 
"editMediaPoolPage"),
 
 1360            "editMediaPoolPage",
 
 1363        $ilCtrl->setParameter($this, 
"mepitem_id", $this->object->getPoolTree()->getParentId(
$_GET[
"mepitem_id"]));
 
 1364        $ilTabs->setBackTarget(
$lng->txt(
"mep_folder"), 
$ilCtrl->getLinkTarget($this, 
"listMedia"));
 
 1365        $ilCtrl->setParameter($this, 
"mepitem_id", 
$_GET[
"mepitem_id"]);
 
 1389        $ilTabs->clearTargets();
 
 1393            $lng->txt(
"cont_current_usages"),
 
 1394            $ilCtrl->getLinkTarget($this, 
"showMediaPoolPageUsages")
 
 1399            $lng->txt(
"cont_all_usages"),
 
 1400            $ilCtrl->getLinkTarget($this, 
"showAllMediaPoolPageUsages")
 
 1404            $ilTabs->activateSubTab(
"all_usages");
 
 1405            $cmd = 
"showAllMediaPoolPageUsages";
 
 1407            $ilTabs->activateSubTab(
"current_usages");
 
 1408            $cmd = 
"showMediaPoolPageUsages";
 
 1412        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
 
 1414        $mep_page_gui->getTabs();
 
 1418        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
 
 1421        include_once(
"./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
 
 1443        $ilTabs->addSubTab(
"content", $this->lng->txt(
"objs_fold"), $this->ctrl->getLinkTarget($this, 
""));
 
 1445        $ilCtrl->setParameter($this, 
"mepitem_id", 
"");
 
 1446        $ilTabs->addSubTab(
"mep_all_mobs", $this->lng->txt(
"mep_all_mobs"), $this->ctrl->getLinkTarget($this, 
"allMedia"));
 
 1447        $ilCtrl->setParameter($this, 
"mepitem_id", 
$_GET[
"mepitem_id"]);
 
 1449        if ($ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
 1452                $this->lng->txt(
"mep_media_subtitles"),
 
 1453                $ilCtrl->getLinkTargetByClass(
"ilmobmultisrtuploadgui", 
"")
 
 1457        $ilTabs->activateSubTab($a_active);
 
 1471        $ilHelp->setScreenIdComponent(
"mep");
 
 1473        if ($ilAccess->checkAccess(
'read', 
'', $this->ref_id) ||
 
 1474            $ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
 1475            $ilTabs->addTab(
"content", $this->lng->txt(
"mep_content"), $this->ctrl->getLinkTarget($this, 
""));
 
 1486        if ($ilAccess->checkAccess(
'visible', 
'', $this->ref_id) ||
 
 1487            $ilAccess->checkAccess(
'read', 
'', $this->ref_id) ||
 
 1488            $ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
 1489            $force_active = ($this->ctrl->getNextClass() == 
"ilinfoscreengui" 
 1490                || strtolower(
$_GET[
"cmdClass"]) == 
"ilnotegui")
 
 1496                $this->ctrl->getLinkTargetByClass(
 
 1497                    array(
"ilobjmediapoolgui", 
"ilinfoscreengui"),
 
 1500                array(
"showSummary", 
"infoScreen"),
 
 1507        if ($ilAccess->checkAccess(
"write", 
"", $this->object->getRefId())) {
 
 1510                $this->ctrl->getLinkTarget($this, 
"edit"),
 
 1512                array(
"", 
"ilobjmediapoolgui")
 
 1516        if ($ilAccess->checkAccess(
"write", 
"", $this->object->getRefId())) {
 
 1519                $this->ctrl->getLinkTarget($this, 
"openClipboard"),
 
 1521                "ileditclipboardgui" 
 1525        if ($ilAccess->checkAccess(
"write", 
"", $this->object->getRefId())) {
 
 1528                $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
""),
 
 1535                $this->ctrl->getLinkTargetByClass(
"ilmediapoolimportgui", 
""),
 
 1537                "ilmediapoolimportgui" 
 1541        if ($ilAccess->checkAccess(
"edit_permission", 
"", $this->object->getRefId())) {
 
 1544                $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"),
 
 1545                array(
"perm",
"info",
"owner"),
 
 1563        if ($ilAccess->checkAccess(
"write", 
"", $this->object->getRefId())) {
 
 1566                $lng->txt(
"settings"),
 
 1567                $this->ctrl->getLinkTarget($this, 
"edit")
 
 1571            if ($mset->get(
"mep_activate_pages")) {
 
 1572                $ilTabs->addSubTabTarget(
 
 1573                    "obj_multilinguality",
 
 1574                    $this->ctrl->getLinkTargetByClass(
"ilobjecttranslationgui", 
"")
 
 1579        $ilTabs->setSubTabActive($a_active);
 
 1590        $ilAccess = 
$DIC->access();
 
 1594        $targets = explode(
'_', $a_target);
 
 1595        if (count((array) $targets) > 1) {
 
 1597            $subitem_id = $targets[1];
 
 1602        if ($ilAccess->checkAccess(
"read", 
"", 
$ref_id)) {
 
 1603            $_GET[
"baseClass"] = 
"ilMediaPoolPresentationGUI";
 
 1605            $_GET[
'mepitem_id'] = $subitem_id;
 
 1606            include(
"ilias.php");
 
 1608        } elseif ($ilAccess->checkAccess(
"visible", 
"", 
$ref_id)) {
 
 1609            $_GET[
"baseClass"] = 
"ilMediaPoolPresentationGUI";
 
 1611            $_GET[
"cmd"] = 
"infoScreen";
 
 1612            include(
"ilias.php");
 
 1614        } elseif ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID)) {
 
 1616                $lng->txt(
"msg_no_perm_read_item"),
 
 1632        $this->ctrl->setCmd(
"showSummary");
 
 1633        $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
 1645        if (!$ilAccess->checkAccess(
"visible", 
"", $this->ref_id) &&
 
 1646            !$ilAccess->checkAccess(
"read", 
"", $this->ref_id) &&
 
 1647            !$ilAccess->checkAccess(
"write", 
"", $this->ref_id)) {
 
 1648            $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"), 
$ilErr->MESSAGE);
 
 1651        if ($this->ctrl->getCmd() == 
"infoScreen") {
 
 1652            $this->ctrl->setCmd(
"showSummary");
 
 1653            $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
 1656        include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
 1659        $info->enablePrivateNotes();
 
 1663        $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
 
 1666        $this->ctrl->forwardCommand(
$info);
 
 1686            $a_files = 
$_POST[
"file"];
 
 1689        $ilTabs->clearTargets();
 
 1690        $ilTabs->setBackTarget(
 
 1692            $ilCtrl->getLinkTarget($this, 
"listMedia")
 
 1700            include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 1702                "rename" => 
$lng->txt(
"mep_up_dir_move"),
 
 1703                "copy" => 
$lng->txt(
"mep_up_dir_copy"),
 
 1707            $ilToolbar->addInputItem(
$si);
 
 1708            $ilToolbar->setCloseFormTag(
false);
 
 1709            $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
 1710            $ilToolbar->setFormName(
"mep_up_form");
 
 1712            include_once(
"./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
 
 1715                "selectUploadDirFiles",
 
 1718            $tab->setFormName(
"mep_up_form");
 
 1731        $upload_dir = trim($mset->get(
"upload_dir"));
 
 1733        include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
 1736            foreach (
$_POST[
"file"] as $f) {
 
 1737                $f  = str_replace(
"..", 
"", $f);
 
 1738                $fullpath = $upload_dir . 
"/" . $f;
 
 1740                $mob->setTitle(basename($fullpath));
 
 1741                $mob->setDescription(
"");
 
 1746                $mob->createDirectory();
 
 1750                $mob->addMediaItem($media_item);
 
 1751                $media_item->setPurpose(
"Standard");
 
 1753                $file = $mob_dir . 
"/" . basename($fullpath);
 
 1759                    ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
 
 1760                        $_GET[
"ref_id"] . 
"&mepitem_id=" . 
$_GET[
"mepitem_id"]);
 
 1763                switch (
$_POST[
"action"]) {
 
 1765                        rename($fullpath, 
$file);
 
 1769                        copy($fullpath, 
$file);
 
 1778                $media_item->setFormat(
$format);
 
 1780                $media_item->setLocationType(
"LocalFile");
 
 1782                $mob->setDescription(
$format);
 
 1789                    $media_item->getLocation(),
 
 1795                $media_item->setWidth($wh[
"width"]);
 
 1796                $media_item->setHeight($wh[
"height"]);
 
 1797                if ($wh[
"info"] != 
"") {
 
 1801                $media_item->setHAlign(
"Left");
 
 1808                $mep_item->setTitle($mob->getTitle());
 
 1809                $mep_item->setType(
"mob");
 
 1810                $mep_item->setForeignId($mob->getId());
 
 1811                $mep_item->create();
 
 1813                $tree = $this->
object->getTree();
 
 1814                $parent = (
$_GET[
"mepitem_id"] == 
"")
 
 1815                    ? 
$tree->getRootId()
 
 1816                    : 
$_GET[
"mepitem_id"];
 
 1817                $tree->insertNode($mep_item->getId(), $parent);
 
 1820        ilUtil::redirect(
"ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
 
 1821            $_GET[
"ref_id"] . 
"&mepitem_id=" . 
$_GET[
"mepitem_id"]);
 
 1835        require_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
 
 1838        $tpl->addJavaScript(
"./Modules/MediaPool/js/ilMediaPool.js");
 
 1840        $ilCtrl->setParameterByClass(
"ilobjmediapoolgui", 
"mepitem_id", 
"");
 
 1841        $ilCtrl->setParameterByClass(
"ilobjmediapoolgui", 
"ref_id", $a_mpool_ref_id);
 
 1842        $tpl->addOnloadCode(
"il.MediaPool.setPreviewUrl('" . 
$ilCtrl->getLinkTargetByClass(array(
"ilmediapoolpresentationgui", 
"ilobjmediapoolgui"), 
"showPreview", 
"", 
false, 
false) . 
"');");
 
 1843        $ilCtrl->setParameterByClass(
"ilobjmediapoolgui", 
"mepitem_id", 
$_GET[
"mepitem_id"]);
 
 1844        $ilCtrl->setParameterByClass(
"ilobjmediapoolgui", 
"ref_id", 
$_GET[
"red_id"]);
 
 1846        include_once(
"./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
 
 1848        $modal->setHeading(
$lng->txt(
"preview"));
 
 1849        $modal->setId(
"ilMepPreview");
 
 1851        $modal->setBody(
"<iframe id='ilMepPreviewContent'></iframe>");
 
 1853        return $modal->getHTML();
 
 1863        if ($ot->getContentActivated()) {
 
 1868        $this->
object->exportXML($opt);
 
sprintf('%.4f', $callTime)
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
Class ilEditClipboardGUI.
Export User Interface Class.
File System Explorer GUI class.
static _checkAdministrationPermission()
Class ilMediaPoolPage GUI class.
TableGUI class for media pool page usages listing.
static lookupTitle($a_page_id)
Lookup title.
Handler class for multi srt upload in learning modules.
Upload SRT files to a set of media objects.
static getInstance()
Get instance.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
New implementation of ilObjectGUI.
prepareOutput($a_show_subobjects=true)
prepare output
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class!...
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getCreationMode()
get creation mode
initImportForm($a_new_type)
Init object import form.
initCreateForm($a_new_type)
Init object creation form.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
addHeaderAction()
Add header action menu.
GUI class for object translation handling.
static getInstance($a_obj_id)
Get instance.
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getRefId()
get reference id @access public
static getUsages($a_pc_type, $a_pc_id, $a_incl_hist=true)
Get usages.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Saves (mostly asynchronously) user properties of tables (e.g.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
static getWebspaceDir($mode="filesystem")
get webspace directory
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
if(!array_key_exists('StateId', $_REQUEST)) $id
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output
if(empty($password)) $table
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file