ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjComponentSettingsGUI Class Reference

Components (Modules, Services, Plugins) Settings. More...

+ Inheritance diagram for ilObjComponentSettingsGUI:
+ Collaboration diagram for ilObjComponentSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor.
 executeCommand ()
 Execute command.
 getAdminTabs ()
 Get tabs.
 listModules ()
 List Modules.
 listServices ()
 List Services.
 saveOptions ()
 Save Options.
 showPluginSlot ()
 Show information about a plugin slot.
 refreshPluginsInformation ()
 Refresh plugins information.
 activatePlugin ()
 Activate a plugin.
 updatePlugin ()
 Update a plugin.
 deactivatePlugin ()
 Deactivate a plugin.
 refreshLanguages ()
 Refresh Languages.
 updatePluginDB ()
 Update plugin DB.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Static Private Attributes

static $ERROR_MESSAGE

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Components (Modules, Services, Plugins) Settings.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilObjComponentSettingsGUI: ilPermissionGUI

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

Constructor & Destructor Documentation

ilObjComponentSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor.

public

Definition at line 24 of file class.ilObjComponentSettingsGUI.php.

References ilObjectGUI\ilObjectGUI().

{
$this->type = 'cmps';
parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
$this->lng->loadLanguageModule('cmps');
}

+ Here is the call graph for this function:

Member Function Documentation

ilObjComponentSettingsGUI::activatePlugin ( )

Activate a plugin.

Definition at line 287 of file class.ilObjComponentSettingsGUI.php.

References $_GET, $ilCtrl, ilObjectGUI\$lng, $result, ilPlugin\getPluginObject(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
include_once("./Services/Component/classes/class.ilPlugin.php");
$pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
$_GET["slot_id"], $_GET["pname"]);
try
{
$result = $pl->activate();
if ($result !== true)
{
}
else
{
ilUtil::sendSuccess($lng->txt("cmps_plugin_activated"), true);
}
}
{
ilUtil::sendFailure($e->getMessage, true);
}
$ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
$ilCtrl->setParameter($this, "cname", $_GET["cname"]);
$ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
$ilCtrl->redirect($this, "showPluginSlot");
}

+ Here is the call graph for this function:

ilObjComponentSettingsGUI::deactivatePlugin ( )

Deactivate a plugin.

Definition at line 354 of file class.ilObjComponentSettingsGUI.php.

References $_GET, $ilCtrl, ilObjectGUI\$lng, $result, ilPlugin\getPluginObject(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
include_once("./Services/Component/classes/class.ilPlugin.php");
$pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
$_GET["slot_id"], $_GET["pname"]);
$result = $pl->deactivate();
if ($result !== true)
{
}
else
{
ilUtil::sendSuccess($lng->txt("cmps_plugin_deactivated"), true);
}
$ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
$ilCtrl->setParameter($this, "cname", $_GET["cname"]);
$ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
$ilCtrl->redirect($this, "showPluginSlot");
}

+ Here is the call graph for this function:

ilObjComponentSettingsGUI::executeCommand ( )

Execute command.

public

Reimplemented from ilObjectGUI.

Definition at line 38 of file class.ilObjComponentSettingsGUI.php.

References $cmd, $ilErr, $ret, and ilObjectGUI\prepareOutput().

{
global $rbacsystem,$ilErr,$ilAccess;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
{
$ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
}
switch($next_class)
{
case 'ilpermissiongui':
$this->tabs_gui->setTabActive('perm_settings');
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if(!$cmd || $cmd == 'view')
{
$cmd = "listModules";
}
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjComponentSettingsGUI::getAdminTabs ( )

Get tabs.

public

Definition at line 79 of file class.ilObjComponentSettingsGUI.php.

References $_GET.

{
global $rbacsystem, $ilAccess;
if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$this->tabs_gui->addTarget("cmps_modules",
$this->ctrl->getLinkTarget($this, "listModules"),
array("listModules", "view", "showPluginSlot"));
$this->tabs_gui->addTarget("cmps_services",
$this->ctrl->getLinkTarget($this, "listServices"),
array("listServices"));
}
if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
{
$this->tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"),
array(),'ilpermissiongui');
}
if ($_GET["ctype"] == "Services")
{
$this->tabs_gui->activateTab("cmps_services");
}
}
ilObjComponentSettingsGUI::listModules ( )

List Modules.

Definition at line 109 of file class.ilObjComponentSettingsGUI.php.

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, and ilObjectGUI\$tpl.

{
$this->tabs_gui->setTabActive('cmps_modules');
$tpl = new ilTemplate("tpl.component_list.html", true, true, "Services/Component");
/*
$tpl->setVariable("HREF_REFRESH_PLUGINS_INFORMATION",
$ilCtrl->getLinkTarget($this, "refreshPluginsInformation"));
$tpl->setVariable("TXT_REFRESH_PLUGINS_INFORMATION",
$lng->txt("cmps_refresh_plugins_inf"));
*/
include_once("./Services/Component/classes/class.ilComponentsTableGUI.php");
$comp_table = new ilComponentsTableGUI($this, "listModules");
$tpl->setVariable("TABLE", $comp_table->getHTML());
$this->tpl->setContent($tpl->get());
}
ilObjComponentSettingsGUI::listServices ( )

