1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 * Help class to provide links to render help texts
8 * Render the help text calls to fetch
9 * translated help texts vis ajax calls.
12 * Entering <?php help::render('edit'); ?> somewhere on a page (view) will
13 * create a clickable icon that fetches the help text from the current
16 * By adding a second parameter to the call:
17 * <?php help::render('edit', 'extinfo'); ?> the information is instead
18 * fetched from the extinfo controller.
20 public static function render($key=false, $controller=false)
26 $img_path = url
::base(false).'application/views/icons/12x12/help.png';
28 $controller = !empty($controller) ?
$controller : Router
::$controller;
30 # build the element ID with random nr | controller | help key
31 $id = 'help_'.rand(0, 10000).'|'.$controller.'|'.$key;
33 return '<a class="helptext_target" style="border:0" id="'.$id.'" href="#">'.
34 '<img src="'.$img_path.'" title="'._('Click for help').'" alt="'._('Click for help').'" style="width: 12px; height: 12px; margin-bottom: -1px" /></a>';