ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCloudPluginSettingsGUI Class Reference

Class ilCloudPluginSettingsGUI. More...

+ Inheritance diagram for ilCloudPluginSettingsGUI:
+ Collaboration diagram for ilCloudPluginSettingsGUI:

Public Member Functions

 setCloudObject (ilObjCloud $object)
 editSettings ()
 Edit Settings.
 initSettingsForm ()
 getSettingsValues ()
 Get values for edit Settings form.
 updateSettings ()
 Update Settings.
- Public Member Functions inherited from ilCloudPluginGUI
 __construct ($plugin_service_class)
 getPluginObject ()
 getPluginHookObject ()
 getAdminConfigObject ()
 getService ()
 txt ($var="")
 executeCommand ()

Protected Member Functions

 createPluginSection ()
 initPluginSettings ()
 getMakeOwnPluginSection ()
 getPluginSettingsValues (&$values)
 updatePluginSettings ()

Protected Attributes

 $cloud_object
 $form
- Protected Attributes inherited from ilCloudPluginGUI
 $service = null

Detailed Description

Class ilCloudPluginSettingsGUI.

Base class for the settings. Needs to be overwritten if the plugin needs custom settings.

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 18 of file class.ilCloudPluginSettingsGUI.php.

Member Function Documentation

ilCloudPluginSettingsGUI::createPluginSection ( )
protected

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

References $lng, $section, and getMakeOwnPluginSection().

Referenced by initSettingsForm().

{
if(get_class($this) != "ilCloudPluginSettingsGUI" && $this->getMakeOwnPluginSection())
{
global $lng;
$section->setTitle($this->cloud_object->getServiceName()." ".$lng->txt("cld_service_specific_settings"));
$this->form->addItem($section);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCloudPluginSettingsGUI::editSettings ( )

Edit Settings.

This commands uses the form class to display an input form.

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

References $lng, $tpl, getSettingsValues(), initSettingsForm(), and ilUtil\sendFailure().

{
global $tpl, $ilTabs, $lng;
$ilTabs->activateTab("settings");
try
{
$this->initSettingsForm();
$tpl->setContent($this->form->getHTML());
} catch (Exception $e)
{
ilUtil::sendFailure($e->getMessage());
}
}

+ Here is the call graph for this function:

ilCloudPluginSettingsGUI::getMakeOwnPluginSection ( )
protected

Definition at line 107 of file class.ilCloudPluginSettingsGUI.php.

Referenced by createPluginSection().

{
return true;
}

+ Here is the caller graph for this function:

ilCloudPluginSettingsGUI::getPluginSettingsValues ( $values)
protected

Definition at line 126 of file class.ilCloudPluginSettingsGUI.php.

Referenced by getSettingsValues().

{}

+ Here is the caller graph for this function:

ilCloudPluginSettingsGUI::getSettingsValues ( )

Get values for edit Settings form.

Definition at line 115 of file class.ilCloudPluginSettingsGUI.php.

References getPluginSettingsValues().

Referenced by editSettings().

{
$values["title"] = $this->cloud_object->getTitle();
$values["desc"] = $this->cloud_object->getDescription();
$values["online"] = $this->cloud_object->getOnline();
$values["root_folder"] = $this->cloud_object->getRootFolder();
$this->getPluginSettingsValues($values);
$this->form->setValuesByArray($values);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCloudPluginSettingsGUI::initPluginSettings ( )
protected

Definition at line 105 of file class.ilCloudPluginSettingsGUI.php.

Referenced by initSettingsForm().

{}

+ Here is the caller graph for this function:

ilCloudPluginSettingsGUI::initSettingsForm ( )

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

References $ilCtrl, $lng, createPluginSection(), initPluginSettings(), ilFormPropertyGUI\setDisabled(), and ilFormPropertyGUI\setRequired().

Referenced by editSettings(), and updateSettings().

{
global $ilCtrl, $lng;
$this->form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($lng->txt("title"), "title");
$ti->setRequired(true);
$this->form->addItem($ti);
// description
$ta = new ilTextAreaInputGUI($lng->txt("description"), "desc");
$this->form->addItem($ta);
// online
$cb = new ilCheckboxInputGUI($lng->txt("online"), "online");
$this->form->addItem($cb);
$folder = new ilTextInputGUI($lng->txt("cld_root_folder"), "root_folder");
if(!$this->cloud_object->currentUserIsOwner())
{
$folder->setDisabled(true);
$folder->setInfo($lng->txt("cld_only_owner_has_permission_to_change_root_path"));
}
$folder->setMaxLength(255);
$folder->setSize(50);
$this->form->addItem($folder);
$this->form->addCommandButton("updateSettings", $lng->txt("save"));
$this->form->setTitle($lng->txt("cld_edit_Settings"));
$this->form->setFormAction($ilCtrl->getFormActionByClass("ilCloudPluginSettingsGUI"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCloudPluginSettingsGUI::setCloudObject ( ilObjCloud  $object)

Definition at line 31 of file class.ilCloudPluginSettingsGUI.php.

{
$this->cloud_object = $object;
}
ilCloudPluginSettingsGUI::updatePluginSettings ( )
protected

Definition at line 163 of file class.ilCloudPluginSettingsGUI.php.

Referenced by updateSettings().

{}

+ Here is the caller graph for this function:

ilCloudPluginSettingsGUI::updateSettings ( )

Update Settings.

Definition at line 130 of file class.ilCloudPluginSettingsGUI.php.

References $ilCtrl, $lng, $tpl, ilCloudPluginGUI\getService(), initSettingsForm(), ilCloudUtil\normalizePath(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and updatePluginSettings().

{
global $tpl, $lng, $ilCtrl, $ilTabs;
$ilTabs->activateTab("settings");
try
{
$this->initSettingsForm();
if ($this->form->checkInput())
{
$this->cloud_object->setTitle($this->form->getInput("title"));
$this->cloud_object->setDescription($this->form->getInput("desc"));
if (ilCloudUtil::normalizePath($this->form->getInput("root_folder")) != $this->cloud_object->getRootFolder())
{
$this->cloud_object->setRootFolder($this->form->getInput("root_folder"));
$this->cloud_object->setRootId($this->getService()->getRootId($this->cloud_object->getRootFolder()));
}
$this->cloud_object->setOnline($this->form->getInput("online"));
$this->cloud_object->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, 'editSettings');
}
} catch (Exception $e)
{
ilUtil::sendFailure($e->getMessage());
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

Field Documentation

ilCloudPluginSettingsGUI::$cloud_object
protected

Definition at line 23 of file class.ilCloudPluginSettingsGUI.php.

ilCloudPluginSettingsGUI::$form
protected

Definition at line 28 of file class.ilCloudPluginSettingsGUI.php.


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