ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilComponent Class Reference
+ Inheritance diagram for ilComponent:
+ Collaboration diagram for ilComponent:

Public Member Functions

 getVersion ()
 Get Version Number of Component.
 isCore ()
 getName ()
 Get Name.
 __construct ()
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setPluginSlots ($a_pluginslots)
 Set Plugin Slots.
 getPluginSlots ()
 Get Plugin Slots.
 setSubDirectory ($a_subdirectory)
 Set Sub Directory.
 getSubDirectory ()
 Get Sub Directory.
 getPluginSlotName ($a_id)
 Get name of plugin slot.
 getPluginSlotDirectory ($a_id)
 Get directory of plugin slot.
 getPluginSlotLanguagePrefix ($a_id)
 Get language prefix for plugin slot.

Static Public Member Functions

static getComponentType ()
static getComponentObject ($a_ctype, $a_cname)
 Get component object.
static lookupPluginSlots ($a_type, $a_name)
 Lookup all plugin slots of a component.
static lookupId ($a_type, $a_name)
 Lookup ID of a component.
static checkVersionNumber ($a_ver)
 Check version number.
static isVersionGreaterString ($a_ver1, $a_ver2)
static isVersionGreater ($a_ver1, $a_ver2)
 Check whether version number is greater than another version number.

Detailed Description

Definition at line 22 of file class.ilComponent.php.

Constructor & Destructor Documentation

ilComponent::__construct ( )

Reimplemented in ilModule, ilSurveyQuestionPoolModule, ilTestQuestionPoolModule, ilAuthShibbolethService, ilCOPageService, ilEventHandlingService, ilRepositoryService, ilLDAPService, ilPersonalDesktopService, and ilUIComponentService.

Definition at line 52 of file class.ilComponent.php.

References $ilDB, getComponentType(), getName(), lookupPluginSlots(), setId(), and setPluginSlots().

{
global $ilDB;
$set = $ilDB->queryF("SELECT * FROM il_component WHERE type = %s ".
" AND name = %s", array("text", "text"),
array($this->getComponentType(), $this->getName()));
$rec = $ilDB->fetchAssoc($set);
$this->setId($rec["id"]);
$this->getComponentType(), $this->getName()));
}

+ Here is the call graph for this function:

Member Function Documentation

static ilComponent::checkVersionNumber (   $a_ver)
staticfinal

Check version number.

Definition at line 245 of file class.ilComponent.php.

References $lng.

Referenced by isVersionGreaterString().

{
global $lng;
$parts = explode(".", $a_ver);
if (count($parts) != 3)
{
return "Version Number does not conform to format a.b.c";
}
if (!is_numeric($parts[0]) || !is_numeric($parts[1]) || !is_numeric($parts[2]))
{
return "Not all version number parts a.b.c are numeric.";
}
return $parts;
}

+ Here is the caller graph for this function:

static ilComponent::getComponentObject (   $a_ctype,
  $a_cname 
)
staticfinal

Get component object.

Parameters
string$a_ctypeIL_COMP_MODULE | IL_COMP_SERVICE
string$a_cnamecomponent name

Definition at line 112 of file class.ilComponent.php.

References $ilDB, IL_COMP_MODULE, and IL_COMP_SERVICE.

Referenced by ilObjComponentSettingsGUI\showPluginSlot(), and ilObjComponentSettingsGUI\showPluginSlotInfo().

{
global $ilDB;
$set = $ilDB->queryF("SELECT * FROM il_component WHERE type = %s ".
" AND name = %s", array("text", "text"),
array($a_ctype, $a_cname));
if (!$ilDB->fetchAssoc($set))
{
return null;
}
switch ($a_ctype)
{
if (is_file("./Modules/".$a_cname."/classes/class.il".$a_cname."Module.php"))
{
include_once("./Modules/".$a_cname."/classes/class.il".$a_cname."Module.php");
$class = "il".$a_cname."Module";
$comp = new $class();
return $comp;
}
break;
if (is_file("./Services/".$a_cname."/classes/class.il".$a_cname."Service.php"))
{
include_once("./Services/".$a_cname."/classes/class.il".$a_cname."Service.php");
$class = "il".$a_cname."Service";
$comp = new $class();
return $comp;
}
break;
}
return null;
}

+ Here is the caller graph for this function:

static ilComponent::getComponentType ( )
staticabstract

Reimplemented in ilModule, and ilService.

Referenced by __construct().

+ Here is the caller graph for this function:

ilComponent::getId ( )
final

Get Id.

Returns
string Id

Definition at line 81 of file class.ilComponent.php.

Referenced by getPluginSlotLanguagePrefix().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilComponent::getName ( )
abstract

Get Name.

Returns
string Name

Reimplemented in ilModule, and ilService.

Referenced by __construct(), and getPluginSlotDirectory().

+ Here is the caller graph for this function:

ilComponent::getPluginSlotDirectory (   $a_id)

Get directory of plugin slot.

Parameters
string$a_idPlugin Slot ID

Definition at line 208 of file class.ilComponent.php.

References getName(), and getPluginSlots().

{
$slots = $this->getPluginSlots();
return "Customizing/global/plugins/".$this->getComponentType()."/".
$this->getName()."/".$slots[$a_id]["name"];
}

+ Here is the call graph for this function:

ilComponent::getPluginSlotLanguagePrefix (   $a_id)

Get language prefix for plugin slot.

Parameters
string$a_idPlugin Slot ID

Definition at line 221 of file class.ilComponent.php.

References getId(), and getPluginSlots().

{
$slots = $this->getPluginSlots();
return $this->getId()."_".$slots[$a_id]["id"]."_";
}

+ Here is the call graph for this function:

ilComponent::getPluginSlotName (   $a_id)

Get name of plugin slot.

Parameters
string$a_idPlugin Slot ID

Definition at line 196 of file class.ilComponent.php.

References getPluginSlots().

{
$slots = $this->getPluginSlots();
return $slots[$a_id]["name"];
}

+ Here is the call graph for this function:

ilComponent::getPluginSlots ( )
final

Get Plugin Slots.

Returns
array Plugin Slots

Definition at line 101 of file class.ilComponent.php.

Referenced by getPluginSlotDirectory(), getPluginSlotLanguagePrefix(), and getPluginSlotName().

{
return $this->pluginslots;
}

+ Here is the caller graph for this function:

ilComponent::getSubDirectory ( )

Get Sub Directory.

Returns
string Sub Directory

Definition at line 165 of file class.ilComponent.php.

{
return $this->subdirectory;
}
ilComponent::getVersion ( )
abstract

Get Version Number of Component.

The number should be changed if anything in the code is changed. Otherwise ILIAS will not be able to recognize any change in the module.

The format must be: <major number>="">.<minor number>="">.<bugfix number>=""> <bugfix number>=""> should be increased for bugfixes <minor number>=""> should be increased for behavioural changes (and new functionalities) <major number>=""> should be increased for major revisions

The number should be returned directly as string, e.g. return "1.0.2";

Returns
string version number

Reimplemented in ilSurveyQuestionPoolModule, ilTestQuestionPoolModule, ilAuthShibbolethService, ilCOPageService, ilEventHandlingService, ilRepositoryService, ilLDAPService, ilPersonalDesktopService, and ilUIComponentService.

static ilComponent::isVersionGreater (   $a_ver1,
  $a_ver2 
)
staticfinal

Check whether version number is greater than another version number.

Parameters
$a_ver1array version number as array as returned by checkVersionNumber()
$a_ver2array version number as array as returned by checkVersionNumber()

$return boolean true, if $a_ver1 is greater than $a_ver2

Definition at line 286 of file class.ilComponent.php.

Referenced by isVersionGreaterString().

{
if ($a_ver1[0] > $a_ver2[0])
{
return true;
}
else if ($a_ver1[0] < $a_ver2[0])
{
return false;
}
else if ($a_ver1[1] > $a_ver2[1])
{
return true;
}
else if ($a_ver1[1] < $a_ver2[1])
{
return false;
}
else if ($a_ver1[2] > $a_ver2[2])
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

static ilComponent::isVersionGreaterString (   $a_ver1,
  $a_ver2 
)
staticfinal

Definition at line 264 of file class.ilComponent.php.

References checkVersionNumber(), and isVersionGreater().

Referenced by ilPluginAdmin\getPluginData().

{
$a_arr1 = ilComponent::checkVersionNumber($a_ver1);
$a_arr2 = ilComponent::checkVersionNumber($a_ver2);
if (is_array($a_arr1) && is_array($a_arr2))
{
return ilComponent::isVersionGreater($a_arr1, $a_arr2);
}
else
{
return false;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilComponent::lookupId (   $a_type,
  $a_name 
)
static

Lookup ID of a component.

Definition at line 230 of file class.ilComponent.php.

References $ilDB.

Referenced by ilPluginSlot\getPrefix(), and lookupPluginSlots().

{
global $ilDB;
$set = $ilDB->queryF("SELECT * FROM il_component WHERE type = %s ".
" AND name = %s", array("text", "text"),
array($a_type, $a_name));
$rec = $ilDB->fetchAssoc($set);
return $rec["id"];
}

+ Here is the caller graph for this function:

static ilComponent::lookupPluginSlots (   $a_type,
  $a_name 
)
static

Lookup all plugin slots of a component.

Definition at line 173 of file class.ilComponent.php.

References $ilDB, and lookupId().

Referenced by __construct(), ilComponentsTableGUI\fillRow(), and ilPluginsOverviewTableGUI\getComponents().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM il_pluginslot WHERE component = ".
$ilDB->quote($a_type."/".$a_name, "text"));
$ps = array();
//echo "<br>".$a_type."/".$a_name;
while($rec = $ilDB->fetchAssoc($set))
{
$rec["dir"] = "Customizing/global/plugins/".$a_type."/".$a_name."/".$rec["name"];
$rec["dir_pres"] = "Customizing/global/plugins/<br />".$a_type."/".$a_name."/".$rec["name"];
$rec["lang_prefix"] = ilComponent::lookupId($a_type,$a_name)."_".$rec["id"]."_";
$ps[$rec["id"]] = $rec;
}
return $ps;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilComponent::setId (   $a_id)
final

Set Id.

Parameters
string$a_idId

Definition at line 71 of file class.ilComponent.php.

Referenced by __construct().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilComponent::setPluginSlots (   $a_pluginslots)
final

Set Plugin Slots.

Parameters
array$a_pluginslotsPlugin Slots

Definition at line 91 of file class.ilComponent.php.

Referenced by __construct().

{
$this->pluginslots = $a_pluginslots;
}

+ Here is the caller graph for this function:

ilComponent::setSubDirectory (   $a_subdirectory)

Set Sub Directory.

Parameters
string$a_subdirectorySub Directory

Definition at line 155 of file class.ilComponent.php.

{
$this->subdirectory = $a_subdirectory;
}

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