<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* CiviCRM components
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
static $_contactSubTypes = NULL;
+ /**
+ * @param bool $force
+ *
+ * @return array|null
+ */
private static function &_info($force = FALSE) {
if (self::$_info == NULL || $force) {
self::$_info = array();
return self::$_info;
}
+ /**
+ * @param $name
+ * @param null $attribute
+ *
+ * @return mixed
+ */
static function get($name, $attribute = NULL) {
$comp = CRM_Utils_Array::value($name, self::_info());
if ($attribute) {
return $comp;
}
+ /**
+ * @param bool $force
+ *
+ * @return array
+ * @throws Exception
+ */
public static function &getComponents($force = FALSE) {
static $_cache = NULL;
return $_cache;
}
+ /**
+ * @param bool $force
+ *
+ * @return array|null
+ */
static public function &getEnabledComponents($force = FALSE) {
return self::_info($force);
}
self::getEnabledComponents(TRUE);
}
+ /**
+ * @param bool $translated
+ *
+ * @return array
+ */
public static function &getNames($translated = FALSE) {
$allComponents = self::getComponents();
return $names;
}
+ /**
+ * @param $args
+ * @param $type
+ *
+ * @return bool
+ */
static function invoke(&$args, $type) {
$info = self::_info();
$config = CRM_Core_Config::singleton();
return FALSE;
}
+ /**
+ * @return array
+ */
static function xmlMenu() {
// lets build the menu for all components
return $files;
}
+ /**
+ * @return array
+ */
static function &menu() {
$info = self::_info();
$items = array();
return $items;
}
+ /**
+ * @param $config
+ * @param bool $oldMode
+ */
static function addConfig(&$config, $oldMode = FALSE) {
$info = self::_info();
return;
}
+ /**
+ * @param $componentName
+ *
+ * @return mixed
+ */
static function getComponentID($componentName) {
$info = self::_info();
-
- return $info[$componentName]->componentID;
+ if (!empty($info[$componentName])) {
+ return $info[$componentName]->componentID;
+ }
+ else {
+ return;
+ }
}
+ /**
+ * @param $componentID
+ *
+ * @return int|null|string
+ */
static function getComponentName($componentID) {
$info = self::_info();
return $componentName;
}
+ /**
+ * @return array
+ */
static function &getQueryFields() {
$info = self::_info();
$fields = array();
return $fields;
}
+ /**
+ * @param $query
+ * @param $fnName
+ */
static function alterQuery(&$query, $fnName) {
$info = self::_info();
}
}
+ /**
+ * @param $fieldName
+ * @param $mode
+ * @param $side
+ *
+ * @return null
+ */
static function from($fieldName, $mode, $side) {
$info = self::_info();
return $from;
}
+ /**
+ * @param $mode
+ * @param bool $includeCustomFields
+ *
+ * @return null
+ */
static function &defaultReturnProperties($mode,
$includeCustomFields = TRUE
) {
return $properties;
}
+ /**
+ * @param $form
+ */
static function &buildSearchForm(&$form) {
$info = self::_info();
}
}
+ /**
+ * @param $row
+ * @param $id
+ */
static function searchAction(&$row, $id) {
$info = self::_info();
}
}
+ /**
+ * @return array|null
+ */
static function &contactSubTypes() {
if (self::$_contactSubTypes == NULL) {
self::$_contactSubTypes = array();
}
+ /**
+ * @param $subType
+ * @param $op
+ *
+ * @return null
+ */
static function &contactSubTypeProperties($subType, $op) {
$properties = self::contactSubTypes();
if (array_key_exists($subType, $properties) &&
return CRM_Core_DAO::$_nullObject;
}
+ /**
+ * FIXME: This function does not appear to do anything. The is_array() check runs on a bunch of objects and (always?) returns false
+ */
static function &taskList() {
$info = self::_info();
$tasks = array();
foreach ($info as $name => $value) {
- if (!empty($info[$name]['task'])) {
+ if (is_array($info[$name]) && isset($info[$name]['task'])) {
$tasks += $info[$name]['task'];
}
}