ILIAS  Release_5_0_x_branch Revision 61816
 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.
 hasLearningProgress ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Checks whether plugin has active learning progress.

Static Public Member Functions

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

Data Fields

 $got_data = false

Static Public Attributes

static $active_plugins = array()
static $plugin_objects = array()

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 16 of file class.ilPluginAdmin.php.

Constructor & Destructor Documentation

ilPluginAdmin::__construct ( )

Constructor.

Definition at line 36 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 242 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 279 of file class.ilPluginAdmin.php.

Referenced by ilAppEventHandler\raise().

{
// cache the list of active plugins
if (!isset(self::$active_plugins[$a_ctype][$a_cname][$a_slot_id]))
{
include_once "./Services/Component/classes/class.ilPlugin.php";
self::$active_plugins[$a_ctype][$a_cname][$a_slot_id] =
ilPlugin::getActivePluginsForSlot($a_ctype, $a_cname, $a_slot_id);
}
return self::$active_plugins[$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 270 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 207 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 193 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 179 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 48 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(), hasLearningProgress(), 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,
"learning_progress" => (bool)$learning_progress);
}
$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
Returns
ilPlugin the plugin

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

Referenced by ilUIHookProcessor\__construct(), ilTestSignatureGUI\__construct(), ilTabsGUI\__getHTML(), ilStartUpGUI\_checkGoto(), ilTemplate\addBlockFile(), ilObjComponentSettingsGUI\executeCommand(), ilTemplate\get(), ilContainerGUI\getAsynchItemListObject(), includeClass(), ilInitialisation\initStyle(), ilRendererFactory\loadAvailableRenderers(), ilTemplate\loadTemplatefile(), ilAppEventHandler\raise(), ilUtil\redirect(), ilObjContentObjectGUI\setilLMMenu(), and ilTemplate\show().

{
// cache the plugin objects
if (!isset(self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname]))
{
self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname] =
ilPlugin::getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname);
}
return self::$plugin_objects[$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 165 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::hasLearningProgress (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Checks whether plugin has active learning progress.

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

Definition at line 342 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]["learning_progress"];
}

+ Here is the call graph for this function:

static ilPluginAdmin::includeClass (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname,
  $a_class_file_name 
)
static

Get Plugin Object.

Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
ilPlugin the plugin

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

References getPluginObject().

{
// cache the plugin objects
if (!isset(self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname]))
{
self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname] =
ilPlugin::getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname);
}
$pl = self::$plugin_objects[$a_ctype][$a_cname][$a_slot_id][$a_pname];
$pl->includeClass($a_class_file_name);
}

+ 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 221 of file class.ilPluginAdmin.php.

References getPluginData().

{
try
{
$this->getPluginData($a_ctype, $a_cname, $a_slot_id, $a_pname);
}
catch (ilPluginException $e)
{
return false;
}
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 256 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::$active_plugins = array()
static

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

ilPluginAdmin::$got_data = false

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

ilPluginAdmin::$plugin_objects = array()
static

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


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