List Services.

Definition at line 134 of file class.ilObjComponentSettingsGUI.php.

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, ilObjectGUI\$tpl, and IL_COMP_SERVICE.

{
$this->tabs_gui->setTabActive('cmps_services');
$tpl = new ilTemplate("tpl.component_list.html", true, true, "Services/Component");
$ilCtrl->setParameter($this, "mode", IL_COMP_SERVICE);
$tpl->setVariable("HREF_REFRESH_PLUGINS_INFORMATION",
$ilCtrl->getLinkTarget($this, "refreshPluginsInformation"));
$tpl->setVariable("TXT_REFRESH_PLUGINS_INFORMATION",
$lng->txt("cmps_refresh_plugins_inf"));
include_once("./Services/Component/classes/class.ilComponentsTableGUI.php");
$comp_table = new ilComponentsTableGUI($this, "listServices", IL_COMP_SERVICE);
$tpl->setVariable("TABLE", $comp_table->getHTML());
$this->tpl->setContent($tpl->get());
}
ilObjComponentSettingsGUI::refreshLanguages ( )

Refresh Languages.

Definition at line 382 of file class.ilObjComponentSettingsGUI.php.

References $_GET, $ilCtrl, $result, ilPlugin\getPluginObject(), and ilUtil\sendFailure().

{
global $ilCtrl;
include_once("./Services/Component/classes/class.ilPlugin.php");
$pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
$_GET["slot_id"], $_GET["pname"]);
$result = $pl->updateLanguages();
if ($result !== true)
{
}
$ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
$ilCtrl->setParameter($this, "cname", $_GET["cname"]);
$ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
$ilCtrl->redirect($this, "showPluginSlot");
}

+ Here is the call graph for this function:

ilObjComponentSettingsGUI::refreshPluginsInformation ( )

Refresh plugins information.

Definition at line 267 of file class.ilObjComponentSettingsGUI.php.

References $_GET, $ilCtrl, and IL_COMP_SERVICE.

{
global $ilCtrl;
die ("ilObjComponentSettigsGUI::refreshPluginsInformation: deprecated");
include_once("./Services/Component/classes/class.ilPlugin.php");
ilPlugin::refreshPluginXmlInformation();
if ($_GET["mode"] == IL_COMP_SERVICE)
{
$ilCtrl->redirect($this, "listServices");
}
else
{
$ilCtrl->redirect($this, "listModules");
}
}
ilObjComponentSettingsGUI::saveOptions ( )

Save Options.

Definition at line 158 of file class.ilObjComponentSettingsGUI.php.

References $_POST, $ilCtrl, $ilSetting, ilObjectGUI\$lng, ilUtil\sendInfo(), and ilUtil\sendSuccess().

{
// disable creation
if (is_array($_POST["obj_pos"]))
{
foreach($_POST["obj_pos"] as $k => $v)
{
$ilSetting->set("obj_dis_creation_".$k, (int) $_POST["obj_dis_creation"][$k]);
}
}
// add new position
$double = $ex_pos = array();
if (is_array($_POST["obj_pos"]))
{
reset($_POST["obj_pos"]);
foreach($_POST["obj_pos"] as $k => $v)
{
if (in_array($v, $ex_pos))
{
$double[$v] = $v;
}
$ex_pos[] = $v;
$ilSetting->set("obj_add_new_pos_".$k, $v);
}
}
if (count($double) == 0)
{
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
}
else
{
ilUtil::sendInfo($lng->txt("cmps_duplicate_positions")." ".implode($double, ", "), true);
}
$ilCtrl->redirect($this, "listModules");
}

+ Here is the call graph for this function:

ilObjComponentSettingsGUI::showPluginSlot ( )

Show information about a plugin slot.

Definition at line 202 of file class.ilObjComponentSettingsGUI.php.

References $_GET, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilComponent\getComponentObject().

