public function __construct($config = array()) { $rt = parent::__construct($config); MageBridgeModelDebug::getDebugOrigin(MageBridgeModelDebug::MAGEBRIDGE_DEBUG_ORIGIN_JOOMLA_JSONRPC); $this->debug = MageBridgeModelDebug::getInstance(); $this->app = JFactory::getApplication(); return $rt; }
public function event($authentication = array(), $event = '', $arguments = array()) { // Reset the debug-namespace to joomla MageBridgeModelDebug::getDebugOrigin(MageBridgeModelDebug::MAGEBRIDGE_DEBUG_ORIGIN_JOOMLA_XMLRPC); if ($this->authenticate($authentication) == false) { MageBridgeModelDebug::getInstance()->warning('XML-RPC plugin: Failed to start event ' . $event); return false; } if (!empty($event)) { MageBridgeModelDebug::getInstance()->trace('XML-RPC: firing mageEvent ', $event); //MageBridgeModelDebug::getInstance()->trace( 'XML-RPC: plugin arguments', $arguments ); JPluginHelper::importPlugin('magento'); $application = JFactory::getApplication(); $result = $application->triggerEvent($event, array($arguments)); // @todo: Translate result automatically into an array return true; } else { MageBridgeModelDebug::getInstance()->error('XML-RPC plugin: empty mageEvent'); return false; } }
public function event($params = array()) { // Parse the parameters $event = isset($params[0]) && is_string($params[0]) ? $params[0] : null; $arguments = isset($params[1]) && is_array($params[1]) ? $params[1] : array(); // Check if this call is valid if (empty($event)) { return false; } // Start debugging MageBridgeModelDebug::getDebugOrigin(MageBridgeModelDebug::MAGEBRIDGE_DEBUG_ORIGIN_JOOMLA_JSONRPC); MageBridgeModelDebug::getInstance()->trace('JSON-RPC: firing mageEvent ', $event); //MageBridgeModelDebug::getInstance()->trace( 'JSON-RPC: plugin arguments', $arguments ); // Initialize the plugin-group "magento" JPluginHelper::importPlugin('magento'); $application = JFactory::getApplication(); // Trigger the event and return the result $result = $application->triggerEvent($event, array($arguments)); if (!empty($result[0])) { return $result[0]; } else { return false; } }
/** * Constructor */ public function __construct() { MageBridgeModelDebug::getDebugOrigin(MageBridgeModelDebug::MAGEBRIDGE_DEBUG_ORIGIN_JOOMLA_JSONRPC); $this->debug = MageBridgeModelDebug::getInstance(); $this->app = JFactory::getApplication(); }