ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPluginAdmin Class Reference

Administration class for plugins. More...

+ Collaboration diagram for ilPluginAdmin:

Public Member Functions

 __construct ()
 Constructor.
 getVersion ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get version of plugin.
 getIliasMinVersion ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get Ilias Min Version.
 getIliasMaxVersion ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get Ilias Max Version.
 getId ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get ID.
 isActive ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Checks whether plugin is active (include version checks)
 exists ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Checks whether plugin exists.
 needsUpdate ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get version.
 getAllData ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get all data from file in an array.
 getActivePluginsForSlot ($a_ctype, $a_cname, $a_slot_id)
 Get all active plugins for a slot.

Static Public Member Functions

static getPluginObject ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get Plugin Object.

Data Fields

 $got_data = false

Private Member Functions

 getPluginData ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Get basic data of plugin from plugin.php.

Detailed Description

Administration class for plugins.

Handles basic data from plugin.php files.

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

Definition at line 35 of file class.ilPluginAdmin.php.

Constructor & Destructor Documentation

ilPluginAdmin::__construct ( )

Constructor.

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

{
}

Member Function Documentation

ilPluginAdmin::exists (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Checks whether plugin exists.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 240 of file class.ilPluginAdmin.php.

References getPluginData().

{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
return isset($this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]);
}

+ Here is the call graph for this function:

ilPluginAdmin::getActivePluginsForSlot (   $a_ctype,
  $a_cname,
  $a_slot_id 
)

Get all active plugins for a slot.

Definition at line 277 of file class.ilPluginAdmin.php.

Referenced by ilAppEventHandler\raise().

{
include_once "./Services/Component/classes/class.ilPlugin.php";
return ilPlugin::getActivePluginsForSlot($a_ctype, $a_cname, $a_slot_id);
}

+ Here is the caller graph for this function:

ilPluginAdmin::getAllData (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get all data from file in an array.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 268 of file class.ilPluginAdmin.php.

References getPluginData().

{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname];
}

+ Here is the call graph for this function:

ilPluginAdmin::getId (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get ID.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 212 of file class.ilPluginAdmin.php.

References getPluginData().

{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["id"];
}

+ Here is the call graph for this function:

ilPluginAdmin::getIliasMaxVersion (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get Ilias Max Version.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 198 of file class.ilPluginAdmin.php.

References getPluginData().

{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["ilias_max_version"];
}

+ Here is the call graph for this function:

ilPluginAdmin::getIliasMinVersion (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get Ilias Min Version.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 184 of file class.ilPluginAdmin.php.

References getPluginData().

{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["ilias_min_version"];
}

+ Here is the call graph for this function:

ilPluginAdmin::getPluginData (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
finalprivate

Get basic data of plugin from plugin.php.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 54 of file class.ilPluginAdmin.php.

References $ilDB, $lng, ilPlugin\getPluginRecord(), ILIAS_VERSION_NUMERIC, ilComponent\isVersionGreaterString(), and ilPluginSlot\lookupSlotName().

Referenced by exists(), getAllData(), getId(), getIliasMaxVersion(), getIliasMinVersion(), getVersion(), isActive(), and needsUpdate().

{
global $ilDB, $lng;
if (!isset($this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname]))
{
include_once "./Services/Component/classes/class.ilPluginSlot.php";
$slot_name = ilPluginSlot::lookupSlotName($a_ctype, $a_cname, $a_slot_id);
$plugin_php_file = "./Customizing/global/plugins/".$a_ctype."/".
$a_cname."/".$slot_name."/".$a_pname."/plugin.php";
$rec = ilPlugin::getPluginRecord($a_ctype, $a_cname, $a_slot_id, $a_pname);
if (is_file($plugin_php_file))
{
include_once($plugin_php_file);
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname] =
array("version" => $version, "id" => $id,
"ilias_min_version" => $ilias_min_version,
"ilias_max_version" => $ilias_max_version,
"responsible" => $responsible,
"responsible_mail" => $responsible_mail);
}
$active = $rec["active"];
$needs_update = false;
$activation_possible = !$active;
$inactive_reason = "";
// version checks
{
$active = false;
if (is_object($lng))
{
$inactive_reason = $lng->txt("cmps_needs_newer_ilias_version");
}
else
{
$inactive_reason = "Plugin needs a newer version of ILIAS.";
}
$activation_possible = false;
}
{
$active = false;
if (is_object($lng))
{
$inactive_reason = $lng->txt("cmps_needs_newer_plugin_version");
}
else
{
$inactive_reason = "Plugin does not support current version of ILIAS. Newer version of plugin needed.";
}
$activation_possible = false;
}
else if ($rec["last_update_version"] == "")
{
$active = false;
if (is_object($lng))
{
$inactive_reason = $lng->txt("cmps_needs_update");
}
else
{
$inactive_reason = "Update needed.";
}
$needs_update = true;
$activation_possible = false;
}
else if (ilComponent::isVersionGreaterString($rec["last_update_version"], $version))
{
$active = false;
if (is_object($lng))
{
$inactive_reason = $lng->txt("cmps_needs_upgrade");
}
else
{
$inactive_reason = "Upgrade needed.";
}
$activation_possible = false;
}
else if ($rec["last_update_version"] != $version)
{
$active = false;
if (is_object($lng))
{
$inactive_reason = $lng->txt("cmps_needs_update");
}
else
{
$inactive_reason = "Update needed.";
}
$needs_update = true;
$activation_possible = false;
}
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["is_active"] = $active;
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["inactive_reason"] = $inactive_reason;
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["needs_update"] = $needs_update;
$this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["activation_possible"] = $activation_possible;
$this->got_data[$a_ctype][$a_cname][$a_slot_id][$a_pname] = true;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilPluginAdmin::getPluginObject (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
static

Get Plugin Object.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 291 of file class.ilPluginAdmin.php.

Referenced by ilObjComponentSettingsGUI\executeCommand(), ilAppEventHandler\raise(), ilObjContentObjectGUI\setilLMMenu(), and ilMainMenuGUI\setTemplateVars().

{
return ilPlugin::getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname);
}

+ Here is the caller graph for this function:

ilPluginAdmin::getVersion (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get version of plugin.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 170 of file class.ilPluginAdmin.php.

References getPluginData().

{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["version"];
}

+ Here is the call graph for this function:

ilPluginAdmin::isActive (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Checks whether plugin is active (include version checks)

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 226 of file class.ilPluginAdmin.php.

References getPluginData().

{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["is_active"];
}

+ Here is the call graph for this function:

ilPluginAdmin::needsUpdate (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Get version.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name

Definition at line 254 of file class.ilPluginAdmin.php.

References getPluginData().

{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
return $this->data[$a_ctype][$a_cname][$a_slot_id][$a_pname]["needs_update"];
}

+ Here is the call graph for this function:

Field Documentation

ilPluginAdmin::$got_data = false

Definition at line 37 of file class.ilPluginAdmin.php.


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