[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] manual index.php inc/hook_help.inc.php inc/clas...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] manual index.php inc/hook_help.inc.php inc/clas... |
Date: |
Wed, 25 Oct 2006 13:53:34 +0000 |
CVSROOT: /sources/phpgroupware
Module name: manual
Changes by: Sigurd Nes <sigurdne> 06/10/25 13:53:34
Modified files:
. : index.php
inc : hook_help.inc.php
Added files:
inc : class.help.inc.php class.help_helper.inc.php
class.uimanual.inc.php
templates/base/images: navbar.png title_overview.png
Log message:
We want manual - right?
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/manual/index.php?cvsroot=phpgroupware&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/manual/inc/hook_help.inc.php?cvsroot=phpgroupware&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/manual/inc/class.help.inc.php?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/manual/inc/class.help_helper.inc.php?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/manual/inc/class.uimanual.inc.php?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/manual/templates/base/images/navbar.png?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/manual/templates/base/images/title_overview.png?cvsroot=phpgroupware&rev=1.1
Patches:
Index: index.php
===================================================================
RCS file: /sources/phpgroupware/manual/index.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- index.php 17 Apr 2005 13:45:48 -0000 1.12
+++ index.php 25 Oct 2006 13:53:34 -0000 1.13
@@ -5,7 +5,7 @@
* @copyright Copyright (C) 2000-2002,2005 Free Software Foundation,
Inc. http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package manual
- * @version $Id: index.php,v 1.12 2005/04/17 13:45:48 powerstat Exp $
+ * @version $Id: index.php,v 1.13 2006/10/25 13:53:34 sigurdne Exp $
*/
$GLOBALS['phpgw_info']['flags'] = array
@@ -19,5 +19,5 @@
*/
include('../header.inc.php');
- $GLOBALS['phpgw']->common->phpgw_footer();
+ $GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' =>
'manual.uimanual.index') );
?>
Index: inc/hook_help.inc.php
===================================================================
RCS file: /sources/phpgroupware/manual/inc/hook_help.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- inc/hook_help.inc.php 17 Apr 2005 13:45:47 -0000 1.4
+++ inc/hook_help.inc.php 25 Oct 2006 13:53:34 -0000 1.5
@@ -5,16 +5,17 @@
* @copyright Copyright (C) 2000-2003,2005 Free Software Foundation,
Inc. http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package manual
- * @version $Id: hook_help.inc.php,v 1.4 2005/04/17 13:45:47 powerstat
Exp $
+ * @version $Id: hook_help.inc.php,v 1.5 2006/10/25 13:53:34 sigurdne
Exp $
*/
/**
* Include api setup
*/
+
include(PHPGW_SERVER_ROOT . '/' . 'phpgwapi' . '/setup/setup.inc.php');
$GLOBALS['phpgw']->help->set_params(array('app_name' =>
'manual',
-
'title' => phpGroupWare,
+
'title' => 'phpGroupWare',
'app_version' => $setup_info['phpgwapi']['version']));
$GLOBALS['phpgw']->help->data[] = array
Index: inc/class.help.inc.php
===================================================================
RCS file: inc/class.help.inc.php
diff -N inc/class.help.inc.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ inc/class.help.inc.php 25 Oct 2006 13:53:34 -0000 1.1
@@ -0,0 +1,285 @@
+<?php
+ /*******************************************************************\
+ * phpGroupWare API - help system manager *
+ * Written by Bettina Gille address@hidden *
+ * Manager for the phpGroupWare help system *
+ * Copyright (C) 2002, 2003 Bettina Gille *
+ * ----------------------------------------------------------------- *
+ * This library is part of the phpGroupWare API *
+ * http://www.phpgroupware.org *
+ * ----------------------------------------------------------------- *
+ * This library 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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
+ \*******************************************************************/
+ /* $Id: class.help.inc.php,v 1.1 2006/10/25 13:53:34 sigurdne Exp $ */
+
+ class help
+ {
+ var $lang;
+ var $app_name;
+ var $app_version;
+ var $app_id;
+ var $up;
+ var $down;
+ var $intro;
+ var $app_intro;
+ var $note;
+
+ var $extrabox;
+ var $xhelp;
+ var $listbox;
+
+ var $output;
+ var $data;
+
+ var $title;
+
+ /* This is the constructor for the object. */
+
+ function help($reset = False)
+ {
+ $this->lang =
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
+ $this->title = '';
+ $this->app_name = '';
+ $this->app_version = '';
+ $this->app_id = 0;
+
+ $this->up = '';
+ $this->down = '';
+ $this->intro = '';
+ $this->app_intro = '';
+ $this->note = '';
+
+ $this->extrabox = '';
+ $this->xhelp = '';
+ $this->listbox = '';
+ $this->data = array();
+
+ if (!$reset)
+ {
+ $this->output = array();
+ }
+
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('manual','base')
. SEP . 'help');
+ }
+
+ /*
+ Use these functions to get and set the values of this
+ object's variables. This is good OO practice, as it means
+ that datatype checking can be completed and errors raised
accordingly.
+ */
+ function setvar($var,$value='')
+ {
+ if ($value=='')
+ {
+ global $$var;
+ $value = $$var;
+ }
+ $this->$var = $value;
+ // echo $var." = ".$this->$var."<br>\n";
+ }
+
+ function getvar($var='')
+ {
+ if ($var=='' || !isset($this->$var))
+ {
+ echo 'Programming Error:
'.$this->getvar('classname').'->getvar('.$var.')!<br>'."\n";
+ $GLOBALS['phpgw_info']['flags']['nodisplay'] =
True;
+ exit;
+ }
+ //echo "Var = ".$var."<br>\n";
+ //echo $var." = ".$this->$var."<br>\n";
+ return $this->$var;
+ }
+
+ function start_template()
+ {
+ if ($this->app_name)
+ {
+
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('manual','base')
. SEP . 'help_data');
+ //
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir($this->app_name,'base')
. SEP . 'help_data');
+ }
+ }
+
+ function set_controls($type = 'app', $control='',
$control_url='')
+ {
+ switch($type)
+ {
+ case 'app':
+ if($control != '' && $control_url != '')
+ {
+
$this->setvar($control,$this->check_help_file($control_url));
+ }
+ break;
+ default:
+
$this->setvar('intro',$GLOBALS['phpgw']->link('/help.php'));
+
$this->setvar('app_intro',$GLOBALS['phpgw']->link('/help.php','app=' .
$this->app_name));
+
$this->setvar('note',$GLOBALS['phpgw']->link('/help.php','note=True'));
+ break;
+ }
+ }
+
+ function set_internal($extra_data = '')
+ {
+ if($extra_data !='')
+ {
+ $this->extrabox = $extra_data;
+ }
+ }
+
+ function set_xinternal($extra_data='')
+ {
+ if($extra_data !='')
+ {
+ $this->xhelp = $extra_data;
+ }
+ }
+
+ function draw_box()
+ {
+ $control_array = array
+ (
+ 'intro' => True
+ );
+
+ if($this->app_intro)
+ {
+ $control_array['app_intro'] = True;
+ }
+ if($this->up)
+ {
+ $control_array['up'] = True;
+ }
+ if($this->down)
+ {
+ $control_array['down'] = True;
+ }
+ $control_array['note'] = True;
+
+ //_debug_array($control_array);
+
+ @reset($control_array);
+ while(list($param,$value) = each($control_array))
+ {
+ if(isset($this->$param) && $this->$param)
+ {
+ $image_width = 15;
+
+ $control_link[] = array
+ (
+ 'param_url' =>
$this->$param,
+ 'link_img'
=> $GLOBALS['phpgw']->common->image('phpgwapi',$param.'_help'),
+ 'img_width'
=> $image_width,
+ 'lang_param_title' =>
lang($param)
+ );
+ }
+ }
+
+ if ($this->app_name == 'manual')
+ {
+ $logo_img =
$GLOBALS['phpgw']->common->image('phpgwapi','logo','',True);
+ }
+ else
+ {
+ $logo_img =
$GLOBALS['phpgw']->common->image($this->app_name,'navbar','',True);
+ }
+
+ $this->output['help_values'][] = array
+ (
+ 'img' => $logo_img,
+ 'title' => $this->title,
+ 'lang_version' => lang('version'),
+ 'version' => $this->app_version,
+ 'control_link' =>
(isset($control_link)?$control_link:''),
+ 'listbox' => $this->listbox,
+ 'extrabox' => $this->extrabox,
+ 'xhelp' => $this->xhelp
+ );
+ }
+
+ function check_file($file)
+ {
+ $check_file = PHPGW_SERVER_ROOT . $file;
+
+ if(@is_file($check_file))
+ {
+ return $file;
+ }
+ else
+ {
+ return '';
+ }
+ }
+
+ function check_help_file($file)
+ {
+ $lang = strtoupper($this->lang);
+
+ $help_file = $this->check_file('/' . $this->app_name .
'/help/'. $lang . '/' . $file);
+
+ if($help_file == '')
+ {
+ $help_file = $this->check_file('/' .
$this->app_name . '/help/EN/' . $file);
+ }
+
+ if ($help_file)
+ {
+ return $GLOBALS['phpgw']->link($help_file);
+ }
+
+ return False;
+ }
+
+ /*function display_manual_section($appname,$file)
+ {
+ $font = $GLOBALS['phpgw_info']['theme']['font'];
+ $navbar =
$GLOBALS['phpgw_info']['user']['preferences']['common']['navbar_format'];
+ $lang =
strtoupper($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']);
+ $GLOBALS['treemenu'][] = '..'.($navbar != 'text'?'<img
src="'.$GLOBALS['phpgw']->common->image($appname,'navbar').'" border="0"
alt="'.ucwords($appname).'">':'').($navbar != 'icons'?'<font
face="'.$font.'">'.lang($appname).'</font>':'').'|'.$GLOBALS['phpgw']->link('/'.$appname.'/help/index.php');
+
+ $help_file = check_help_file($appname,$lang,$appname.'.php');
+ if($help_file != '')
+ {
+ $GLOBALS['treemenu'][] = '...<font
face="'.$font.'">'.lang('Overview').'</font>|'.$GLOBALS['phpgw']->link($help_file);
+ }
+ while(list($title,$filename) = each($file))
+ {
+ $help_file = check_help_file($appname,$lang,$filename);
+ if($help_file != '')
+ {
+ $GLOBALS['treemenu'][] = '...<font
face="'.$font.'">'.lang($title).'</font>|'.$GLOBALS['phpgw']->link($help_file);
+ }
+ }
+ }
+
+ function show_menu($expandlevels)
+ {
+ $menutree = CreateObject('phpgwapi.menutree','text');
+ $menutree->set_lcs(300);
+
+ $str = '<table cellpadding="10" width="20%"><td>';
+ $str .= '<font
face="'.$GLOBALS['phpgw_info']['theme']['font'].'" size="2">';
+ $str .= 'Note: Some of this information is out of date<br>';
+
+ $GLOBALS['treemenu'] = Array();
+
+
$GLOBALS['phpgw']->hooks->process('manual',array('manual','preferences'));
+
+ reset($GLOBALS['treemenu']);
+
+ $str .=
$menutree->showtree($GLOBALS['treemenu'],$expandlevels).'</td></table>';
+
+ return $str;
+ }*/
+ }
+?>
Index: inc/class.help_helper.inc.php
===================================================================
RCS file: inc/class.help_helper.inc.php
diff -N inc/class.help_helper.inc.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ inc/class.help_helper.inc.php 25 Oct 2006 13:53:34 -0000 1.1
@@ -0,0 +1,103 @@
+<?php
+ /*******************************************************************\
+ * phpGroupWare API - help system manager *
+ * Written by Bettina Gille address@hidden *
+ * Manager for the phpGroupWare help system *
+ * Copyright (C) 2002, 2003 Bettina Gille *
+ * ----------------------------------------------------------------- *
+ * This library is part of the phpGroupWare API *
+ * http://www.phpgroupware.org *
+ * ----------------------------------------------------------------- *
+ * This library 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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
+ \*******************************************************************/
+ /* $Id: class.help_helper.inc.php,v 1.1 2006/10/25 13:53:34 sigurdne
Exp $ */
+
+ CreateObject('manual.help');
+
+ class help_helper extends help
+ {
+ function help_helper()
+ {
+ $this->help();
+ }
+
+ function set_params($param)
+ {
+ $this->help(True);
+ @reset($param);
+ while(list($key,$value) = each($param))
+ {
+ if($key != 'title')
+ {
+ //echo 'Setting
'.$key.':'.$value."<br>\n";
+ $this->setvar($key,$value);
+ }
+ }
+ $this->title = $param['title'];
+
+ if(isset($param['controls']) &&
is_array($param['controls']))
+ {
+ while(list($key,$value) =
each($param['controls']))
+ {
+ $this->set_controls('app',$key,$value);
+ }
+ $this->set_controls('base');
+ }
+ }
+
+ function draw($extra_data='')
+ {
+ if(is_array($this->data) && !empty($this->data))
+ {
+ for ($x = 0; $x < count($this->data); $x++)
+ {
+ $var[] = array
+ (
+ 'text'
=> $this->data[$x]['text'],
+ 'link'
=> $this->data[$x]['link'],
+ 'lang_link_statustext' =>
$this->data[$x]['lang_link_statustext']
+ );
+ }
+ $this->listbox = $var;
+ }
+ $this->set_internal($extra_data);
+ $this->draw_box();
+ }
+
+ function xdraw($extra_data='')
+ {
+ if ($extra_data)
+ {
+ $this->start_template();
+ }
+
+ if(is_array($this->data) && !empty($this->data))
+ {
+ for ($x = 0; $x < count($this->data); $x++)
+ {
+ $var[] = array
+ (
+ 'text'
=> $this->data[$x]['text'],
+ 'link'
=> $this->data[$x]['link'],
+ 'lang_link_statustext' =>
$this->data[$x]['lang_link_statustext']
+ );
+ }
+ $this->listbox = $var;
+ }
+ $this->set_xinternal($extra_data);
+ $this->draw_box();
+ }
+ }
+?>
Index: inc/class.uimanual.inc.php
===================================================================
RCS file: inc/class.uimanual.inc.php
diff -N inc/class.uimanual.inc.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ inc/class.uimanual.inc.php 25 Oct 2006 13:53:34 -0000 1.1
@@ -0,0 +1,69 @@
+<?php
+ /**
+ * phpGroupWare - property: a Facilities Management System.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package property
+ * @subpackage admin
+ * @version $Id: class.uimanual.inc.php,v 1.1 2006/10/25 13:53:34
sigurdne Exp $
+ */
+
+ /**
+ * Description
+ * @package property
+ */
+
+ class uimanual
+ {
+ var $grants;
+ var $start;
+ var $query;
+ var $sort;
+ var $order;
+ var $sub;
+ var $currentapp;
+
+ var $public_functions = array
+ (
+ 'index' => True
+ );
+
+ function uimanual()
+ {
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+ $GLOBALS['phpgw']->help =
CreateObject('manual.help_helper');
+
+ $this->currentapp =
get_var('app',array('POST','GET'));
+
+ if (!$this->currentapp)
+ {
+ $this->currentapp = 'help';
+ }
+ }
+
+ function index()
+ {
+
+ if ($this->currentapp == 'help')
+ {
+
$GLOBALS['phpgw']->hooks->process('help',array('manual'));
+ }
+ else
+ {
+
$GLOBALS['phpgw']->hooks->single('help',$this->currentapp);
+ }
+
+ $appname = lang('Help');
+ $function_msg = lang($this->currentapp);
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
$appname . ' - ' . $appname;
+
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('help' =>
$GLOBALS['phpgw']->help->output));
+
+ }
+
+ }
+?>
Index: templates/base/images/navbar.png
===================================================================
RCS file: templates/base/images/navbar.png
diff -N templates/base/images/navbar.png
Binary files /dev/null and /tmp/cvskqlc38 differ
Index: templates/base/images/title_overview.png
===================================================================
RCS file: templates/base/images/title_overview.png
diff -N templates/base/images/title_overview.png
Binary files /dev/null and /tmp/cvsdKOvs9 differ
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] manual index.php inc/hook_help.inc.php inc/clas...,
Sigurd Nes <=