Loading...
 

Feedback

This page documents the method used starting with Tiki16 to provide feedback to users on the page, for example to indicate an action was successfully completed, to give a warning, a note, or indicate an error has occurred. Previously a variety of methods have been used, including use of ErrorReportLib for some errors. Starting with Tiki16, the Feedback class is used (at lib/core/Feedback.php ) to centralize and standardize the coding used for providing feedback to the user.

Server side

Adding Feedback

Typically, all that a developer needs to do is add a command in the PHP file where the feedback is generated. For example:

Feedback::success(tr('Your action was successful.'));

The feedback will then be automatically be displayed at the top of the page when displayed.

Feedback types

Below or the standard feedback types available along with default settings:

Type Title Icon
error Error
note Note
success Success
warning Warning

Each one of these is a function (e.g., Feedback::error($feedback)). The generic function add can also be used if customization is needed. The {remarksbox} smarty function is used to add the alert formatting, icons and colors.

Feedback options

The above functions require at least a string message as a parameter, but an array can also be used to provide multiple messages and other parameters. If an array is used, the message or messages must be in the array key mes . Other parameters that can be set in the array are type , title , and icon (each of these being the array key that must be used).

The tpl option can be set to specify a Smarty template other than the default one (at templates/feedback/default.tpl ). The value used for this array key needs to be the same as the name of the template file in the feedback directory. For example, 'tpl' => 'pref' , will cause templates/feedback/pref.tpl to be used.

Display options

A second parameter with the value session can also be added if the feedback needs to be added through the PHP global $_SESSION variable instead of through a Smarty template variable. This may be necessary if the page is redirected from the file where the feedback originated.

Feedback through ajax

Use the send_headers function right after adding feedback to send feedback using ajax. For example:

Feedback::warning(tr('Your input may not be valid'), 'session');
Feedback::send_headers();

Retrieving and displaying feedback (non-ajax)

This part works automatically as follows:

  • The base layout_view.tpl templates used to display tiki pages contain the {feedback} Smarty function
  • This function does the following:
    • Retrieves the feedback from the $_SESSION['tikifeedback'] PHP global variable or the Smarty {$tikifeedback} template variable.
    • Assigns or reassigns the feedback to the Smarty {$tikifeedback} variable
      • Note that there is no need for a developer to set the {$tikifeedback} Smarty variable - this is done automatically in this step
    • Fetches the feedback display template for display

Client side

A javascript feedback function (in lib/jquery_tiki/tiki-jquery.js ) can be used if a pure client-side method is needed. It has the same parameters as described above for the server side method, plus a modal parameter that sets whether the feedback is sent to a popup modal or is sent to the div#tikifeedback element that is on every page.

Areas where Feedback has not been implemented

Below are areas where this Feedback could possibly be used but where it has not yet been implemented, usually because of additional complexities.

  • $_SESSION[tiki_importer_errors]
  • $_SESSION[tiki_importer_feedback]
  • $_SESSION[tiki_importer_log]
  • footer.tpl
  • module errors
  • messu-broadcast.php
  • tiki-accounting*.php
  • tiki-share.php
  • $page_badchars_display in a few templates (eg, tiki-copypage.tpl and tiki-rename_page.tpl )

Contributors to this page: lindon .
Page last modified on Friday 24 November, 2017 22:03:44 GMT-0000 by lindon.

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
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Group
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
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, alert + Social Bookmarking
Terms and Conditions
Theme
TikiTests
Timesheet
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