public function getResource($name, $enabledOnly = true) { $resourceData = xapp_get_option(self::RESOURCES_DATA, $this); if ($resourceData !== null) { $resourceItem = (array) xapp_object_find($resourceData, '.items', array('class=' . 'cmx.types.Resource', 'name=' . $name, 'type=' . xo_get(self::RESOURCES_TYPE, $this), 'enabled=' . $enabledOnly)); if (count($resourceItem) && is_object($resourceItem[0])) { return $resourceItem[0]; } } return null; }
public static function isLocal($name, $resourceData) { $nameIn = '' . str_replace('/', '', $name); if ($resourceData !== null) { $resourceItem = (array) xapp_object_find($resourceData, '.items', array('class=' . 'cmx.types.Resource', 'type=' . XAPP_RESOURCE_TYPE_FILE_PROXY, 'name=' . $nameIn, 'enabled=' . true)); if (count($resourceItem) && is_object($resourceItem[0])) { return $resourceItem[0]; } } return null; }
public static function getResourceByName($name, $resourceData) { $nameIn = '' . str_replace('/', '', $name); if ($resourceData !== null) { $resourceItem = (array) xapp_object_find($resourceData, '.items', array('class=' . 'cmx.types.Resource', 'name=' . $nameIn, 'enabled=' . true)); if (count($resourceItem) && is_object($resourceItem[0])) { return $resourceItem[0]; } } return null; }
public function getPluginInfos($searchPath, $type) { $result = array(); //scan for plugin configs $foundPlugins = $this->getEnabledPluginsConfigs($searchPath); if ($foundPlugins != null && count($foundPlugins) > 0) { $res = (array) xapp_object_find($foundPlugins, '.', array('type=' . $type)); if ($res && count($res) > 0) { //now iterate over plugin configs foreach ($res as $pluginConfig) { array_push($result, $pluginConfig); } } } return $result; }
public function getResourcesByType($type, $enabledOnly = true) { $resourceData = xapp_get_option(self::RESOURCES_DATA, $this); if ($resourceData !== null) { $resourceItems = (array) xapp_object_find($resourceData, '.items', array('class=' . 'cmx.types.Resource', 'type=' . $type, 'enabled=' . $enabledOnly)); if ($resourceItems != null && count($resourceItems)) { return $resourceItems; } } return null; }