ILIAS  Release_4_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.

Static Public Member Functions

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

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 40 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 237 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 274 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 265 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 209 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 195 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 181 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 52 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 (!$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;
// 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 288 of file class.ilPluginAdmin.php.

Referenced by ilAppEventHandler\raise().

{
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 167 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 223 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 251 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:


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