/** * @static * @param unknown_type $type * @return JD_Action instance :0 */ function &getInstance($type = null) { static $instances = array(); if (empty($type)) { return $instances; } $type = JFolder::makeSafe($type); if (empty($instances[$type])) { JD_Action::_loadActions(); $className = 'JD_' . $type . '_Action'; if (class_exists($className)) { $instances[$type] = new $className(); } else { JError::raiseWarning(0, JText::_('Cannot instanciate action class') . ': ' . 'jd_' . $type . '_action'); return null; } } return $instances[$type]; }