NorrCompetition | NorrNext Documentation
DocumentationNorrCompetition
  • 🚀Getting started
    • Technical Requirements
    • Installation and Updates
  • 🛠️Configuration
    • Component Options
    • General
    • Contests
    • Contest
    • Entries
    • Entry
    • Categories
    • Category
    • Images
    • Comments
    • Contest Form
    • Permissions
  • 🖼️Contests
    • Managing Contests
    • Creating Contest
    • Contest Layout Options
    • Closing Contest
  • 🏆Entries
    • Managing Entries
    • Adding Entry
    • Approving Entry
    • Entry Data Comparison
    • Entry Layout Options
    • Submitting Entry Form
    • Contestant's Profile
    • Votes Log
  • 📂Categories
    • General Information
    • Managing Categories
    • Creating Category
    • Category Layout Options
  • 🧩Fields
    • General Information
    • Managing Fields
    • Field Types
    • Creating Field
  • 🔋Modules
    • NorrCompetition Entries
    • NorrCompetition Contests
    • NorrCompetition Grid
  • 🔌Plugins
    • NorrCompetition Notifications
    • NorrCompetition Smart Search
    • NorrCompetition Search
    • NorrCompetition Sitemap
    • NorrCompetition Profile Link
    • Application for EasySocial
    • NorrCompetition Application for JomSocial
    • AUP plugin for NorrCompetition
    • NorrCompetition Image Moderation
      • Sightengine Setup
      • Plugin Configuration
  • 💬Comments
    • Integration with Facebook
    • Integration with JComments
    • Integration with Komento
    • Integration with Disqus
    • Integration with VK.com
  • ☁️Remote Storage
    • General Information
    • AWS S3
  • 🖥️Customisation
    • Template Overriding
    • Using content plugins on entry page
    • Link to contestant
    • Events
      • Content
      • Contest
      • Entry
      • Entry Form
      • Field
      • Vote
      • Other
  • ✍️Localisation
    • Language pack installation
    • How to take a part in NorrCompetition localisation
  • 📜Best Practices
    • Recommendations on image sizes
    • Use on multilingual sites
    • Tutorial: How to Create Photo/Video Voting Contest on Joomla
    • Tutorial: Monetize Voting Contests via Membership
    • Tutorial: Monetize Voting Contests via Points
    • Embedding HTML snippets on example of music contest
  • 💡FAQ
    • How the protection from unfair voting is implemented?
    • What notifications does the component send?
    • Create and edit contests on front-end
    • Submitting Entries by Unregistered Users
    • How to install sample data
    • How to change the order of tabs with comments
    • Using navigation module (breadcrumbs)
    • NorrCompetition and YOOtheme Pro
  • 🔍Troubleshooting
    • I do not get notifications from NorrCompetition
    • I get an error or white screen on photo upload
    • No images appear after submitting entries
    • Submit button is not working
  • User is not able to vote. Errors in the console
Powered by GitBook
On this page
  • onOpenGraphPrepare
  • onSaveRedirect
  • onUserAuthorise
  1. Customisation
  2. Events

Other

Events that does not have a specific context.

onOpenGraphPrepare

/**
 * Triggered on Open Graph data preparation for contest, entry or category (view).
 *
 * @param   string  $context   Event context.
 * @param   object  $item      Item: contest, entry or category.
 * @param   object  $ogObject  Object with Open Graph data.
 * @param   array   $options   Array of additional options like Twitter card types.
 */
public function onOpenGraphPrepare($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.
 *
 * @param   string  $context    Event context.
 * @param   string  $url        URL to redirect.
 * @param   string  $msg        System message to display.
 * @param   array   $validData  Validated form data.
 */
public function onSaveRedirect($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.
 *
 * @param   object  $user       Reference to JUser object.
 * @param   string  $action     Name of the action to check for permission, like 'core.vote'.
 * @param   object  $assetname  Name of the asset on which to perform the action, like 'com_competition.competition.1'.
 */
public function onUserAuthorise($user, $action, $assetname)
{
	// Allow action
	return;
}
PreviousVoteNextLanguage pack installation

Last updated 2 years ago

🖥️