Loading...
 

Events

Events can be triggered in Tiki during execution of functions. A general usage is to trigger events in service controllers.
Events call a callback function
Events can be chained
Activities are triggered event instances that are configured to be recorded. Event instances are not automatically recorded (except for some basic events), you need to set up an activity rule if you want this to happen. Activities can be displayed in activity streams.
Events are not log entries.
Tiki events are defined in the source code, so if you want to setup a new event, you need to modify the definition file.

Definitions

Copy to clipboard
lib/setup/events.php


An event is definded as below:

event namea unique name for the event. Example: tiki.comment.update.
priorityAllows events to be forced to execute after others. For example, normal priorities may alter data, but indexing should not happen until all data has been modified. Default priority is 0. Priorities are numeric, false indicates that the event executes at all levels. This is used for chaining and happens transparently when using bind() with an event as the callback.
callback the name of the callback function to be executed.
arguments arguments to be passed to the callback function


When defining events it is important to bind and chain them (see function bind and bindPriority in the Library)
function bind binds an event at normal priority and handles event chaining.
function bindPriority binds the event at a specific priority
Binding can:

  • point to another event
  • defer to a library with a function within that library
  • call a service controller function
  • be delegated to another library/controller

Copy to clipboard
$events = TikiLib::events(); $defer = function ($lib, $function ) { return Tiki_Event_Lib::defer($lib, $function); }; //single binding to another event $events->bind('tiki.comment.post', 'tiki.comment.save'); //multiple binding by deferring to a library and a function within that library $events->bind('tiki.trackeritem.save', $defer('trk', 'update_tracker_summary')); $events->bind('tiki.trackeritem.save', $defer('trk', 'invalidate_item_cache')); // binding using a service controller $events->bind('tiki.trackeritem.create', ['Services_MustRead_Controller', 'handleItemCreation']); //delegated binding TikiLib::lib('goalevent')->bindEvents($events);

Library

Copy to clipboard
lib/core/Tiki/Event/Manager.php

How to use

In a service controller call the trigger function and supply the necessary inputs

Copy to clipboard
TikiLib::events()->trigger('tiki.comment.update', array( 'type' => $comment['objectType'], 'object' => $comment['object'], 'title' => $title, 'comment' => $threadId, 'user' => $GLOBALS['user'], 'content' => $data, 'index_handled' => true, ));

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Diagram
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw -superseded by Diagram
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Gantt
Group
Groupmail
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Kanban
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend
Terms and Conditions
Theme
TikiTests
Federated Timesheets
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools