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

Plugin Slot. More...

+ Collaboration diagram for ilPluginSlot:

Public Member Functions

 __construct ($a_c_type, $a_c_name, $a_slot_id)
 Constructor.
 read ()
 Read properties from DB.
 setComponentType ($a_componenttype)
 Set Component Type.
 getComponentType ()
 Get Component Type.
 setComponentName ($a_componentname)
 Set Component Name.
 getComponentName ()
 Get Component Name.
 setSlotId ($a_slotid)
 Set Slot ID.
 getSlotId ()
 Get Slot ID.
 setSlotName ($a_slotname)
 Set Slot Name.
 getSlotName ()
 Get Slot Name.
 getPluginsDirectory ()
 Get directory of.
 _getPluginsDirectory ($a_ctype, $a_cname, $a_slot_id)
 Get plugins directory.
 getPluginPhpFileName ($a_plugin_name)
 Get File name for plugin.php.
 checkPluginPhpFileAvailability ($a_plugin_name)
 Check whether plugin.php file is available for plugin or not.
 getPluginClassFileName ($a_plugin_name)
 Get Class File name for plugin.
 checkClassFileAvailability ($a_plugin_name)
 Check whether Plugin class file is available for plugin or not.
 getPrefix ()
 Get slot prefix, used for lang vars and db tables.
 getPluginsInformation ()
 Get information an all plugins and their status.
 getActivePlugins ()
 Get active plugins of slot.

Static Public Member Functions

static lookupSlotId ($a_ctype, $a_cname, $a_slot_name)
 Lookup slot ID for component and slot name.
static lookupSlotName ($a_ctype, $a_cname, $a_slot_id)
 Lookup slot name for component and slot id.
static getAllSlots ()
 Get all plugin slots.

Detailed Description

Plugin Slot.

A plugin slot defines an interface for a set of plugins that share the same characteristics

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

Definition at line 19 of file class.ilPluginSlot.php.

Constructor & Destructor Documentation

ilPluginSlot::__construct (   $a_c_type,
  $a_c_name,
  $a_slot_id 
)

Constructor.

Definition at line 25 of file class.ilPluginSlot.php.

References read(), setComponentName(), setComponentType(), and setSlotId().

{
$this->setComponentType($a_c_type);
$this->setComponentName($a_c_name);
$this->setSlotId($a_slot_id);
if ($a_slot_id != "")
{
$this->read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilPluginSlot::_getPluginsDirectory (   $a_ctype,
  $a_cname,
  $a_slot_id 
)

Get plugins directory.

Definition at line 144 of file class.ilPluginSlot.php.

References lookupSlotName().

Referenced by ilPlugin\_getDirectory().

{
return "./Customizing/global/plugins/".$a_ctype.
"/".$a_cname."/".ilPluginSlot::lookupSlotName($a_ctype, $a_cname, $a_slot_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPluginSlot::checkClassFileAvailability (   $a_plugin_name)

Check whether Plugin class file is available for plugin or not.

Definition at line 185 of file class.ilPluginSlot.php.

References getPluginClassFileName().

Referenced by getPluginsInformation().

{
if (@is_file($this->getPluginClassFileName($a_plugin_name)))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPluginSlot::checkPluginPhpFileAvailability (   $a_plugin_name)

Check whether plugin.php file is available for plugin or not.

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

References getPluginPhpFileName().

Referenced by getPluginsInformation().

{
if (@is_file($this->getPluginPhpFileName($a_plugin_name)))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPluginSlot::getActivePlugins ( )

Get active plugins of slot.

Definition at line 302 of file class.ilPluginSlot.php.

References getComponentName(), getComponentType(), and getSlotId().

{
global $ilPluginAdmin;
return $ilPluginAdmin->getActivePluginsForSlot($this->getComponentType(),
$this->getComponentName(), $this->getSlotId());
}

+ Here is the call graph for this function:

static ilPluginSlot::getAllSlots ( )
static

Get all plugin slots.

Definition at line 314 of file class.ilPluginSlot.php.

References $ilDB.

Referenced by ilObjLanguage\refreshAll().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM il_pluginslot ");
$slots = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$pos = strpos($rec["component"], "/");
$slots[] = array(
"component_type" => substr($rec["component"], 0, $pos),
"component_name" => substr($rec["component"], $pos + 1),
"slot_id" => $rec["id"],
"slot_name" => $rec["name"]
);
}
return $slots;
}

+ Here is the caller graph for this function:

ilPluginSlot::getComponentName ( )

Get Component Name.

Returns
string Component Name

Definition at line 87 of file class.ilPluginSlot.php.

Referenced by getActivePlugins(), getPluginsInformation(), getPrefix(), and read().

{
return $this->componentname;
}

+ Here is the caller graph for this function:

ilPluginSlot::getComponentType ( )

Get Component Type.

Returns
string Component Type

Definition at line 67 of file class.ilPluginSlot.php.

Referenced by getActivePlugins(), getPluginsInformation(), getPrefix(), and read().

{
return $this->componenttype;
}

+ Here is the caller graph for this function:

ilPluginSlot::getPluginClassFileName (   $a_plugin_name)

Get Class File name for plugin.

Definition at line 176 of file class.ilPluginSlot.php.

References getPluginsDirectory().

Referenced by checkClassFileAvailability().

{
return $this->getPluginsDirectory()."/".
$a_plugin_name."/classes/class.il".$a_plugin_name."Plugin.php";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPluginSlot::getPluginPhpFileName (   $a_plugin_name)

Get File name for plugin.php.

Definition at line 154 of file class.ilPluginSlot.php.

References getPluginsDirectory().

Referenced by checkPluginPhpFileAvailability().

{
return $this->getPluginsDirectory()."/".
$a_plugin_name."/plugin.php";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPluginSlot::getPluginsDirectory ( )

Get directory of.

Definition at line 135 of file class.ilPluginSlot.php.

References getSlotName().

Referenced by getPluginClassFileName(), getPluginPhpFileName(), and getPluginsInformation().

{
return "./Customizing/global/plugins/".$this->getComponentType().
"/".$this->getComponentName()."/".$this->getSlotName();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPluginSlot::getPluginsInformation ( )

Get information an all plugins and their status.

Definition at line 214 of file class.ilPluginSlot.php.

References $dir, $file, checkClassFileAvailability(), checkPluginPhpFileAvailability(), getComponentName(), getComponentType(), getPluginsDirectory(), getSlotId(), and ilPlugin\lookupStoredData().

{
global $ilPluginAdmin;
// read plugins directory
$pl_dir = $this->getPluginsDirectory();
if (!@is_dir($pl_dir))
{
return array();
}
$dir = opendir($pl_dir);
$plugins = array();
while($file = readdir($dir))
{
if ($file != "." and
$file != "..")
{
// directories
if (@is_dir($pl_dir."/".$file))
{
$plugin = array();
$this->getComponentName(), $this->getSlotId(), $file);
$pdata = $ilPluginAdmin->getAllData($this->getComponentType(),
$this->getComponentName(), $this->getSlotId(), $file);
$plugin["version"] = $pdata["version"];
$plugin["id"] = $pdata["id"];
$plugin["is_active"] = $pdata["is_active"];
$plugin["inactive_reason"] = $pdata["inactive_reason"];
$plugin["needs_update"] = $pdata["needs_update"];
$plugin["ilias_min_version"] = $pdata["ilias_min_version"];
$plugin["ilias_max_version"] = $pdata["ilias_max_version"];
$plugin["activation_possible"] = $pdata["activation_possible"];
$plugin["responsible"] = $pdata["responsible"];
$plugin["responsible_mail"] = $pdata["responsible_mail"];
$plugin["name"] = $file;
$plugin["plugin_php_file_status"] = $this->checkPluginPhpFileAvailability($file);
$plugin["class_file_status"] = $this->checkClassFileAvailability($file);
$plugin["class_file"] = "class.il".$plugin["name"]."Plugin.php";
$plugins[] = $plugin;
}
}
}
return $plugins;
}

+ Here is the call graph for this function:

ilPluginSlot::getPrefix ( )

Get slot prefix, used for lang vars and db tables.

Needs plugin id appended.

Definition at line 199 of file class.ilPluginSlot.php.

References getComponentName(), getComponentType(), getSlotId(), and ilComponent\lookupId().

{
if ($this->prefix == "")
{
$this->prefix =
$this->getComponentName())."_".$this->getSlotId();
}
return $this->prefix;
}

+ Here is the call graph for this function:

ilPluginSlot::getSlotId ( )

Get Slot ID.

Returns
string Slot ID

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

Referenced by getActivePlugins(), getPluginsInformation(), getPrefix(), and read().

{
return $this->slotid;
}

+ Here is the caller graph for this function:

ilPluginSlot::getSlotName ( )

Get Slot Name.

Returns
string Slot Name

Definition at line 127 of file class.ilPluginSlot.php.

Referenced by getPluginsDirectory().

{
return $this->slotname;
}

+ Here is the caller graph for this function:

static ilPluginSlot::lookupSlotId (   $a_ctype,
  $a_cname,
  $a_slot_name 
)
static

Lookup slot ID for component and slot name.

Definition at line 272 of file class.ilPluginSlot.php.

References $ilDB, and $q.

{
global $ilDB;
$q = "SELECT * FROM il_pluginslot WHERE component = ".
$ilDB->quote($a_ctype."/".$a_cname, "text").
" AND name = ".$ilDB->quote($a_slot_name, "text");
$set = $ilDB->query($q);
$rec = $ilDB->fetchAssoc($set);
return $rec["id"];
}
static ilPluginSlot::lookupSlotName (   $a_ctype,
  $a_cname,
  $a_slot_id 
)
static

Lookup slot name for component and slot id.

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

References $ilDB, and $q.

Referenced by _getPluginsDirectory(), ilPluginsTableGUI\fillRow(), ilPluginAdmin\getPluginData(), ilPlugin\getPluginObject(), and ilPluginDBUpdate\ilPluginDBUpdate().

{
global $ilDB;
$q = "SELECT * FROM il_pluginslot WHERE component = ".
$ilDB->quote($a_ctype."/".$a_cname, "text").
" AND id = ".$ilDB->quote($a_slot_id, "text");
$set = $ilDB->query($q);
$rec = $ilDB->fetchAssoc($set);
return $rec["name"];
}

+ Here is the caller graph for this function:

ilPluginSlot::read ( )

Read properties from DB.

Definition at line 40 of file class.ilPluginSlot.php.

References $ilDB, $q, getComponentName(), getComponentType(), getSlotId(), and setSlotName().

Referenced by __construct().

{
global $ilDB;
$q = "SELECT * FROM il_pluginslot WHERE component = ".
$ilDB->quote($this->getComponentType()."/".$this->getComponentName(), "text").
" AND id = ".$ilDB->quote($this->getSlotId(), "text");
$set = $ilDB->query($q);
$rec = $ilDB->fetchAssoc($set);
$this->setSlotName($rec["name"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPluginSlot::setComponentName (   $a_componentname)

Set Component Name.

Parameters
string$a_componentnameComponent Name

Definition at line 77 of file class.ilPluginSlot.php.

Referenced by __construct().

{
$this->componentname = $a_componentname;
}

+ Here is the caller graph for this function:

ilPluginSlot::setComponentType (   $a_componenttype)

Set Component Type.

Parameters
string$a_componenttypeComponent Type

Definition at line 57 of file class.ilPluginSlot.php.

Referenced by __construct().

{
$this->componenttype = $a_componenttype;
}

+ Here is the caller graph for this function:

ilPluginSlot::setSlotId (   $a_slotid)

Set Slot ID.

Parameters
string$a_slotidSlot ID

Definition at line 97 of file class.ilPluginSlot.php.

Referenced by __construct().

{
$this->slotid = $a_slotid;
}

+ Here is the caller graph for this function:

ilPluginSlot::setSlotName (   $a_slotname)

Set Slot Name.

Parameters
string$a_slotnameSlot Name

Definition at line 117 of file class.ilPluginSlot.php.

Referenced by read().

{
$this->slotname = $a_slotname;
}

+ Here is the caller graph for this function:


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