/** * Fire onContentPrepare for content that isn't part of an article. * * @param string $text The content to be transformed. * @param array $params The content params. * @param string $context The context of the content to be transformed. * * @return string The content after transformation. * * @since 11.1 */ public static function prepare($text, $params = null, $context = 'text') { if ($params === null) { $params = new Object(); } $article = new stdClass(); $article->text = $text; Helper::importPlugin('content'); $dispatcher = Dispatcher::getInstance(); $dispatcher->trigger('onContentPrepare', array($context, &$article, &$params, 0)); return $article->text; }
/** * Authorises that a particular user should be able to login * * @param AuthenticationResponse $response response including username of the user to authorise * @param array $options list of options * * @return array[AuthenticationResponse] results of authorisation * * @since 11.2 */ public static function authorise($response, $options = array()) { // Get plugins in case they haven't been imported already Helper::importPlugin('user'); Helper::importPlugin('authentication'); $dispatcher = Dispatcher::getInstance(); $results = $dispatcher->trigger('onUserAuthorisation', array($response, $options)); return $results; }
/** * Method to delete the JUser object from the database * * @return boolean True on success * * @since 11.1 */ public function delete() { PluginHelper::importPlugin('user'); // Trigger the onUserBeforeDelete event $dispatcher = Dispatcher::getInstance(); $dispatcher->trigger('onUserBeforeDelete', array($this->getProperties())); // Create the user table object $table = $this->getTable(); $result = false; if (!($result = $table->delete($this->id))) { $this->setError($table->getError()); } // Trigger the onUserAfterDelete event $dispatcher->trigger('onUserAfterDelete', array($this->getProperties(), $result, $this->getError())); return $result; }