/** * Triggered on Open Graph data preparation for contest, entry or category (view). * * @paramstring $context Event context. * @paramobject $item Item: contest, entry or category. * @paramobject $ogObject Object with Open Graph data. * @paramarray $options Array of additional options like Twitter card types. */publicfunctiononOpenGraphPrepare($context, $item, $ogObject,&$options){if ($context !='com_competition.competition'&& $context !='com_competition.participant'&& $context !='com_competition.category'||!\Joomla\CMS\Factory::getApplication()->app->isClient('site')) {return; } $ogObject->title =empty($item->title)? $context : $item->title .' - '. $context; $ogObject->description ='onOpenGraphPrepare is working fine'; $options['twitter_card'] ='summary_large_image';}
onSaveRedirect
/** * Triggered on entry or contest form save (controller). * com_competition.appform - entry form context. * com_competition.cform - contest form context. * * @paramstring $context Event context. * @paramstring $url URL to redirect. * @paramstring $msg System message to display. * @paramarray $validData Validated form data. */publicfunctiononSaveRedirect($context,&$url,&$msg, $validData){if ($context !='com_competition.appform'&& $context !='com_competition.cform'||!\Joomla\CMS\Factory::getApplication()->app->isClient('site')) {return; } $url =\Joomla\CMS\Uri\Uri::root(); $msg ='onSaveRedirect is working fine for '. $context;}
onUserAuthorise
The event can be triggered anywhere in the component and allows the plugins to override JUser::authorise result in case it is not true. If the plugin returns true then action is allowed. Currently plugins can override only core.vote and core.unvote actions.
/** * Event can be triggered anywhere in the component. * * @paramobject $user Reference to JUser object. * @paramstring $action Name of the action to check for permission, like 'core.vote'. * @paramobject $assetname Name of the asset on which to perform the action, like 'com_competition.competition.1'. */publicfunctiononUserAuthorise($user, $action, $assetname){// Allow actionreturn;}