[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare - eTemplate Extension - Manual Widget * 4 * http://www.egroupware.org * 5 * Written by Ralf Becker <RalfBecker@outdoor-training.de> * 6 * -------------------------------------------- * 7 * This program is free software; you can redistribute it and/or modify it * 8 * under the terms of the GNU General Public License as published by the * 9 * Free Software Foundation; either version 2 of the License, or (at your * 10 * option) any later version. * 11 \**************************************************************************/ 12 13 /* $Id: class.manual_widget.inc.php 19739 2005-11-11 08:49:06Z ralfbecker $ */ 14 15 /** 16 * eTemplate Extension: Manual widget 17 * 18 * This widget is an icon which opens the online help system (manual) in a popup. 19 * 20 * With the value or the name of the widget, you can specify a certain manual page 21 * (eg. ManualAddressbook). Additional params can be past to the manual app with 22 * $GLOBALS['egw_info']['flags']['params']['manual']. 23 * If no page is set after that two mechanisms the URL will contains the referer. 24 * 25 * @package etemplate 26 * @subpackage extensions 27 * @author RalfBecker-AT-outdoor-training.de 28 * @license GPL 29 */ 30 class manual_widget 31 { 32 /** 33 * exported methods of this class 34 * @var array $public_functions 35 */ 36 var $public_functions = array( 37 'pre_process' => True, 38 ); 39 /** 40 * availible extensions and there names for the editor 41 * 42 * @var string/array $human_name 43 */ 44 var $human_name = 'Manual'; 45 /** 46 * @var array 47 */ 48 49 /** 50 * Constructor of the extension 51 * 52 * @param string $ui '' for html 53 */ 54 function manual_widget($ui) 55 { 56 $this->ui = $ui; 57 } 58 59 /** 60 * pre-processing of the extension 61 * 62 * This function is called before the extension gets rendered 63 * 64 * @param string $name form-name of the control 65 * @param mixed &$value value / existing content, can be modified 66 * @param array &$cell array with the widget, can be modified for ui-independent widgets 67 * @param array &$readonlys names of widgets as key, to be made readonly 68 * @param mixed &$extension_data data the extension can store persisten between pre- and post-process 69 * @param object &$tmpl reference to the template we belong too 70 * @return boolean true if extra label is allowed, false otherwise 71 */ 72 function pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl) 73 { 74 $link = array('menuaction' => 'manual.uimanual.view'); 75 if (is_array($GLOBALS['egw_info']['flags']['params']['manual'])) 76 { 77 $link = array_merge($link,$GLOBALS['egw_info']['flags']['params']['manual']); 78 } 79 $page = $cell['name'] ? $cell['name'] : $value; 80 if (!empty($page)) 81 { 82 $link['page'] = $page; 83 } 84 if (!$link['page']) 85 { 86 $link['referer'] = ($_SERVER['HTTPS'] ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; 87 } 88 $link = $GLOBALS['egw']->link('/index.php',$link); 89 90 $cell['type'] = 'button'; 91 $cell['size'] = 'manual-small'; 92 $cell['onclick'] = "window.open('$link','manual','width=800,height=600,scrollbars=yes,resizable=yes'); return false;"; 93 if (!$cell['label']) $cell['label'] = 'Manual'; 94 if (!$cell['help']) $cell['help'] = /*lang(*/'Open the online help.'/*)*/; 95 96 if (!$cell['readonly'] && !isset($GLOBALS['egw_info']['user']['apps']['manual'])) 97 { 98 $cell['readonly'] = true; // we disable / remove the button, if use has no run-rights for the manual 99 } 100 return False; // no extra label, label is tooltip for image 101 } 102 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |