ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCloudPluginInitGUI Class Reference

Class ilCloudPluginInitGUI. More...

+ Inheritance diagram for ilCloudPluginInitGUI:
+ Collaboration diagram for ilCloudPluginInitGUI:

Public Member Functions

 setGuiClass ($gui_class)
 
 getGuiClass ()
 
 setPermCreateFolders ($perm_create_folders)
 
 getPermCreateFolders ()
 
 setPermDeleteFiles ($perm_delete_files)
 
 getPermDeleteFiles ()
 
 setPermDeleteFolders ($perm_delete_folders)
 
 getPermDeleteFolders ()
 
 setPermDownload ($perm_download)
 
 getPermDownload ()
 
 setPermFilesVisible ($perm_files_visible)
 
 getPermFilesVisible ()
 
 setPermFoldersVisible ($perm_folders_visible)
 
 getPermFoldersVisible ()
 
 setPermUploadItems ($perm_upload_items)
 
 getPermUploadItems ()
 
 setTplFileTree ($tpl_file_tree)
 
 getTplFileTree ()
 
 initGUI (ilObjCloudGUI $gui_class, $perm_create_folder, $perm_upload_items, $perm_delete_files, $perm_delete_folders, $perm_download, $perm_files_visible, $perm_folders_visible)
 
 addToolbar ($root_node)
 
 beforeInitGUI ()
 
 beforeSetContent ()
 
 afterInitGUI ()
 
- Public Member Functions inherited from ilCloudPluginGUI
 __construct ($plugin_service_class)
 
 getPluginObject ()
 
 getPluginHookObject ()
 
 getAdminConfigObject ()
 
 getService ()
 
 txt ($var="")
 
 executeCommand ()
 

Protected Attributes

 $gui_class = null
 
 $perm_upload_items = false
 
 $perm_create_folders = false
 
 $perm_delete_files = false
 
 $perm_delete_folders = false
 
 $perm_download = false
 
 $perm_files_visible = false
 
 $perm_folders_visible = false
 
 $tpl_file_tree = null
 
- Protected Attributes inherited from ilCloudPluginGUI
 $service = null
 

Detailed Description

Class ilCloudPluginInitGUI.

GUI Class for initialization of the object. Can be extended if needed.

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id$

Definition at line 16 of file class.ilCloudPluginInitGUI.php.

Member Function Documentation

◆ addToolbar()

ilCloudPluginInitGUI::addToolbar (   $root_node)
Parameters
$root_node

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

References $DIC, $ilLog, $lng, getGuiClass(), ilCloudConnector\getItemCreationListGUIClass(), ilCloudPluginFileTreeGUI\getLinkToFolder(), getPermCreateFolders(), getPermUploadItems(), ilCloudPluginGUI\getService(), object, and ilAdvancedSelectionListGUI\STYLE_EMPH.

Referenced by initGUI().

333  {
334  global $DIC;
335  $lng = $DIC['lng'];
336  $ilToolbar = $DIC['ilToolbar'];
337  $ilLog = $DIC['ilLog'];
338 
339  $create_list_gui = ilCloudConnector::getItemCreationListGUIClass($this->getService());
340 
341  $list_gui_html = $create_list_gui->getGroupedListItemsHTML($this->getPermUploadItems(), $this->getPermCreateFolders());
342  if ($list_gui_html) {
343  //toolbar
344  $toolbar_locator = new ilLocatorGUI();
345  $toolbar_locator->addItem($this->getGuiClass()->object->getTitle(), ilCloudPluginFileTreeGUI::getLinkToFolder($root_node));
346  $ilToolbar->setId('xcld_toolbar');
347  $ilToolbar->addText("<div class='xcld_locator'>" . $toolbar_locator->getHtml() . "</div>");
348  $ilToolbar->addSeparator();
349 
350  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
351  $adv = new ilAdvancedSelectionListGUI();
352  $adv->setListTitle($lng->txt("cld_add_new_item"));
353 
354  $ilCloudGroupedListGUI = $create_list_gui->getGroupedListItems($this->getPermUploadItems(), $this->getPermCreateFolders());
355 
356  if ($ilCloudGroupedListGUI->hasItems()) {
357  $adv->setGroupedList($ilCloudGroupedListGUI);
358  }
359 
361  $ilToolbar->addText($adv->getHTML());
362  }
363  }
global $DIC
Definition: saml.php:7
locator handling class
static getLinkToFolder(ilCloudFileNode $node)
User interface class for advanced drop-down selection lists.
Create new PHPExcel object
obj_idprivate
global $lng
Definition: privfeed.php:17
static getItemCreationListGUIClass(ilCloudPluginService $plugin_service_class)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterInitGUI()

ilCloudPluginInitGUI::afterInitGUI ( )

Definition at line 376 of file class.ilCloudPluginInitGUI.php.

Referenced by initGUI().

377  {
378  }
+ Here is the caller graph for this function:

◆ beforeInitGUI()

ilCloudPluginInitGUI::beforeInitGUI ( )

Definition at line 366 of file class.ilCloudPluginInitGUI.php.

Referenced by initGUI().

367  {
368  }
+ Here is the caller graph for this function:

◆ beforeSetContent()

ilCloudPluginInitGUI::beforeSetContent ( )

Definition at line 371 of file class.ilCloudPluginInitGUI.php.

Referenced by initGUI().

372  {
373  }
+ Here is the caller graph for this function:

◆ getGuiClass()

ilCloudPluginInitGUI::getGuiClass ( )
Returns

Definition at line 65 of file class.ilCloudPluginInitGUI.php.

References $gui_class.

Referenced by addToolbar(), and initGUI().

+ Here is the caller graph for this function:

◆ getPermCreateFolders()

ilCloudPluginInitGUI::getPermCreateFolders ( )
Returns
boolean

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

References $perm_create_folders.

Referenced by addToolbar().

+ Here is the caller graph for this function:

◆ getPermDeleteFiles()

ilCloudPluginInitGUI::getPermDeleteFiles ( )
Returns
boolean

Definition at line 101 of file class.ilCloudPluginInitGUI.php.

References $perm_delete_files.

◆ getPermDeleteFolders()

ilCloudPluginInitGUI::getPermDeleteFolders ( )
Returns
boolean

Definition at line 119 of file class.ilCloudPluginInitGUI.php.

References $perm_delete_folders.

◆ getPermDownload()

ilCloudPluginInitGUI::getPermDownload ( )
Returns
boolean

Definition at line 137 of file class.ilCloudPluginInitGUI.php.

References $perm_download.

◆ getPermFilesVisible()

ilCloudPluginInitGUI::getPermFilesVisible ( )
Returns
boolean

Definition at line 155 of file class.ilCloudPluginInitGUI.php.

References $perm_files_visible.

◆ getPermFoldersVisible()

ilCloudPluginInitGUI::getPermFoldersVisible ( )
Returns
boolean

Definition at line 173 of file class.ilCloudPluginInitGUI.php.

References $perm_folders_visible.

◆ getPermUploadItems()

ilCloudPluginInitGUI::getPermUploadItems ( )
Returns
boolean

Definition at line 191 of file class.ilCloudPluginInitGUI.php.

References $perm_upload_items.

Referenced by addToolbar().

+ Here is the caller graph for this function:

◆ getTplFileTree()

ilCloudPluginInitGUI::getTplFileTree ( )
Returns

Definition at line 209 of file class.ilCloudPluginInitGUI.php.

References $tpl_file_tree.

◆ initGUI()

ilCloudPluginInitGUI::initGUI ( ilObjCloudGUI  $gui_class,
  $perm_create_folder,
  $perm_upload_items,
  $perm_delete_files,
  $perm_delete_folders,
  $perm_download,
  $perm_files_visible,
  $perm_folders_visible 
)
Parameters
ilObjCloudGUI$gui_class
$perm_create_folder
$perm_upload_items
$perm_delete_files
$perm_delete_folders
$perm_download
$perm_files_visible
$perm_folders_visible

else { $file_tree = ilCloudFileTree::getFileTreeFromSession(); if($_GET["current_path"] && $_GET["current_id"] && $file_tree && $file_tree->getId() == $this->getGUIClass()->object->getId()) { $path = $_GET["current_path"]; $id = $_GET["current_id"];

} else { $path = $gui_class->object->getRootFolder(); $id = $gui_class->object->getRootId(); ilCloudFileTree::clearFileTreeSession(); $file_tree = new ilCloudFileTree($this->getGUIClass()->object->getRootFolder(), $this->getGUIClass()->object->getRootId(), $this->getGUIClass()->object->getId(), $this->getGUIClass()->object->getServiceName()); }

$file_tree->updateFileTree($path); $file_tree_gui = ilCloudConnector::getFileTreeGUIClass($this->getService(), $file_tree); $this->content = $file_tree_gui->getFolderHtml($this->getGuiClass(), $id, $this->getPermDeleteFiles(), $this->getPermDeleteFolders(), $this->getPermDownload(), $this->getPermFilesVisible(), $this->getPermCreateFolders()); $tpl->setContent($this->content); }

Definition at line 231 of file class.ilCloudPluginInitGUI.php.

References $_POST, $DIC, $lng, $perm_delete_files, $perm_delete_folders, $perm_download, $perm_files_visible, $perm_folders_visible, $perm_upload_items, $tpl, addToolbar(), afterInitGUI(), ilCloudException\AUTHENTICATION_FAILED, beforeInitGUI(), beforeSetContent(), ilCloudConnector\checkServiceActive(), getGuiClass(), ilCloudConnector\getPluginClass(), ilYuiUtil\initConnection(), object, ilUtil\sendFailure(), setGuiClass(), setPermCreateFolders(), setPermDeleteFiles(), setPermDeleteFolders(), setPermDownload(), setPermFilesVisible(), setPermFoldersVisible(), setPermUploadItems(), and ilCloudFileTree\storeFileTreeToSession().

232  {
233  global $DIC;
234  $ilTabs = $DIC['ilTabs'];
235  $lng = $DIC['lng'];
236  $tpl = $DIC['tpl'];
237 
238  $ilTabs->activateTab("content");
239 
240  $this->setGuiClass($gui_class);
242  $this->setPermCreateFolders($perm_create_folder);
248 
249  try {
250  ilCloudConnector::checkServiceActive($this->getGUIClass()->object->getServiceName());
251  $this->beforeInitGUI();
252 
253  //if($this->getPluginObject()->getAsyncDrawing())
254  {
255  $tpl->addJavaScript("./Modules/Cloud/js/ilCloudFileList.js");
256  $tpl->addJavaScript("./Modules/Cloud/js/jquery.address.js");
257  $tpl->addJavascript("./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
258  $tpl->addCss("./Modules/Cloud/templates/css/cloud.css");
259 
260  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
262 
263  $this->tpl_file_tree = new ilTemplate("tpl.cloud_file_tree.html", true, true, "Modules/Cloud");
264 
265  $file_tree = new ilCloudFileTree($this->getGUIClass()->object->getRootFolder(), $this->getGUIClass()->object->getRootId(), $this->getGUIClass()->object->getId(), $this->getGUIClass()->object->getServiceName());
266  $file_tree->storeFileTreeToSession();
267 
268  $this->addToolbar($file_tree->getRootNode());
269 
270  $this->tpl_file_tree->setVariable("ASYNC_GET_BLOCK", json_encode($this->getGUIClass()->getCtrl()->getLinkTargetByClass("ilobjcloudgui", "asyncGetBlock", true)));
271  $this->tpl_file_tree->setVariable("ASYNC_CREATE_FOLDER", json_encode($this->getGUIClass()->getCtrl()->getLinkTargetByClass("ilcloudplugincreatefoldergui", "asyncCreateFolder", true)));
272  $this->tpl_file_tree->setVariable("ASYNC_UPLOAD_FILE", json_encode($this->getGUIClass()->getCtrl()->getLinkTargetByClass("ilcloudpluginuploadgui", "asyncUploadFile", true)));
273  $this->tpl_file_tree->setVariable("ASYNC_DELETE_ITEM", json_encode($this->getGUIClass()->getCtrl()->getLinkTargetByClass("ilcloudplugindeletegui", "asyncDeleteItem", true)));
274  $this->tpl_file_tree->setVariable("ROOT_ID", json_encode($file_tree->getRootNode()->getId()));
275  $this->tpl_file_tree->setVariable("ROOT_PATH", json_encode($file_tree->getRootNode()->getPath()));
276  if (isset($_POST["path"])) {
277  $this->tpl_file_tree->setVariable("CURRENT_PATH", json_encode($_POST["path"]));
278  $file_tree->updateFileTree($_POST["path"]);
279  $node = $file_tree->getNodeFromPath($_POST["path"]);
280  $this->tpl_file_tree->setVariable("CURRENT_ID", json_encode($node->getId()));
281  } else {
282  $this->tpl_file_tree->setVariable("CURRENT_PATH", json_encode($file_tree->getRootNode()->getPath()));
283  $this->tpl_file_tree->setVariable("CURRENT_ID", json_encode($file_tree->getRootNode()->getID()));
284  }
285  $txt_max_file_size = $lng->txt("file_notice") . " "
286  . ilCloudConnector::getPluginClass($this->getGUIClass()->object->getServiceName(), $this->getGUIClass()->object->getId())
287  ->getMaxFileSize() . " MB";
288  $this->tpl_file_tree->setVariable("MAX_FILE_SIZE", json_encode($txt_max_file_size));
289  $this->beforeSetContent();
290  $tpl->setContent($this->tpl_file_tree->get());
291  $tpl->setPermanentLink("cld", $this->getGuiClass()->object->getRefId(), "_path__endPath");
292  }
293 
318  $this->afterInitGUI();
319  } catch (Exception $e) {
320  if ($e->getCode() == ilCloudException::AUTHENTICATION_FAILED) {
321  $this->getGUIClass()->object->setAuthComplete(false);
322  $this->getGUIClass()->object->doUpdate();
323  }
324  ilUtil::sendFailure($e->getMessage());
325  }
326  }
setPermDeleteFolders($perm_delete_folders)
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static initConnection(ilTemplate $a_main_tpl=null)
Init YUI Connection module.
setPermDeleteFiles($perm_delete_files)
ilCloudFileTree class
setPermFilesVisible($perm_files_visible)
setPermCreateFolders($perm_create_folders)
special template class to simplify handling of ITX/PEAR
static getPluginClass($service_name, $obj_id)
static checkServiceActive($name)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Create new PHPExcel object
obj_idprivate
global $lng
Definition: privfeed.php:17
$_POST["username"]
setPermFoldersVisible($perm_folders_visible)
setPermUploadItems($perm_upload_items)
+ Here is the call graph for this function:

◆ setGuiClass()

ilCloudPluginInitGUI::setGuiClass (   $gui_class)
Parameters
\ilObjCloudGUI$gui_class

Definition at line 56 of file class.ilCloudPluginInitGUI.php.

References $gui_class.

Referenced by initGUI().

57  {
58  $this->gui_class = $gui_class;
59  }
+ Here is the caller graph for this function:

◆ setPermCreateFolders()

ilCloudPluginInitGUI::setPermCreateFolders (   $perm_create_folders)
Parameters
boolean$perm_create_folders

Definition at line 74 of file class.ilCloudPluginInitGUI.php.

References $perm_create_folders.

Referenced by initGUI().

75  {
76  $this->perm_create_folders = $perm_create_folders;
77  }
+ Here is the caller graph for this function:

◆ setPermDeleteFiles()

ilCloudPluginInitGUI::setPermDeleteFiles (   $perm_delete_files)
Parameters
boolean$perm_delete_files

Definition at line 92 of file class.ilCloudPluginInitGUI.php.

References $perm_delete_files.

Referenced by initGUI().

93  {
94  $this->perm_delete_files = $perm_delete_files;
95  }
+ Here is the caller graph for this function:

◆ setPermDeleteFolders()

ilCloudPluginInitGUI::setPermDeleteFolders (   $perm_delete_folders)
Parameters
boolean$perm_delete_folders

Definition at line 110 of file class.ilCloudPluginInitGUI.php.

References $perm_delete_folders.

Referenced by initGUI().

111  {
112  $this->perm_delete_folders = $perm_delete_folders;
113  }
+ Here is the caller graph for this function:

◆ setPermDownload()

ilCloudPluginInitGUI::setPermDownload (   $perm_download)
Parameters
boolean$perm_download

Definition at line 128 of file class.ilCloudPluginInitGUI.php.

References $perm_download.

Referenced by initGUI().

129  {
130  $this->perm_download = $perm_download;
131  }
+ Here is the caller graph for this function:

◆ setPermFilesVisible()

ilCloudPluginInitGUI::setPermFilesVisible (   $perm_files_visible)
Parameters
boolean$perm_files_visible

Definition at line 146 of file class.ilCloudPluginInitGUI.php.

References $perm_files_visible.

Referenced by initGUI().

147  {
148  $this->perm_files_visible = $perm_files_visible;
149  }
+ Here is the caller graph for this function:

◆ setPermFoldersVisible()

ilCloudPluginInitGUI::setPermFoldersVisible (   $perm_folders_visible)
Parameters
boolean$perm_folders_visible

Definition at line 164 of file class.ilCloudPluginInitGUI.php.

References $perm_folders_visible.

Referenced by initGUI().

165  {
166  $this->perm_folders_visible = $perm_folders_visible;
167  }
+ Here is the caller graph for this function:

◆ setPermUploadItems()

ilCloudPluginInitGUI::setPermUploadItems (   $perm_upload_items)
Parameters
boolean$perm_upload_items

Definition at line 182 of file class.ilCloudPluginInitGUI.php.

References $perm_upload_items.

Referenced by initGUI().

183  {
184  $this->perm_upload_items = $perm_upload_items;
185  }
+ Here is the caller graph for this function:

◆ setTplFileTree()

ilCloudPluginInitGUI::setTplFileTree (   $tpl_file_tree)
Parameters
\ilTemplate$tpl_file_tree

Definition at line 200 of file class.ilCloudPluginInitGUI.php.

References $tpl_file_tree.

201  {
202  $this->tpl_file_tree = $tpl_file_tree;
203  }

Field Documentation

◆ $gui_class

ilCloudPluginInitGUI::$gui_class = null
protected

Definition at line 22 of file class.ilCloudPluginInitGUI.php.

Referenced by getGuiClass(), and setGuiClass().

◆ $perm_create_folders

ilCloudPluginInitGUI::$perm_create_folders = false
protected

Definition at line 30 of file class.ilCloudPluginInitGUI.php.

Referenced by getPermCreateFolders(), and setPermCreateFolders().

◆ $perm_delete_files

ilCloudPluginInitGUI::$perm_delete_files = false
protected

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

Referenced by getPermDeleteFiles(), initGUI(), and setPermDeleteFiles().

◆ $perm_delete_folders

ilCloudPluginInitGUI::$perm_delete_folders = false
protected

◆ $perm_download

ilCloudPluginInitGUI::$perm_download = false
protected

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

Referenced by getPermDownload(), initGUI(), and setPermDownload().

◆ $perm_files_visible

ilCloudPluginInitGUI::$perm_files_visible = false
protected

◆ $perm_folders_visible

ilCloudPluginInitGUI::$perm_folders_visible = false
protected

◆ $perm_upload_items

ilCloudPluginInitGUI::$perm_upload_items = false
protected

Definition at line 26 of file class.ilCloudPluginInitGUI.php.

Referenced by getPermUploadItems(), initGUI(), and setPermUploadItems().

◆ $tpl_file_tree

ilCloudPluginInitGUI::$tpl_file_tree = null
protected

Definition at line 218 of file class.ilCloudPluginInitGUI.php.

Referenced by getTplFileTree(), and setTplFileTree().


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