{
global $tpl,$lng, $ilTabs;
if ($_GET["mode"] == "Services")
{
$ilTabs->setTabActive("cmps_services");
}
//slot_id
$ptpl = new ilTemplate("tpl.plugin_slot.html", true, true,
"Services/Component");
include_once("./Services/Component/classes/class.ilComponent.php");
$comp = ilComponent::getComponentObject($_GET["ctype"], $_GET["cname"]);
$ptpl->setVariable("TXT_COMPONENT", $lng->txt("cmps_component"));
$ptpl->setVariable("VAL_COMPONENT_NAME", $comp->getComponentType()."/".$comp->getName());
$ptpl->setVariable("VAL_COMPONENT_ID", $comp->getId());
$ptpl->setVariable("TXT_PLUGIN_SLOT", $lng->txt("cmps_plugin_slot"));
$ptpl->setVariable("VAL_PLUGIN_SLOT", $comp->getPluginSlotName($_GET["slot_id"]));
$ptpl->setVariable("VAL_PLUGIN_SLOT_ID", $_GET["slot_id"]);
// directories
$ptpl->setVariable("TXT_PLUGIN_DIR", $lng->txt("cmps_plugin_dirs"));
$ptpl->setVariable("VAL_PLUGIN_DIR",
$comp->getPluginSlotDirectory($_GET["slot_id"])."/<Plugin_Name>");
$ptpl->setVariable("TXT_MAIN_DIR", $lng->txt("cmps_main_dir"));
$ptpl->setVariable("TXT_PLUGIN_FILE", $lng->txt("cmps_plugin_file"));
$ptpl->setVariable("TXT_LANG_FILES", $lng->txt("cmps_lang_files"));
$ptpl->setVariable("TXT_DB_UPDATE", $lng->txt("cmps_db_update"));
$ptpl->setVariable("VAL_PLUGIN_FILE",
"<".$lng->txt("cmps_main_dir").">".
"/classes/class.il<Plugin_Name>Plugin.php");
$ptpl->setVariable("VAL_LANG_FILES",
"<".$lng->txt("cmps_main_dir").">".
"/lang/ilias_<Language ID>.lang");
$ptpl->setVariable("VAL_DB_UPDATE",
"<".$lng->txt("cmps_main_dir").">".
"/sql/dbupdate.php");
$ptpl->setVariable("TXT_PLUGIN_LANG_PREFIX", $lng->txt("cmps_plugin_lang_prefixes"));
$ptpl->setVariable("VAL_PLUGIN_LANG_PREFIX",
$comp->getPluginSlotLanguagePrefix($_GET["slot_id"])."<Plugin_ID>_");
$ptpl->setVariable("TXT_PLUGIN_DB_PREFIX", $lng->txt("cmps_plugin_db_prefixes"));
$ptpl->setVariable("VAL_PLUGIN_DB_PREFIX",
$comp->getPluginSlotLanguagePrefix($_GET["slot_id"])."<Plugin_ID>_");
// plugins table
include_once("./Services/Component/classes/class.ilPluginsTableGUI.php");
$plugins_table = new ilPluginsTableGUI($this, "showPluginSlot",
$_GET["ctype"], $_GET["cname"], $_GET["slot_id"]);
$ptpl->setVariable("PLUGIN_LIST", $plugins_table->getHTML());
// set content and title
$tpl->setContent($ptpl->get());
$tpl->setTitle($comp->getComponentType()."/".$comp->getName().": ".
$lng->txt("cmps_plugin_slot")." \"".$comp->getPluginSlotName($_GET["slot_id"])."\"");
$tpl->setDescription("");
}

+ Here is the call graph for this function:

ilObjComponentSettingsGUI::updatePlugin ( )

Update a plugin.

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

References $_GET, $ilCtrl, $result, ilPlugin\getPluginObject(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
include_once("./Services/Component/classes/class.ilPlugin.php");
$pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
$_GET["slot_id"], $_GET["pname"]);
$result = $pl->update();
if ($result !== true)
{
ilUtil::sendFailure($pl->message, true);
}
else
{
ilUtil::sendSuccess($pl->message, true);
}
// reinitialize control class
global $ilCtrl;
$ilCtrl->initBaseClass("iladministrationgui");
$_GET["cmd"] = "jumpToPluginSlot";
$ilCtrl->setParameterByClass("iladministrationgui", "ctype", $_GET["ctype"]);
$ilCtrl->setParameterByClass("iladministrationgui", "cname", $_GET["cname"]);
$ilCtrl->setParameterByClass("iladministrationgui", "slot_id", $_GET["slot_id"]);
$ilCtrl->setTargetScript("ilias.php");
$ilCtrl->callBaseClass();
//$ilCtrl->redirectByClass("iladministrationgui", );
}

+ Here is the call graph for this function:

ilObjComponentSettingsGUI::updatePluginDB ( )

Update plugin DB.

Definition at line 406 of file class.ilObjComponentSettingsGUI.php.

References $_GET, $ilCtrl, $ilDB, $row, and ilUtil\sendInfo().

{
global $ilDB;
include_once("./Services/Component/classes/class.ilPluginDBUpdate.php");
$dbupdate = new ilPluginDBUpdate($_GET["ctype"], $_GET["cname"],
$_GET["slot_id"], $_GET["pname"], $ilDB, true);
$dbupdate->applyUpdate();
if ($dbupdate->updateMsg == "no_changes")
{
$message = $this->lng->txt("no_changes").". ".$this->lng->txt("database_is_uptodate");
}
else
{
foreach ($dbupdate->updateMsg as $row)
{
$message .= $this->lng->txt($row["msg"]).": ".$row["nr"]."<br/>";
}
}
ilUtil::sendInfo($message, true);
$ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
$ilCtrl->setParameter($this, "cname", $_GET["cname"]);
$ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
$ilCtrl->redirect($this, "showPluginSlot");
}

+ Here is the call graph for this function:

Field Documentation

ilObjComponentSettingsGUI::$ERROR_MESSAGE
staticprivate

Definition at line 18 of file class.ilObjComponentSettingsGUI.php.


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