/** * Factory method: Get the action * @param string $type * @return JD_Action the action */ function &_getAction($type) { $action =& JD_Action::getInstance($type); return $action; }
/** * This method can receive both single integer value, and an array */ function _getAction() { global $mainframe; JRequest::checkToken() or die('Invalid token'); $logId = JRequest::getInt('id'); $logIds = JRequest::getVar('cid', array(), 'default', 'array'); if (!empty($logIds)) { JArrayHelper::toInteger($logIds); $logId = reset($logIds); } else { $logIds = array($logId); } // Check the log $logRecord =& JTable::getInstance('Log', 'Table'); if (!$logRecord->load($logId)) { JError::raiseError(404, JText::_('Cannot find log')); return false; } $action =& JD_Action::getInstance($logRecord->type); if (empty($action)) { JError::raiseError(404, JText::_('Cannot find action for type') . ': ' . $logRecord->type); return array(false, false); } return array(&$action, $logIds); }