[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] etemplate index.php phpGtk_test.php process_exe...
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] etemplate index.php phpGtk_test.php process_exe... |
Date: |
Wed, 06 Sep 2006 11:13:31 +0000 |
CVSROOT: /cvsroot/phpgroupware
Module name: etemplate
Changes by: Dave Hall <skwashd> 06/09/06 11:13:30
Modified files:
. : index.php phpGtk_test.php process_exec.php
doc : etemplate.html referenz.html
doc/et_media : index.php
doc/et_media/inc: class.et_media.inc.php
doc/et_media/setup: setup.inc.php
doc/et_notes : index.php
doc/et_notes/inc: class.bo.inc.php class.so.inc.php
class.ui.inc.php hook_add_def_pref.inc.php
hook_admin.inc.php hook_deleteaccount.inc.php
doc/et_notes/setup: setup.inc.php tables_current.inc.php
inc : class.boetemplate.inc.php
class.date_widget.inc.php
class.db_tools.inc.php class.editor.inc.php
class.etemplate.inc.php class.html.inc.php
class.link_widget.inc.php
class.nextmatch_widget.inc.php
class.sbox2.inc.php class.select_widget.inc.php
class.so_sql.inc.php class.soetemplate.inc.php
class.solangfile.inc.php
class.tab_widget.inc.php
class.uietemplate.inc.php
class.uietemplate_gtk.inc.php
class.xmltool.inc.php class.xslt_widget.inc.php
class.xul_io.inc.php get_var.php
setup : etemplates.inc.php setup.inc.php
tables_baseline.inc.php tables_current.inc.php
tables_update.inc.php
Log message:
code cleanup, merge my simple mods, update docs and headers
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/etemplate/index.php?cvsroot=phpgroupware&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/etemplate/phpGtk_test.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/etemplate/process_exec.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/etemplate.html?cvsroot=phpgroupware&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/referenz.html?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_media/index.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_media/inc/class.et_media.inc.php?cvsroot=phpgroupware&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_media/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/index.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/inc/class.bo.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/inc/class.so.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/inc/class.ui.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/inc/hook_add_def_pref.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/inc/hook_admin.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/inc/hook_deleteaccount.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/etemplate/doc/et_notes/setup/tables_current.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.boetemplate.inc.php?cvsroot=phpgroupware&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.date_widget.inc.php?cvsroot=phpgroupware&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.db_tools.inc.php?cvsroot=phpgroupware&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.editor.inc.php?cvsroot=phpgroupware&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.etemplate.inc.php?cvsroot=phpgroupware&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.html.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.link_widget.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.nextmatch_widget.inc.php?cvsroot=phpgroupware&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.sbox2.inc.php?cvsroot=phpgroupware&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.select_widget.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.so_sql.inc.php?cvsroot=phpgroupware&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.soetemplate.inc.php?cvsroot=phpgroupware&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.solangfile.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.tab_widget.inc.php?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.uietemplate.inc.php?cvsroot=phpgroupware&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.uietemplate_gtk.inc.php?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.xmltool.inc.php?cvsroot=phpgroupware&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.xslt_widget.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/class.xul_io.inc.php?cvsroot=phpgroupware&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/etemplate/inc/get_var.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/setup/etemplates.inc.php?cvsroot=phpgroupware&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/etemplate/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/etemplate/setup/tables_baseline.inc.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/etemplate/setup/tables_current.inc.php?cvsroot=phpgroupware&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/etemplate/setup/tables_update.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
Patches:
Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/index.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- index.php 21 Apr 2003 08:39:10 -0000 1.4
+++ index.php 6 Sep 2006 11:13:30 -0000 1.5
@@ -1,16 +1,19 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplates - Editor
*
+ /**********************************************************************\
+ * phpGroupWare - eTemplate *
* http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
* --------------------------------------------
*
- * 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: index.php,v 1.4 2003/04/21 08:39:10 ralfbecker Exp $ */
+ * 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: index.php,v 1.5 2006/09/06 11:13:30 skwashd Exp $ */
$GLOBALS['phpgw_info']['flags'] = array(
'currentapp' => 'etemplate',
Index: phpGtk_test.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/phpGtk_test.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- phpGtk_test.php 28 Sep 2002 20:01:43 -0000 1.3
+++ phpGtk_test.php 6 Sep 2006 11:13:30 -0000 1.4
@@ -1,18 +1,21 @@
-#!/usr/local/bin/php -q
+#!/usr/bin/php -q
<?php
-
/**************************************************************************\
- * phpGroupWare - EditableTemplates - GTK User Interface
*
+ /**********************************************************************\
+ * phpGroupWare - eTemplate *
* http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
* --------------------------------------------
*
- * 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: phpGtk_test.php,v 1.3 2002/09/28 20:01:43 seek3r Exp $ */
+ * 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: phpGtk_test.php,v 1.4 2006/09/06 11:13:30 skwashd Exp $ */
//echo "Hello World!!!\n";
Index: process_exec.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/process_exec.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- process_exec.php 3 Oct 2002 10:31:24 -0000 1.3
+++ process_exec.php 6 Sep 2006 11:13:30 -0000 1.4
@@ -1,19 +1,24 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplates - process_exec
*
+ /**********************************************************************\
+ * phpGroupWare - eTemplate *
* http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
* --------------------------------------------
*
- * 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.
*
-
\**************************************************************************/
+ * 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: process_exec.php,v 1.4 2006/09/06 11:13:30 skwashd Exp $ */
- /* $Id: process_exec.php,v 1.3 2002/10/03 10:31:24 ralfbecker Exp $ */
+ list($app) = explode('.',$_GET['menuaction']);
$GLOBALS['phpgw_info']['flags'] = array(
- 'currentapp' =>
$GLOBALS['HTTP_POST_VARS']['etemplate_exec_app'],
+ 'currentapp' => $app,
'noheader' => True,
'nonavbar' => True
);
Index: doc/etemplate.html
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/etemplate.html,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- doc/etemplate.html 8 Aug 2003 16:20:16 -0000 1.19
+++ doc/etemplate.html 6 Sep 2006 11:13:30 -0000 1.20
@@ -1,5 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- $Id: etemplate.html,v 1.19 2003/08/08 16:20:16 ralfbecker Exp $ -->
+<!-- $Id: etemplate.html,v 1.20 2006/09/06 11:13:30 skwashd Exp $ -->
<html>
<head>
<title>phpGroupware: eTemplates - Templates and Dialog-Editor</title>
@@ -15,6 +15,7 @@
<body>
<h1>eTemplate - Templates and Dialog-Editor for phpGroupware</h1>
<h3>by Ralf Becker <a href="#"
onClick="document.location='mai'+'lto:RalfBecker'+unescape('%40')+'outdoor-training'+unescape('%2E')+'de';
return false;">RalfBecker AT outdoor-training DOT de</a></h3>
+<p>© Copyright 2002, 2003 Free Software Foundation Inc.</p>
<p>A developers tutorial how to write an application with the new
eTemplates.<br>
It is also an introduction how to write a phpgw- and setup(3)-compatible
app.</p>
<hr>
Index: doc/referenz.html
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/referenz.html,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- doc/referenz.html 29 Jun 2003 17:00:05 -0000 1.13
+++ doc/referenz.html 6 Sep 2006 11:13:30 -0000 1.14
@@ -2,7 +2,7 @@
<html>
<head>
<title>phpGroupware: eTemplate-Referenz</title>
-<!-- $Id: referenz.html,v 1.13 2003/06/29 17:00:05 ralfbecker Exp $ -->
+<!-- $Id: referenz.html,v 1.14 2006/09/06 11:13:30 skwashd Exp $ -->
<STYLE type="text/css">
<!--
pre { font-family: monospace; background-color: #e0e0e0; padding: 2mm;
border-width: thin; border-style: solid; border-color: black; white-space: pre;
}
@@ -15,6 +15,7 @@
<body>
<h1>eTemplate-Referenz - Templates and Dialog-Editor for phpGroupware</h1>
<h3>by Ralf Becker <a href="#"
onClick="document.location='mai'+'lto:RalfBecker'+unescape('%40')+'outdoor-training'+unescape('%2E')+'de';
return false;">RalfBecker AT outdoor-training DOT de</a></h3>
+<p>© Copyright 2002, 2003 Free Software Foundation Inc.</p>
<p>A referenz documentation about the new eTemplates and the <a
href="#referenz">syntax and parameters</a>
of the several widgets.</p>
<hr>
@@ -36,7 +37,7 @@
<a href="show.gif">show-function</a>):</p>
<pre>
<?xml version="1.0"?>
-<span><!-- $Id: referenz.html,v 1.13 2003/06/29 17:00:05 ralfbecker Exp $
--></span>
+<span><!-- $Id: referenz.html,v 1.14 2006/09/06 11:13:30 skwashd Exp $
--></span>
<overlay>
<grid id="et_media.edit" template="" lang="" group="" version=""
width="100%">
<columns>
@@ -320,7 +321,7 @@
<td><b>Disabled</b><br>column-attr.<br>row-attr.</td>
<td>disabled</td>
<td>no</td>
- <td> </td>
+ <td>disabled</td>
<td>
Syntax: <b>address@hidden|address@hidden|value2}]</b><br>
Disables (=dont show it) a row/column if a certain criteria is
(not (=!)) meet.<br>
@@ -345,6 +346,18 @@
or 'bottom'
</td>
</tr>
+<tr>
+ <td><b>blurText</b></td>
+ <td>blur</td>
+ <td>no</td>
+ <td>blur</td>
+ <td>
+ This text get displayed if an input-field is empty <u>and</u>
does not have the
+ input-focus (blur). It can be used to show a default value or a
kind of help-text.<br>
+ If it contains a text (eg. 'Search...'), this text is run
through lang(), if it contains
+ a reference to the content array (eg. '@blur_text') it does
<u>not</u> get translated.
+ </td>
+</tr>
</table>
<a name="widgets">
@@ -548,7 +561,9 @@
years from now or if > 100 a absolut year)<br>
<b>select-number</b>:<br>
Select a number out of a range specified by the
options-field:<br>
- ,{start (default=1)},{end (incl.,
default=10)},{decrement (default=1)}<br>
+ ,{start (default=1)},{end (incl.,
default=10)},{decrement (default={padding zeros}1)}.<br>
+ Example with padding zeros: options=',0,59,05'
will give values: 00, 05, 10, ..., 55
+ (like you would use it for minutes in a
time-field)<br>
<b>select-app</b>:<br>
Select an application, availible options:
,{''=user enabled(default)|installed|all)}
</td>
Index: doc/et_media/index.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/et_media/index.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- doc/et_media/index.php 28 Sep 2002 20:01:44 -0000 1.3
+++ doc/et_media/index.php 6 Sep 2006 11:13:30 -0000 1.4
@@ -1,16 +1,19 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplates - Example App et_media
*
+ /**********************************************************************\
+ * phpGroupWare - eTemplate *
* http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Ralf Becker - <address@hidden> *
* --------------------------------------------
*
- * 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: index.php,v 1.3 2002/09/28 20:01:44 seek3r Exp $ */
+ * 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: index.php,v 1.4 2006/09/06 11:13:30 skwashd Exp $ */
$GLOBALS['phpgw_info']['flags'] = array(
'currentapp' => 'et_media',
Index: doc/et_media/inc/class.et_media.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/etemplate/doc/et_media/inc/class.et_media.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- doc/et_media/inc/class.et_media.inc.php 8 Aug 2003 16:29:34 -0000
1.5
+++ doc/et_media/inc/class.et_media.inc.php 6 Sep 2006 11:13:30 -0000
1.6
@@ -1,16 +1,11 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplates - Tutoria Example - a simple MediaDB
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.et_media.inc.php,v 1.5 2003/08/08 16:29:34 ralfbecker Exp
$ */
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.et_media.inc.php,v 1.6 2006/09/06 11:13:30 skwashd Exp $
+*/
include_once(PHPGW_INCLUDE_ROOT .
'/etemplate/inc/class.so_sql.inc.php');
$GLOBALS['phpgw_info']['flags']['included_classes']['so_sql'] = True;
// for 0.9.14
@@ -27,7 +22,7 @@
function et_media()
{
- $this->tmpl =
CreateObject('etemplate.etemplate','et_media.edit');
+ $this->tmpl =
createObject('etemplate.etemplate','et_media.edit');
$this->so_sql('et_media','phpgw_et_media'); // sets
up our storage layer using the table 'phpgw_et_media'
$this->empty_on_write = "''"; // that means if a
column is empty how to write in the db, the default is NULL
@@ -129,11 +124,11 @@
$this->tmpl->exec('et_media.et_media.edit',$content);
}
- /*!
- @function writeLangFile
- @abstract writes langfile with all templates and types here
- @discussion can be called via [write Langfile] in the eTemplate
editor or
- @discussion
http://domain/phpgroupware/index.php?et_media.et_media.writeLangFile
+ /**
+ * writes langfile with all templates and types here
+ *
+ * can be called via [write Langfile] in the eTemplate editor or
+ *
http://domain/phpgroupware/index.php?et_media.et_media.writeLangFile
*/
function writeLangFile()
{
Index: doc/et_media/setup/setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/et_media/setup/setup.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- doc/et_media/setup/setup.inc.php 11 Mar 2006 23:20:48 -0000 1.7
+++ doc/et_media/setup/setup.inc.php 6 Sep 2006 11:13:30 -0000 1.8
@@ -1,16 +1,13 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - Editable Templates: Example App of the tutorial
*
- * http://www.phpgroupware.org
*
- " Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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.
*
-
\**************************************************************************/
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: setup.inc.php,v 1.8 2006/09/06 11:13:30 skwashd Exp $
+*/
- /* $Id: setup.inc.php,v 1.7 2006/03/11 23:20:48 skwashd Exp $ */
+//TODO document this file properly
$setup_info['et_media']['name'] = 'et_media';
$setup_info['et_media']['title'] = 'eT-Media';
Index: doc/et_notes/index.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/et_notes/index.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/et_notes/index.php 3 Apr 2003 01:02:30 -0000 1.1
+++ doc/et_notes/index.php 6 Sep 2006 11:13:30 -0000 1.2
@@ -1,16 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - Notes eTemplate Port
*
+ /**********************************************************************\
+ * phpGroupWare - eTemplate *
* http://www.phpgroupware.org
*
- * Written by Bettina Gille address@hidden *
- * Ported to eTemplate by Ralf Becker address@hidden *
- * -----------------------------------------------
*
- * 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: index.php,v 1.1 2003/04/03 01:02:30 ralfbecker Exp $ */
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Originally Written by Bettina Gille - <ceb at phpgroupware.org> *
+ * Contributions from Ralf Becker - <address@hidden> *
+ * --------------------------------------------
*
+ * 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: index.php,v 1.2 2006/09/06 11:13:30 skwashd Exp $ */
$GLOBALS['phpgw_info']['flags'] = array
(
Index: doc/et_notes/inc/class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/et_notes/inc/class.bo.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/et_notes/inc/class.bo.inc.php 3 Apr 2003 01:02:30 -0000 1.1
+++ doc/et_notes/inc/class.bo.inc.php 6 Sep 2006 11:13:30 -0000 1.2
@@ -1,17 +1,15 @@
<?php
-
/***************************************************************************\
- * phpGroupWare - Notes eTemplate Port
*
- * http://www.phpgroupware.org
*
- * Written by : Andy Holman (LoCdOg)
*
- * Bettina Gille address@hidden *
- * Ported to eTemplate by Ralf Becker address@hidden *
- * -------------------------------------------------
*
- * 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: class.bo.inc.php,v 1.1 2003/04/03 01:02:30 ralfbecker Exp $ */
+/**
+* eTemplate Notes - port of the notes application
+* @author Bettina Gille <address@hidden>
+* @author Andy Holman LoCdOg
+* @author Ralf Becker <address@hidden>
+* @copyright Copyright (c) ??? Andy Holman - LoCdOg
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.bo.inc.php,v 1.2 2006/09/06 11:13:30 skwashd Exp $
+*/
class bo
{
@@ -55,7 +53,7 @@
function bo($session=False)
{
- $this->so = CreateObject('et_notes.so');
+ $this->so = createObject('et_notes.so');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->grants =
$GLOBALS['phpgw']->acl->get_grants('et_notes');
$this->grants[$this->account] = PHPGW_ACL_READ +
PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE;
Index: doc/et_notes/inc/class.so.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/et_notes/inc/class.so.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/et_notes/inc/class.so.inc.php 3 Apr 2003 01:02:30 -0000 1.1
+++ doc/et_notes/inc/class.so.inc.php 6 Sep 2006 11:13:30 -0000 1.2
@@ -1,25 +1,21 @@
<?php
-
/***************************************************************************\
- * phpGroupWare - Notes eTemplate Port
*
- * http://www.phpgroupware.org
*
- * Written by : Bettina Gille address@hidden *
- * Ported to eTemplate by Ralf Becker address@hidden *
- * -------------------------------------------------
*
- * 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: class.so.inc.php,v 1.1 2003/04/03 01:02:30 ralfbecker Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @author Bettina Gille <address@hidden>
+* @author Ralf Becker <address@hidden>
+* @package etemplate
+* @version $Id: class.so.inc.php,v 1.2 2006/09/06 11:13:30 skwashd Exp $
+*/
class so
{
var $grants;
function so()
{
- $this->db = $GLOBALS['phpgw']->db;
- $this->db2 = $this->db;
+ $this->db =& $GLOBALS['phpgw']->db;
+ $this->db2 = clone($this->db);
$this->grants =
$GLOBALS['phpgw']->acl->get_grants('et_notes');
$this->owner =
$GLOBALS['phpgw_info']['user']['account_id'];
}
Index: doc/et_notes/inc/class.ui.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/et_notes/inc/class.ui.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/et_notes/inc/class.ui.inc.php 3 Apr 2003 01:02:30 -0000 1.1
+++ doc/et_notes/inc/class.ui.inc.php 6 Sep 2006 11:13:30 -0000 1.2
@@ -1,18 +1,14 @@
<?php
-
/***************************************************************************\
- * phpGroupWare - Notes eTemplate Port
*
- * http://www.phpgroupware.org
*
- * Written by : Bettina Gille address@hidden *
- * Andy Holman (LoCdOg)
*
- * Ported to eTemplate by Ralf Becker address@hidden *
- * -------------------------------------------------
*
- * 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: class.ui.inc.php,v 1.1 2003/04/03 01:02:30 ralfbecker Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @author Bettina Gille <address@hidden>
+* @author Andy Holman LoCdog
+* @author Ralf Becker <address@hidden>
+* @package etemplate
+* @version $Id: class.ui.inc.php,v 1.2 2006/09/06 11:13:30 skwashd Exp $
+*/
class ui
{
var $grants;
@@ -31,10 +27,10 @@
function ui()
{
- $this->cats =
CreateObject('phpgwapi.categories');
+ $this->cats =
createObject('phpgwapi.categories');
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
- $this->tpl =
CreateObject('etemplate.etemplate','et_notes.edit');
- $this->bo =
CreateObject('et_notes.bo',True);
+ $this->tpl =
createObject('etemplate.etemplate','et_notes.edit');
+ $this->bo =
createObject('et_notes.bo',True);
$this->session_data = array(
'start' => $this->bo->start,
Index: doc/et_notes/inc/hook_add_def_pref.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/etemplate/doc/et_notes/inc/hook_add_def_pref.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/et_notes/inc/hook_add_def_pref.inc.php 3 Apr 2003 01:02:30 -0000
1.1
+++ doc/et_notes/inc/hook_add_def_pref.inc.php 6 Sep 2006 11:13:30 -0000
1.2
@@ -1,15 +1,13 @@
<?php
-
/***************************************************************************\
- * phpGroupWare - Notes
*
- * http://www.phpgroupware.org
*
- * -----------------------------------------------
*
- * 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: hook_add_def_pref.inc.php,v 1.1 2003/04/03 01:02:30 ralfbecker
Exp $ */
-
+<?php
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Bettina Gille <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: hook_add_def_pref.inc.php,v 1.2 2006/09/06 11:13:30 skwashd
Exp $
+*/
global $pref;
$pref->change('notes','notes_font','Verdana,Arial,Helvetica,sans-serif');
$pref->change('notes','notes_font_size','3');
Index: doc/et_notes/inc/hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/et_notes/inc/hook_admin.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/et_notes/inc/hook_admin.inc.php 3 Apr 2003 01:02:30 -0000 1.1
+++ doc/et_notes/inc/hook_admin.inc.php 6 Sep 2006 11:13:30 -0000 1.2
@@ -1,17 +1,12 @@
<?php
-
/**************************************************************************\
- * phpGroupWare
*
- * http://www.phpgroupware.org
*
- * Written by Joseph Engo <address@hidden> *
- * --------------------------------------------
*
- * 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: hook_admin.inc.php,v 1.1 2003/04/03 01:02:30 ralfbecker Exp $
- // $Source:
/cvsroot/phpgroupware/etemplate/doc/et_notes/inc/hook_admin.inc.php,v $
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Joseph Engo <address@hidden>
+* @author Joseph Engo <address@hidden>
+* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public
License
+* @package etemplate
+* @version $Id: hook_admin.inc.php,v 1.2 2006/09/06 11:13:30 skwashd Exp $
+*/
{
$values = array
(
Index: doc/et_notes/inc/hook_deleteaccount.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/etemplate/doc/et_notes/inc/hook_deleteaccount.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/et_notes/inc/hook_deleteaccount.inc.php 3 Apr 2003 01:02:30 -0000
1.1
+++ doc/et_notes/inc/hook_deleteaccount.inc.php 6 Sep 2006 11:13:30 -0000
1.2
@@ -1,32 +1,25 @@
<?php
- /**************************************************************************\
- * phpGroupWare *
- * http://www.phpgroupware.org *
- * Written by Mark Peters <address@hidden> *
- * -------------------------------------------- *
- * 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: hook_deleteaccount.inc.php,v 1.1 2003/04/03 01:02:30 ralfbecker
Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2003 Free Software Foundation, Inc.
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @author Mark Peters <address@hidden>
+* @package etemplate
+* @version $Id: hook_deleteaccount.inc.php,v 1.2 2006/09/06 11:13:30 skwashd
Exp $
+*/
// Delete all records for a user
$table_locks = Array('phpgw_et_notes');
- $db2 = $GLOBALS['phpgw']->db;
+ $db2 =& $GLOBALS['phpgw']->db;
$db2->lock($table_locks);
- $new_owner = intval(get_var('new_owner',Array('POST')));
- $account_id = intval(get_var('account_id',Array('POST')));
- if($new_owner==0)
+ if ( $_POST['new_owner'] == 0 )
{
- $db2->query('DELETE FROM phpgw_et_notes WHERE
note_owner='.$account_id,__LINE__,__FILE__);
+ $db2->query('DELETE FROM phpgw_et_notes WHERE note_owner = ' .
intval($_POST['account_id']), __LINE__, __FILE__);
}
else
{
- $db2->query('UPDATE phpgw_et_notes SET note_owner='.$new_owner
- . ' WHERE note_owner='.$account_id,__LINE__,__FILE__);
+ $db2->query('UPDATE phpgw_et_notes SET note_owner=' .
intval($_POST['new_owner'])
+ . ' WHERE note_owner=' . intval($_POST['account_id']),
__LINE__, __FILE__);
}
$db2->unlock();
?>
Index: doc/et_notes/setup/setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/doc/et_notes/setup/setup.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- doc/et_notes/setup/setup.inc.php 11 Mar 2006 23:20:48 -0000 1.3
+++ doc/et_notes/setup/setup.inc.php 6 Sep 2006 11:13:30 -0000 1.4
@@ -1,15 +1,12 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - Notes eTemplates Port
*
- * http://www.phpgroupware.org
*
- * Ported to eTemplate by Ralf Becker address@hidden *
- * --------------------------------------------
*
- * 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: setup.inc.php,v 1.3 2006/03/11 23:20:48 skwashd Exp $ */
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: setup.inc.php,v 1.4 2006/09/06 11:13:30 skwashd Exp $
+*/
$setup_info['et_notes']['name'] = 'et_notes';
$setup_info['et_notes']['version'] = '0.9.15.001';
Index: doc/et_notes/setup/tables_current.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/etemplate/doc/et_notes/setup/tables_current.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/et_notes/setup/tables_current.inc.php 3 Apr 2003 01:02:31 -0000
1.1
+++ doc/et_notes/setup/tables_current.inc.php 6 Sep 2006 11:13:30 -0000
1.2
@@ -1,16 +1,11 @@
<?php
- /**************************************************************************\
- * phpGroupWare - Notes eTemplate Port *
- * http://www.phpgroupware.org *
- * -------------------------------------------- *
- * 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: tables_current.inc.php,v 1.1 2003/04/03 01:02:31 ralfbecker Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: tables_current.inc.php,v 1.2 2006/09/06 11:13:30 skwashd Exp $
+*/
$phpgw_baseline = array(
'phpgw_et_notes' => array(
'fd' => array(
Index: inc/class.boetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.boetemplate.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- inc/class.boetemplate.inc.php 3 Sep 2006 17:00:05 -0000 1.36
+++ inc/class.boetemplate.inc.php 6 Sep 2006 11:13:30 -0000 1.37
@@ -1,25 +1,19 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - EditableTemplates - Buiseness Objects
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.boetemplate.inc.php,v 1.36 2006/09/03 17:00:05 Caeies Exp
$ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public
License
+* @package etemplate
+* @version $Id: class.boetemplate.inc.php,v 1.37 2006/09/06 11:13:30 skwashd
Exp $
+*/
include_once(PHPGW_INCLUDE_ROOT .
'/etemplate/inc/class.soetemplate.inc.php');
- /*!
- @class boetemplate
- @author ralfbecker
- @abstract Buiseness Objects for eTemplates
- @discussion Not so much so far, as the most logic is still in the
UI-class
- @param $types,$alings converts internal names/values to (more) human
readible ones
+ /**
+ * Buiseness Objects for eTemplates
+ *
+ * Not so much so far, as the most logic is still in the UI-class
+ * @param $types,$alings converts internal names/values to (more) human
readible ones
*/
class boetemplate extends soetemplate
{
@@ -46,16 +40,20 @@
'hbox' => 'HBox', // a
(horizontal) box to contain widgets in cols, size = # of cols
'deck' => 'Deck' // a container
of elements where only one is visible, size = # of elem.
);
- /*!
- @function boetemplate
- @abstract constructor of class
- @param $name name of etemplate or array with name and other
keys
- @param $load_via name/array with keys of other etemplate to
load in order to get $name
- @discussion Calls the constructor of soetemplate
+ /**
+ * constructor of class
+ *
+ * @param $name name of etemplate or array with name and
other keys
+ * @param $load_via name/array with keys of other etemplate to
load in order to get $name
+ * Calls the constructor of soetemplate
*/
function boetemplate($name='',$load_via='')
{
$this->public_functions += array(
+ 'set_row_attribute' => True,
+ 'disable_row' => True,
+ 'set_column_attribute' => True,
+ 'disable_column' => True,
'disable_cells' => True,
'set_cell_attribute' => True,
'get_cell_attribute' => True,
@@ -79,31 +77,30 @@
}
}
- /*!
- @function expand_name
- @syntax expand_name( $name,$c,$row,$c_='',$row_='',$cont='' )
- @author ralfbecker
- @abstract allows a few variables (eg. row-number) to be used in
field-names
- @discussion This is mainly used for autorepeat, but other use
is possible.
- @discussion You need to be aware of the rules PHP uses to
expand vars in strings, a name
- @discussion of "Row$row[length]" will expand to 'Row' as $row
is scalar, you need to use
- @discussion "Row${row}[length]" instead. Only one indirection
is allowd in a string by php !!!
- @discussion Out of that reason we have now the variable
$row_cont, which is $cont[$row] too.
- @discussion Attention !!!
- @discussion Using only number as index in field-names causes a
lot trouble, as depending
- @discussion on the variable type (which php determines itself)
you used filling and later
- @discussion accessing the array it can by the index or the key
of an array element.
- @discussion To make it short and clear, use "Row$row" or
"$col$row" not "$row" or "$row$col" !!!
- @param $name the name to expand
- @param $c is the column index starting with 0 (if you have
row-headers, data-cells start at 1)
- @param $row is the row number starting with 0 (if you have
col-headers, data-cells start at 1)
- @param $c_, $row_ are the respective values of the previous
template-inclusion,
- @param eg. the column-headers in the
eTemplate-editor are templates itself,
- @param to show the column-name in the header you can
not use $col as it will
- @param be constant as it is always the same col in
the header-template,
- @param what you want is the value of the previous
template-inclusion.
- @param $cont content array of the template, you might use it to
generate button-names with
- @param id values in it: "del[$cont[id]]" expands to
"del[123]" if $cont = array('id' => 123)
+ /**
+ * @author ralfbecker
+ * allows a few variables (eg. row-number) to be used in
field-names
+ *
+ * This is mainly used for autorepeat, but other use is
possible.
+ * You need to be aware of the rules PHP uses to expand vars in
strings, a name
+ * of "Row$row[length]" will expand to 'Row' as $row is scalar,
you need to use
+ * "Row${row}[length]" instead. Only one indirection is allowd
in a string by php !!!
+ * Out of that reason we have now the variable $row_cont, which
is $cont[$row] too.
+ * Attention !!!
+ * Using only number as index in field-names causes a lot
trouble, as depending
+ * on the variable type (which php determines itself) you used
filling and later
+ * accessing the array it can by the index or the key of an
array element.
+ * To make it short and clear, use "Row$row" or "$col$row" not
"$row" or "$row$col" !!!
+ * @param $name the name to expand
+ * @param $c is the column index starting with 0 (if you have
row-headers, data-cells start at 1)
+ * @param $row is the row number starting with 0 (if you have
col-headers, data-cells start at 1)
+ * @param $c_, $row_ are the respective values of the previous
template-inclusion,
+ * @param eg. the column-headers in the
eTemplate-editor are templates itself,
+ * @param to show the column-name in the header you
can not use $col as it will
+ * @param be constant as it is always the same col
in the header-template,
+ * @param what you want is the value of the previous
template-inclusion.
+ * @param $cont content array of the template, you might use it
to generate button-names with
+ * @param id values in it: "del[$cont[id]]" expands to
"del[123]" if $cont = array('id' => 123)
*/
function expand_name($name,$c,$row,$c_='',$row_='',$cont='')
{
@@ -131,28 +128,27 @@
return $name;
}
- /*!
- @function autorepeat_idx
- @abstract Checks if we have an row- or column autorepeat and
sets the indexes for $content, etc.
- @discussion Autorepeat is important to allow a variable numer
of rows or cols, eg. for a list.
- @discussion The eTemplate has only one (have to be the last)
row or column, which gets
- @discussion automaticaly repeated as long as content is
availible. To check this the content
- @discussion has to be in an sub-array of content. The index /
subscript into content is
- @discussion determined by the content of size for templates or
name for regular fields.
- @discussion An autorepeat is defined by an index which contains
variables to expand.
- @discussion (vor variable expansion in names see expand_names).
Usually I use the keys
- @discussion $row: 0, 1, 2, 3, ... for only rows, $col: '@',
'A', 'B', 'C', ... for only cols or
- @discussion $col$row: '@0','A0',... '@1','A1','B1',...
'@2','A2','B2',... for both rows and cells.
- @discussion In general everything expand_names can generate is
ok - see there.
- @discussion As you usually have col- and row-headers,
data-cells start with '1' or 'A' !!!
- @syntax
autorepeat_idx($cell,$c,$r,&$idx,&$idx_cname,$check_col=False)
- @param $cell array with data of cell: name, type, size, ...
- @param $c,$r col/row index starting from 0
- @param &$idx returns the index in $content and $readonlys (NOT
$sel_options !!!)
- @param &$idx_cname returns the basename for the form-name: is
$idx if only one value
- @param (no ',') is given in size (name (not
template-fields) are always only one value)
- @param $check_col boolean to check for col- or row-autorepeat
- @result true if cell is autorepeat (has index with vars / '$')
or false otherwise
+ /**
+ * Checks if we have an row- or column autorepeat and sets the
indexes for $content, etc.
+ *
+ * Autorepeat is important to allow a variable numer of rows or
cols, eg. for a list.
+ * The eTemplate has only one (have to be the last) row or
column, which gets
+ * automaticaly repeated as long as content is availible. To
check this the content
+ * has to be in an sub-array of content. The index / subscript
into content is
+ * determined by the content of size for templates or name for
regular fields.
+ * An autorepeat is defined by an index which contains
variables to expand.
+ * (vor variable expansion in names see expand_names). Usually
I use the keys
+ * $row: 0, 1, 2, 3, ... for only rows, $col: '@', 'A', 'B',
'C', ... for only cols or
+ * $col$row: '@0','A0',... '@1','A1','B1',...
'@2','A2','B2',... for both rows and cells.
+ * In general everything expand_names can generate is ok - see
there.
+ * As you usually have col- and row-headers, data-cells start
with '1' or 'A' !!!
+ * @param $cell array with data of cell: name, type, size, ...
+ * @param $c,$r col/row index starting from 0
+ * @param &$idx returns the index in $content and $readonlys
(NOT $sel_options !!!)
+ * @param &$idx_cname returns the basename for the form-name:
is $idx if only one value
+ * @param (no ',') is given in size (name (not
template-fields) are always only one value)
+ * @param $check_col boolean to check for col- or row-autorepeat
+ * @return true if cell is autorepeat (has index with vars /
'$') or false otherwise
*/
function
autorepeat_idx($cell,$c,$r,&$idx,&$idx_cname,$check_col=False)
{
@@ -206,11 +202,10 @@
return $Ok;
}
- /*!
- @function appsession_id
- @syntax appsession_id( )
- @author ralfbecker
- @abstract creates a new appsession-id via microtime()
+ /**
+ * @author ralfbecker
+ * creates a new appsession-id via microtime()
+ *
*/
function appsession_id()
{
@@ -220,18 +215,98 @@
return $id;
}
- /*!
- @function save_appsession
- @syntax save_appsession( $data,$id='' )
- @author ralfbecker
- @abstract saves content,readonlys,template-keys, ... via the
appsession function
- @discussion As a user may open several windows with the same
content/template wie generate a location-id from microtime
- @discussion which is used as location for appsession to
descriminate between the different windows. This location-id
- @discussion is then saved as a hidden-var in the form. The
above mentions session-id has nothing to do / is different
- @discussion from the session-id which is constant for all
windows opened in one session.
- @param $data the data to save
- @param $id the id to use or '' to generate a new id
- @result the location-id
+ /**
+ * appsession
+ * db-sessions appsession function
+ *
+ * It is used to overcome the problem with overflowing
php4-sessions
+ */
+ function appsession($location = 'default', $appname = '', $data
= '##NOTHING##')
+ {
+ // use the version from the sessions-class if we use
db-sessions
+ //
+ if ($GLOBALS['phpgw_info']['server']['sessions_type']
== 'db')
+ {
+ return
$GLOBALS['phpgw']->session->appsession($location,$appname,$data);
+ }
+ // if not, we use or own copy of the appsessions
function
+ // setting these class vars to be compatible with the
session-class
+ //
+ $this->sessionid =
$GLOBALS['phpgw']->session->sessionid;
+ $this->account_id =
$GLOBALS['phpgw']->session->account_id;
+
+ if (! $appname)
+ {
+ $appname =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ }
+
+ if ($data == '##NOTHING##')
+ {
+ $query = "SELECT content FROM
phpgw_app_sessions WHERE"
+ ." sessionid='".$this->sessionid."' AND
loginid='".$this->account_id."'"
+ ." AND app = '".$appname."' AND
location='".$location."'";
+
+
$GLOBALS['phpgw']->db->query($query,__LINE__,__FILE__);
+ $GLOBALS['phpgw']->db->next_record();
+
+ // I added these into seperate steps for easier
debugging
+ $data = $GLOBALS['phpgw']->db->f('content');
+ // Changed by Skeeter 2001 Mar 04 0400Z
+ // This was not properly decoding structures
saved into session data properly
+// $data =
$GLOBALS['phpgw']->common->decrypt($data);
+// return stripslashes($data);
+ // Changed by milosch 2001 Dec 20
+ // do not stripslashes here unless this proves
to be a problem.
+ // Changed by milosch 2001 Dec 25
+ /* do not decrypt and return if no data
(decrypt returning garbage) */
+ if($data)
+ {
+ $data =
$GLOBALS['phpgw']->crypto->decrypt($data);
+// echo 'appsession returning: ';
_debug_array($data);
+ }
+ }
+ else
+ {
+ $GLOBALS['phpgw']->db->query("SELECT content
FROM phpgw_app_sessions WHERE "
+ . "sessionid = '".$this->sessionid."'
AND loginid = '".$this->account_id."'"
+ . " AND app = '".$appname."' AND
location = '".$location."'",__LINE__,__FILE__);
+
+ $encrypteddata =
$GLOBALS['phpgw']->crypto->encrypt($data);
+ $encrypteddata =
$GLOBALS['phpgw']->db->db_addslashes($encrypteddata);
+
+ if ($GLOBALS['phpgw']->db->num_rows()==0)
+ {
+ $GLOBALS['phpgw']->db->query("INSERT
INTO phpgw_app_sessions (sessionid,loginid,app,location,content,session_dla) "
+ . "VALUES
('".$this->sessionid."','".$this->account_id."','".$appname
+ .
"','".$location."','".$encrypteddata."','" . time() . "')",__LINE__,__FILE__);
+ }
+ else
+ {
+ $GLOBALS['phpgw']->db->query("UPDATE
phpgw_app_sessions SET content='".$encrypteddata."'"
+ . "WHERE sessionid =
'".$this->sessionid."'"
+ . "AND loginid =
'".$this->account_id."' AND app = '".$appname."'"
+ . "AND location =
'".$location."'",__LINE__,__FILE__);
+ }
+ }
+ // we need to clean up not longer used records, else
the db gets bigger and bigger
+ //
+ $GLOBALS['phpgw']->db->query("DELETE FROM
phpgw_app_sessions WHERE session_dla <= '" . (time() -
$GLOBALS['phpgw_info']['server']['sessions_timeout'])
+ . "'",__LINE__,__FILE__);
+
+ return $data;
+ }
+
+ /**
+ * @author ralfbecker
+ * saves content,readonlys,template-keys, ... via the
appsession function
+ *
+ * As a user may open several windows with the same
content/template wie generate a location-id from microtime
+ * which is used as location for appsession to descriminate
between the different windows. This location-id
+ * is then saved as a hidden-var in the form. The above
mentions session-id has nothing to do / is different
+ * from the session-id which is constant for all windows opened
in one session.
+ * @param $data the data to save
+ * @param $id the id to use or '' to generate a new id
+ * @return the location-id
*/
function save_appsession($data,$id='')
{
@@ -239,34 +314,36 @@
{
$id = $this->appsession_id;
}
-
$GLOBALS['phpgw']->session->appsession($id,'etemplate',$data);
+
$this/*GLOBALS['phpgw']->session*/->appsession($id,'etemplate',$data);
return $id;
}
- /*!
- @function get_appsession
- @syntax get_appsession( $id )
- @author ralfbecker
- @abstract gets content,readonlys,template-keys, ... back from
the appsession function
- @param $id the location-id
- @result the session-data
+ /**
+ * @author ralfbecker
+ * gets content,readonlys,template-keys, ... back from the
appsession function
+ *
+ * @param $id the location-id
+ * @return the session-data
*/
function get_appsession($id)
{
- $data =
$GLOBALS['phpgw']->session->appsession($id,'etemplate');
+ $data =
$this/*GLOBALS['phpgw']->session*/->appsession($id,'etemplate');
//echo "<p>get_appsession('$id') data=";
_debug_array($data);
+ // if we delete the returned value here, we cant get
back (back-button),
+ // not even to a non-submitted page
+
//$GLOBALS['phpgw']->session->appsession_delete($id,'etemplate');
+
return $data;
}
- /*!
- @function get_cell_attribute
- @syntax get_cell_attribute( $name,$attr )
- @author ralfbecker
- @abstract gets an attribute in a named cell
- @result the attribute or False if named cell not found
+ /**
+ * @author ralfbecker
+ * gets an attribute in a named cell
+ *
+ * @return the attribute or False if named cell not found
*/
function get_cell_attribute($name,$attr)
{
@@ -287,22 +364,20 @@
return False;
}
- /*!
- @function set_cell_attribute
- @syntax set_cell_attribute( $name,$attr,$val )
- @author ralfbecker
- @abstract set an attribute in a named cell
- @result the number of changed cells
+ /**
+ * @author ralfbecker
+ * set an attribute in a named cell
+ *
+ * @return the number of changed cells
*/
function set_cell_attribute($name,$attr,$val)
{
//echo "<p>set_cell_attribute(tpl->name=$this->name,
name='$name', attr='$attr',val='$val')</p>\n";
- reset($this->data);
$n = 0;
- while(list($row,$cols) = each($this->data))
+ foreach($this->data as $row => $cols)
{
- while(list($col,$cell) = each($cols))
+ foreach($cols as $col => $cell)
{
if ($cell['name'] == $name)
{
@@ -313,67 +388,99 @@
{
if (!is_object($cell['obj']))
{
-
$this->data[$row][$col]['obj'] =
CreateObject('etemplate.etemplate',$cell['name']);
+
$this->data[$row][$col]['obj'] =
createObject('etemplate.etemplate',$cell['name']);
}
$n +=
$this->data[$row][$col]['obj']->set_cell_attribute($name,$attr,$val);
}
}
}
- reset($this->data);
return $n;
}
- /*!
- @function disable_cells
- @syntax disable_cells( $name )
- @author ralfbecker
- @abstract disables all cells with name == $name
+ /**
+ * @author ralfbecker
+ * disables all cells with name == $name
+ *
*/
function disable_cells($name)
{
return $this->set_cell_attribute($name,'disabled',True);
}
- /*!
- @function disable_row
- @syntax disable_row( $n,$enable=False )
- @author ralfbecker
- @abstract disables row $n
- @param $n is numerical row-number starting with 1 (!)
- @param $enable can be used to re-enable a row if set to True
+ /**
+ * @author ralfbecker
+ * set one or more attibutes for row $n
+ *
+ * @param $n is numerical row-number starting with 1 (!)
+ * @param $height in percent or pixel or '' for no height
+ * @param $class name of css class (without the leading '.') or
'' for no class
+ * @param $valign alignment (top,middle,bottom) or '' for none
+ * @param $disabled True or expression or False to disable or
enable the row
+ * @param Only the number 0 means dont change the attribute !!!
+ */
+ function
set_row_attributes($n,$height=0,$class=0,$valign=0,$disabled=0)
+ {
+ list($old_height,$old_disabled) =
explode(',',$this->data[0]["h$n"]);
+ $disabled = $disabled !== 0 ? $disabled : $old_disabled;
+ $this->data[0]["h$n"] = ($height !== 0 ? $height :
$old_height).
+ ($disabled ? ','.$disabled : '');
+ list($old_class,$old_valign) =
explode(',',$this->data[0]["c$n"]);
+ $valign = $valign !== 0 ? $valign : $old_valign;
+ $this->data[0]["c$n"] = ($class !== 0 ? $class :
$old_class).
+ ($valign ? ','.$valign : '');
+ }
+
+ /**
+ * @author ralfbecker
+ * disables row $n
+ *
+ * @param $n is numerical row-number starting with 1 (!)
+ * @param $enable can be used to re-enable a row if set to True
*/
function disable_row($n,$enable=False)
{
- list($height) = explode(',',$this->data[0]["h$n"]);
- $this->data[0]["h$n"] = $height.($enable?'':',1');
+ $this->set_row_attributes($n,0,0,0,!$enable);
}
- /*!
- @function disable_column
- @syntax disable_column( $c,$enable=False )
- @author ralfbecker
- @abstract disables column $c
- @param $c is numerical column-number starting with 1 (!), or
the char-code starting with 'A'
- @param $enable can be used to re-enable a column if set to True
+ /**
+ * @author ralfbecker
+ * set one or more attibutes for column $c
+ *
+ * @param $c is numerical column-number starting with 0 (!), or
the char-code starting with 'A'
+ * @param $width in percent or pixel or '' for no height
+ * @param $disabled True or expression or False to disable or
enable the column
+ * @param Only the number 0 means dont change the attribute !!!
*/
- function disable_column($c,$enable=False)
+ function set_column_attributes($c,$width=0,$disabled=0)
{
if (is_numeric($c))
{
- $c = $this->num2chars($c);
+ $c = $this->num2chrs($c);
}
- list($height) = explode(',',$this->data[0][$c]);
- $this->data[0][$c] = $height.($enable?'':',1');
+ list($old_width,$old_disabled) =
explode(',',$this->data[0][$c]);
+ $disabled = $disabled !== 0 ? $disabled : $old_disabled;
+ $this->data[0][$c] = ($width !== 0 ? $width :
$old_width).
+ ($disabled ? ','.$disabled : '');
}
- /*!
- @function loadExtension
- @syntax loadExtension( $type )
- @author ralfbecker
- @abstact trys to load the Extension / Widget-class from the app
or etemplate
- @param $name name of the extension, the classname should be
class.${name}_widget.inc.php
- @discussion the $name might be "$name.$app" to give a app-name
(default is the current app,or template-name)
+ /**
+ * @author ralfbecker
+ * disables column $c
+ *
+ * @param $c is numerical column-number starting with 0 (!), or
the char-code starting with 'A'
+ * @param $enable can be used to re-enable a column if set to
True
+ */
+ function disable_column($c,$enable=False)
+ {
+ $this->set_column_attributes($c,0,!$enable);
+ }
+
+ /**
+ * @author ralfbecker
+ * trys to load the Extension / Widget-class from the app or
etemplate
+ * @param $name name of the extension, the classname should be
class.${name}_widget.inc.php
+ * the $name might be "$name.$app" to give a app-name (default
is the current app,or template-name)
*/
function loadExtension($type)
{
@@ -396,7 +503,7 @@
{
return
$GLOBALS['phpgw_info']['etemplate']['extension'][$type] = False;
}
- $GLOBALS['phpgw_info']['etemplate']['extension'][$type]
= CreateObject($app.'.'.$class,$ui='html');
+ $GLOBALS['phpgw_info']['etemplate']['extension'][$type]
= createObject($app.'.'.$class,$ui='html');
return
$GLOBALS['phpgw_info']['etemplate']['extension'][$type]->human_name;
}
@@ -470,12 +577,11 @@
$GLOBALS['phpgw_info']['etemplate']['extension_data'][$name],$this);
}
- /*!
- @function isset_array
- @syntax isset_array( $arr,$idx )
- @author ralfbecker
- @abstract checks if idx, which may contain ONE subindex is set
in array
- @author ralfbecker
+ /**
+ * @author ralfbecker
+ * checks if idx, which may contain ONE subindex is set in array
+ *
+ * @author ralfbecker
*/
function isset_array($arr,$idx)
{
@@ -486,13 +592,12 @@
return isset($arr[$idx]);
}
- /*!
- @function set_array
- @syntax set_array( &$arr,$idx,$val )
- @author ralfbecker
- @abstract sets $arr[$idx] = $val
- @discussion This works for non-trival indexes like 'a[b][c]'
too: $arr['a']['b']['c'] = $val;
- @author ralfbecker
+ /**
+ * @author ralfbecker
+ * sets $arr[$idx] = $val
+ *
+ * This works for non-trival indexes like 'a[b][c]' too:
$arr['a']['b']['c'] = $val;
+ * @author ralfbecker
*/
function set_array(&$arr,$idx,$val)
{
@@ -509,14 +614,13 @@
$pos = $val;
}
- /*!
- @function get_array
- @syntax get_array( &$arr,$idx )
- @author ralfbecker
- @abstract return a var-param to $arr[$idx]
- @example $sub = get_array($arr,'a[b]'); $sub = 'c'; is
equivalent to $arr['a']['b'] = 'c';
- @discussion This works for non-trival indexes like 'a[b][c]'
too: it returns &$arr[a][b][c]
- @author ralfbecker
+ /**
+ * @author ralfbecker
+ * return a var-param to $arr[$idx]
+ *
+ * $sub = get_array($arr,'a[b]'); $sub = 'c'; is equivalent to
$arr['a']['b'] = 'c';
+ * This works for non-trival indexes like 'a[b][c]' too: it
returns &$arr[a][b][c]
+ * @author ralfbecker
*/
function &get_array(&$arr,$idx)
{
@@ -537,14 +641,13 @@
return $pos;
}
- /*!
- @function unset_array
- @syntax unset_array( &$arr,$idx )
- @author ralfbecker
- @abstract unsets $arr[$idx]
- @example unset_array($arr,'a[b]'); is equivalent to
unset($arr['a']['b']);
- @discussion This works for non-trival indexes like 'a[b][c]' too
- @author ralfbecker
+ /**
+ * @author ralfbecker
+ * unsets $arr[$idx]
+ *
+ * unset_array($arr,'a[b]'); is equivalent to
unset($arr['a']['b']);
+ * This works for non-trival indexes like 'a[b][c]' too
+ * @author ralfbecker
*/
function unset_array(&$arr,$idx)
{
@@ -561,12 +664,11 @@
unset($pos[$idx]);
}
- /*!
- @function complete_array_merge
- @syntax complete_array_merge( $old,$new )
- @author ralfbecker
- @abstract merges $old and $new, content of $new has precedence
over $old
- @discussion THIS IS NOT THE SAME AS PHP4: array_merge (as it
calls itself recursive for values which are arrays.
+ /**
+ * @author ralfbecker
+ * merges $old and $new, content of $new has precedence over
$old
+ *
+ * THIS IS NOT THE SAME AS PHP4: array_merge (as it calls
itself recursive for values which are arrays.
*/
function complete_array_merge($old,$new)
{
@@ -610,9 +712,9 @@
return $cname;
}
- /*!
- @function store_in_cache()
- @abstract stores the etemplate in the cache in phpgw_info
+ /**
+ * stores the etemplate in the cache in phpgw_info
+ *
*/
function store_in_cache()
{
@@ -650,12 +752,12 @@
return False;
}
- /*!
- @function read
- @abstract Reads an eTemplate from the cache or database /
filesystem (and updates the cache)
- @param as discripted in soetemplate::read
- @param $load_via name/array of keys of etemplate to load in
order to get $name (only as second try!)
- @result True if a fitting template is found, else False
+ /**
+ * Reads an eTemplate from the cache or database / filesystem
(and updates the cache)
+ *
+ * @param as discripted in soetemplate::read
+ * @param $load_via name/array of keys of etemplate to load in
order to get $name (only as second try!)
+ * @return True if a fitting template is found, else False
*/
function
read($name,$template='default',$lang='default',$group=0,$version='',$load_via='')
{
@@ -692,11 +794,11 @@
return True;
}
- /*!
- @function save
- @abstract saves eTemplate-object to db and update the cache
- @params keys see soetemplate::save
- @result the number of affected rows, 1 should be ok, 0
somethings wrong
+ /**
+ * saves eTemplate-object to db and update the cache
+ *
+ * keys see soetemplate::save
+ * @return the number of affected rows, 1 should be ok, 0
somethings wrong
*/
function
save($name='',$template='.',$lang='.',$group='',$version='.')
{
Index: inc/class.date_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.date_widget.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- inc/class.date_widget.inc.php 18 Aug 2003 23:15:59 -0000 1.14
+++ inc/class.date_widget.inc.php 6 Sep 2006 11:13:30 -0000 1.15
@@ -1,26 +1,20 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplate Extension - Date Widget
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.date_widget.inc.php,v 1.14 2003/08/18 23:15:59 ralfbecker
Exp $ */
-
- /*!
- @class date_widget
- @author ralfbecker
- @abstract widget that reads a date and/or time
- @param Options/$cell['size'] = $format[,$options],
- @param $format: ''=timestamp or eg. 'Y-m-d H:i' for 2002-12-31 23:59
- @param $options: &1 = year is int-input not selectbox, &2 = show a
[Today] button, \
- &4 = 1min steps for time (default is 5min, with fallback to
1min if value is not in 5min-steps)
- @discussion This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no render-function
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.date_widget.inc.php,v 1.15 2006/09/06 11:13:30 skwashd
Exp $
+*/
+ /**
+ * widget that reads a date and/or time
+ *
+ * @param Options/$cell['size'] = $format[,$options],
+ * @param $format: ''=timestamp or eg. 'Y-m-d H:i' for 2002-12-31 23:59
+ * @param $options: &1 = year is int-input not selectbox, &2 = show a
[Today] button, \
+ * * &4 = 1min steps for time (default is 5min, with fallback to
1min if value is not in 5min-steps)
+ * This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no render-function
*/
class date_widget
{
@@ -36,11 +30,12 @@
function date_widget($ui)
{
+ $this->timeformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'];
if ($ui == 'html')
{
- $this->jscal =
CreateObject('phpgwapi.jscalendar');
+ $this->jscal =
createObject('phpgwapi.jscalendar');
}
- $this->timeformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['timeformat'];
+
}
function
pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)
@@ -71,6 +66,7 @@
{
case 'Y': $value['Y'] = $dat;
break;
case 'm': $value['m'] = $dat;
break;
+ case 'M': $value['m'] = $dat;
break;
case 'd': $value['d'] = $dat;
break;
case 'H': $value['H'] = $dat;
break;
case 'i': $value['i'] = $dat;
break;
@@ -134,8 +130,8 @@
'i' => 'select-number'
);
$opts = array(
- 'H' => $this->timeformat == '12' ? ',0,12' :
',0,23',
- 'i' => $value['i'] % 5 || $options & 4 ?
',0,59' : ',0,59,5' // 5min steps, if ok with value
+ 'H' => $this->timeformat == '12' ? ',0,12' :
',0,23,01',
+ 'i' => $value['i'] % 5 || $options & 4 ?
',0,59,01' : ',0,59,05' // 5min steps, if ok with value
);
$help = array(
'Y' => 'Year',
@@ -153,7 +149,7 @@
{
$dcell['type'] = 'html';
$dcell['name'] = 'str';
- $value['str'] =
$this->jscal->input($name.'[str]',False,$value['Y'],$value['m'],$value['d'],$cell['help']);
+ $value['str'] =
$this->jscal->input($name.'[str]',False,$value['Y'],$value['m'],$value['d'],lang($cell['help']));
$n = 2; // no
other fields
$options &= ~2; // no set-today
button
// register us for process_exec
@@ -164,7 +160,7 @@
$dcell['type'] = $types[$format[$n]];
$dcell['size'] = $opts[$format[$n]];
$dcell['name'] = $format[$n];
- $dcell['help'] =
lang($help[$format[$n]]).': '.$cell['help']; // note: no lang on help,
already done
+ $dcell['help'] =
lang($help[$format[$n]]).': '.lang($cell['help']); // note: no lang on
help, already done
}
if ($n == 4)
{
@@ -192,7 +188,7 @@
if ($n == 2 && $type == 'date-time') //
insert some space between date+time
{
$dcell = $tpl->empty_cell();
- $dcell['type'] = 'label';
+ $dcell['type'] = 'html';
$dcell['name'] = 'space';
$value['space'] = ' ';
$dcell['no_lang'] = True;
@@ -240,9 +236,13 @@
$value[$d] = date($d);
}
}
- if (isset($value_in['str']))
+ if (isset($value_in['str']) && !empty($value_in['str']))
{
- $value =
$this->jscal->input2date($value_in['str'],False,'d','m','Y');
+ if (!is_array($value))
+ {
+ $value = array();
+ }
+ $value +=
$this->jscal->input2date($value_in['str'],False,'d','m','Y');
}
if ($value['d'] || isset($value['H']) && $value['H']
!== '' ||
isset($value['i']) && $value['i']
!== '')
Index: inc/class.db_tools.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.db_tools.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- inc/class.db_tools.inc.php 8 Aug 2003 16:18:30 -0000 1.19
+++ inc/class.db_tools.inc.php 6 Sep 2006 11:13:30 -0000 1.20
@@ -1,17 +1,12 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplates - DB-Tools
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.db_tools.inc.php,v 1.19 2003/08/08 16:18:30 ralfbecker
Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.db_tools.inc.php,v 1.20 2006/09/06 11:13:30 skwashd Exp $
+*/
class db_tools
{
var $public_functions = array
@@ -42,29 +37,24 @@
// 'abstime' => 'abstime (mysql:timestamp)',
);
var $setup_header = '<?php
- /**************************************************************************\\
- * phpGroupWare - Setup *
- * http://www.phpgroupware.org *
- * Created by eTemplates DB-Tools written by address@hidden *
- * -------------------------------------------- *
- * 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: class.db_tools.inc.php,v 1.19 2003/08/08 16:18:30 ralfbecker Exp $ */
+/**
+* ' . $app . ' Setup
+* @copyright Copyright (C) 2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Your Name <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU Lesser General Public
License
+* @package etemplate
+* @version $Id: class.db_tools.inc.php,v 1.20 2006/09/06 11:13:30 skwashd Exp $
+*/
';
- /*!
- @function db_tools
- @syntax db_tools( )
- @author ralfbecker
- @abstract constructor of class
+ /**
+ * @author ralfbecker
+ * constructor of class
+ *
*/
function db_tools()
{
- $this->editor =
CreateObject('etemplate.etemplate','etemplate.db-tools.edit');
+ $this->editor =
createObject('etemplate.etemplate','etemplate.db-tools.edit');
$this->data = array();
if (!is_array($GLOBALS['phpgw_info']['apps']) ||
!count($GLOBALS['phpgw_info']['apps']))
@@ -73,17 +63,16 @@
}
}
- /*!
- @function edit
- @syntax edit( $content='',$msg='' )
- @author ralfbecker
- @abstract this is the table editor (and the
callback/submit-method too)
+ /**
+ * @author ralfbecker
+ * this is the table editor (and the callback/submit-method too)
+ *
*/
function edit($content='',$msg = '')
{
- if (isset($GLOBALS['HTTP_GET_VARS']['app']))
+ if (isset($_GET['app']))
{
- $this->app = $GLOBALS['HTTP_GET_VARS']['app'];
+ $this->app = $_GET['app'];
}
if (is_array($content))
{
@@ -168,8 +157,8 @@
}
else // import
{
- $oProc =
CreateObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
- $oProc->m_odb = $GLOBALS['phpgw']->db;
+ $oProc =
createObject('phpgwapi.schema_proc',$GLOBALS['phpgw_info']['server']['db_type']);
+ $oProc->m_odb =& $GLOBALS['phpgw']->db;
$oProc->m_oTranslator->_GetColumns($oProc,$content['new_table_name'],$nul);
while (list($key,$tbldata) = each
($oProc->m_oTranslator->sCol))
@@ -223,16 +212,15 @@
array('posted_table' =>
$this->table,'posted_app' => $this->app,'changes' => $this->changes));
}
- /*!
- @function needs_save
- @syntax needs_save(
$cont='',$posted_app='',$posted_table='',$edited_table='' )
- @author ralfbecker
- @abstract checks if table was changed and if so offers user to
save changes
- @param $cont the content of the form (if called by process_exec)
- @param $posted_app the app the table is from
- @param $posted_table the table-name
- @param $edited_table the edited table-definitions
- @result only if no changes
+ /**
+ * @author ralfbecker
+ * checks if table was changed and if so offers user to save
changes
+ *
+ * @param $cont the content of the form (if called by
process_exec)
+ * @param $posted_app the app the table is from
+ * @param $posted_table the table-name
+ * @param $edited_table the edited table-definitions
+ * @return only if no changes
*/
function
needs_save($cont='',$posted_app='',$posted_table='',$edited_table='')
{
@@ -315,13 +303,12 @@
return True; // dont continue in edit
}
- /*!
- @function table2content
- @syntax table2content( $table )
- @author ralfbecker
- @abstract creates content-array from a $table
- @param $table table-definition, eg. $phpgw_baseline[$table_name]
- @result content-array
+ /**
+ * @author ralfbecker
+ * creates content-array from a $table
+ *
+ * @param $table table-definition, eg.
$phpgw_baseline[$table_name]
+ * @return content-array
*/
function table2content($table)
{
@@ -348,14 +335,13 @@
return $content;
}
- /*!
- @function content2table
- @syntax content2table( $content )
- @author ralfbecker
- @abstract creates table-definition from posted content
- @param $content posted content-array
- @note It sets some reasonalbe defaults for not set precisions
(else setup will not install)
- @result table-definition
+ /**
+ * @author ralfbecker
+ * creates table-definition from posted content
+ *
+ * @param $content posted content-array
+ * It sets some reasonalbe defaults for not set precisions
(else setup will not install)
+ * @return table-definition
*/
function content2table($content)
{
@@ -436,14 +422,13 @@
return $table;
}
- /*!
- @function read
- @syntax read( $app,&$phpgw_baseline )
- @author ralfbecker
- @abstract includes $app/setup/tables_current.inc.php
- @param $app application name
- @param $phpgw_baseline where to put the data
- @result True if file found, False else
+ /**
+ * @author ralfbecker
+ * includes $app/setup/tables_current.inc.php
+ *
+ * @param $app application name
+ * @param $phpgw_baseline where to put the data
+ * @return True if file found, False else
*/
function read($app,&$phpgw_baseline)
{
@@ -521,14 +506,13 @@
return $def;
}
- /*!
- @function write
- @syntax write( $app,$phpgw_baseline )
- @author ralfbecker
- @abstract writes tabledefinitions $phpgw_baseline to file
/$app/setup/tables_current.inc.php
- @param $app app-name
- @param $phpgw_baseline tabledefinitions
- @return True if file writen else False
+ /**
+ * @author ralfbecker
+ * writes tabledefinitions $phpgw_baseline to file
/$app/setup/tables_current.inc.php
+ *
+ * @param $app app-name
+ * @param $phpgw_baseline tabledefinitions
+ * @return True if file writen else False
*/
function write($app,$phpgw_baseline)
{
@@ -576,15 +560,14 @@
return True;
}
- /*!
- @function setup_version
- @syntax setup_version( $app,$new = '',$tables='' )
- @author ralfbecker
- @abstract reads and updates the version and tables info in file
$app/setup/setup.inc.php
- @param $app the app
- @param $new new version number to set, if $new != ''
- @param $tables new tables to include, if $tables != ''
- @return the version or False if the file could not be read or
written
+ /**
+ * @author ralfbecker
+ * reads and updates the version and tables info in file
$app/setup/setup.inc.php
+ *
+ * @param $app the app
+ * @param $new new version number to set, if $new != ''
+ * @param $tables new tables to include, if $tables != ''
+ * @return the version or False if the file could not be read
or written
*/
function setup_version($app,$new = '',$tables='')
{
@@ -685,15 +668,14 @@
return $new;
}
- /*!
- @function update
- @syntax update( $app,$current,$version )
- @author ralfbecker
- @abstract updates file /$app/setup/tables_update.inc.php to
reflect changes in $current
- @param $app app-name
- @param $current new tabledefinitions
- @param $version new version
- @return True if file writen else False
+ /**
+ * @author ralfbecker
+ * updates file /$app/setup/tables_update.inc.php to reflect
changes in $current
+ *
+ * @param $app app-name
+ * @param $current new tabledefinitions
+ * @param $version new version
+ * @return True if file writen else False
*/
function update($app,$current,$version)
{
@@ -849,12 +831,11 @@
return $update;
}
- /*!
- @function normalize
- @syntax normalize( $table )
- @author ralfbecker
- @abstract sets all nullable properties to True or False
- @result the new array
+ /**
+ * @author ralfbecker
+ * sets all nullable properties to True or False
+ *
+ * @return the new array
*/
function normalize($table)
{
@@ -879,12 +860,11 @@
);
}
- /*!
- @function tables_identical
- @syntax tables_identical( $old,$new )
- @author ralfbecker
- @abstract compares two table-definitions
- @result True if they are identical or False else
+ /**
+ * @author ralfbecker
+ * compares two table-definitions
+ *
+ * @return True if they are identical or False else
*/
function tables_identical($a,$b)
{
Index: inc/class.editor.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.editor.inc.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- inc/class.editor.inc.php 3 Sep 2006 17:01:15 -0000 1.39
+++ inc/class.editor.inc.php 6 Sep 2006 11:13:30 -0000 1.40
@@ -1,16 +1,12 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplates - Editor
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.editor.inc.php,v 1.39 2006/09/03 17:01:15 Caeies Exp $ */
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.editor.inc.php,v 1.40 2006/09/06 11:13:30 skwashd Exp $
+*/
class editor
{
@@ -51,8 +47,8 @@
function editor()
{
- $this->etemplate = CreateObject('etemplate.etemplate');
- //echo '$HTTP_POST_VARS=';
_debug_array($HTTP_POST_VARS);
+ $this->etemplate = createObject('etemplate.etemplate');
+ //echo '$_POST='; _debug_array($_POST);
$this->editor = new etemplate('etemplate.editor');
}
@@ -527,9 +523,9 @@
}
if (!is_object($this->etemplate->xul_io))
{
- $this->etemplate->xul_io =
CreateObject('etemplate.xul_io');
+ $this->etemplate->xul_io =
createObject('etemplate.xul_io');
}
- $xul =
$this->etemplate->xul_io->export($this->etemplate);
+ $xul =
$this->etemplate->xul_io->export(&$this->etemplate);
fwrite($f,$xul);
fclose($f);
@@ -548,9 +544,9 @@
if (!is_object($this->etemplate->xul_io))
{
- $this->etemplate->xul_io =
CreateObject('etemplate.xul_io');
+ $this->etemplate->xul_io =
createObject('etemplate.xul_io');
}
- $imported =
$this->etemplate->xul_io->import($this->etemplate,$xul);
+ $imported =
$this->etemplate->xul_io->import(&$this->etemplate,$xul);
$this->etemplate->modified = @filemtime($f);
$this->etemplate->modified_set = 'xul-import';
@@ -792,13 +788,11 @@
),'');
}
- /*!
- @function scan_for_extensions
- @syntax scan_for_extensions( $app )
- @author ralfbecker
- @abstract search the inc-dirs of etemplate and the app whichs
template is edited for extensions / custom widgets
- @discussion extensions are class-files in
$app/inc/class.${name}_widget.inc.php
- @result array with name => human_name of the extensions found
+ /**
+ * search the inc-dirs of etemplate and the app whichs template
is edited for extensions / custom widgets
+ *
+ * extensions are class-files in
$app/inc/class.${name}_widget.inc.php
+ * @return array with name => human_name of the extensions found
*/
function scan_for_extensions($app='etemplate')
{
Index: inc/class.etemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.etemplate.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- inc/class.etemplate.inc.php 3 Sep 2006 17:00:40 -0000 1.6
+++ inc/class.etemplate.inc.php 6 Sep 2006 11:13:30 -0000 1.7
@@ -1,16 +1,12 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - EditableTemplates
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.etemplate.inc.php,v 1.6 2006/09/03 17:00:40 Caeies Exp $
*/
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.etemplate.inc.php,v 1.7 2006/09/06 11:13:30 skwashd Exp $
+*/
if (!function_exists('get_var'))
{
Index: inc/class.html.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.html.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- inc/class.html.inc.php 6 Sep 2006 10:27:22 -0000 1.24
+++ inc/class.html.inc.php 6 Sep 2006 11:13:30 -0000 1.25
@@ -1,16 +1,12 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - HTML creation class
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.html.inc.php,v 1.24 2006/09/06 10:27:22 Caeies Exp $ */
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.html.inc.php,v 1.25 2006/09/06 11:13:30 skwashd Exp $
+*/
class html
{
@@ -158,44 +154,32 @@
($image == '' || $accesskey ? $lang_u : '').'</button>';
}
- /*!
- @function link
- @abstract creates an absolut link + the query / get-variables
- @param $url phpgw-relative link, may include query / get-vars
- @parm $vars query or array ('name' => 'value', ...) with query
- @example
link('/index.php?menuaction=infolog.uiinfolog.get_list',array('info_id' => 123))
- @example =
'http://domain/phpgw-path/index.php?menuaction=infolog.uiinfolog.get_list&info_id=123'
- @result absolut link already run through $phpgw->link
+ /**
+ * creates an absolut link + the query / get-variables
+ *
+ * @param $url phpgw-relative link, may include query / get-vars
+ * $vars query or array ('name' => 'value', ...) with query
+ *
link('/index.php?menuaction=infolog.uiinfolog.get_list',array('info_id' => 123))
+ * =
'http://domain/phpgw-path/index.php?menuaction=infolog.uiinfolog.get_list&info_id=123'
+ * @return absolut link already run through $GLOBALS['phpgw']->link
*/
- function link($url,$vars='')
+ function link($url, $vars='')
{
+ //echo "<p>html::link(url='$url',vars='"; print_r($vars); echo
"')</p>\n";
if (!is_array($vars))
{
- if(!empty($vars))
- {
- $vars = explode('&',$vars);
- }
- else
- {
- $vars = array();
- }
+ parse_str($vars, $vars);
}
+
if(strpos('?',$url) > 0)
{
list($url,$v) = explode('?',$url); // url may
contain additional vars
}
+
if (isset($v))
{
- $vars += explode('&',$v);
- foreach($vars as $k => $vv)
- {
- $tmp = explode('=', $vv);
- if(count($tmp) == 2)
- {
- $vars[$tmp[0]] = $tmp[1];
- unset($vars[$k]);
- }
- }
+ parse_str($v,$v);
+ $vars += $v;
}
return $GLOBALS['phpgw']->link($url,$vars);
}
@@ -224,17 +208,16 @@
$hidden_vars,$url,$url_vars,$form_name,'',$method);
}
- /*!
- @function table
- @abstracts creates table from array with rows
- @discussion abstract the html stuff
- @param $rows array with rows, each row is an array of the cols
- @param $options options for the table-tag
- @example $rows = array ( '1' => array( 1 => 'cell1', '.1' =>
'colspan=3',
- @example 2 => 'cell2', 3 => 'cell3',
'.3' => 'width="10%"' ),
- @example '.1' => 'BGCOLOR="#0000FF"' );
- @example table($rows,'WIDTH="100%"') = '<table WIDTH="100%"><tr><td
colspan=3>cell1</td><td>cell2</td><td width="10%">cell3</td></tr></table>'
- @result string with html-code of the table
+ /**
+ * creates table from array with rows
+ * abstract the html stuff
+ * @param $rows array with rows, each row is an array of the cols
+ * @param $options options for the table-tag
+ * $rows = array ( '1' => array( 1 => 'cell1', '.1' => 'colspan=3',
+ * 2 => 'cell2', 3 => 'cell3', '.3' =>
'width="10%"' ),
+ * '.1' => 'BGCOLOR="#0000FF"' );
+ * table($rows,'WIDTH="100%"') = '<table WIDTH="100%"><tr><td
colspan=3>cell1</td><td>cell2</td><td width="10%">cell3</td></tr></table>'
+ * @return string with html-code of the table
*/
function table($rows,$options = '',$no_table_tr=False)
{
@@ -342,13 +325,13 @@
return "<hr $options>\n";
}
- /*!
- @function formatOptions
- @abstract formats option-string for most of the above functions
- @param $options String (or Array) with option-values eg. '100%,,1'
- @param $names String (or Array) with the option-names eg.
'WIDTH,HEIGHT,BORDER'
- @example formatOptions('100%,,1','WIDTH,HEIGHT,BORDER') = '
WIDTH="100%" BORDER="1"'
- @result option string
+ /**
+ * formats option-string for most of the above functions
+ *
+ * @param $options String (or Array) with option-values eg. '100%,,1'
+ * @param $names String (or Array) with the option-names eg.
'WIDTH,HEIGHT,BORDER'
+ * formatOptions('100%,,1','WIDTH,HEIGHT,BORDER') = ' WIDTH="100%"
BORDER="1"'
+ * @return option string
*/
function formatOptions($options,$names)
{
@@ -362,20 +345,20 @@
return $html;
}
- /*!
- @function themeStyles
- @abstract returns simple stylesheet (incl. <STYLE> tags) for nextmatch
row-colors
- @result the classes 'th' = nextmatch header, 'row_on'+'row_off' =
alternating rows
+ /**
+ * returns simple stylesheet (incl. <STYLE> tags) for nextmatch
row-colors
+ *
+ * @return the classes 'th' = nextmatch header, 'row_on'+'row_off' =
alternating rows
*/
function themeStyles()
{
return $this->style($this->theme2css());
}
- /*!
- @function theme2css
- @abstract returns simple stylesheet for nextmatch row-colors
- @result the classes 'th' = nextmatch header, 'row_on'+'row_off' =
alternating rows
+ /**
+ * returns simple stylesheet for nextmatch row-colors
+ *
+ * @return the classes 'th' = nextmatch header, 'row_on'+'row_off' =
alternating rows
*/
function theme2css()
{
Index: inc/class.link_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.link_widget.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- inc/class.link_widget.inc.php 5 May 2005 14:31:55 -0000 1.8
+++ inc/class.link_widget.inc.php 6 Sep 2006 11:13:30 -0000 1.9
@@ -1,25 +1,22 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplate Extension - InfoLog LinkTo Widget
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.link_widget.inc.php,v 1.8 2005/05/05 14:31:55 powerstat
Exp $ */
-
- /*!
- @class link_widget
- @author ralfbecker
- @abstract link-to: Widget to create links to an other entries of
link-aware apps
- @abstract link-list: Widget to shows the links to an entry and a Unlink
Button for each link
- @abstract link-string: comma-separated list of link-titles with a link
to its view method, value is like get_links()
- @discussion This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no
- render-function.
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.link_widget.inc.php,v 1.9 2006/09/06 11:13:30 skwashd
Exp $
+*/
+
+ /**
+ * link-to: Widget to create links to an other entries of link-aware
apps
+ *
+ * link-list: Widget to shows the links to an entry and a Unlink Button
for each link
+ *
+ * link-string: comma-separated list of link-titles with a link to its
view method, value is like get_links()
+ *
+ * This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no
+ * * render-function.
*/
class link_widget
{
@@ -36,7 +33,7 @@
function link_widget($ui)
{
- $this->link = CreateObject('infolog.bolink');
+ $this->link = createObject('infolog.bolink');
}
function
pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)
@@ -222,7 +219,7 @@
echo
"<p>unlink(link-id=$unlink,$value[to_app],$value[to_id])</p>\n";
if (is_array($value['to_id']))
_debug_array($value['to_id']);
}
-
$this->link->unlink($unlink,$value['to_app'],$value['to_id']);
+
$this->link->unlink($unlink,$value['to_app'],&$value['to_id']);
if (is_array($value['to_id']))
{
$extension_data['to_id'] =
$value['to_id']; // else changes from unlink get lost
Index: inc/class.nextmatch_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.nextmatch_widget.inc.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- inc/class.nextmatch_widget.inc.php 29 Jun 2003 16:59:14 -0000 1.14
+++ inc/class.nextmatch_widget.inc.php 6 Sep 2006 11:13:30 -0000 1.15
@@ -1,23 +1,18 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplate Extension - Nextmatch Widget
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.nextmatch_widget.inc.php,v 1.14 2003/06/29 16:59:14
ralfbecker Exp $ */
-
- /*!
- @class nextmatch_widget
- @author ralfbecker
- @abstract Widget that show only a certain number of data-rows and
allows to modifiy the rows shown (scroll).
- @discussion This widget replaces the old nextmatch-class
- @discussion This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no render-function
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.nextmatch_widget.inc.php,v 1.15 2006/09/06 11:13:30
skwashd Exp $
+*/
+
+ /**
+ * Widget that show only a certain number of data-rows and allows to
modifiy the rows shown (scroll).
+ *
+ * This widget replaces the old nextmatch-class
+ * This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no render-function
*/
class nextmatch_widget
{
@@ -36,7 +31,7 @@
//echo "<p>nextmatch_widget.pre_process: value = ";
_debug_array($value);
list($app,$class,$method) =
explode('.',$value['get_rows']);
- $obj = CreateObject($app.'.'.$class);
+ $obj = createObject($app.'.'.$class);
if (!is_object($obj))
{
echo "<p>nextmatch_widget::pre_process($name):
'$value[get_rows]' is no valid method !!!</p>\n";
@@ -152,7 +147,7 @@
}
unset($value['bottom']);
}
- if ($value['start_search'] ||
+ if ($value['start_search'] || $value['search'] !=
$old_value['search'] ||
isset($value['cat_id']) && $value['cat_id'] !=
$old_value['cat_id'] ||
$old_value['filter'] != '' &&
isset($value['filter']) && $value['filter'] != $old_value['filter'] ||
$old_value['filter2'] != '' &&
isset($value['filter2']) && $value['filter2'] != $old_value['filter2'])
Index: inc/class.sbox2.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.sbox2.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- inc/class.sbox2.inc.php 13 Apr 2003 16:02:32 -0000 1.7
+++ inc/class.sbox2.inc.php 6 Sep 2006 11:13:30 -0000 1.8
@@ -1,33 +1,15 @@
<?php
- /**************************************************************************\
- * phpGroupWare API - Select Box 2 *
- * Written by Ralf Becker <address@hidden> *
- * Class for creating select boxes for addresse, projects, array items, ... *
- * Copyright (C) 2000, 2001 Dan Kuykendall *
- * -------------------------------------------------------------------------*
- * This library is part of the phpGroupWare API *
- * http://www.phpgroupware.org/api *
- * ------------------------------------------------------------------------ *
- * This library is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as published by *
- * the Free Software Foundation; either version 2.1 of the License, *
- * or any later version. *
- * This library 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 Lesser General Public License for more details. *
- * You should have received a copy of the GNU Lesser General Public License *
- * along with this library; if not, write to the Free Software Foundation, *
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- \**************************************************************************/
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @internal based on phpgwapi/sbox2
+* @package etemplate
+* @version $Id: class.sbox2.inc.php,v 1.8 2006/09/06 11:13:30 skwashd Exp $
+*/
- /* $Id: class.sbox2.inc.php,v 1.7 2003/04/13 16:02:32 ralfbecker Exp $ */
-
- if(!isset($GLOBALS['phpgw_info']['flags']['included_classes']['sbox']))
- {
- include(PHPGW_API_INC . '/class.sbox.inc.php');
- $GLOBALS['phpgw_info']['flags']['included_classes']['sbox'] =
True;
- }
+ include_once(PHPGW_API_INC . '/class.sbox.inc.php');
class sbox2 extends sbox
{
@@ -133,7 +115,7 @@
{
if (!is_object($this->bocal))
{
- $this->bocal =
createobject('calendar.bocalendar');
+ $this->bocal =
createObject('calendar.bocalendar');
}
if (!is_array($event) && (int) $event > 0)
{
@@ -179,7 +161,7 @@
{
if (!is_object($this->bocal))
{
- $this->bocal =
createobject('calendar.bocalendar');
+ $this->bocal =
createObject('calendar.bocalendar');
}
if ($query_name)
{
@@ -244,7 +226,7 @@
// echo
"<p>getAddress('$name',$id_name,'$query_name','$title')</p>";
if ($id_name || $query_name)
{
- $contacts = createobject('phpgwapi.contacts');
+ $contacts = createObject('phpgwapi.contacts');
if ($query_name)
{
@@ -276,7 +258,7 @@
if (!is_array($addr))
{
$home = substr($addr,-1) == 'h';
- $contacts = createobject('phpgwapi.contacts');
+ $contacts = createObject('phpgwapi.contacts');
list( $addr ) = $contacts->read_single_entry(
intval($addr) );
}
if ($home)
@@ -310,7 +292,7 @@
// echo
"<p>getAddress('$name',$id_name,'$query_name','$title')</p>";
if ($id_name || $query_name)
{
- $contacts = createobject('phpgwapi.contacts');
+ $contacts = createObject('phpgwapi.contacts');
if ($query_name)
{
@@ -367,7 +349,7 @@
}
if ($id_name || $query_name)
{
- $projects = createobject('projects.boprojects');
+ $projects = createObject('projects.boprojects');
if (!is_object($projects))
{
return '';
@@ -499,8 +481,8 @@
if (!is_array($account_data))
{
- $accounts =
createobject('phpgwapi.accounts',$id);
- $accounts->db = $GLOBALS['phpgw']->db;
+ $accounts =
createObject('phpgwapi.accounts',$id);
+ $accounts->db =& $GLOBALS['phpgw']->db;
$accounts->read_repository();
$account_data = $accounts->data;
}
@@ -523,8 +505,8 @@
*/
function
getAccount($name,$id,$longnames=0,$type='accounts',$multiple=0,$options='')
{
- $accounts = createobject('phpgwapi.accounts');
- $accounts->db = $GLOBALS['phpgw']->db;
+ $accounts = createObject('phpgwapi.accounts');
+ $accounts->db =& $GLOBALS['phpgw']->db;
$accs = $accounts->get_list($type);
if ($multiple < 0)
@@ -566,7 +548,7 @@
{
if (!is_object($this->cat))
{
- $this->cat =
CreateObject('phpgwapi.categories');
+ $this->cat =
createObject('phpgwapi.categories');
}
if ($jscript)
{
Index: inc/class.select_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.select_widget.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- inc/class.select_widget.inc.php 4 May 2003 09:18:40 -0000 1.8
+++ inc/class.select_widget.inc.php 6 Sep 2006 11:13:30 -0000 1.9
@@ -1,23 +1,18 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplate Extension - Select Widgets
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.select_widget.inc.php,v 1.8 2003/05/04 09:18:40
ralfbecker Exp $ */
-
- /*!
- @class select_widget
- @author ralfbecker
- @abstract Several select-boxes with predefined phpgw specific content.
- @discussion This widget replaces the old sbox class
- @discussion This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no render-function
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.select_widget.inc.php,v 1.9 2006/09/06 11:13:30 skwashd
Exp $
+*/
+
+ /**
+ * Several select-boxes with predefined phpgw specific content.
+ *
+ * This widget replaces the old sbox class
+ * This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no render-function
*/
class select_widget
{
@@ -356,6 +351,8 @@
function select_widget($ui)
{
+ $this->firsttime = true;
+
foreach($this->monthnames as $k => $name)
{
if ($name)
@@ -415,7 +412,7 @@
case 'select-cat': // !$type == globals
cats too
if
(!is_object($GLOBALS['phpgw']->categories))
{
- $GLOBALS['phpgw']->categories =
CreateObject('phpgwapi.categories');
+ $GLOBALS['phpgw']->categories =
createObject('phpgwapi.categories');
}
$cats =
$GLOBALS['phpgw']->categories->return_sorted_array(0,False,'','','',!$type);
@@ -447,16 +444,17 @@
break;
case 'select-account': // options:
#rows,{accounts(default)|both|groups},{0(=lid)|1(default=name)|2(=lid+name))}
- $accs =
$GLOBALS['phpgw']->accounts->get_list(empty($type) ? 'accounts' : $type); //
default is accounts
- while (list(,$acc) = each($accs))
+ if ($this->firsttime)
{
- if ($acc['account_type'] == 'g')
-
$cell['sel_options'][$acc['account_id']] =
$this->accountInfo($acc['account_id'],$acc,$type2,$type=='both');
+ $this->firsttime = False;
+ $tmp_type = ( empty($type) ) ?
'accounts' : $type;
+ $this->accs =
$GLOBALS['phpgw']->accounts->get_list($tmp_type); // default is accounts
}
- reset($accs);
- while (list(,$acc) = each($accs))
+
+ reset($this->accs);
+ while (list(,$acc) = each($this->accs))
{
- if ($acc['account_type'] == 'u')
+ if ($acc['account_type'] == 'g'
|| $acc['account_type'] == 'u')
$cell['sel_options'][$acc['account_id']] =
$this->accountInfo($acc['account_id'],$acc,$type2,$type=='both');
}
$cell['no_lang'] = True;
@@ -489,18 +487,22 @@
$type3 = 1;
// fall-through
- case 'select-number': // options:
rows,min,max,dec
- $cell['sel_options'][''] = '';
- $type = $type === '' ? 1 :
intval($type);
- $type2 = $type2 === '' ? 10 :
intval($type2);
- $type3 = !$type3 ? 1 : intval($type3);
+ case 'select-number': // options:
rows,min,max,decrement
+ $type = $type === '' ? 1 :
intval($type); // min
+ $type2 = $type2 === '' ? 10 :
intval($type2); // max
+ $format = '%d';
+ if (!empty($type3) && $type3[0] == '0')
// leading zero
+ {
+ $format =
'%0'.strlen($type3).'d';
+ }
+ $type3 = !$type3 ? 1 : intval($type3);
// decrement
if (($type < $type2) != ($type3 > 0))
{
$type3 = -$type3; // void
infinite loop
}
for ($i=0,$n=$type; $n <= $type2 && $i
<= 100; $n += $type3)
{
- $cell['sel_options'][$n] = $n;
+ $cell['sel_options'][$n] =
sprintf($format,$n);
}
$cell['no_lang'] = True;
break;
Index: inc/class.so_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.so_sql.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- inc/class.so_sql.inc.php 4 May 2005 12:12:41 -0000 1.6
+++ inc/class.so_sql.inc.php 6 Sep 2006 11:13:30 -0000 1.7
@@ -1,34 +1,29 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - generalized SQL Storage Object
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.so_sql.inc.php,v 1.6 2005/05/04 12:12:41 powerstat Exp $
*/
-
-/*!
address@hidden so_sql
address@hidden ralfbecker
address@hidden generalized SQL Storage Object
address@hidden the class can be used in following ways:
address@hidden 1) by calling the constructor with an app and table-name or
address@hidden 2) by setting the following class-vars in a class derifed from
this one
address@hidden Of cause can you derife the class and call the constructor with
params.
address@hidden $table_name need to be set in the derived class to the
db-table-name
address@hidden $autoinc_id db-col-name of autoincrement id or ''
address@hidden $db_key_cols array of all primary-key-columns in form dbName =>
internalName
address@hidden the save function does NOT touch any other cols in the table!!!
address@hidden $db_data_cols array of all data-cols
address@hidden $debug turns on debug-messages
address@hidden $empty_on_write string to be written to db if a col-value is '',
eg. "''" or 'NULL' (default)
address@hidden $non_db_cols all cols in data which are not (direct)in the db,
for data_merge
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.so_sql.inc.php,v 1.7 2006/09/06 11:13:30 skwashd Exp $
*/
+
+/**
+ * generalized SQL Storage Object
+ *
+ * the class can be used in following ways:
+ * 1) by calling the constructor with an app and table-name or
+ * 2) by setting the following class-vars in a class derifed from this one
+ * Of cause can you derife the class and call the constructor with params.
+ * @param $table_name need to be set in the derived class to the db-table-name
+ * @param $autoinc_id db-col-name of autoincrement id or ''
+ * @param $db_key_cols array of all primary-key-columns in form dbName =>
internalName
+ * the save function does NOT touch any other cols in the table!!!
+ * @param $db_data_cols array of all data-cols
+ * @param $debug turns on debug-messages
+ * @param $empty_on_write string to be written to db if a col-value is '', eg.
"''" or 'NULL' (default)
+ * @param $non_db_cols all cols in data which are not (direct)in the db, for
data_merge
+ */
class so_sql
{
var $public_functions = array(
@@ -48,18 +43,17 @@
var $data; // holds the content of all db_cols
var $debug = 0;
var $empty_on_write = 'NULL';
+ var $non_db_cols = array();
- /*!
- @function so_sql
- @syntax so_sql( $app='',$table='' )
- @author ralfbecker
- @abstract constructor of the class
- @discussion NEED to be called from the constructor of the derived class
- @param $app, $table should be set if table-defs to be read from
<app>/setup/tables_current.inc.php
+ /**
+ * constructor of the class
+ *
+ * NEED to be called from the constructor of the derived class
+ * @param $app, $table should be set if table-defs to be read from
<app>/setup/tables_current.inc.php
*/
function so_sql($app='',$table='')
{
- $this->db = $GLOBALS['phpgw']->db;
+ $this->db =& $GLOBALS['phpgw']->db;
$this->db_cols = $this->db_key_cols + $this->db_data_cols;
if ($app && $table)
@@ -75,13 +69,11 @@
}
}
- /*!
- @function setup_table
- @syntax setup_table( $app,$table )
- @author ralfbecker
- @abstract reads table-definition from <app>/setup/tables_current.inc.php
- @discussion Does NOT set a different internal-data-name. If you want
this, you have to do so
- @discussion in a derifed class !!!
+ /**
+ * reads table-definition from <app>/setup/tables_current.inc.php
+ *
+ * Does NOT set a different internal-data-name. If you want this, you
have to do so
+ * in a derifed class !!!
*/
function setup_table($app,$table)
{
@@ -120,12 +112,10 @@
}
}
- /*!
- @function so_data_merge
- @syntax so_data_merge( $new )
- @author ralfbecker
- @abstract merges in new values from the given new data-array
- @param $new array in form col => new_value with values to set
+ /**
+ * merges in new values from the given new data-array
+ *
+ * @param $new array in form col => new_value with values to set
*/
function data_merge($new)
{
@@ -149,12 +139,12 @@
}
}
- /*!
- @function db2data
- @abstract changes the data from the db-format to your work-format
- @discussion it gets called everytime when data is read from the db
- @discussion This function needs to be reimplemented in the derived class
- @param $data if given works on that array and returns result, else
works on internal data-array
+ /**
+ * changes the data from the db-format to your work-format
+ *
+ * it gets called everytime when data is read from the db
+ * This function needs to be reimplemented in the derived class
+ * @param $data if given works on that array and returns result, else
works on internal data-array
*/
function db2data($data=0)
{
@@ -171,12 +161,12 @@
return $data;
}
- /*!
- @function data2db
- @abstract changes the data from your work-format to the db-format
- @discussion It gets called everytime when data gets writen into db or
on keys for db-searches
- @discussion this needs to be reimplemented in the derived class
- @param $data if given works on that array and returns result, else
works on internal data-array
+ /**
+ * changes the data from your work-format to the db-format
+ *
+ * It gets called everytime when data gets writen into db or on keys
for db-searches
+ * this needs to be reimplemented in the derived class
+ * @param $data if given works on that array and returns result, else
works on internal data-array
*/
function data2db($data=0)
{
@@ -193,11 +183,11 @@
return $data;
}
- /*!
- @function init
- @abstract initializes data with the content of key
- @param $keys array with keys in form internalName => value
- @result void
+ /**
+ * initializes data with the content of key
+ *
+ * @param $keys array with keys in form internalName => value
+ * @return void
*/
function init($keys=array())
{
@@ -208,11 +198,11 @@
$this->data_merge($keys);
}
- /*!
- @function read
- @abstract reads row matched by key and puts all cols in the data array
- @param $keys array with keys in form internalName => value, may be a
scalar value if only one key
- @result data array if row could be retrived else False and data =
array()
+ /**
+ * reads row matched by key and puts all cols in the data array
+ *
+ * @param $keys array with keys in form internalName => value, may be a
scalar value if only one key
+ * @return data array if row could be retrived else False and data =
array()
*/
function read($keys)
{
@@ -273,11 +263,10 @@
return $this->data;
}
- /*!
- @function save
- @abstracts saves the content of data to the db
- @param $keys if given $keys are copied to data before saveing => allows
a save as
- @result 0 on success and errno != 0 else
+ /**
+ * saves the content of data to the db
+ * @param $keys if given $keys are copied to data before saveing =>
allows a save as
+ * @return 0 on success and errno != 0 else
*/
function save($keys='')
{
@@ -323,7 +312,7 @@
$keys = '';
foreach($this->db_key_cols as $db_col => $col)
{
- $keys .= ($keys ? ',':'') .
"$db_col='".addslashes($this->data[$col])."'";
+ $keys .= ($keys ? ' AND ':'') .
"$db_col='".addslashes($this->data[$col])."'";
}
$this->db->query($sql = "UPDATE $this->table_name SET
$vals WHERE $keys",__LINE__,__FILE__);
}
@@ -336,11 +325,11 @@
return $this->db->errno;
}
- /*!
- @function delete
- @abstract deletes row representing keys in internal data or the
supplied $keys if != ''
- @param $keys if not '', array with col => value pairs to characterise
the rows to delete
- @result affected rows, should be 1 if ok, 0 if an error
+ /**
+ * deletes row representing keys in internal data or the supplied $keys
if != ''
+ *
+ * @param $keys if not '', array with col => value pairs to
characterise the rows to delete
+ * @return affected rows, should be 1 if ok, 0 if an error
*/
function delete($keys='')
{
@@ -375,18 +364,18 @@
return $this->db->affected_rows();
}
- /*!
- @function search
- @abstract searches db for rows matching searchcriteria
- @discussion '*' and '?' are replaced with sql-wildcards '%' and '_'
- @param $criteria array of key and data cols, OR a SQL query (content
for WHERE), fully quoted (!)
- @param $only_keys True returns only keys, False returns all cols
- @param $order_by fieldnames + {ASC|DESC} separated by colons ','
- @param $extra_cols string to be added to the SELECT, eg. (count(*) as
num)
- @param $wildcard string appended befor and after each criteria
- @param $empty False=empty criteria are ignored in query, True=empty
have to be empty in row
- @param $op defaults to 'AND', can be set to 'OR' too, then criteria's
are OR'ed together
- @result array of matching rows (the row is an array of the cols) or
False
+ /**
+ * searches db for rows matching searchcriteria
+ *
+ * '*' and '?' are replaced with sql-wildcards '%' and '_'
+ * @param $criteria array of key and data cols, OR a SQL query (content
for WHERE), fully quoted (!)
+ * @param $only_keys True returns only keys, False returns all cols
+ * @param $order_by fieldnames + {ASC|DESC} separated by colons ','
+ * @param $extra_cols string to be added to the SELECT, eg. (count(*)
as num)
+ * @param $wildcard string appended befor and after each criteria
+ * @param $empty False=empty criteria are ignored in query, True=empty
have to be empty in row
+ * @param $op defaults to 'AND', can be set to 'OR' too, then
criteria's are OR'ed together
+ * @return array of matching rows (the row is an array of the cols) or
False
*/
function
search($criteria,$only_keys=True,$order_by='',$extra_cols='',$wildcard='',$empty=False,$op='AND')
{
@@ -431,13 +420,11 @@
return $n ? $arr : False;
}
- /*!
- @function not_unique
- @syntax not_unique( $data='' )
- @author ralfbecker
- @abstract Check if values for unique keys are unique
- @param $data data-set to check, defaults to $this->data
- @result 0: all keys are unique, 1: first key not unique, 2: ...
+ /**
+ * Check if values for unique keys are unique
+ *
+ * @param $data data-set to check, defaults to $this->data
+ * @return 0: all keys are unique, 1: first key not unique, 2: ...
*/
function not_unique($data='')
{
Index: inc/class.soetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.soetemplate.inc.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- inc/class.soetemplate.inc.php 3 Sep 2006 17:00:05 -0000 1.30
+++ inc/class.soetemplate.inc.php 6 Sep 2006 11:13:30 -0000 1.31
@@ -1,39 +1,36 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - EditableTemplates - Storage Objects
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.soetemplate.inc.php,v 1.30 2006/09/03 17:00:05 Caeies Exp
$ */
-
- /*!
- @class soetemplate
- @author ralfbecker
- @abstract Storage Objects: Everything to store and retrive the
eTemplates.
- @discussion eTemplates are stored in the db in table 'phpgw_etemplate'
and gets distributed
- @discussion through the file 'etemplates.inc.php' in the setup dir of
each app. That file gets
- @discussion automatically imported in the db, whenever you show a
eTemplate of the app. For
- @discussion performace reasons the timestamp of the file is stored in
the db, so 'new'
- @discussion eTemplates need to have a newer file. The distribution-file
is generated with the
- @discussion function dump, usually by pressing a button in the editor.
- @discussion writeLangFile writes an lang-file with all Labels,
incorporating an existing one.
- @discussion Beside a name eTemplates use the following keys to find the
most suitable template
- @discussion for an user (in order of precedence):
- @discussion 1) User-/Group-Id (not yet implemented)
- @discussion 2) preferd languages of the user (templates for all langs
have $lang='')
- @discussion 3) selected template: verdilak, ... (the default is called
'' in the db, not default)
- @discussion 4) a version-number of the form, eg: '0.9.13.001' (filled
up with 0 same size)
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.soetemplate.inc.php,v 1.31 2006/09/06 11:13:30 skwashd
Exp $
+*/
+
+ /**
+ * Storage Objects: Everything to store and retrive the eTemplates.
+ *
+ * eTemplates are stored in the db in table 'phpgw_etemplate' and gets
distributed
+ * through the file 'etemplates.inc.php' in the setup dir of each app.
That file gets
+ * automatically imported in the db, whenever you show a eTemplate of
the app. For
+ * performace reasons the timestamp of the file is stored in the db, so
'new'
+ * eTemplates need to have a newer file. The distribution-file is
generated with the
+ * function dump, usually by pressing a button in the editor.
+ * writeLangFile writes an lang-file with all Labels, incorporating an
existing one.
+ * Beside a name eTemplates use the following keys to find the most
suitable template
+ * for an user (in order of precedence):
+ * 1) User-/Group-Id (not yet implemented)
+ * 2) preferd languages of the user (templates for all langs have
$lang='')
+ * 3) selected template: verdilak, ... (the default is called '' in
the db, not default)
+ * 4) a version-number of the form, eg: '0.9.13.001' (filled up with 0
same size)
*/
class soetemplate
{
var $public_functions = array(
'init' => True,
+ 'empty_cell' => True,
+ 'new_cell' => True,
'read' => True,
'search' => True,
'save' => True,
@@ -66,15 +63,14 @@
);
var $db_cols;
- /*!
- @function soetemplate
- @abstract constructor of the class
- @syntax
soetemplate($name='',$template='',$lang='',$group=0,$version='',$rows=2,$cols=2)
- @param as read
+ /**
+ * constructor of the class
+ *
+ * @param as read
*/
function
soetemplate($name='',$template='',$lang='',$group=0,$version='',$rows=2,$cols=2)
{
- $this->db = $GLOBALS['phpgw']->db;
+ $this->db =& $GLOBALS['phpgw']->db;
$this->db_cols = $this->db_key_cols +
$this->db_data_cols;
if (empty($name))
@@ -87,12 +83,11 @@
}
}
- /*!
- @function num2chrs
- @abstract generates column-names from index: 'A', 'B', ...,
'AA', 'AB', ..., 'ZZ' (not more!)
- @syntax num2chrs($num)
- @param $num index to generate name from 1 => 'A'
- @result the name
+ /**
+ * generates column-names from index: 'A', 'B', ..., 'AA',
'AB', ..., 'ZZ' (not more!)
+ *
+ * @param $num index to generate name from 1 => 'A'
+ * @return the name
*/
function num2chrs($num)
{
@@ -108,21 +103,66 @@
return $chrs;
}
- /*!
- @function empty_cell
- @abstracts constructor for a new / empty cell (nothing fancy so
far)
- @syntax empty_cell()
- @result the cell
+ /**
+ * constructor for a new / empty cell (nothing fancy so far)
+ * @return the cell
+ */
+ function empty_cell($type='label',$name='')
+ {
+ return array(
+ 'type' => $type,
+ 'name' => $name,
+ );
+ }
+
+ /**
+ * constructs a new cell in a give row or the last row, not
existing rows will be created
+ *
+ * @param int $row row-number starting with 1 (!)
+ * @param string $type type of the cell
+ * @param string $label label for the cell
+ * @param string $name name of the cell (index in the
content-array)
+ * @param array $attributes other attributes for the cell
+ * @return a reference to the new cell, use $new_cell =
&$tpl->new_cell(); (!)
*/
- function empty_cell()
+ function
&new_cell($row=False,$type='label',$label='',$name='',$attributes=False)
+ {
+ $row = $row >= 0 ? intval($row) : 0;
+ if ($row && !isset($this->data[$row]) ||
!isset($this->data[1])) // new row ?
+ {
+ if (!$row) $row = 1;
+
+ $this->data[$row] = array();
+ }
+ if (!$row) // use last row
+ {
+ $row = count($this->data);
+ while (!isset($this->data[$row]))
+ {
+ --$row;
+ }
+ }
+ $row = &$this->data[$row];
+ $col = $this->num2chrs(count($row));
+ $cell = &$row[$col];
+ $cell = $this->empty_cell($type,$name);
+ if ($label !== '')
+ {
+ $attributes['label'] = $label;
+ }
+ if (is_array($attributes))
{
- return array('type' => 'label', 'name' => '');
+ foreach($attributes as $name => $value)
+ {
+ $cell[$name] = $value;
+ }
+ }
+ return $cell;
}
- /*!
- @function set_rows_cols()
- @abstract initialises rows & cols from the size of the
data-array
- @syntax set_rows_cols()
+ /**
+ * initialises rows & cols from the size of the data-array
+ *
*/
function set_rows_cols()
{
@@ -130,13 +170,12 @@
$this->cols = count($this->data[1]); // 1 = first row,
not 0
}
- /*!
- @function init
- @abstract initialises all internal data-structures of the
eTemplate and sets the keys
- @syntax
init($name='',$template='',$lang='',$group=0,$version='',$rows=1,$cols=1)
- @param $name name of the eTemplate or array with the keys or
all data
- @param $template,$lang,$group,$version see class
- @param $rows,$cols initial size of the template
+ /**
+ * initialises all internal data-structures of the eTemplate
and sets the keys
+ *
+ * @param $name name of the eTemplate or array with the keys or
all data
+ * @param $template,$lang,$group,$version see class
+ * @param $rows,$cols initial size of the template
*/
function
init($name='',$template='',$lang='',$group=0,$version='',$rows=1,$cols=1)
{
@@ -174,7 +213,7 @@
return; // data already set
}
$this->size = $this->style = '';
- $this->data = array();
+ $this->data = array(0 => array());
$this->rows = $rows < 0 ? 1 : $rows;
$this->cols = $cols < 0 ? 1 : $cols;
for ($row = 1; $row <= $rows; ++$row)
@@ -186,15 +225,14 @@
}
}
- /*!
- @function read
- @abstract Reads an eTemplate from the database
- @syntax
read($name,$template='default',$lang='default',$group=0,$version='')
- @param as discripted with the class, with the following
exeptions
- @param $template as '' loads the prefered template 'default'
loads the default one '' in the db
- @param $lang as '' loads the pref. lang 'default' loads the
default one '' in the db
- @param $group is NOT used / implemented yet
- @result True if a fitting template is found, else False
+ /**
+ * Reads an eTemplate from the database
+ *
+ * @param as discripted with the class, with the following
exeptions
+ * @param $template as '' loads the prefered template 'default'
loads the default one '' in the db
+ * @param $lang as '' loads the pref. lang 'default' loads the
default one '' in the db
+ * @param $group is NOT used / implemented yet
+ * @return True if a fitting template is found, else False
*/
function
read($name,$template='default',$lang='default',$group=0,$version='')
{
@@ -262,11 +300,10 @@
return True;
}
- /*!
- @function readfile
- @abstract Reads an eTemplate from the filesystem, the keys are
already set by init in read
- @syntax readfile()
- @result True if a template is found, else False
+ /**
+ * Reads an eTemplate from the filesystem, the keys are already
set by init in read
+ *
+ * @return True if a template is found, else False
*/
function readfile()
{
@@ -323,9 +360,9 @@
{
if (!is_object($this->xul_io))
{
- $this->xul_io =
CreateObject('etemplate.xul_io');
+ $this->xul_io =
createObject('etemplate.xul_io');
}
- $loaded = $this->xul_io->import($this,$xml);
+ $loaded = $this->xul_io->import(&$this,$xml);
if (!is_array($loaded))
{
@@ -338,16 +375,14 @@
return True;
}
- /*!
- @function search
- @syntax
search($name,$template='default',$lang='default',$group=0,$version='')
- @author ralfbecker
- @abstract Lists the eTemplates matching the given criteria
- @param as discripted with the class, with the following
exeptions
- @param $template as '' loads the prefered template 'default'
loads the default one '' in the db
- @param $lang as '' loads the pref. lang 'default' loads the
default one '' in the db
- @param $group is NOT used / implemented yet
- @result array of arrays with the template-params
+ /**
+ * Lists the eTemplates matching the given criteria
+ *
+ * @param as discripted with the class, with the following
exeptions
+ * @param $template as '' loads the prefered template 'default'
loads the default one '' in the db
+ * @param $lang as '' loads the pref. lang 'default' loads the
default one '' in the db
+ * @param $group is NOT used / implemented yet
+ * @return array of arrays with the template-params
*/
function
search($name,$template='default',$lang='default',$group=0,$version='')
{
@@ -403,10 +438,9 @@
return $result;
}
- /*!
- @function db2obj
- @abstract copies all cols into the obj and unserializes the
data-array
- @syntax db2obj()
+ /**
+ * copies all cols into the obj and unserializes the data-array
+ *
*/
function db2obj()
{
@@ -440,15 +474,13 @@
$this->set_rows_cols();
}
- /*!
- @function compress_array
- @syntax compress_array( $arr )
- @author ralfbecker
- @abstract to save space in the db all empty values in the array
got unset
- @discussion The never-'' type field ensures a cell does not
disapear completely.
- @discussion Calls it self recursivly for arrays / the rows
- @param $arr the array to compress
- @result the compressed array
+ /**
+ * to save space in the db all empty values in the array got
unset
+ *
+ * The never-'' type field ensures a cell does not disapear
completely.
+ * Calls it self recursivly for arrays / the rows
+ * @param $arr the array to compress
+ * @return the compressed array
*/
function compress_array($arr)
{
@@ -470,12 +502,11 @@
return $arr;
}
- /*!
- @function as_array
- @abstract returns obj-data as array
- @syntax as_array($data_too=0)
- @param $data_too 0 = no data array, 1 = data array too, 2 =
serialize data array
- @result the array
+ /**
+ * returns obj-data as array
+ *
+ * @param $data_too 0 = no data array, 1 = data array too, 2 =
serialize data array
+ * @return the array
*/
function as_array($data_too=0)
{
@@ -498,12 +529,11 @@
return $arr;
}
- /*!
- @function save
- @abstract saves eTemplate-object to db, can be used as saveAs
by giving keys as params
- @syntax
save($name='',$template='.',$lang='.',$group='',$version='.')
- @params keys see class
- @result the number of affected rows, 1 should be ok, 0
somethings wrong
+ /**
+ * saves eTemplate-object to db, can be used as saveAs by
giving keys as params
+ *
+ * keys see class
+ * @return the number of affected rows, 1 should be ok, 0
somethings wrong
*/
function
save($name='',$template='.',$lang='.',$group='',$version='.')
{
@@ -585,11 +615,10 @@
return $this->db->affected_rows();
}
- /*!
- @function delete
- @abstract Deletes the eTemplate from the db, object itself is
unchanged
- @syntax delete()
- @result the number of affected rows, 1 should be ok, 0
somethings wrong
+ /**
+ * Deletes the eTemplate from the db, object itself is unchanged
+ *
+ * @return the number of affected rows, 1 should be ok, 0
somethings wrong
*/
function delete()
{
@@ -602,12 +631,11 @@
return $this->db->affected_rows();
}
- /*!
- @function dump2setup
- @abstract dumps all eTemplates to
<app>/setup/etemplates.inc.php for distribution
- @syntax dump2setup($app)
- @param $app app- or template-name
- @result the number of templates dumped as message
+ /**
+ * dumps all eTemplates to <app>/setup/etemplates.inc.php for
distribution
+ *
+ * @param $app app- or template-name
+ * @return the number of templates dumped as message
*/
function dump2setup($app)
{
@@ -655,26 +683,35 @@
function getToTranslateCell($cell,&$to_trans)
{
+ $strings = explode('|',$cell['help']);
+
+ if ($cell['type'] != 'image')
+ {
+ $strings += explode('|',$cell['label']);
+ }
list($extra_row) = explode(',',$cell['size']);
- if (substr($cell['type'],0,6) != 'select' ||
!empty($extra_row) && $extra_row > 0)
- $extra_row = '';
- $all = explode('|',$cell['help'].($cell['type'] !=
'image'?'|'.$cell['label']:'').
- (!empty($extra_row) ? '|'.$extra_row : ''));
- while (list(,$str) = each($all))
+ if (substr($cell['type'],0,6) == 'select' &&
!empty($extra_row) && !intval($extra_row))
+ {
+ $strings[] = $extra_row;
+ }
+ if (!empty($cell['blur']))
+ {
+ $strings[] = $cell['blur'];
+ }
+ foreach($strings as $str)
{
if (strlen($str) > 1 && $str[0] != '@')
{
- $to_trans[strtolower($str)] = $str;
+ $to_trans[trim(strtolower($str))] =
$str;
}
}
}
- /*!
- @function getToTranslate
- @abstract extracts all texts: labels and helptexts from an
eTemplate-object
- @discussion some extensions use a '|' to squezze multiple texts
in a label or help field
- @syntax getToTranslate()
- @result array with messages as key AND value
+ /**
+ * extracts all texts: labels and helptexts from an
eTemplate-object
+ *
+ * some extensions use a '|' to squezze multiple texts in a
label or help field
+ * @return array with messages as key AND value
*/
function getToTranslate()
{
@@ -683,7 +720,7 @@
reset($this->data); each($this->data); // skip width
while (list($row,$cols) = each($this->data))
{
- while (list($col,$cell) = each($cols))
+ foreach($cols as $col => $cell)
{
$this->getToTranslateCell($cell,$to_trans);
@@ -699,12 +736,11 @@
return $to_trans;
}
- /*!
- @function getToTranslateApp
- @abstract Read all eTemplates of an app an extracts the texts
to an array
- @syntax getToTranslateApp($app)
- @param $app name of the app
- @result the array with texts
+ /**
+ * Read all eTemplates of an app an extracts the texts to an
array
+ *
+ * @param $app name of the app
+ * @return the array with texts
*/
function getToTranslateApp($app)
{
@@ -728,15 +764,14 @@
return $to_trans;
}
- /*!
- @function writeLangFile
- @abstract Write new lang-file using the existing one and all
text from the eTemplates
- @syntax writeLangFile($app,$lang='en',$additional='')
- @param $app app- or template-name
- @param $lang language the messages in the template are,
defaults to 'en'
- @param $additional extra texts to translate, if you pass here
an array with all messages and
- @param select-options they get writen too (form is
<unique key> => <message>)
- @result message with number of messages written (total and new)
+ /**
+ * Write new lang-file using the existing one and all text from
the eTemplates
+ *
+ * @param $app app- or template-name
+ * @param $lang language the messages in the template are,
defaults to 'en'
+ * @param $additional extra texts to translate, if you pass
here an array with all messages and
+ * @param select-options they get writen too (form
is <unique key> => <message>)
+ * @return message with number of messages written (total and
new)
*/
function writeLangFile($app,$lang='en',$additional='')
{
@@ -748,33 +783,35 @@
if
(!file_exists(PHPGW_SERVER_ROOT.'/developer_tools/inc/class.solangfile.inc.php'))
{
- $solangfile =
CreateObject('etemplate.solangfile');
+ $solangfile =
createObject('etemplate.solangfile');
}
else
{
- $solangfile =
CreateObject('developer_tools.solangfile');
+ $solangfile =
createObject('developer_tools.solangfile');
}
$langarr = $solangfile->load_app($app,$lang);
if (!is_array($langarr))
{
$langarr = array();
}
+ $commonarr = $solangfile->load_app('phpgwapi',$lang) +
$solangfile->load_app('etemplate',$lang);
+
$to_trans = $this->getToTranslateApp($app);
if (is_array($additional))
{
//echo "writeLangFile: additional =";
_debug_array($additional);
- reset($additional);
- while (list($nul,$msg) = each($additional))
+ foreach($additional as $msg)
{
- $to_trans[strtolower($msg)] = $msg;
+ $to_trans[trim(strtolower($msg))] =
$msg;
}
}
unset($to_trans['']);
- for ($new = $n = 0; list($message_id,$content) =
each($to_trans); ++$n) {
- if (!isset($langarr[$message_id]))
+ for ($new = $n = 0; list($message_id,$content) =
each($to_trans); ++$n)
+ {
+ if (!isset($langarr[$message_id]) &&
!isset($commonarr[$message_id]))
{
- if (isset($langarr[$content])) //
caused by not lowercased-message_id's
+ if (@isset($langarr[$content])) //
caused by not lowercased-message_id's
{
unset($langarr[$content]);
}
@@ -809,12 +846,11 @@
return lang("%1 (%2 new) Messages writen for
Application '%3' and Languages '%4'",$n,$new,$app,$lang);
}
- /*!
- @function import_dump
- @abstract Imports the dump-file /$app/setup/etempplates.inc.php
unconditional (!)
- @syntax import_dump($app)
- @param $app app name
- @result message with number of templates imported
+ /**
+ * Imports the dump-file /$app/setup/etempplates.inc.php
unconditional (!)
+ *
+ * @param $app app name
+ * @return message with number of templates imported
*/
function import_dump($app)
{
@@ -837,13 +873,12 @@
return lang("%1 new eTemplates imported for Application
'%2'",$n,$app);
}
- /*!
- @function test_import
- @abstract test if new template-import necessary for app and
does the import
- @discussion Get called on every read of a eTemplate, caches the
result in phpgw_info.
- @discussion The timestamp of the last import for app gets
written into the db.
- @syntax test_import($app)
- @param $app app- or template-name
+ /**
+ * test if new template-import necessary for app and does the
import
+ *
+ * Get called on every read of a eTemplate, caches the result
in phpgw_info.
+ * The timestamp of the last import for app gets written into
the db.
+ * @param $app app- or template-name
*/
function test_import($app) // should be done from the
setup-App
{
Index: inc/class.solangfile.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.solangfile.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- inc/class.solangfile.inc.php 27 Apr 2003 08:19:59 -0000 1.2
+++ inc/class.solangfile.inc.php 6 Sep 2006 11:13:30 -0000 1.3
@@ -1,16 +1,11 @@
<?php
- /**************************************************************************\
- * phpGroupWare - Translation Editor *
- * http://www.phpgroupware.org *
- * -------------------------------------------- *
- * 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: class.solangfile.inc.php,v 1.2 2003/04/27 08:19:59 ralfbecker Exp $
*/
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.solangfile.inc.php,v 1.3 2006/09/06 11:13:30 skwashd Exp
$
+*/
class solangfile
{
var $total;
@@ -38,7 +33,7 @@
function solangfile()
{
- $this->db = $GLOBALS['phpgw']->db;
+ $this->db =& $GLOBALS['phpgw']->db;
}
function parse_php_app($fd,$plist)
@@ -127,10 +122,10 @@
return($plist);
}
- /*!
- @function add_app
- @abstract loads all app phrases into langarray
- @param $lang user lang variable (defaults to en)
+ /**
+ * loads all app phrases into langarray
+ *
+ * @param $lang user lang variable (defaults to en)
*/
function add_app($app,$userlang='en')
{
@@ -178,10 +173,10 @@
return $this->langarray;
}
- /*!
- @function load_app
- @abstract loads all app phrases into langarray
- @param $lang user lang variable (defaults to en)
+ /**
+ * loads all app phrases into langarray
+ *
+ * @param $lang user lang variable (defaults to en)
*/
function load_app($app,$userlang='en')
{
Index: inc/class.tab_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.tab_widget.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- inc/class.tab_widget.inc.php 13 Apr 2003 19:14:50 -0000 1.13
+++ inc/class.tab_widget.inc.php 6 Sep 2006 11:13:30 -0000 1.14
@@ -1,23 +1,17 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplate Extension - Tab Widget
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.tab_widget.inc.php,v 1.13 2003/04/13 19:14:50 ralfbecker
Exp $ */
-
- /*!
- @class tab_widget
- @author ralfbecker
- @abstract widget that shows one row of tabs and an other row with the
eTemplate of the selected tab
- @discussion see the example in 'etemplate.tab_widget.test' (use show to
view it)
- @discussion This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no render-function
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.tab_widget.inc.php,v 1.14 2006/09/06 11:13:30 skwashd
Exp $
+*/
+ /**
+ * widget that shows one row of tabs and an other row with the
eTemplate of the selected tab
+ *
+ * see the example in 'etemplate.tab_widget.test' (use show to view it)
+ * This widget is independent of the UI as it only uses
etemplate-widgets and has therefor no render-function
*/
class tab_widget
{
Index: inc/class.uietemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate.inc.php,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- inc/class.uietemplate.inc.php 6 Sep 2006 10:27:22 -0000 1.65
+++ inc/class.uietemplate.inc.php 6 Sep 2006 11:13:30 -0000 1.66
@@ -1,32 +1,26 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - EditableTemplates - HTML User Interface
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.uietemplate.inc.php,v 1.65 2006/09/06 10:27:22 Caeies Exp
$ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.uietemplate.inc.php,v 1.66 2006/09/06 11:13:30 skwashd
Exp $
+*/
include_once(PHPGW_INCLUDE_ROOT .
'/etemplate/inc/class.boetemplate.inc.php');
- /*!
- @class etemplate
- @author ralfbecker
- @abstract creates dialogs / HTML-forms from eTemplate descriptions
- @discussion etemplate or uietemplate extends boetemplate, all vars and
public functions are inherited
- @example $tmpl =
CreateObject('etemplate.etemplate','app.template.name');
- @example $tmpl->exec('app.class.callback',$content_to_show);
- @example This creates a form from the eTemplate 'app.template.name' and
takes care that
- @example the method / public function 'callback' in (bo)class 'class'
of 'app' gets called
- @example if the user submitts the form. Vor the complete param's see
the description of exec.
- @param $debug enables debug messages: 0=no, 1=calls to show and
process_show, 2=content of process_show
- @param 3=calls to show_cell OR template-
or cell-type name
- @param $html instances of html class used to generate the html
+ /**
+ * creates dialogs / HTML-forms from eTemplate descriptions
+ *
+ * etemplate or uietemplate extends boetemplate, all vars and public
functions are inherited
+ * $tmpl = createObject('etemplate.etemplate','app.template.name');
+ * $tmpl->exec('app.class.callback',$content_to_show);
+ * This creates a form from the eTemplate 'app.template.name' and takes
care that
+ * the method / public function 'callback' in (bo)class 'class' of
'app' gets called
+ * if the user submitts the form. Vor the complete param's see the
description of exec.
+ * @param $debug enables debug messages: 0=no, 1=calls to show and
process_show, 2=content of process_show
+ * @param 3=calls to show_cell OR
template- or cell-type name
+ * @param $html instances of html class used to generate the html
*/
class etemplate extends boetemplate
{
@@ -35,11 +29,11 @@
var $html; // instance of html-class
var $class_conf = array('nmh' => 'th','nmr0' => 'row_on','nmr1'
=> 'row_off');
- /*!
- @function etemplate
- @abstract constructor of etemplate class, reads an eTemplate if
$name is given
- @param $name name of etemplate or array with name and other
keys
- @param $load_via name/array with keys of other etemplate to
load in order to get $name
+ /**
+ * constructor of etemplate class, reads an eTemplate if $name
is given
+ *
+ * @param $name name of etemplate or array with name and
other keys
+ * @param $load_via name/array with keys of other etemplate to
load in order to get $name
*/
function etemplate($name='',$load_via='')
{
@@ -49,48 +43,45 @@
'show' => True,
'process_show' => True,
);
- $this->html = CreateObject('etemplate.html'); //
should be in the api (older version in infolog)
+ $this->html = createObject('etemplate.html'); //
should be in the api (older version in infolog)
$this->boetemplate($name,$load_via);
- list($a,$b,$c,$d) =
explode('.',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
- //echo "Version: $a.$b.$c.$d\n";
- //$this->stable = $a <= 0 && $b <= 9 && $c <= 14 &&
!is_object($GLOBALS['phpgw']->xslttpl);
- $this->stable = true; //XXX Make etemplate more or less
working for head CAEIES :)
+ $this->stable = true;
}
- /*!
- @function location
- @abstract Abstracts a html-location-header call
- @discussion In other UI's than html this needs to call the
methode, defined by menuaction or
- @discussion open a browser-window for any other links.
+ /**
+ * Abstracts a html-location-header call
+ *
+ * In other UI's than html this needs to call the methode,
defined by menuaction or
+ * open a browser-window for any other links.
*/
function location($vars='')
{
$GLOBALS['phpgw']->redirect_link(is_array($vars) ?
'/index.php' : $vars,
- is_array($vars) ? $vars : '');
+ is_array($vars) ? $vars : array(), true);
}
- /*!
- @function exec
- @abstract Generats a Dialog from an eTemplate - abstract the
UI-layer
- @discussion This is the only function an application should
use, all other are INTERNAL and
- @discussion do NOT abstract the UI-layer, because they return
HTML.
- @discussion Generates a webpage with a form from the template
and puts process_exec in the
- @discussion form as submit-url to call process_show for the
template before it
- @discussion ExecuteMethod's the given $methode of the caller.
- @param $methode Methode (e.g. 'etemplate.editor.edit') to be
called if form is submitted
- @param $content Array with content to fill the input-fields of
template, eg. the text-field
- @param with name 'name' gets its content from
$content['name']
- @param $sel_options Array or arrays with the options for each
select-field, keys are the
- @param field-names, eg. array('name' => array(1 =>
'one',2 => 'two')) set the
- @param options for field 'name'.
($content['options-name'] is possible too !!!)
- @param $readonlys Array with field-names as keys for fields
with should be readonly
- @param (eg. to implement ACL grants on field-level
or to remove buttons not applicable)
- @param $preserv Array with vars which should be transported to
the $method-call (eg. an id) array('id' => $id)
- sets $HTTP_POST_VARS['id'] for the $method-call
- @param $return_html if true, dont show the page, just return
the html
- @result nothing
+ /**
+ * Generats a Dialog from an eTemplate - abstract the UI-layer
+ *
+ * This is the only function an application should use, all
other are INTERNAL and
+ * do NOT abstract the UI-layer, because they return HTML.
+ * Generates a webpage with a form from the template and puts
process_exec in the
+ * form as submit-url to call process_show for the template
before it
+ * ExecuteMethod's the given $method of the caller.
+ * @param $method Methode (e.g. 'etemplate.editor.edit') to be
called if form is submitted
+ * @param $content Array with content to fill the input-fields
of template, eg. the text-field
+ * @param with name 'name' gets its content from
$content['name']
+ * @param $sel_options Array or arrays with the options for
each select-field, keys are the
+ * @param field-names, eg. array('name' => array(1
=> 'one',2 => 'two')) set the
+ * @param options for field 'name'.
($content['options-name'] is possible too !!!)
+ * @param $readonlys Array with field-names as keys for fields
with should be readonly
+ * @param (eg. to implement ACL grants on
field-level or to remove buttons not applicable)
+ * @param $preserv Array with vars which should be transported
to the $method-call (eg. an id) array('id' => $id)
+ * sets $_POST['id'] for the $method-call
+ * @param $return_html if true, dont show the page, just return
the html
+ * @return nothing
*/
function
exec($method,$content,$sel_options='',$readonlys='',$preserv='',$changes='',$return_html=False)
{
@@ -115,28 +106,6 @@
{
$GLOBALS['phpgw_info']['flags']['app_header'] =
$content['app_header'];
}
-/*
- $html = '';
- if ($this->stable)
- {
- $hooked =
$GLOBALS['phpgw']->template->get_var('phpgw_body');
- if
(address@hidden'phpgw_info']['etemplate']['hooked'] && !$return_html)
- {
-
$GLOBALS['phpgw_info']['flags']['java_script'] = $this->include_java_script(2);
-
$GLOBALS['phpgw']->common->phpgw_header();
- }
- else
- {
- $html = $this->include_java_script(2);
// better than nothing
- }
- }
- else
- {
- $hooked =
$GLOBALS['phpgw']->xslttpl->get_var('phpgw');
- $hooked = $hooked['body_data'];
-
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('java_script' =>
$this->include_java_script(2)));
- }
-*/
if ($GLOBALS['phpgw_info']['flags']['currentapp'] !=
'etemplate')
{
$GLOBALS['phpgw']->translation->add_app('etemplate'); // some extensions have
own texts
@@ -148,9 +117,8 @@
$html = ($this->stable ?
$this->html->themeStyles()."\n\n" : ''). // so they get included once
$this->html->form($this->include_java_script(1).
$this->show($this->complete_array_merge($content,$changes),$sel_options,$readonlys,'exec'),array(
- 'etemplate_exec_id' => $id,
- 'etemplate_exec_app' =>
$GLOBALS['phpgw_info']['flags']['currentapp']
-
),'/etemplate/process_exec.php','','eTemplate',$GLOBALS['phpgw_info']['etemplate']['form_options']);
+ 'etemplate_exec_id' => $id
+
),'/etemplate/process_exec.php?menuaction='.$method,'','eTemplate',$GLOBALS['phpgw_info']['etemplate']['form_options']);
//_debug_array($GLOBALS['phpgw_info']['etemplate']['to_process']);
if ($this->stable)
{
@@ -171,6 +139,7 @@
$hooked = $hooked['body_data'];
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('java_script' =>
$GLOBALS['phpgw_info']['flags']['java_script'].$this->include_java_script(2)));
}
+
$tmpa = explode(',',$this->size);
$width = isset($tmpa[0]) ? $tmpa[0] : '';
$height = isset($tmpa[1]) ? $tmpa[1] : '';
@@ -191,7 +160,7 @@
'java_script' =>
isset($GLOBALS['phpgw_info']['etemplate']['java_script']) ?
$GLOBALS['phpgw_info']['etemplate']['java_script'] : '',
'dom_enabled' =>
isset($GLOBALS['phpgw_info']['etemplate']['dom_enabled']) ?
$GLOBALS['phpgw_info']['etemplate']['dom_enabled'] : '',
'method' => $method,
- 'hooked' => $hooked
+ 'hooked' => $hooked != '' ? $hooked :
$GLOBALS['phpgw_info']['etemplate']['hook_content']
),$id);
if ($return_html)
@@ -204,9 +173,10 @@
{
echo parse_navbar();
}
- echo $html;
+ echo
$GLOBALS['phpgw_info']['etemplate']['hook_content'].$html;
- if
(address@hidden'phpgw_info']['etemplate']['hooked'] &&
!isset($_GET['menuaction']))
+ if
(address@hidden'phpgw_info']['etemplate']['hooked'] &&
+ (!isset($_GET['menuaction']) ||
strstr($_SERVER['PHP_SELF'],'process_exec.php')))
{
$GLOBALS['phpgw']->common->phpgw_footer();
}
@@ -217,31 +187,36 @@
}
}
- /*!
- @function process_exec
- @abstract Makes the necessary adjustments to HTTP_POST_VARS
before it calls the app's method
- @discussion This function is only to submit forms to, create
with exec.
- @discussion All eTemplates / forms executed with exec are
submited to this function
- @discussion (via the global index.php and menuaction). It then
calls process_show
- @discussion for the eTemplate (to adjust the content of the
HTTP_POST_VARS) and
- @discussion ExecMethod's the given callback from the app with
the content of the form as first argument.
+ /**
+ * Makes the necessary adjustments to _POST before it calls the
app's method
+ *
+ * This function is only to submit forms to, create with exec.
+ * All eTemplates / forms executed with exec are submited to
this function
+ * (via the global index.php and menuaction). It then calls
process_show
+ * for the eTemplate (to adjust the content of the _POST) and
+ * ExecMethod's the given callback from the app with the
content of the form as first argument.
*/
function process_exec()
{
- //echo "process_exec: HTTP_POST_VARS =";
_debug_array($GLOBALS['HTTP_POST_VARS']);
- $session_data =
$this->get_appsession($GLOBALS['HTTP_POST_VARS']['etemplate_exec_id']);
+ //echo "process_exec: _POST ="; _debug_array($_POST);
+ $session_data =
$this->get_appsession($_POST['etemplate_exec_id']);
//echo "<p>process_exec: session_data =";
_debug_array($session_data);
- $content = $GLOBALS['HTTP_POST_VARS']['exec'];
+ if (!$_POST['etemplate_exec_id'] ||
!is_array($session_data) || count($session_data) < 10)
+ {
+ // this prevents an empty screen, if the
sessiondata gets lost somehow
+ $this->location(array('menuaction' =>
$_GET['menuaction']));
+ }
+ $content = $_POST['exec'];
if (!is_array($content))
{
$content = array();
}
$this->init($session_data);
$GLOBALS['phpgw_info']['etemplate']['extension_data'] =
$session_data['extension_data'];
- $GLOBALS['phpgw_info']['etemplate']['java_script'] =
$session_data['java_script'] || $GLOBALS['HTTP_POST_VARS']['java_script'];
- $GLOBALS['phpgw_info']['etemplate']['dom_enabled'] =
$session_data['dom_enabled'] || $GLOBALS['HTTP_POST_VARS']['dom_enabled'];
- //echo "globals[java_script] =
'".$GLOBALS['phpgw_info']['etemplate']['java_script']."',
session_data[java_script] = '".$session_data['java_script']."',
HTTP_POST_VARS[java_script] =
'".$GLOBALS['HTTP_POST_VARS']['java_script']."'\n";
+ $GLOBALS['phpgw_info']['etemplate']['java_script'] =
$session_data['java_script'] || $_POST['java_script'];
+ $GLOBALS['phpgw_info']['etemplate']['dom_enabled'] =
$session_data['dom_enabled'] || $_POST['dom_enabled'];
+ //echo "globals[java_script] =
'".$GLOBALS['phpgw_info']['etemplate']['java_script']."',
session_data[java_script] = '".$session_data['java_script']."',
_POST[java_script] = '".$_POST['java_script']."'\n";
//echo "process_exec($this->name) content =";
_debug_array($content);
$this->process_show($content,$session_data['to_process'],'exec');
@@ -256,7 +231,8 @@
{
if ($this->stable)
{
-
$GLOBALS['phpgw']->template->set_var('phpgw_body',$session_data['hooked']);
+ //echo "<p>process_exec:
hook_content set</p>\n";
+
$GLOBALS['phpgw_info']['etemplate']['hook_content'] = $session_data['hooked'];
}
else
{
@@ -264,12 +240,12 @@
}
}
//echo "<p>process_exec($this->name): <font
color=red>loop is set</font>, content=</p>\n"; _debug_array($content);
-
$this->exec($session_data['method'],$session_data['content'],$session_data['sel_options'],
+
$this->exec($_GET['menuaction'],$session_data['content'],$session_data['sel_options'],
$session_data['readonlys'],$session_data['preserv'],$content);
}
else
{
-
ExecMethod($session_data['method'],$this->complete_array_merge($session_data['preserv'],$content));
+
ExecMethod($_GET['menuaction'],$this->complete_array_merge($session_data['preserv'],$content));
}
}
@@ -296,22 +272,22 @@
return $result;
}
- /*!
- @function show
- @abstract creates HTML from an eTemplate
- @discussion This is done by calling show_cell for each cell in
the form. show_cell itself
- @discussion calls show recursivly for each included eTemplate.
- @discussion You can use it in the UI-layer of an app, just make
shure to call process_show !!!
- @discussion This is intended as internal function and should
NOT be called by new app's direct,
- @discussion as it deals with HTML and is so UI-dependent, use
exec instead.
- @param $content array with content for the cells, keys are the
names given in the cells/form elements
- @param $sel_options array with options for the selectboxes,
keys are the name of the selectbox
- @param $readonlys array with names of cells/form-elements to be
not allowed to change
- @param This is to facilitate complex ACL's which
denies access on field-level !!!
- @param $cname basename of names for form-elements, means index
in $HTTP_POST_VARS
- @param eg. $cname='cont', element-name = 'name' returned
content in $HTTP_POST_VARS['cont']['name']
- @param $show_xxx row,col name/index for name expansion
- @result the generated HTML
+ /**
+ * creates HTML from an eTemplate
+ *
+ * This is done by calling show_cell for each cell in the form.
show_cell itself
+ * calls show recursivly for each included eTemplate.
+ * You can use it in the UI-layer of an app, just make shure to
call process_show !!!
+ * This is intended as internal function and should NOT be
called by new app's direct,
+ * as it deals with HTML and is so UI-dependent, use exec
instead.
+ * @param $content array with content for the cells, keys are
the names given in the cells/form elements
+ * @param $sel_options array with options for the selectboxes,
keys are the name of the selectbox
+ * @param $readonlys array with names of cells/form-elements to
be not allowed to change
+ * @param This is to facilitate complex ACL's which
denies access on field-level !!!
+ * @param $cname basename of names for form-elements, means
index in $_POST
+ * @param eg. $cname='cont', element-name = 'name'
returned content in $_POST['cont']['name']
+ * @param $show_xxx row,col name/index for name expansion
+ * @return the generated HTML
*/
function
show($content,$sel_options='',$readonlys='',$cname='',$show_c=0,$show_row=0,
$no_table_tr=False,$tr_class='')
@@ -477,7 +453,7 @@
$colspan = $span == 'all' ?
$this->cols-$c : 0+$span;
if ($colspan > 1)
{
- $row_data[".$col"] .= "
COLSPAN=$colspan";
+ $row_data[".$col"] .= "
COLSPAN=\"$colspan\"";
for ($i = 1; $i < $colspan;
++$i,++$c)
{
each($cols); // skip
next cell(s)
@@ -517,22 +493,21 @@
}
$html =
$this->html->table($rows,$this->html->formatOptions($this->size,'WIDTH,HEIGHT,BORDER,CLASS,CELLSPACING,CELLPADDING'),$no_table_tr);
- /* does NOT work with mozilla: shows nothing if a div
is inside a form
list($width,$height,,,,,$overflow) =
explode(',',$this->size);
if (!empty($overflow)) {
$div_style=' STYLE="'.($width?"width: $width;
":'').($height ? "height: $height; ":'')."overflow: $overflow\"";
$html = $this->html->div($html,$div_style);
- }*/
+ }
return "\n\n<!-- BEGIN $this->name
-->\n$style\n".$html."<!-- END $this->name -->\n\n";
}
- /*!
- @function show_cell
- @abstract generates HTML for 1 input-field / cell
- @discussion calls show to generate included eTemplates. Again
only an INTERMAL function.
- @param $cell array with data of the cell: name, type, ...
- @param for rest see show
- @result the generated HTML
+ /**
+ * generates HTML for 1 input-field / cell
+ *
+ * calls show to generate included eTemplates. Again only an
INTERMAL function.
+ * @param $cell array with data of the cell: name, type, ...
+ * @param for rest see show
+ * @return the generated HTML
*/
function
show_cell($cell,$content,$sel_options,$readonlys,$cname,$show_c,$show_row,&$span)
{
@@ -571,7 +546,7 @@
}
$value = $this->get_array($content,$name);
- if ($readonly = $cell['readonly'] || @$readonlys[$name]
|| $readonlys['__ALL__'])
+ if ($readonly = $cell['readonly'] ||
(@$readonlys[$name] && !is_array($readonlys[$name])) || $readonlys['__ALL__'])
{
$options .= ' READONLY';
}
@@ -605,18 +580,38 @@
{
$help =
$this->get_array($content,substr($help,1));
}
+ $blur = $cell['blur'][0] == '@' ?
$this->get_array($content,substr($cell['blur'],1)) :
+ (strlen($cell['blur']) <= 1 ? $cell['blur'] :
lang($cell['blur']));
+
if ($this->java_script())
{
+ if ($blur)
+ {
+ if (empty($value))
+ {
+ $value = $blur;
+ }
+ $onFocus .=
"if(this.value=='".addslashes(htmlspecialchars($blur))."') this.value='';";
+ $onBlur .= "if(this.value=='')
this.value='".addslashes(htmlspecialchars($blur))."';";
+ }
if ($help)
{
- $options .= "
onFocus=\"self.status='".addslashes(lang($help))."'; return true;\"";
- $options .= " onBlur=\"self.status='';
return true;\"";
+ if ($cell['no_lang'] < 2)
+ {
+ $help = lang($help);
+ }
+ $onFocus .=
"self.status='".addslashes(htmlspecialchars($help))."'; return true;";
+ $onBlur .= "self.status=''; return
true;";
if ($cell['type'] == 'button' ||
$cell['type'] == 'file') // for button additionally when mouse over button
{
- $options .= "
onMouseOver=\"self.status='".addslashes(lang($help))."'; return true;\"";
+ $options .= "
onMouseOver=\"self.status='".addslashes(htmlspecialchars($help))."'; return
true;\"";
$options .= "
onMouseOut=\"self.status=''; return true;\"";
}
}
+ if ($onBlur)
+ {
+ $options .= " onFocus=\"$onFocus\"
onBlur=\"$onBlur\"";
+ }
if ($cell['onchange'] && $cell['type'] !=
'button') // values != '1' can only set by a program (not in the editor so fa
{
$options .= '
onChange="'.($cell['onchange']=='1'?'this.form.submit();':$cell['onchange']).'"';
@@ -806,7 +801,11 @@
list($multiple) =
explode(',',$cell_options);
if (!empty($multiple) && 0+$multiple <=
0)
{
- $sels[''] = $multiple < 0 ?
lang('all') : lang($multiple);
+ $sels[''] = $multiple < 0 ?
'all' : $multiple;
+ if ($cell['no_lang'])
+ {
+ $sels[''] =
lang($sels['']);
+ }
$multiple = 0;
}
if (!empty($cell['sel_options']))
@@ -956,9 +955,15 @@
unset($GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name]);
$GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name] =
'ext-'.$ext_type;
}
+ // save blur-value to strip it in process_exec
+ if (!empty($blur) &&
isset($GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name]))
+ {
+
$GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name] =
is_array($GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name]) ?
$GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name] : array('type' =>
$GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name]);
+
$GLOBALS['phpgw_info']['etemplate']['to_process'][$form_name]['blur'] = $blur;
+ }
if ($extra_label && ($label != '' || $html == ''))
{
- if (strlen($label) > 1 && !($cell['no_lang'] &&
$cell['label'] != $label))
+ if (strlen($label) > 1 && !($cell['no_lang'] &&
$cell['label'] != $label || $cell['no_lang'] == 2))
{
$label = lang($label);
}
@@ -995,16 +1000,15 @@
}
- /*!
- @function process_show
- @abstract makes necessary adjustments on HTTP_POST_VARS after a
eTemplate / form gots submitted
- @discussion This is only an internal function, dont call it
direct use only exec
- @discussion Process_show uses a list of input-fields/widgets
generated by show.
- @syntax process_show(&$content,$to_process,$cname='')
- @param $content HTTP_POST_VARS[$cname]
- @param $to_process list of widgets/form-fields to process
- @param $cname basename of our returnt content (same as in call
to show)
- @result the adjusted content (by using the var-param &$content)
+ /**
+ * makes necessary adjustments on _POST after a eTemplate /
form gots submitted
+ *
+ * This is only an internal function, dont call it direct use
only exec
+ * Process_show uses a list of input-fields/widgets generated
by show.
+ * @param $content _POST[$cname]
+ * @param $to_process list of widgets/form-fields to process
+ * @param $cname basename of our returnt content (same as in
call to show)
+ * @return the adjusted content (by using the var-param
&$content)
*/
function process_show(&$content,$to_process,$cname='')
{
@@ -1031,6 +1035,11 @@
$attr = array();
}
$value =
$this->get_array($content_in,$form_name);
+
+ if (isset($attr['blur']) && $attr['blur'] ==
stripslashes($value))
+ {
+ $value = ''; // blur-values is equal
to emtpy
+ }
//echo "<p>process_show($this->name) $type:
$form_name = '$value'</p>\n";
list($type,$sub) = explode('-',$type);
switch ($type)
@@ -1100,13 +1109,11 @@
}
}
- /*!
- @function java_script
- @syntax java_script( $consider_not_tested_as_enabled = True )
- @author ralfbecker
- @abstract is javascript enabled?
- @discussion this should be tested by the api at login
- @result true if javascript is enabled or not yet tested and
$consider_not_tested_as_enabled
+ /**
+ * is javascript enabled?
+ *
+ * this should be tested by the api at login
+ * @return true if javascript is enabled or not yet tested and
$consider_not_tested_as_enabled
*/
function java_script($consider_not_tested_as_enabled = True)
{
@@ -1121,13 +1128,11 @@
$GLOBALS['phpgw_info']['etemplate']['java_script'].'' == '');
}
- /*!
- @function include_java_script
- @syntax include_java_script( )
- @author ralfbecker
- @abstract returns the javascript to be included by exec
- @param $what &1 = returns the test, note: has to be included in
the body, not the header\
- &2 = returns the common functions, best to be included
in the header
+ /**
+ * returns the javascript to be included by exec
+ *
+ * @param $what &1 = returns the test, note: has to be included
in the body, not the header\
+ * &2 = returns the common functions, best to be included
in the header
*/
function include_java_script($what = 3)
{
@@ -1146,61 +1151,8 @@
// here are going all the necesarry functions if
javascript is enabled
if ($what & 2 && $this->java_script(True))
{
- $js .= "<script language=\"JavaScript\">
-function set_element(form,name,value)
-{
-". /* " alert('set_element: '+name+'='+value);". */ "
- for (i = 0; i < form.length; i++)
- {
- if (form.elements[i].name == name)
- {
- form.elements[i].value = value;
- }
- }
-}
-
-function set_element2(form,name,vname)
-{
-". /* " alert('set_element2: '+name+'='+vname);". */ "
- for (i = 0; i < form.length; i++)
- {
- if (form.elements[i].name == vname)
- {
- value = form.elements[i].value;
- }
- }
-". /* " alert('set_element2: '+name+'='+value);". */ "
- for (i = 0; i < form.length; i++)
- {
- if (form.elements[i].name == name)
- {
- form.elements[i].value = value;
- }
- }
-}
-
-function activate_tab(tab,all_tabs,name)
-{
- var tabs = all_tabs.split('|');
- var parts = tab.split('.');
- var last_part = parts.length-1;
-
- for (n = 0; n < tabs.length; n++)
- {
- var t = tabs[n];
-
- if (t.indexOf('.') < 0 && parts.length > 1)
- {
- parts[last_part] = t;
- t = parts.join('.');
- }
- document.getElementById(t).style.visibility = t == tab ?
'visible' : 'hidden';
- document.getElementById(t+'-tab').className =
'etemplate_tab'+(t == tab ? '_active th' : ' row_on');
- }
- document.getElementByName(name).value = tab;
-}
-</script>
-";
+ $js .= '<script type="text/javascript" src="'.
+
$GLOBALS['phpgw_info']['server']['webserver_url'].'/etemplate/js/etemplate.js"></script>';
}
return $js;
}
Index: inc/class.uietemplate_gtk.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate_gtk.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- inc/class.uietemplate_gtk.inc.php 5 May 2005 14:31:55 -0000 1.13
+++ inc/class.uietemplate_gtk.inc.php 6 Sep 2006 11:13:30 -0000 1.14
@@ -1,31 +1,25 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - EditableTemplates - GTK User Interface
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.uietemplate_gtk.inc.php,v 1.13 2005/05/05 14:31:55
powerstat Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.uietemplate_gtk.inc.php,v 1.14 2006/09/06 11:13:30
skwashd Exp $
+*/
include_once(PHPGW_INCLUDE_ROOT .
'/etemplate/inc/class.boetemplate.inc.php');
- /*!
- @class etemplate
- @author ralfbecker
- @abstract creates dialogs / HTML-forms from eTemplate descriptions
- @discussion etemplate or uietemplate extends boetemplate, all vars and
public functions are inherited
- @example $tmpl =
CreateObject('etemplate.etemplate','app.template.name');
- @example $tmpl->exec('app.class.callback',$content_to_show);
- @example This creates a form from the eTemplate 'app.template.name' and
takes care that
- @example the method / public function 'callback' in (bo)class 'class'
of 'app' gets called
- @example if the user submitts the form. Vor the complete param's see
the description of exec.
- @param $debug enables debug messages: 0=no, 1=calls to show and
process_show, 2=content of process_show
- @param 3=calls to show_cell OR template-
or cell-type name
+ /**
+ * creates dialogs / HTML-forms from eTemplate descriptions
+ *
+ * etemplate or uietemplate extends boetemplate, all vars and public
functions are inherited
+ * $tmpl = createObject('etemplate.etemplate','app.template.name');
+ * $tmpl->exec('app.class.callback',$content_to_show);
+ * This creates a form from the eTemplate 'app.template.name' and takes
care that
+ * the method / public function 'callback' in (bo)class 'class' of
'app' gets called
+ * if the user submitts the form. Vor the complete param's see the
description of exec.
+ * @param $debug enables debug messages: 0=no, 1=calls to show and
process_show, 2=content of process_show
+ * @param 3=calls to show_cell OR
template- or cell-type name
*/
class etemplate extends boetemplate
{
@@ -41,10 +35,10 @@
);
var $font_width=8;
- /*!
- @function etemplate
- @abstract constructor of etemplate class, reads an eTemplate if
$name is given
- @param as soetemplate.read
+ /**
+ * constructor of etemplate class, reads an eTemplate if $name
is given
+ *
+ * @param as soetemplate.read
*/
function
etemplate($name='',$template='default',$lang='default',$group=0,$version='',$rows=2,$cols=2)
{
@@ -61,24 +55,24 @@
return True;
}
- /*!
- @function exec
- @abstract Generats a Dialog from an eTemplate - abstract the
UI-layer
- @discussion This is the only function an application should
use, all other are INTERNAL and
- @discussion do NOT abstract the UI-layer, because they return
HTML.
- @discussion Generates a webpage with a form from the template
and puts process_exec in the
- @discussion form as submit-url to call process_show for the
template before it
- @discussion ExecuteMethod's the given $methode of the caller.
- @param $methode Methode (e.g. 'etemplate.editor.edit') to be
called if form is submitted
- @param $content Array with content to fill the input-fields of
template, eg. the text-field
- @param with name 'name' gets its content from
$content['name']
- @param $sel_options Array or arrays with the options for each
select-field, keys are the
- @param field-names, eg. array('name' => array(1 =>
'one',2 => 'two')) set the
- @param options for field 'name'.
($content['options-name'] is possible too !!!)
- @param $readonlys Array with field-names as keys for fields
with should be readonly
- @param (eg. to implement ACL grants on field-level
or to remove buttons not applicable)
- @param $preserv Array with vars which should be transported to
the $method-call (eg. an id) array('id' => $id) sets $HTTP_POST_VARS['id'] for
the $method-call
- @result nothing
+ /**
+ * Generats a Dialog from an eTemplate - abstract the UI-layer
+ *
+ * This is the only function an application should use, all
other are INTERNAL and
+ * do NOT abstract the UI-layer, because they return HTML.
+ * Generates a webpage with a form from the template and puts
process_exec in the
+ * form as submit-url to call process_show for the template
before it
+ * ExecuteMethod's the given $methode of the caller.
+ * @param $methode Methode (e.g. 'etemplate.editor.edit') to be
called if form is submitted
+ * @param $content Array with content to fill the input-fields
of template, eg. the text-field
+ * @param with name 'name' gets its content from
$content['name']
+ * @param $sel_options Array or arrays with the options for
each select-field, keys are the
+ * @param field-names, eg. array('name' => array(1
=> 'one',2 => 'two')) set the
+ * @param options for field 'name'.
($content['options-name'] is possible too !!!)
+ * @param $readonlys Array with field-names as keys for fields
with should be readonly
+ * @param (eg. to implement ACL grants on
field-level or to remove buttons not applicable)
+ * @param $preserv Array with vars which should be transported
to the $method-call (eg. an id) array('id' => $id) sets $_POST['id'] for the
$method-call
+ * @return nothing
*/
function
exec($method,$content,$sel_options='',$readonlys='',$preserv='')
{
@@ -152,10 +146,10 @@
ExecMethod($method,array_merge($this->result,$preserv));
}
- /*!
- @function process_show
- @abstract this is only an empty function for the GTK ui
- @result the adjusted content (in the simplest case that would
be $content)
+ /**
+ * this is only an empty function for the GTK ui
+ *
+ * @return the adjusted content (in the simplest case that
would be $content)
*/
function process_show(&$content,$readonlys='')
{
@@ -249,22 +243,22 @@
}
}
- /*!
- @function show
- @abstract creates HTML from an eTemplate
- @discussion This is done by calling show_cell for each cell in
the form. show_cell itself
- @discussion calls show recursivly for each included eTemplate.
- @discussion You can use it in the UI-layer of an app, just make
shure to call process_show !!!
- @discussion This is intended as internal function and should
NOT be called by new app's direct,
- @discussion as it deals with HTML and is so UI-dependent, use
exec instead.
- @param $content array with content for the cells, keys are the
names given in the cells/form elements
- @param $sel_options array with options for the selectboxes,
keys are the name of the selectbox
- @param $readonlys array with names of cells/form-elements to be
not allowed to change
- @param This is to facilitate complex ACL's which
denies access on field-level !!!
- @param $cname basename of names for form-elements, means index
in $HTTP_POST_VARS
- @param eg. $cname='cont', element-name = 'name' returned
content in $HTTP_POST_VARS['cont']['name']
- @param $show_xxx row,col name/index for name expansion
- @result the generated HTML
+ /**
+ * creates HTML from an eTemplate
+ *
+ * This is done by calling show_cell for each cell in the form.
show_cell itself
+ * calls show recursivly for each included eTemplate.
+ * You can use it in the UI-layer of an app, just make shure to
call process_show !!!
+ * This is intended as internal function and should NOT be
called by new app's direct,
+ * as it deals with HTML and is so UI-dependent, use exec
instead.
+ * @param $content array with content for the cells, keys are
the names given in the cells/form elements
+ * @param $sel_options array with options for the selectboxes,
keys are the name of the selectbox
+ * @param $readonlys array with names of cells/form-elements to
be not allowed to change
+ * @param This is to facilitate complex ACL's which
denies access on field-level !!!
+ * @param $cname basename of names for form-elements, means
index in $_POST
+ * @param eg. $cname='cont', element-name = 'name'
returned content in $_POST['cont']['name']
+ * @param $show_xxx row,col name/index for name expansion
+ * @return the generated HTML
*/
function
show(&$result,$content,$sel_options='',$readonlys='',$cname='',$show_c=0,$show_row=0)
{
@@ -428,13 +422,13 @@
$event->area->x, $event->area->y);
}
- /*!
- @function show_cell
- @abstract generates HTML for 1 input-field / cell
- @discussion calls show to generate included eTemplates. Again
only an INTERMAL function.
- @param $cell array with data of the cell: name, type, ...
- @param for rest see show
- @result the generated HTML
+ /**
+ * generates HTML for 1 input-field / cell
+ *
+ * calls show to generate included eTemplates. Again only an
INTERMAL function.
+ * @param $cell array with data of the cell: name, type, ...
+ * @param for rest see show
+ * @return the generated HTML
*/
function
show_cell($cell,$content,$sel_options,$readonlys,$cname,$show_c,$show_row,&$span,&$result)
{
@@ -599,7 +593,7 @@
case 'button':
//$html .=
$this->html->submit_button($form_name,$cell['label'],'',strlen($cell['label'])
<= 1 || $cell['no_lang'],$options);
$widget = &new
GtkButton(strlen($cell['label']) > 1 ? lang($cell['label']) : $cell['label']);
- $widget->connect_object('clicked',
array('etemplate', 'button_clicked'),$var,$form_name);
+ $widget->connect_object('clicked',
array('etemplate', 'button_clicked'),&$var,$form_name);
break;
case 'hrule':
//$html .=
$this->html->hr($cell['size']);
Index: inc/class.xmltool.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.xmltool.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- inc/class.xmltool.inc.php 1 Oct 2002 23:35:30 -0000 1.4
+++ inc/class.xmltool.inc.php 6 Sep 2006 11:13:30 -0000 1.5
@@ -1,4 +1,12 @@
<?php
+/**
+* eTemplate - basic application development environment
+* @copyright Assumming Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author ???
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.xmltool.inc.php,v 1.5 2006/09/06 11:13:30 skwashd Exp $
+*/
function var2xml($name, $data)
{
$doc = new xmltool('root','','');
Index: inc/class.xslt_widget.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.xslt_widget.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- inc/class.xslt_widget.inc.php 1 Oct 2002 18:26:30 -0000 1.2
+++ inc/class.xslt_widget.inc.php 6 Sep 2006 11:13:30 -0000 1.3
@@ -1,24 +1,18 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplate Extension - XSLT Widget
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.xslt_widget.inc.php,v 1.2 2002/10/01 18:26:30 ralfbecker
Exp $ */
-
- /*!
- @class xslt_widget
- @author ralfbecker
- @abstract widget that generates its html-output via a xslt file with
its in $options and the content as xml
- @discussion The following data is placed in the xml:
value,name,label(translated),statustext(translated),readonly
- @discussion and all widget-attributes as descript in the referenz,
using there xml-names.
- @discussion This widget is generating html, so it does not work
(without an extra implementation) in an other UI
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.xslt_widget.inc.php,v 1.3 2006/09/06 11:13:30 skwashd
Exp $
+*/
+ /**
+ * widget that generates its html-output via a xslt file with its in
$options and the content as xml
+ *
+ * The following data is placed in the xml:
value,name,label(translated),statustext(translated),readonly
+ * and all widget-attributes as descript in the referenz, using there
xml-names.
+ * This widget is generating html, so it does not work (without an
extra implementation) in an other UI
*/
class xslt_widget
{
@@ -31,7 +25,7 @@
function xslt_widget($ui='')
{
- $this->xslttemplates =
CreateObject('phpgwapi.xslttemplates',PHPGW_INCLUDE_ROOT);
+ $this->xslttemplates =
createObject('phpgwapi.xslttemplates',PHPGW_INCLUDE_ROOT);
switch($ui)
{
Index: inc/class.xul_io.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.xul_io.inc.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- inc/class.xul_io.inc.php 5 May 2005 14:31:55 -0000 1.24
+++ inc/class.xul_io.inc.php 6 Sep 2006 11:13:30 -0000 1.25
@@ -1,17 +1,12 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - eTemplates - XUL/XML Import & Export
*
- * http://www.phpgroupware.org
*
- * Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: class.xul_io.inc.php,v 1.24 2005/05/05 14:31:55 powerstat Exp $
*/
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: class.xul_io.inc.php,v 1.25 2006/09/06 11:13:30 skwashd Exp $
+*/
if (!function_exists('var2xml'))
{
@@ -96,7 +91,7 @@
);
}
- function set_attributes(&$widget,$attr,$val,&$spanned='')
+ function set_attributes(&$widget,$attr,$val,$spanned='')
{
if ($attr != '')
{
@@ -162,7 +157,7 @@
$embeded = new
etemplate($tpl,$etempl->as_array());
if ($embeded_too)
{
-
$this->etempl2grid($embeded,$root,$embeded_too);
+
$this->etempl2grid($embeded,&$root,$embeded_too);
}
$cell['size'] = $embeded->name;
unset($embeded);
@@ -181,7 +176,7 @@
$embeded = new
etemplate($names[$n],$etempl->as_array());
if ($embeded_too)
{
-
$this->etempl2grid($embeded,$root,$embeded_too);
+
$this->etempl2grid($embeded,&$root,$embeded_too);
}
$grid = new xmlnode('grid');
$grid->set_attribute('id',$embeded->name);
@@ -219,7 +214,7 @@
$embeded = new etemplate();
if
($embeded->read($name=$embeded->expand_name($cell['name'],0,0),'default','default',0,'',$etempl->as_array()))
{
-
$this->etempl2grid($embeded,$root,$embeded_too);
+
$this->etempl2grid($embeded,&$root,$embeded_too);
}
$cell['name'] = $embeded->name;
unset($embeded);
@@ -240,7 +235,7 @@
{
$attr = $this->attr2xul[$attr];
}
-
$this->set_attributes($attr_widget,$attr,$val,$spanned);
+
$this->set_attributes($attr_widget,$attr,$val,&$spanned);
}
if ($child)
{
@@ -319,7 +314,7 @@
return '';
}
- function export(&$etempl)
+ function export($etempl)
{
if ($this->debug)
{
@@ -331,7 +326,7 @@
$xul_overlay = new xmlnode('overlay');
$embeded_too = True;
- $this->etempl2grid($etempl,$xul_overlay,$embeded_too);
+ $this->etempl2grid($etempl,&$xul_overlay,$embeded_too);
$doc->add_root($xul_overlay);
$xml = $doc->export_xml();
@@ -492,7 +487,7 @@
$tab_attr['span'] .=
$tab_attr['class'] ? ','.$tab_attr['class'] : '';
unset($tab_attr['class']);
-
$this->add_cell($etempl,$tab_attr,$box,$col,$node['level']);
+
$this->add_cell($etempl,$tab_attr,&$box,&$col,$node['level']);
unset($tab_attr);
}
break;
@@ -521,7 +516,7 @@
}
else
{
-
$this->add_cell($etempl,$menulist_attr,$box,$col,$node['level']);
+
$this->add_cell($etempl,$menulist_attr,&$box,&$col,$node['level']);
unset($menulist_attr);
}
break;
@@ -536,7 +531,7 @@
$cell =
&$box[$node['level']];
$cell['size'] =
$cell['anz'] . ($cell['size'] != '' ? ','.$cell['size'] : '');
unset($cell['anz']);
-
$this->add_cell($etempl,$cell,$box,$col,$node['level']);
+
$this->add_cell($etempl,$cell,&$box,&$col,$node['level']);
unset($box[$node['level']]);
}
break;
@@ -595,7 +590,7 @@
{
break;
}
-
$this->add_cell($etempl,$attr,$box,$col,$node['level']);
+
$this->add_cell($etempl,$attr,&$box,&$col,$node['level']);
break;
}
}
Index: inc/get_var.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/get_var.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- inc/get_var.php 17 Oct 2002 23:34:28 -0000 1.1
+++ inc/get_var.php 6 Sep 2006 11:13:30 -0000 1.2
@@ -1,4 +1,19 @@
<?php
+ /**********************************************************************\
+ * phpGroupWare - eTemplate *
+ * http://www.phpgroupware.org *
+ * This program is part of the GNU project, see http://www.gnu.org/ *
+ * *
+ * Copyright 2002, 2003 Free Software Foundation, Inc. *
+ * *
+ * Based on common_functions.inc.php from the phpGroupWare API *
+ * --------------------------------------------
*
+ * 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: get_var.php,v 1.2 2006/09/06 11:13:30 skwashd Exp $ */
function reg_var($varname, $method = 'any', $valuetype =
'alphanumeric',$default_value='',$register=True)
{
if($method == 'any')
Index: setup/etemplates.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/setup/etemplates.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- setup/etemplates.inc.php 8 Aug 2003 16:17:44 -0000 1.36
+++ setup/etemplates.inc.php 6 Sep 2006 11:13:30 -0000 1.37
@@ -1,7 +1,7 @@
<?php
-// eTemplates for Application 'etemplate', generated by etemplate.dump()
2003-06-29 18:47
+// eTemplates for Application 'etemplate', generated by etemplate.dump()
2003-08-20 02:26
-/* $Id: etemplates.inc.php,v 1.36 2003/08/08 16:17:44 ralfbecker Exp $ */
+/* $Id: etemplates.inc.php,v 1.37 2006/09/06 11:13:30 skwashd Exp $ */
$templ_data[] = array('name' => 'etemplate.datefield','template' => '','lang'
=> '','group' => '0','version' => '0.9.15.001','data' =>
'a:2:{i:0;a:0:{}i:1;a:3:{s:1:\"A\";a:4:{s:4:\"type\";s:3:\"int\";s:4:\"size\";s:4:\"1,31\";s:4:\"name\";s:1:\"d\";s:4:\"help\";s:3:\"Day\";}s:1:\"B\";a:4:{s:4:\"type\";s:3:\"int\";s:4:\"size\";s:4:\"1,12\";s:4:\"name\";s:1:\"m\";s:4:\"help\";s:5:\"Month\";}s:1:\"C\";a:4:{s:4:\"type\";s:3:\"int\";s:4:\"size\";s:4:\"1900\";s:4:\"name\";s:1:\"Y\";s:4:\"help\";s:4:\"Year\";}}}','size'
=> '','style' => '','modified' => '1032907904',);
@@ -133,3 +133,9 @@
$templ_data[] = array('name' =>
'etemplate.nextmatch_widget.header_only','template' => '','lang' => '','group'
=> '0','version' => '0.9.15.001','data' =>
'a:3:{i:0;a:2:{s:1:\"A\";s:3:\"50%\";s:1:\"B\";s:3:\"50%\";}i:1;a:2:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:12:\"@header_left\";}s:1:\"B\";a:3:{s:4:\"type\";s:8:\"template\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:13:\"@header_right\";}}i:2;a:2:{s:1:\"A\";a:5:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:4:\"rows\";s:4:\"span\";s:3:\"all\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:9:\"@template\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size'
=> '100%','style' => '','modified' => '1056877177',);
+$templ_data[] = array('name' => 'etemplate.db-tools.ask_save','template' =>
'','lang' => '','group' => '0','version' => '0.9.14.002','data' =>
'a:9:{i:0;a:0:{}i:1;a:2:{s:1:\"A\";a:6:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:2:\"bi\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:29:\"Editable
Templates -
DB-Tools\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:3:\"msg\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:2;a:2:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"hrule\";s:4:\"span\";s:3:\"all\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:3;a:2:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:3:\"all\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:4;a:2:{s:1:\"A\";a:6:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:2:\"bi\";s:5:\"label\";s:27:\"Update
from Version \'%s\'
to\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:7:\"version\";}s:1:\"B\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:11:\"new_version\";s:4:\"help\";s:75:\"enter
the new version number here (> old_version), empty for no
update-file\";}}i:5;a:2:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:3:\"all\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:6;a:2:{s:1:\"A\";a:7:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:53:\"Do
you want to save the changes you made in table
%s?\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:5:\"table\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:7;a:2:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:3:\"all\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:8;a:2:{s:1:\"A\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:3:\"Yes\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:3:\"yes\";s:4:\"help\";s:39:\"saves
changes to
tables_current.inc.php\";}s:1:\"B\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:2:\"No\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:2:\"no\";s:4:\"help\";s:15:\"discard
changes\";}}}','size' => '100%','style' => '','modified' => '1060350447',);
+
+$templ_data[] = array('name' => 'etemplate.editor.cell','template' =>
'','lang' => '','group' => '0','version' => '0.9.15.003','data' =>
'a:5:{i:0;a:4:{s:2:\"c1\";s:3:\"row\";s:2:\"c2\";s:3:\"row\";s:2:\"c3\";s:3:\"row\";s:2:\"c4\";s:3:\"row\";}i:1;a:6:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Type\";}s:1:\"B\";a:3:{s:4:\"type\";s:6:\"select\";s:4:\"name\";s:4:\"type\";s:4:\"help\";s:57:\"type
of the field (select Label if field should be
empty)\";}s:1:\"C\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:7:\"Options\";s:5:\"align\";s:6:\"center\";}s:1:\"D\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"name\";s:4:\"size\";s:4:\"help\";s:187:\"Label:[bold][italic]
Text:[len][,max] Numbers:[min][,[max][,len]] T.area:[rows][,cols]
Radiob.:value H.Rule:[width] Templ.:[IndexInContent] Select:[multiselect]
Date:[values: eg.
\'Y-m-d\']\";}s:1:\"E\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:11:\"Span,
Class\";s:5:\"align\";s:6:\"center\";}s:1:\"F\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"name\";s:4:\"span\";s:4:\"help\";s:111:\"number
of colums the field/cell should span or \'all\' for the remaining columns,
CSS-class name (for the TD
tag)\";}}i:2;a:6:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:5:\"Label\";}s:1:\"B\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:5:\"label\";s:4:\"help\";s:118:\"displayed
in front of input or input is inserted for a \'%s\' in the label (label of the
Submitbutton or
Image-filename)\";}s:1:\"C\";a:6:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:16:\"%s
NoTranslation\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:7:\"no_lang\";s:4:\"help\";s:82:\"select
if content of field should not be translated (label gets always
translated)\";}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:5:\"Align\";s:5:\"align\";s:6:\"center\";}s:1:\"F\";a:3:{s:4:\"type\";s:6:\"select\";s:4:\"name\";s:5:\"align\";s:4:\"help\";s:48:\"alignment
of label and input-field in
table-cell\";}}i:3;a:6:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Name\";}s:1:\"B\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:4:\"name\";s:4:\"help\";s:78:\"index/name
of returned content (name of the Template, Link / Method for
Image)\";}s:1:\"C\";a:7:{s:4:\"type\";s:4:\"hbox\";s:4:\"size\";s:1:\"4\";s:4:\"span\";s:1:\"4\";i:1;a:5:{s:4:\"type\";s:8:\"checkbox\";s:5:\"label\";s:9:\"%s
needed\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:6:\"needed\";s:4:\"help\";s:39:\"check
if field has to be filled by
user\";}i:2;a:5:{s:4:\"type\";s:8:\"checkbox\";s:5:\"label\";s:11:\"%s
readonly\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:8:\"readonly\";s:4:\"help\";s:94:\"check
if content should only be displayed but not altered (the content is not send
back then!)\";}i:3;a:5:{s:4:\"type\";s:8:\"checkbox\";s:5:\"label\";s:11:\"%s
disabled\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:8:\"disabled\";s:4:\"help\";s:96:\"if
field is disabled an empty table-cell is displayed, for (temporal) removement
of a
field/cell\";}i:4;a:5:{s:4:\"type\";s:8:\"checkbox\";s:5:\"label\";s:11:\"%s
onChange\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:8:\"onchange\";s:4:\"help\";s:33:\"enable
JavaScript onChange
submit\";}}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:4;a:6:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Help\";}s:1:\"B\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"45\";s:4:\"span\";s:1:\"3\";s:4:\"name\";s:4:\"help\";s:4:\"help\";s:60:\"displayed
in statusline of browser if input-field gets
focus\";}s:1:\"C\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:8:\"blurText\";s:5:\"align\";s:6:\"center\";}s:1:\"F\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"name\";s:4:\"blur\";s:4:\"help\";s:76:\"this
text gets displayed if the input-field is empty and has no focus
(blur)\";}}}','size' => ',100%','style' => '','modified' => '1061339128',);
+
+$templ_data[] = array('name' => 'etemplate.nextmatch_widget.nm_row','template'
=> '','lang' => '','group' => '0','version' => '0.9.15.006','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\";}}}','size' => '100%,,,,0,5','style' => '','modified' =>
'1061331789',);
+
Index: setup/setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/setup/setup.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- setup/setup.inc.php 11 Mar 2006 23:20:48 -0000 1.15
+++ setup/setup.inc.php 6 Sep 2006 11:13:30 -0000 1.16
@@ -1,17 +1,12 @@
<?php
-
/**************************************************************************\
- * phpGroupWare - Editable Templates
*
- * http://www.phpgroupware.org
*
- " Written by Ralf Becker <address@hidden> *
- * --------------------------------------------
*
- * 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: setup.inc.php,v 1.15 2006/03/11 23:20:48 skwashd Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: setup.inc.php,v 1.16 2006/09/06 11:13:30 skwashd Exp $
+*/
$setup_info['etemplate']['name'] = 'etemplate';
$setup_info['etemplate']['version'] = '0.9.15.002';
$setup_info['etemplate']['app_order'] = 8; // just behind the
developers-tools
Index: setup/tables_baseline.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/setup/tables_baseline.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- setup/tables_baseline.inc.php 29 Sep 2002 13:01:40 -0000 1.1
+++ setup/tables_baseline.inc.php 6 Sep 2006 11:13:30 -0000 1.2
@@ -1,17 +1,12 @@
<?php
- /**************************************************************************\
- * phpGroupWare - Editable Templates *
- * http://www.phpgroupware.org *
- " Written by Ralf Becker <address@hidden> *
- * -------------------------------------------- *
- * 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: tables_baseline.inc.php,v 1.1 2002/09/29 13:01:40 ralfbecker Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: tables_baseline.inc.php,v 1.2 2006/09/06 11:13:30 skwashd Exp $
+*/
$phpgw_baseline = array(
'phpgw_etemplate' => array(
'fd' => array(
Index: setup/tables_current.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/setup/tables_current.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- setup/tables_current.inc.php 16 Jan 2005 18:49:01 -0000 1.4
+++ setup/tables_current.inc.php 6 Sep 2006 11:13:30 -0000 1.5
@@ -1,29 +1,24 @@
<?php
- /**************************************************************************\
- * phpGroupWare - Editable Templates *
- * http://www.phpgroupware.org *
- " Written by Ralf Becker <address@hidden> *
- * -------------------------------------------- *
- * 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: tables_current.inc.php,v 1.4 2005/01/16 18:49:01 ceb Exp $ */
-
+/**
+* eTemplate - basic application development environment
+* @copyright Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author Ralf Becker <address@hidden>
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: tables_current.inc.php,v 1.5 2006/09/06 11:13:30 skwashd Exp $
+*/
$phpgw_baseline = array(
'phpgw_etemplate' => array(
'fd' => array(
'et_name' => array('type' =>
'varchar','precision' => '80','nullable' => False),
- 'et_template' => array('type' =>
'varchar','precision' => '20','nullable' => False),
- 'et_lang' => array('type' =>
'varchar','precision' => '5','nullable' => False),
- 'et_group' => array('type' => 'int','precision'
=> '4','default' => 0,'nullable' => False),
- 'et_version' => array('type' =>
'varchar','precision' => '20','nullable' => False),
+ 'et_template' => array('type' =>
'varchar','precision' => '20','nullable' => False,'default' => ''),
+ 'et_lang' => array('type' =>
'varchar','precision' => '5','nullable' => False,'default' => ''),
+ 'et_group' => array('type' => 'int','precision'
=> '4','nullable' => False,'default' => '0'),
+ 'et_version' => array('type' =>
'varchar','precision' => '20','nullable' => False,'default' => ''),
'et_data' => array('type' => 'text','nullable'
=> True),
'et_size' => array('type' =>
'varchar','precision' => '128','nullable' => True),
'et_style' => array('type' => 'text','nullable'
=> True),
- 'et_modified' => array('type' =>
'int','precision' => '4','default' => 0,'nullable' => False)
+ 'et_modified' => array('type' =>
'int','precision' => '4','nullable' => False,'default' => '0')
),
'pk' =>
array('et_name','et_template','et_lang','et_group','et_version'),
'fk' => array(),
Index: setup/tables_update.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/setup/tables_update.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- setup/tables_update.inc.php 18 Mar 2003 00:47:05 -0000 1.2
+++ setup/tables_update.inc.php 6 Sep 2006 11:13:30 -0000 1.3
@@ -1,15 +1,13 @@
<?php
- /**************************************************************************\
- * phpGroupWare - Setup *
- * http://www.phpgroupware.org *
- * -------------------------------------------- *
- * 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: tables_update.inc.php,v 1.2 2003/03/18 00:47:05 ralfbecker Exp $ */
+/**
+* eTemplate - basic application development environment
+* @copyright Assuming Copyright (C) 2002-2006 Free Software Foundation, Inc.
http://www.fsf.org/
+* @author ???
+* @license http://www.gnu.org/licenses/gpl.html GNU General Public License
+* @package etemplate
+* @version $Id: tables_update.inc.php,v 1.3 2006/09/06 11:13:30 skwashd Exp $
+*/
+ /* $Id: tables_update.inc.php,v 1.3 2006/09/06 11:13:30 skwashd Exp $ */
$test[] = '0.9.13.001';
function etemplate_upgrade0_9_13_001()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] etemplate index.php phpGtk_test.php process_exe...,
Dave Hall <=