Manual widget, which open the online help from popups

This commit is contained in:
Ralf Becker 2005-11-09 16:56:23 +00:00
parent 80938c0aa7
commit 69ff4a066f
6 changed files with 109 additions and 2 deletions

View File

@ -0,0 +1,96 @@
<?php
/**************************************************************************\
* eGroupWare - eTemplate Extension - Manual Widget *
* http://www.egroupware.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/**
* eTemplate Extension: Manual widget
*
* This widget is an icon which opens the online help system (manual) in a popup.
*
* With the value or the name of the widget, you can specify a certain manual page
* (eg. ManualAddressbook). If both are empty the URL contains the referer
*
* @package etemplate
* @subpackage extensions
* @author RalfBecker-AT-outdoor-training.de
* @license GPL
*/
class manual_widget
{
/**
* exported methods of this class
* @var array $public_functions
*/
var $public_functions = array(
'pre_process' => True,
);
/**
* availible extensions and there names for the editor
*
* @var string/array $human_name
*/
var $human_name = 'Manual';
/**
* @var array
*/
/**
* Constructor of the extension
*
* @param string $ui '' for html
*/
function manual_widget($ui)
{
$this->ui = $ui;
}
/**
* pre-processing of the extension
*
* This function is called before the extension gets rendered
*
* @param string $name form-name of the control
* @param mixed &$value value / existing content, can be modified
* @param array &$cell array with the widget, can be modified for ui-independent widgets
* @param array &$readonlys names of widgets as key, to be made readonly
* @param mixed &$extension_data data the extension can store persisten between pre- and post-process
* @param object &$tmpl reference to the template we belong too
* @return boolean true if extra label is allowed, false otherwise
*/
function pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)
{
$link = array('menuaction' => 'manual.uimanual.view');
$page = $cell['name'] ? $cell['name'] : $value;
if (!empty($page))
{
$link['page'] = $page;
}
else
{
$link['referer'] = ($_SERVER['HTTPS'] ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
$link = $GLOBALS['egw']->link('/index.php',$link);
$cell['type'] = 'button';
$cell['size'] = 'manual-small';
$cell['onclick'] = "window.open('$link','manual','width=800,height=600,scrollbars=yes,resizable=yes'); return false;";
if (!$cell['label']) $cell['label'] = 'Manual';
if (!$cell['help']) $cell['help'] = /*lang(*/'Open the online help.'/*)*/;
if (!$cell['readonly'] && !isset($GLOBALS['egw_info']['user']['apps']['manual']))
{
$cell['readonly'] = true; // we disable / remove the button, if use has no run-rights for the manual
}
return False; // no extra label, label is tooltip for image
}
}

View File

@ -198,6 +198,12 @@
else
{
echo '<div id="divMain">'."\n";
if ($GLOBALS['egw_info']['user']['apps']['manual'])
{
$manual =& new etemplate('etemplate.popup.manual');
echo $manual->show(array());
unset($manual);
}
}
}
echo $GLOBALS['phpgw_info']['etemplate']['hook_content'].$html;

View File

@ -1,5 +1,5 @@
<?php
// eTemplates for Application 'etemplate', generated by soetemplate::dump4setup() 2005-11-05 18:01
// eTemplates for Application 'etemplate', generated by soetemplate::dump4setup() 2005-11-09 17:51
/* $Id$ */
@ -101,6 +101,8 @@ $templ_data[] = array('name' => 'etemplate.nextmatch_widget.nm_row','template' =
$templ_data[] = array('name' => 'etemplate.nextmatch_widget.nm_row','template' => '','lang' => '','group' => '0','version' => '1.0.0.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:9:{s:1:"A";s:2:"1%";s:1:"B";s:2:"1%";s:1:"C";s:3:"30%";s:1:"D";s:3:"30%";s:1:"F";s:3:"15%";s:1:"G";s:2:"5%";s:1:"H";s:2:"1%";s:1:"I";s:2:"1%";s:2:"c1";s:3:"nmh";}i:1;a:9:{s:1:"A";a:5:{s:4:"type";s:6:"button";s:4:"size";s:24:"first.gif,first-grey.gif";s:5:"label";s:5:"First";s:4:"name";s:5:"first";s:4:"help";s:21:"go to the first entry";}s:1:"B";a:5:{s:4:"type";s:6:"button";s:4:"size";s:22:"left.gif,left-grey.gif";s:5:"label";s:4:"Left";s:4:"name";s:4:"left";s:4:"help";s:34:"go to the previous page of entries";}s:1:"C";a:6:{s:4:"type";s:10:"select-cat";s:4:"size";s:2:"-1";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";s:8:"onchange";s:1:"1";s:4:"help";s:17:"select a Category";}s:1:"D";a:6:{s:4:"type";s:6:"select";s:5:"label";s:13:"@filter_label";s:5:"align";s:6:"center";s:4:"name";s:6:"filter";s:8:"onchange";s:1:"1";s:4:"help";s:12:"@filter_help";}s:1:"E";a:6:{s:4:"type";s:6:"select";s:5:"label";s:14:"@filter2_label";s:5:"align";s:5:"right";s:4:"name";s:7:"filter2";s:8:"onchange";s:1:"1";s:4:"help";s:13:"@filter2_help";}s:1:"F";a:5:{s:4:"type";s:4:"text";s:5:"align";s:5:"right";s:4:"name";s:6:"search";s:8:"onchange";s:1:"1";s:4:"help";s:28:"a pattern to be searched for";}s:1:"G";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Search";s:4:"name";s:12:"start_search";s:4:"help";s:19:"to start the search";}s:1:"H";a:5:{s:4:"type";s:6:"button";s:4:"size";s:24:"right.gif,right-grey.gif";s:5:"label";s:5:"Right";s:4:"name";s:5:"right";s:4:"help";s:30:"go to the next page of entries";}s:1:"I";a:5:{s:4:"type";s:6:"button";s:4:"size";s:22:"last.gif,last-grey.gif";s:5:"label";s:4:"Last";s:4:"name";s:4:"last";s:4:"help";s:20:"go to the last entry";}}}s:4:"rows";i:1;s:4:"cols";i:9;s:4:"size";s:11:"100%,,,,0,5";s:4:"span";s:11:",thinBorder";}}','size' => '100%,,,,0,5','style' => '.thinBorder { border: 1px solid black; }','modified' => '1113294054',);
$templ_data[] = array('name' => 'etemplate.popup.manual','template' => '','lang' => '','group' => '0','version' => '1.2','data' => 'a:1:{i:0;a:5:{s:4:"type";s:6:"manual";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"span";s:12:",popupManual";}}','size' => '','style' => '.popupManual { position: absolute; right: 27px; top: 32px; }','modified' => '1131553453',);
$templ_data[] = array('name' => 'etemplate.stack-test','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"deck";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:5:"label";s:5:"label";s:10:"Hallo Ralf";s:4:"name";s:4:"ralf";}i:2;a:3:{s:4:"type";s:5:"label";s:5:"label";s:10:"Hallo Welt";s:4:"name";s:4:"welt";}}}}s:4:"rows";i:1;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1047754314',);
$templ_data[] = array('name' => 'etemplate.tab_widget','template' => '','lang' => '','group' => '0','version' => '0.9.15.002','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:7:",bottom";s:2:"c2";s:7:"row_off";}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:5:"@tabs";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:5:"@body";}}}s:4:"rows";i:2;s:4:"cols";i:1;s:4:"size";s:11:"100%,,,,0,0";}}','size' => '100%,,,,0,0','style' => '.etemplate_tab { border-style:solid; border-width:1px 1px 0px; border-color:black; padding:3px; padding-left: 6px; padding-right: 6px; width: 60px; cursor: pointer; cursor: hand; }

View File

@ -109,7 +109,7 @@ displayed in statusline of browser if input-field gets focus etemplate de wird i
displayed in the top line of the groupbox (legend) etemplate de wird oben in der Umrandung der Gruppierung angezeigt (Legende)
do you want to save the changes you made in table %s? etemplate de Wollen Sie die Änderungen in der Tabelle '%s' speichern?
documentation etemplate de Dokumentation
doesn't matter etemplate de egal
doesn't matter etemplate de spielt keine Rolle
drop a table - this can not be undone etemplate de Tabelle löschen (drop) - NICHT rückgänig zu machen
drop table etemplate de Tabelle löschen
dump4setup etemplate de Dump4Setup
@ -239,6 +239,7 @@ number of rows/cols in a v/hbox, cellpadding, cellspacing etemplate de Anzahl Ze
of etemplate de von
onclick etemplate de onClick
only an other version found !!! etemplate de nur eine andere Version gefunden !!!
open the online help. etemplate de Öffnet die online Hilfe.
optional note about the link etemplate de optionale Notiz zur Verknüpfung
options etemplate de Optionen
order to navigating by tab key through the form etemplate de Reihenfolger bei der Navigation mit der Tabulator Taste durch das Formular

View File

@ -109,6 +109,7 @@ displayed in statusline of browser if input-field gets focus etemplate en displa
displayed in the top line of the groupbox (legend) etemplate en displayed in the top line of the groupbox (legend)
do you want to save the changes you made in table %s? etemplate en Do you want to save the changes you made in table %s?
documentation etemplate en Documentation
doesn't matter etemplate en doesn't matter
drop a table - this can not be undone etemplate en Drop a table - this can NOT be undone
drop table etemplate en Drop Table
dump4setup etemplate en Dump4Setup
@ -238,6 +239,7 @@ number of rows/cols in a v/hbox, cellpadding, cellspacing etemplate en number of
of etemplate en of
onclick etemplate en onClick
only an other version found !!! etemplate en only an other Version found !!!
open the online help. etemplate en Open the online help.
optional note about the link etemplate en optional note about the Link
options etemplate en Options
order to navigating by tab key through the form etemplate en Order to navigating by tab key through the form

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB