mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Initial revision
This commit is contained in:
parent
166d2cdca2
commit
0731c2f111
162
etemplate/inc/class.boetemplate.inc.php
Normal file
162
etemplate/inc/class.boetemplate.inc.php
Normal file
@ -0,0 +1,162 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - EditableTemplates - Buiseness Objects *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
include(PHPGW_API_INC . '/../../etemplate/inc/class.soetemplate.inc.php');
|
||||
|
||||
/*!
|
||||
@class boetemplate
|
||||
@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
|
||||
*/
|
||||
class boetemplate extends soetemplate
|
||||
{
|
||||
var $types = array(
|
||||
'label' => 'Label', // Label $cell['label'] is (to be translated) textual content
|
||||
'text' => 'Text', // Textfield 1 Line (size = [length][,maxlength])
|
||||
'textarea' => 'Textarea', // Multiline Text Input (size = [rows][,cols])
|
||||
'checkbox'=> 'Checkbox',
|
||||
'radio' => 'Radiobutton', // Radiobutton (size = value if checked)
|
||||
'button' => 'Submitbutton',
|
||||
'hrule' => 'Horizontal Rule',
|
||||
'template' => 'Template', // $cell['name'] contains template-name, $cell['size'] index into $content,$cname,$readonlys
|
||||
'image' => 'Image', // label = url, name=link or method, help=alt or title
|
||||
'date' => 'Date', // Datefield, size='' timestamp or size=format like 'm/d/Y'
|
||||
'select' => 'Selectbox', // Selectbox ($sel_options[$name] or $content[options-$name] is array with options)
|
||||
// if size > 1 then multiple selections, size lines showed
|
||||
'select-percent' => 'Select Percentage',
|
||||
'select-priority' => 'Select Priority',
|
||||
'select-access' => 'Select Access',
|
||||
'select-country' => 'Select Country',
|
||||
'select-state' => 'Select State', // US-states
|
||||
'select-cat' => 'Select Cathegory', // Cathegory-Selection, size: -1=Single+All, 0=Single, >0=Multiple with size lines
|
||||
'select-account' => 'Select Account', // label=accounts(default),groups,both
|
||||
// size: -1=Single+not assigned, 0=Single, >0=Multiple
|
||||
'raw' => 'Raw', // Raw html in $content[$cell['name']]
|
||||
);
|
||||
var $aligns = array(
|
||||
'' => 'Left',
|
||||
'right' => 'Right',
|
||||
'center' => 'Center'
|
||||
);
|
||||
|
||||
/*!
|
||||
@function boetemplate
|
||||
@abstract constructor of class
|
||||
@discussion Calls the constructor of soetemplate
|
||||
*/
|
||||
function boetemplate()
|
||||
{
|
||||
$this->soetemplate();
|
||||
}
|
||||
|
||||
/*!
|
||||
@function expand_name($name,$c,$row,$c_='',$row_='',$cont=array())
|
||||
@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)
|
||||
*/
|
||||
function expand_name($name,$c,$row,$c_='',$row_='',$cont='')
|
||||
{
|
||||
if(!$cont)
|
||||
{
|
||||
$cont = array();
|
||||
}
|
||||
$col = $this->num2chrs($c-1); // $c-1 to get: 0:'@', 1:'A', ...
|
||||
$col_ = $this->num2chrs($c_-1);
|
||||
$row_cont = $cont[$row];
|
||||
|
||||
eval('$name = "'.$name.'";');
|
||||
|
||||
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' !!!
|
||||
@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
|
||||
@returns true if cell is autorepeat (has index with vars / '$') or false otherwise
|
||||
*/
|
||||
function autorepeat_idx($cell,$c,$r,&$idx,&$idx_cname,$check_col=False)
|
||||
{
|
||||
$org_idx = $idx = $cell[ $cell['type'] == 'template' ? 'size' : 'name' ];
|
||||
|
||||
$idx = $this->expand_name($idx,$c,$r);
|
||||
if (!($komma = strpos($idx,',')))
|
||||
{
|
||||
$idx_cname = $idx;
|
||||
}
|
||||
else
|
||||
{
|
||||
$idx_cname = substr($idx,1+$komma);
|
||||
$idx = substr($idx,0,$komma);
|
||||
}
|
||||
$Ok = False;
|
||||
$pat = $org_idx;
|
||||
while (!$Ok && ($pat = strstr($pat,'$')))
|
||||
{
|
||||
$pat = substr($pat,$pat[1] == '{' ? 2 : 1);
|
||||
|
||||
if ($check_col)
|
||||
{
|
||||
$Ok = $pat[0] == 'c' && !(substr($pat,0,4) == 'cont' ||
|
||||
substr($pat,0,2) == 'c_' || substr($pat,0,4) == 'col_');
|
||||
}
|
||||
else
|
||||
{
|
||||
$Ok = $pat[0] == 'r' && !(substr($pat,0,2) == 'r_' || substr($pat,0,4) == 'row_');
|
||||
}
|
||||
}
|
||||
if ($this->name == $this->debug)
|
||||
{
|
||||
echo "$this->name ".($check_col ? 'col' : 'row')."-check: c=$c, r=$r, idx='$org_idx' ==> ".($Ok?'True':'False')."<p>\n";
|
||||
}
|
||||
|
||||
return $Ok;
|
||||
}
|
||||
}
|
530
etemplate/inc/class.db_tools.inc.php
Normal file
530
etemplate/inc/class.db_tools.inc.php
Normal file
@ -0,0 +1,530 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - eTemplates - DB-Tools *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
class db_tools
|
||||
{
|
||||
var $public_functions = array
|
||||
(
|
||||
'edit' => True,
|
||||
'needs_save' => True,
|
||||
'writeLangFile'=> True,
|
||||
//'admin' => True,
|
||||
//'preferences' => True
|
||||
);
|
||||
|
||||
var $debug = 0;
|
||||
var $editor; // editor eTemplate
|
||||
var $data; // Table definitions
|
||||
var $app; // used app
|
||||
var $table; // used table
|
||||
var $messages = array(
|
||||
'not_found' => 'Not found !!!',
|
||||
'select_one' => 'Select one ...',
|
||||
'writen' => 'File writen',
|
||||
'error_writing' => 'Error: writing file !!!',
|
||||
'give_table_name' => 'Please enter table-name first !!!',
|
||||
'new_table' => 'New table created'
|
||||
);
|
||||
var $types = array(
|
||||
'auto' => 'auto',
|
||||
'blob' => 'blob',
|
||||
'char' => 'char',
|
||||
'date' => 'date',
|
||||
'decimal' => 'decimal',
|
||||
'float' => 'float',
|
||||
'int' => 'int',
|
||||
'longtext' => 'longtext',
|
||||
'text' => 'text',
|
||||
'timestamp' => 'timestamp',
|
||||
'varchar' => 'varchar'
|
||||
);
|
||||
|
||||
/*!
|
||||
@function db_tools()
|
||||
@abstract constructor of class
|
||||
*/
|
||||
function db_tools()
|
||||
{
|
||||
$this->editor = CreateObject('etemplate.etemplate','etemplate.db-tools.edit');
|
||||
$this->data = array();
|
||||
|
||||
if (!is_array($GLOBALS['phpgw_info']['apps']) || !count($GLOBALS['phpgw_info']['apps']))
|
||||
{
|
||||
ExecMethod('phpgwapi.applications.read_installed_apps');
|
||||
}
|
||||
$this->apps = array();
|
||||
reset($GLOBALS['phpgw_info']['apps']);
|
||||
while (list($name,$data) = each($GLOBALS['phpgw_info']['apps']))
|
||||
{
|
||||
$this->apps[$name] = $data['title'];
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@function edit()
|
||||
@abstract this is the table editor (and the callback/submit-method too)
|
||||
*/
|
||||
function edit($msg = '')
|
||||
{
|
||||
if (isset($GLOBALS['HTTP_GET_VARS']['app']))
|
||||
{
|
||||
$this->app = $GLOBALS['HTTP_GET_VARS']['app'];
|
||||
}
|
||||
|
||||
if (isset($GLOBALS['HTTP_POST_VARS']['cont']))
|
||||
{
|
||||
$content = $GLOBALS['HTTP_POST_VARS']['cont'];
|
||||
if ($this->debug)
|
||||
{
|
||||
echo "HTTP_POST_VARS ="; _debug_array($GLOBALS['HTTP_POST_VARS']);
|
||||
}
|
||||
$this->app = $content['app']; // this is what the user selected
|
||||
$this->table = $content['table_name'];
|
||||
$posted_app = $GLOBALS['HTTP_POST_VARS']['posted_app']; // this is the old selection
|
||||
$posted_table = $GLOBALS['HTTP_POST_VARS']['posted_table'];
|
||||
}
|
||||
if ($posted_app && $posted_table && // user changed app or table
|
||||
($posted_app != $this->app || $posted_table != $this->table))
|
||||
{
|
||||
if ($this->needs_save($posted_app,$posted_table,$this->content2table($content)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!$this->app)
|
||||
{
|
||||
$this->table = '';
|
||||
$table_names = array('' => lang('none'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->read($this->app,$this->data);
|
||||
|
||||
for (reset($this->data); list($name,$table) = each($this->data); )
|
||||
{
|
||||
$table_names[$name] = $name;
|
||||
}
|
||||
}
|
||||
if (!$this->table || $this->app != $posted_app)
|
||||
{
|
||||
reset($this->data);
|
||||
list($this->table) = each($this->data); // use first table
|
||||
}
|
||||
elseif ($this->app == $posted_app && $posted_table)
|
||||
{
|
||||
$this->data[$posted_table] = $this->content2table($content);
|
||||
}
|
||||
if (isset($content['write_tables']))
|
||||
{
|
||||
$msg .= $this->messages[$this->write($this->app,$this->data) ?
|
||||
'writen' : 'error_writing'];
|
||||
}
|
||||
elseif (isset($content['delete']))
|
||||
{
|
||||
list($col) = each($content['delete']);
|
||||
|
||||
reset($this->data[$posted_table]['fd']);
|
||||
while ($col-- > 0 && list($key,$data) = each($this->data[$posted_table]['fd']));
|
||||
|
||||
unset($this->data[$posted_table]['fd'][$key]);
|
||||
}
|
||||
elseif (isset($content['add_column']))
|
||||
{
|
||||
$this->data[$posted_table]['fd'][''] = array();
|
||||
}
|
||||
elseif (isset($content['add_table']))
|
||||
{
|
||||
if (!$content['new_table_name'])
|
||||
{
|
||||
$msg .= $this->messages['give_table_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->table = $content['new_table_name'];
|
||||
$this->data[$this->table] = array('fd' => array(),'pk' =>array(),'ix' => array(),'uc' => array(),'fk' => array());
|
||||
$msg .= $this->messages['new_table'];
|
||||
}
|
||||
}
|
||||
elseif ($content['editor'])
|
||||
{
|
||||
ExecMethod('etemplate.editor.edit');
|
||||
return;
|
||||
}
|
||||
// from here on, filling new content for eTemplate
|
||||
$content = array(
|
||||
'msg' => $msg,
|
||||
'table_name' => $this->table,
|
||||
'app' => $this->app,
|
||||
);
|
||||
if (!isset($table_names[$this->table])) // table is not jet written
|
||||
{
|
||||
$table_names[$this->table] = $this->table;
|
||||
}
|
||||
|
||||
$sel_options = array(
|
||||
'table_name' => $table_names,
|
||||
'type' => $this->types,
|
||||
'app' => array('' => lang($this->messages['select_one'])) + $this->apps
|
||||
);
|
||||
if ($this->table != '' && isset($this->data[$this->table]))
|
||||
{
|
||||
$content += $this->table2content($this->data[$this->table]);
|
||||
}
|
||||
$no_button = array( );
|
||||
|
||||
if ($this->debug)
|
||||
{
|
||||
echo 'editor.edit: content ='; _debug_array($content);
|
||||
}
|
||||
$this->editor->exec('etemplate.db_tools.edit',$content,$sel_options,$no_buttons,
|
||||
array('posted_table' => $this->table,'posted_app' => $this->app));
|
||||
}
|
||||
|
||||
/*!
|
||||
@function needs_save($posted_app,$posted_table,$edited_table)
|
||||
@abstract checks if table was changed and if so offers user to save changes
|
||||
@param $posted_app the app the table is from
|
||||
@param $posted_table the table-name
|
||||
@param $edited_table the edited table-definitions
|
||||
@returns only if no changes
|
||||
*/
|
||||
function needs_save($posted_app='',$posted_table='',$edited_table='')
|
||||
{
|
||||
if (!$posted_app && isset($GLOBALS['HTTP_POST_VARS']['cont']))
|
||||
{
|
||||
$cont = $GLOBALS['HTTP_POST_VARS']['cont'];
|
||||
$preserv = unserialize(stripslashes($GLOBALS['HTTP_POST_VARS']['preserv']));
|
||||
|
||||
if (isset($cont['yes']))
|
||||
{
|
||||
$this->app = $preserv['app'];
|
||||
$this->table = $preserv['table'];
|
||||
$this->read($this->app,$this->data);
|
||||
$this->data[$this->table] = $preserv['edited_table'];
|
||||
$this->write($this->app,$this->data);
|
||||
$msg .= $this->messages[$this->write($this->app,$this->data) ?
|
||||
'writen' : 'error_writing'];
|
||||
}
|
||||
// return to edit with everything set, so the user gets the table he asked for
|
||||
$GLOBALS['HTTP_POST_VARS'] = array(
|
||||
'cont' => array(
|
||||
'app' => $preserv['new_app'],
|
||||
'table_name' => $preserv['app']==$preserv['new_app'] ? $preserv['new_table']:''
|
||||
),
|
||||
'posted_app' => $preserv['new_app'],
|
||||
);
|
||||
$this->edit($msg);
|
||||
return True;
|
||||
}
|
||||
$new_app = $this->app; // these are the ones, the users whiches to change too
|
||||
$new_table = $this->table;
|
||||
|
||||
$this->app = $posted_app;
|
||||
$this->data = array();
|
||||
$this->read($posted_app,$this->data);
|
||||
|
||||
if (isset($this->data[$posted_table]) &&
|
||||
$this->tables_identical($this->data[$posted_table],$edited_table))
|
||||
{
|
||||
$this->app = $new_app;
|
||||
$this->data = array();
|
||||
return False; // continue edit
|
||||
}
|
||||
$content = array(
|
||||
'app' => $posted_app,
|
||||
'table' => $posted_table
|
||||
);
|
||||
$preserv = $content + array(
|
||||
'new_app' => $new_app,
|
||||
'new_table' => $new_table,
|
||||
'edited_table' => $edited_table
|
||||
);
|
||||
$tmpl = new etemplate('etemplate.db-tools.ask_save');
|
||||
|
||||
$tmpl->exec('etemplate.db_tools.needs_save',$content,array(),array(),
|
||||
array('preserv' => $preserv));
|
||||
|
||||
return True; // dont continue in edit
|
||||
}
|
||||
|
||||
/*!
|
||||
@function table2content($table)
|
||||
@abstract creates content-array from a $table
|
||||
@param $table table-definition, eg. $phpgw_baseline[$table_name]
|
||||
@returns content-array
|
||||
*/
|
||||
function table2content($table)
|
||||
{
|
||||
$content = array();
|
||||
for ($n = 1; list($col_name,$col_defs) = each($table['fd']); ++$n)
|
||||
{
|
||||
$col_defs['name'] = $col_name;
|
||||
$col_defs['pk'] = in_array($col_name,$table['pk']);
|
||||
$col_defs['uc'] = in_array($col_name,$table['uc']);
|
||||
$col_defs['ix'] = in_array($col_name,$table['ix']);
|
||||
$col_defs['fk'] = $table['fk'][$col_name];
|
||||
if (isset($col_defs['default']) && $col_defs['default'] == '')
|
||||
{
|
||||
$col_defs['default'] = "''"; // spezial value for empty, but set, default
|
||||
}
|
||||
$col_defs['n'] = $n;
|
||||
|
||||
$content["Row$n"] = $col_defs;
|
||||
}
|
||||
if ($this->debug >= 3)
|
||||
{
|
||||
echo "<p>table2content: content ="; _debug_array($content);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function content2table($content)
|
||||
@abstract creates table-definition from posted content
|
||||
@param $content posted content-array
|
||||
@returns table-definition
|
||||
*/
|
||||
function content2table($content)
|
||||
{
|
||||
$table = array();
|
||||
$table['fd'] = array(); // do it in the default order of tables_*
|
||||
$table['pk'] = array();
|
||||
$table['fk'] = array();
|
||||
$table['ix'] = array();
|
||||
$table['uc'] = array();
|
||||
for (reset($content),$n = 1; isset($content["Row$n"]); ++$n)
|
||||
{
|
||||
$col = $content["Row$n"];
|
||||
if (($name = $col['name']) != '') // ignoring lines without column-name
|
||||
{
|
||||
while (list($prop,$val) = each($col))
|
||||
{
|
||||
switch ($prop)
|
||||
{
|
||||
case 'default':
|
||||
case 'type': // selectbox ensures type is not empty
|
||||
case 'precision':
|
||||
case 'nullable':
|
||||
if ($val != '' || $prop == 'nullable')
|
||||
{
|
||||
$table['fd'][$name][$prop] = $prop=='default'&& $val=="''" ? '' : $val;
|
||||
}
|
||||
break;
|
||||
case 'pk':
|
||||
case 'uc':
|
||||
case 'ix':
|
||||
if ($val)
|
||||
{
|
||||
$table[$prop][] = $name;
|
||||
}
|
||||
break;
|
||||
case 'fk':
|
||||
if ($val != '')
|
||||
{
|
||||
$table['fk'][$name] = $val;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($this->debug >= 2)
|
||||
{
|
||||
echo "<p>content2table: table ="; _debug_array($table);
|
||||
}
|
||||
return $table;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function read($app,&$phpgw_baseline)
|
||||
@abstract includes $app/setup/tables_current.inc.php
|
||||
@param $app application name
|
||||
@param $phpgw_baseline where to put the data
|
||||
@returns True if file found, False else
|
||||
*/
|
||||
function read($app,&$phpgw_baseline)
|
||||
{
|
||||
$file = PHPGW_SERVER_ROOT."/$app/setup/tables_current.inc.php";
|
||||
|
||||
$phpgw_baseline = array();
|
||||
|
||||
if ($app != '' && file_exists($file))
|
||||
{
|
||||
include($file);
|
||||
}
|
||||
else
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if ($this->debug >= 5)
|
||||
{
|
||||
echo "<p>read($app): file='$file', phpgw_baseline =";
|
||||
_debug_array($phpgw_baseline);
|
||||
}
|
||||
return True;
|
||||
}
|
||||
|
||||
function write_array($arr,$depth,$parent='')
|
||||
{
|
||||
if (in_array($parent,array('pk','fk','ix','uc')))
|
||||
{
|
||||
$depth = 0;
|
||||
if ($parent != 'fk')
|
||||
{
|
||||
$only_vals = True;
|
||||
}
|
||||
}
|
||||
if ($depth)
|
||||
{
|
||||
$tabs = "\n";
|
||||
for ($n = 0; $n < $depth; ++$n)
|
||||
{
|
||||
$tabs .= "\t";
|
||||
}
|
||||
++$depth;
|
||||
}
|
||||
$def = "array($tabs".($tabs ? "\t" : '');
|
||||
|
||||
reset($arr);
|
||||
for ($n = 0; list($key,$val) = each($arr); ++$n)
|
||||
{
|
||||
if (!$only_vals)
|
||||
{
|
||||
$def .= "'$key' => ";
|
||||
}
|
||||
|
||||
if (is_array($val))
|
||||
{
|
||||
$def .= $this->write_array($val,$parent == 'fd' ? 0 : $depth,$key,$only_vals);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$only_vals && $key == 'nullable')
|
||||
{
|
||||
$def .= $val ? 'True' : 'False';
|
||||
}
|
||||
else
|
||||
{
|
||||
$def .= "'$val'";
|
||||
}
|
||||
}
|
||||
if ($n < count($arr)-1)
|
||||
{
|
||||
$def .= ",$tabs".($tabs ? "\t" : '');
|
||||
}
|
||||
}
|
||||
$def .= "$tabs)";
|
||||
|
||||
return $def;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function write($app,$phpgw_baseline)
|
||||
@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
|
||||
*/
|
||||
function write($app,$phpgw_baseline)
|
||||
{
|
||||
$file = PHPGW_SERVER_ROOT."/$app/setup/tables_current.inc.php";
|
||||
|
||||
if (file_exists($file) && ($f = fopen($file,'r')))
|
||||
{
|
||||
$header = fread($f,filesize($file));
|
||||
$header = substr($header,0,strpos($header,'$phpgw_baseline'));
|
||||
fclose($f);
|
||||
|
||||
rename($file,PHPGW_SERVER_ROOT."/$app/setup/tables_current.old.inc.php");
|
||||
|
||||
while ($header[strlen($header)-1] == "\t")
|
||||
{
|
||||
$header = substr($header,0,strlen($header)-1);
|
||||
}
|
||||
}
|
||||
if (!$header)
|
||||
{
|
||||
$header = "<?php\n\n";
|
||||
}
|
||||
|
||||
if (!($f = fopen($file,'w')))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
$def .= "\t\$phpgw_baseline = ";
|
||||
$def .= $this->write_array($phpgw_baseline,1);
|
||||
$def .= ";\n";
|
||||
|
||||
fwrite($f,$header . $def);
|
||||
fclose($f);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function normalize($table)
|
||||
@abstract sets all nullable properties to True or False
|
||||
@returns the new array
|
||||
*/
|
||||
function normalize($table)
|
||||
{
|
||||
$all_props = array('type','precision','nullable','default');
|
||||
|
||||
reset($table['fd']);
|
||||
while (list($col,$props) = each($table['fd']))
|
||||
{
|
||||
$table['fd'][$col] = array(
|
||||
'type' => ''.$props['type'],
|
||||
'precision' => 0+$props['precision'],
|
||||
'nullable' => !!$props['nullable'],
|
||||
'default' => ''.$props['default']
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'fd' => $table['fd'],
|
||||
'pk' => $table['pk'],
|
||||
'fk' => $table['fk'],
|
||||
'ix' => $table['ix'],
|
||||
'uc' => $table['uc']
|
||||
);
|
||||
}
|
||||
|
||||
/*!
|
||||
@function tables_identical($old,$new)
|
||||
@abstract compares two table-definitions
|
||||
@returns True if they are identical or False else
|
||||
*/
|
||||
function tables_identical($a,$b)
|
||||
{
|
||||
$a = serialize($this->normalize($a));
|
||||
$b = serialize($this->normalize($b));
|
||||
|
||||
//echo "<p>checking if tables identical = ".($a == $b ? 'True' : 'False')."<br>\n";
|
||||
//echo "a: $a<br>\nb: $b</p>\n";
|
||||
|
||||
return $a == $b;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function writeLangFile
|
||||
@abstract writes langfile with all templates and messages registered here
|
||||
@discussion can be called via http://domain/phpgroupware/index.php?etemplate.db_tools.writeLangFile
|
||||
*/
|
||||
function writeLangFile()
|
||||
{
|
||||
$this->tmpl->writeLangFile('etemplate','en',$this->messages);
|
||||
}
|
||||
}
|
395
etemplate/inc/class.editor.inc.php
Normal file
395
etemplate/inc/class.editor.inc.php
Normal file
@ -0,0 +1,395 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - eTemplates - Editor *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
class editor
|
||||
{
|
||||
var $debug;
|
||||
var $etemplate; // eTemplate we edit
|
||||
var $editor; // editor eTemplate
|
||||
var $messages = array(
|
||||
'not_found' => 'Error: Template not found !!!',
|
||||
'deleted' => 'Template deleted',
|
||||
'saved' => 'Template saved',
|
||||
'error_writing' => 'Error: while saveing !!!'
|
||||
);
|
||||
|
||||
var $public_functions = array
|
||||
(
|
||||
'edit' => True,
|
||||
'process_edit' => True,
|
||||
'delete' => True,
|
||||
'show' => True,
|
||||
//'admin' => True,
|
||||
//'preferences' => True
|
||||
);
|
||||
|
||||
function editor()
|
||||
{
|
||||
$this->etemplate = CreateObject('etemplate.etemplate');
|
||||
//echo '$HTTP_POST_VARS='; _debug_array($HTTP_POST_VARS);
|
||||
|
||||
$this->editor = new etemplate('etemplate.editor');
|
||||
}
|
||||
|
||||
function edit($msg = '')
|
||||
{
|
||||
$get_vars = $GLOBALS['HTTP_GET_VARS'];
|
||||
if (isset($get_vars['name']) && !$this->etemplate->read($get_vars))
|
||||
{
|
||||
$msg .= $this->messages['not_found'];
|
||||
}
|
||||
|
||||
$content = $this->etemplate->as_array() + array(
|
||||
'cols' => $this->etemplate->cols,
|
||||
'msg' => $msg
|
||||
);
|
||||
$cols_spanned = array();
|
||||
reset($this->etemplate->data);
|
||||
if (isset($this->etemplate->data[0])) each($this->etemplate->data);
|
||||
$no_button = array('values' => True,'edit' => True);
|
||||
while (list($row,$cols) = each($this->etemplate->data))
|
||||
{
|
||||
if ($this->etemplate->rows <= 1)
|
||||
{
|
||||
$no_button["Row$row"]['delete_row[1]'] = True;
|
||||
}
|
||||
if ($row > 1)
|
||||
{
|
||||
$no_button["Row$row"]['insert_row[0]'] = True;
|
||||
}
|
||||
$content["Row$row"] = array(
|
||||
'height' => array("h$row" => $this->etemplate->data[0]["h$row"]),
|
||||
'class' => array("c$row" => $this->etemplate->data[0]["c$row"])
|
||||
);
|
||||
for ($spanned = $c = 0; $c < $this->etemplate->cols; ++$c)
|
||||
{
|
||||
if (!(list($col,$cell) = each($cols)))
|
||||
{
|
||||
$cell = $this->etemplate->empty_cell(); // if cell gots lost, create it empty
|
||||
$col = $this->etemplate->num2chrs($c);
|
||||
}
|
||||
if (--$spanned > 0) // preserv spanned cells
|
||||
{
|
||||
while(list($k,$v) = each($cell)) // so spanned (not shown) cells got
|
||||
{ // reported back like regular one
|
||||
$cols_spanned["cont[$col$row][$k]"] = $v;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$spanned = $cell['span'] == 'all' ? $this->etemplate->cols-$c : 0+$cell['span'];
|
||||
$content[$col.$row] = $cell;
|
||||
}
|
||||
if ($row == 1)
|
||||
{
|
||||
$content["Col$col"] = array('width' => array($col => $this->etemplate->data[0][$col]));
|
||||
if ($this->etemplate->cols <= 1)
|
||||
{
|
||||
$no_button["Col$col"]['delete_col[1]'] = True;
|
||||
}
|
||||
if ($c > 0)
|
||||
{
|
||||
$no_button["Col$col"]['insert_col[0]'] = True;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$no_button['ColA']['exchange_col[1]'] = $no_button['Row1']['exchange_row[1]'] = True;
|
||||
|
||||
if ($this->debug)
|
||||
{
|
||||
echo 'editor.edit: content ='; _debug_array($content);
|
||||
}
|
||||
$this->editor->exec('etemplate.editor.process_edit',$content,
|
||||
array(
|
||||
'type' => $this->etemplate->types,
|
||||
'align' => $this->etemplate->aligns
|
||||
),
|
||||
$no_button,$cols_spanned
|
||||
);
|
||||
}
|
||||
|
||||
function swap(&$a,&$b)
|
||||
{
|
||||
$t = $a; $a = $b; $b = $t;
|
||||
}
|
||||
|
||||
function process_edit()
|
||||
{
|
||||
$content = $GLOBALS['HTTP_POST_VARS']['cont'];
|
||||
|
||||
if ($this->debug)
|
||||
{
|
||||
echo "editor.process_edit: content ="; _debug_array($content);
|
||||
}
|
||||
$this->etemplate->init($content);
|
||||
$this->etemplate->size = $content['size'];
|
||||
$this->etemplate->style = $content['style'];
|
||||
|
||||
$this->etemplate->data = array($content['width']+$content['height']+$content['class']);
|
||||
$row = 1; $col = 0;
|
||||
while (isset($content[$name = $this->etemplate->num2chrs($col) . $row]))
|
||||
{
|
||||
$row_data[$this->etemplate->num2chrs($col++)] = $content[$name];
|
||||
if (!isset($content[$name = $this->etemplate->num2chrs($col) . $row])) // try new row
|
||||
{
|
||||
if ($col > $cols)
|
||||
{
|
||||
$cols = $col;
|
||||
}
|
||||
$this->etemplate->data[$row] = $row_data;
|
||||
++$row; $col = 0;
|
||||
$row_data = array();
|
||||
}
|
||||
}
|
||||
$this->etemplate->rows = $row - 1;
|
||||
$this->etemplate->cols = $cols;
|
||||
|
||||
if (isset($content['insert_row']))
|
||||
{
|
||||
list($row) = each($content['insert_row']);
|
||||
$opts = $this->etemplate->data[0]; // move height + class options of rows
|
||||
for ($r = $this->etemplate->rows; $r > $row; --$r)
|
||||
{
|
||||
$opts['c'.(1+$r)] = $opts["c$r"]; unset($opts["c$r"]);
|
||||
$opts['h'.(1+$r)] = $opts["h$r"]; unset($opts["h$r"]);
|
||||
}
|
||||
$this->etemplate->data[0] = $opts;
|
||||
$old = $this->etemplate->data; // move rows itself
|
||||
$row_data = array();
|
||||
for ($col = 0; $col < $this->etemplate->cols; ++$col)
|
||||
{
|
||||
$row_data[$this->etemplate->num2chrs($col)] = $this->etemplate->empty_cell();
|
||||
}
|
||||
$this->etemplate->data[++$row] = $row_data;
|
||||
for (; $row <= $this->etemplate->rows; ++$row)
|
||||
{
|
||||
$this->etemplate->data[1+$row] = $old[$row];
|
||||
}
|
||||
++$this->etemplate->rows;
|
||||
}
|
||||
elseif (isset($content['insert_col']))
|
||||
{
|
||||
list($insert_col) = each($content['insert_col']);
|
||||
for ($row = 1; $row <= $this->etemplate->rows; ++$row)
|
||||
{
|
||||
$old = $row_data = $this->etemplate->data[$row];
|
||||
$row_data[$this->etemplate->num2chrs($insert_col)] = $this->etemplate->empty_cell();
|
||||
for ($col = $insert_col; $col < $this->etemplate->cols; ++$col)
|
||||
{
|
||||
$row_data[$this->etemplate->num2chrs(1+$col)] = $old[$this->etemplate->num2chrs($col)];
|
||||
}
|
||||
$this->etemplate->data[$row] = $row_data;
|
||||
}
|
||||
$width = $this->etemplate->data[0];
|
||||
for ($col = $this->etemplate->cols; $col > $insert_col; --$col)
|
||||
{
|
||||
$width[$this->etemplate->num2chrs($col)] = $width[$this->etemplate->num2chrs($col-1)];
|
||||
}
|
||||
unset($width[$this->etemplate->num2chrs($insert_col)]);
|
||||
$this->etemplate->data[0] = $width;
|
||||
|
||||
++$this->etemplate->cols;
|
||||
}
|
||||
elseif (isset($content['exchange_col']))
|
||||
{
|
||||
list($exchange_col) = each($content['exchange_col']);
|
||||
$right = $this->etemplate->num2chrs($exchange_col-1);
|
||||
$left = $this->etemplate->num2chrs($exchange_col-2);
|
||||
|
||||
for ($row = 1; $row <= $this->etemplate->rows; ++$row)
|
||||
{
|
||||
$this->swap($this->etemplate->data[$row][$left],$this->etemplate->data[$row][$right]);
|
||||
}
|
||||
$this->swap($this->etemplate->data[0][$left],$this->etemplate->data[0][$right]);
|
||||
}
|
||||
elseif (isset($content['exchange_row']))
|
||||
{
|
||||
list($er2) = each($content['exchange_row']); $er1 = $er2-1;
|
||||
$this->swap($this->etemplate->data[$er1],$this->etemplate->data[$er2]);
|
||||
$this->swap($this->etemplate->data[0]["c$er1"],$this->etemplate->data[0]["c$er2"]);
|
||||
$this->swap($this->etemplate->data[0]["h$er1"],$this->etemplate->data[0]["h$er2"]);
|
||||
}
|
||||
elseif (isset($content['delete_row']))
|
||||
{
|
||||
list($delete_row) = each($content['delete_row']);
|
||||
$opts = $this->etemplate->data[0];
|
||||
for ($row = $delete_row; $row < $this->etemplate->rows; ++$row)
|
||||
{
|
||||
$this->etemplate->data[$row] = $this->etemplate->data[1+$row];
|
||||
$opts["c$row"] = $opts['c'.(1+$row)];
|
||||
$opts["h$row"] = $opts['h'.(1+$row)];
|
||||
}
|
||||
unset($this->etemplate->data[$this->etemplate->rows--]);
|
||||
$this->etemplate->data[0] = $opts;
|
||||
}
|
||||
elseif (isset($content['delete_col']))
|
||||
{
|
||||
list($delete_col) = each($content['delete_col']);
|
||||
for ($row = 1; $row <= $this->etemplate->rows; ++$row)
|
||||
{
|
||||
$row_data = $this->etemplate->data[$row];
|
||||
for ($col = $delete_col; $col < $this->etemplate->cols; ++$col)
|
||||
{
|
||||
$row_data[$this->etemplate->num2chrs($col-1)] = $row_data[$this->etemplate->num2chrs($col)];
|
||||
}
|
||||
unset($row_data[$this->etemplate->num2chrs($this->etemplate->cols-1)]);
|
||||
$this->etemplate->data[$row] = $row_data;
|
||||
}
|
||||
$width = $this->etemplate->data[0];
|
||||
for ($col = $delete_col; $col < $this->etemplate->cols; ++$col)
|
||||
{
|
||||
$width[$this->etemplate->num2chrs($col-1)] = $width[$this->etemplate->num2chrs($col)];
|
||||
}
|
||||
$this->etemplate->data[0] = $width;
|
||||
--$this->etemplate->cols;
|
||||
}
|
||||
if ($this->debug)
|
||||
{
|
||||
echo 'editor.process_edit: rows='.$this->etemplate->rows.', cols='.
|
||||
$this->etemplate->cols.', data ='; _debug_array($this->etemplate->data);
|
||||
}
|
||||
// Execute the action resulting from the submit-button
|
||||
if ($content['read'])
|
||||
{
|
||||
if (!$this->etemplate->read($content))
|
||||
{
|
||||
$msg = $this->messages['not_found'];
|
||||
}
|
||||
}
|
||||
elseif ($content['delete'])
|
||||
{
|
||||
$this->delete();
|
||||
return;
|
||||
}
|
||||
elseif ($content['dump'])
|
||||
{
|
||||
$msg = $this->etemplate->dump2setup($content['name']);
|
||||
}
|
||||
elseif ($content['save'])
|
||||
{
|
||||
$ok = $this->etemplate->save($content['name'],$content['template'],$content['lang'],$content['group'],$content['version']);
|
||||
$msg = $this->messages[$ok ? 'saved' : 'error_writing'];
|
||||
}
|
||||
elseif ($content['show'])
|
||||
{
|
||||
$this->show();
|
||||
return;
|
||||
}
|
||||
elseif ($content['langfile'])
|
||||
{
|
||||
$additional = array();
|
||||
if (substr($content['name'],0,9) == 'etemplate')
|
||||
{
|
||||
$additional = $this->messages + $this->etemplate->types + $this->etemplate->aligns;
|
||||
}
|
||||
|
||||
$msg = $this->etemplate->writeLangFile($content['name'],'en',$additional);
|
||||
}
|
||||
elseif ($content['db_tools'])
|
||||
{
|
||||
ExecMethod('etemplate.db_tools.edit');
|
||||
return;
|
||||
}
|
||||
$this->edit($msg);
|
||||
}
|
||||
|
||||
function delete($back = 'edit')
|
||||
{
|
||||
if (isset($GLOBALS['HTTP_POST_VARS']['name']))
|
||||
{
|
||||
$read_ok = $this->etemplate->read($GLOBALS['HTTP_POST_VARS']);
|
||||
}
|
||||
|
||||
if (isset($GLOBALS['HTTP_POST_VARS']['yes'])) // Delete
|
||||
{
|
||||
if ($read_ok)
|
||||
{
|
||||
$read_ok = $this->etemplate->delete();
|
||||
}
|
||||
$this->edit($this->messages[$read_ok ? 'deleted' : 'not_found']);
|
||||
return;
|
||||
}
|
||||
if (isset($GLOBALS['HTTP_POST_VARS']['no'])) // Back to ...
|
||||
{
|
||||
if (($back = $GLOBALS['HTTP_POST_VARS']['back']) != 'show')
|
||||
{
|
||||
$back = 'edit';
|
||||
}
|
||||
$this->$back();
|
||||
return;
|
||||
}
|
||||
if (isset($GLOBALS['HTTP_GET_VARS']['name']) && !$this->etemplate->read($GLOBALS['HTTP_GET_VARS']))
|
||||
{
|
||||
$this->edit($this->messages['not_found']);
|
||||
return;
|
||||
}
|
||||
$content = $this->etemplate->as_array() + array('back' => $back);
|
||||
|
||||
$delete = new etemplate('etemplate.editor.delete');
|
||||
|
||||
$delete->exec('etemplate.editor.delete',$content,array(),array(),$content,'');
|
||||
}
|
||||
|
||||
function show()
|
||||
{
|
||||
$post_vars = $GLOBALS['HTTP_POST_VARS'];
|
||||
|
||||
if (isset($GLOBALS['HTTP_GET_VARS']['name']) && !$this->etemplate->read($GLOBALS['HTTP_GET_VARS']) ||
|
||||
isset($post_vars['name']) && !$this->etemplate->read($post_vars))
|
||||
{
|
||||
$msg = $this->messages['not_found'];
|
||||
}
|
||||
|
||||
if (!$msg && isset($post_vars['delete']))
|
||||
{
|
||||
$this->delete('show');
|
||||
return;
|
||||
}
|
||||
if (isset($post_vars['edit']))
|
||||
{
|
||||
$this->edit();
|
||||
return;
|
||||
}
|
||||
$content = $this->etemplate->as_array() + array('msg' => $msg);
|
||||
|
||||
$show = new etemplate('etemplate.editor.show');
|
||||
$no_buttons = array('save' => True,'show' => True,'dump' => True,'langfile' => True,'size' => True);
|
||||
|
||||
if (!$msg && isset($post_vars['values']) && !isset($GLOBALS['HTTP_POST_VARS']['vals']))
|
||||
{
|
||||
$cont = $this->etemplate->process_show($GLOBALS['HTTP_POST_VARS']);
|
||||
for ($r = 1; list($key,$val) = each($cont); ++$r)
|
||||
{
|
||||
$vals["A$r"] = $key;
|
||||
$vals["B$r"] = $val;
|
||||
}
|
||||
$show->data[$show->rows]['A']['name'] = 'etemplate.editor.values';
|
||||
$show->data[$show->rows]['A']['size'] = 'vals';
|
||||
$content['vals'] = $vals;
|
||||
}
|
||||
else
|
||||
{
|
||||
$show->data[$show->rows]['A']['name'] = $this->etemplate;
|
||||
$vals = $GLOBALS['HTTP_POST_VARS']['vals'];
|
||||
$olds = unserialize(stripslashes($GLOBALS['HTTP_POST_VARS']['olds']));
|
||||
|
||||
for ($r = 1; isset($vals["B$r"]); ++$r)
|
||||
{
|
||||
$content['cont'][$olds["A$r"]] = $vals["B$r"];
|
||||
}
|
||||
}
|
||||
$show->exec('etemplate.editor.show',$content,array(),$no_buttons,array('olds' => $vals),'');
|
||||
}
|
||||
}
|
17
etemplate/inc/class.etemplate.inc.php
Normal file
17
etemplate/inc/class.etemplate.inc.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - EditableTemplates *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$ui = 'ui'; // html UI, which UI to use, should come from api and be in $GLOBALS['phpgw']???
|
||||
|
||||
include(PHPGW_API_INC . "/../../etemplate/inc/class.${ui}etemplate.inc.php");
|
277
etemplate/inc/class.html.inc.php
Normal file
277
etemplate/inc/class.html.inc.php
Normal file
@ -0,0 +1,277 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - InfoLog *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* originaly based on todo written by Joseph Engo <jengo@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 html
|
||||
{
|
||||
var $prefered_img_title;
|
||||
|
||||
function html()
|
||||
{
|
||||
global $HTTP_USER_AGENT;
|
||||
// should be Ok for all HTML 4 compatible browsers
|
||||
$this->prefered_img_title = stristr($HTTP_USER_AGENT,'konqueror') ? 'title' : 'alt';
|
||||
}
|
||||
|
||||
function input_hidden($vars,$value='')
|
||||
{
|
||||
if (!is_array($vars))
|
||||
{
|
||||
$vars = array( $vars => $value );
|
||||
}
|
||||
while (list($name,$value) = each($vars))
|
||||
{
|
||||
if (is_array($value))
|
||||
{
|
||||
$value = serialize($value);
|
||||
}
|
||||
$del = strchr($value,'"') ? "'" : '"';
|
||||
if ($value && !($name == 'filter' && $value == 'none')) // dont need to send all the empty vars
|
||||
{
|
||||
$html .= "<INPUT TYPE=HIDDEN NAME=\"$name\" VALUE=$del$value$del>\n";
|
||||
}
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
function textarea($name,$value='',$options='' )
|
||||
{
|
||||
return "<TEXTAREA name=\"$name\" $options>$value</TEXTAREA>\n";
|
||||
}
|
||||
|
||||
function input($name,$value='',$type='',$options='' )
|
||||
{
|
||||
if ($type)
|
||||
{
|
||||
$type = "TYPE=$type";
|
||||
}
|
||||
|
||||
return "<INPUT $type NAME=\"$name\" VALUE=\"$value\" $options>\n";
|
||||
}
|
||||
|
||||
function submit_button($name,$lang,$onClick='',$no_lang=0,$options='')
|
||||
{
|
||||
if (!$no_lang)
|
||||
{
|
||||
$lang = lang($lang);
|
||||
}
|
||||
if ($onClick)
|
||||
{
|
||||
$options .= " onClick=\"$onClick\"";
|
||||
}
|
||||
return $this->input($name,$lang,'SUBMIT',$options);
|
||||
}
|
||||
|
||||
/*!
|
||||
@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'
|
||||
@returns absolut link already run through $phpgw->link
|
||||
*/
|
||||
function link($url,$vars='')
|
||||
{
|
||||
if (is_array( $vars ))
|
||||
{
|
||||
$v = array( );
|
||||
while(list($name,$value) = each($vars))
|
||||
{
|
||||
if ($value && !($name == 'filter' && $value == 'none')) // dont need to send all the empty vars
|
||||
{
|
||||
$v[] = "$name=$value";
|
||||
}
|
||||
}
|
||||
$vars = implode('&',$v);
|
||||
}
|
||||
list($url,$v) = explode('?',$url); // url may contain additional vars
|
||||
if ($v)
|
||||
{
|
||||
$vars .= ($vars ? '&' : '') . $v;
|
||||
}
|
||||
|
||||
return $GLOBALS['phpgw']->link($url,$vars);
|
||||
}
|
||||
|
||||
function checkbox($name,$value='')
|
||||
{
|
||||
return "<input type=\"checkbox\" name=\"$name\" value=\"True\"" .($value ? ' checked' : '') . ">\n";
|
||||
}
|
||||
|
||||
function form($content,$hidden_vars,$url,$url_vars='',$method='POST')
|
||||
{
|
||||
$html = "<form method=\"$method\" action=\"".$this->link($url,$url_vars)."\">\n";
|
||||
$html .= $this->input_hidden($hidden_vars);
|
||||
|
||||
if ($content)
|
||||
{
|
||||
$html .= $content;
|
||||
$html .= "</form>\n";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
function form_1button($name,$lang,$hidden_vars,$url,$url_vars='',$method='POST')
|
||||
{
|
||||
return $this->form($this->submit_button($name,$lang),
|
||||
$hidden_vars,$url,$url_vars,$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>'
|
||||
@returns string with html-code of the table
|
||||
*/
|
||||
function table($rows,$options = '')
|
||||
{
|
||||
$html = "<TABLE $options>\n";
|
||||
|
||||
while (list($key,$row) = each($rows))
|
||||
{
|
||||
if (!is_array($row))
|
||||
{
|
||||
continue; // parameter
|
||||
}
|
||||
$html .= "\t<TR ".$rows['.'.$key].">\n";
|
||||
while (list($key,$cell) = each($row))
|
||||
{
|
||||
if ($key[0] == '.')
|
||||
{
|
||||
continue; // parameter
|
||||
}
|
||||
$html .= "\t\t<TD ".$row['.'.$key].">$cell</TD>\n";
|
||||
}
|
||||
$html .= "\t</TR>\n";
|
||||
}
|
||||
$html .= "</TABLE>\n";
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function sbox_submit( $sbox,$no_script=0 )
|
||||
{
|
||||
$html = str_replace('<select','<select onChange="this.form.submit()" ',
|
||||
$sbox);
|
||||
if ($no_script)
|
||||
{
|
||||
$html .= '<noscript>'.$this->submit_button('send','>').'</noscript>';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
function image( $app,$name,$title='',$options='' )
|
||||
{
|
||||
if (!($path = $GLOBALS['phpgw']->common->image($app,$name)))
|
||||
{
|
||||
$path = $name; // name may already contain absolut path
|
||||
}
|
||||
|
||||
if ($title)
|
||||
{
|
||||
$options .= " $this->prefered_img_title=\"$title\"";
|
||||
}
|
||||
return "<IMG SRC=\"$path\" $options>";
|
||||
}
|
||||
|
||||
function a_href( $content,$url,$vars='',$options='')
|
||||
{
|
||||
if (!strstr($url,'/') && count(explode('.',$url)) == 3)
|
||||
{
|
||||
$url = "/index.php?menuaction=$url";
|
||||
}
|
||||
|
||||
return '<a href="'.$this->link($url,$vars).'" '.$options.'>'.$content.'</a>';
|
||||
}
|
||||
|
||||
function bold($content)
|
||||
{
|
||||
return '<b>'.$content.'</b>';
|
||||
}
|
||||
|
||||
function italic($content)
|
||||
{
|
||||
return '<i>'.$content.'</i>';
|
||||
}
|
||||
|
||||
function hr($width,$options='')
|
||||
{
|
||||
if ($width)
|
||||
{
|
||||
$options .= " WIDTH=$width";
|
||||
}
|
||||
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"'
|
||||
@returns option string
|
||||
*/
|
||||
function formatOptions($options,$names)
|
||||
{
|
||||
if (!is_array($options))
|
||||
{
|
||||
$options = explode(',',$options);
|
||||
}
|
||||
if (!is_array($names))
|
||||
{
|
||||
$names = explode(',',$names);
|
||||
}
|
||||
|
||||
while (list($n,$val) = each($options))
|
||||
{
|
||||
if ($val != '' && $names[$n] != '')
|
||||
{
|
||||
$html .= ' '.$names[$n].'="'.$val.'"';
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function nextMatchStyles
|
||||
@abstract returns simple stylesheet for nextmatch row-colors
|
||||
@returns the classes 'nmh' = nextmatch header, 'nmr0'+'nmr1' = alternating rows
|
||||
*/
|
||||
function nextMatchStyles()
|
||||
{
|
||||
return $this->style(
|
||||
".nmh { background: ".$GLOBALS['phpgw_info']['theme']['th_bg']."; }\n".
|
||||
".nmr1 { background: ".$GLOBALS['phpgw_info']['theme']['row_on']."; }\n".
|
||||
".nmr0 { background: ".$GLOBALS['phpgw_info']['theme']['row_off']."; }\n"
|
||||
);
|
||||
}
|
||||
|
||||
function style($styles)
|
||||
{
|
||||
return $styles ? "<STYLE type=\"text/css\">\n<!--\n$styles\n-->\n</STYLE>" : '';
|
||||
}
|
||||
|
||||
function label($content,$options='')
|
||||
{
|
||||
return "<LABEL $options>$content</LABEL>";
|
||||
}
|
||||
}
|
477
etemplate/inc/class.sbox2.inc.php
Normal file
477
etemplate/inc/class.sbox2.inc.php
Normal file
@ -0,0 +1,477 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare API - Select Box 2 *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* 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 *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
class sbox2 extends sbox
|
||||
{
|
||||
/*
|
||||
* Function: search for an id of an db-entry, eg. an address
|
||||
* Parameter: $name base name for all template-vars and of the submitted vars (not to conflict with other template-var-names !!!)
|
||||
* $lang_name titel of the field
|
||||
* $prompt for the JavaScript prompt()
|
||||
* $id_name id of previosly selected entry
|
||||
* $content from id (eg. 'company: lastname, givenname' for address $id) if $id != 0, or
|
||||
* array with searchresult (id's as key), if array is empty if search was unsucsessful
|
||||
* Returns: array with vars to set in temaplate, the vars are:
|
||||
* {doSearchFkt} Javascript Funktion, place somewhere in Template (before rest of the vars)
|
||||
* {$name.'_title} button with titel $lang_name (if JS) or just $lang_name
|
||||
* {$name} content of $id if != 0, or lang('use Button to search for').$lang_name
|
||||
* {$name.'_nojs} searchfield + button if we have no JavaScript, else empty
|
||||
*
|
||||
* To use call $template->set_var(getIdSearch( ... ));
|
||||
* the template should look like {doSeachFkt} <tr><td>{XXX_title}</td><td>{XXX}</td><td>{XXX_nojs}</td></tr> (XXX is content of $name)
|
||||
* In the submitted page the vars $query_XXX and $id_XXX are set according to what is selected, see getAddress as Example
|
||||
*/
|
||||
|
||||
function getId($name,$lang_name,$prompt,$id_name,$content='',$note='')
|
||||
{
|
||||
// echo "<p>getId('$name','$lang_name','$prompt',$id_name,'$content') =";
|
||||
$ret['doSearchFkt'] =
|
||||
'<script language="JavaScript">'."\n".
|
||||
" function doSearch(field,ask) {\n".
|
||||
" field.value = prompt(ask,'');\n".
|
||||
" if (field.value != 'null') {\n".
|
||||
" if (field.value.length == 0)\n".
|
||||
" field.value = '%';\n".
|
||||
" field.form.submit();\n".
|
||||
" } else\n".
|
||||
" field.value = ''\n".
|
||||
" }\n".
|
||||
'</script>';
|
||||
|
||||
$ret[$name.'_title'] = is_array($content) && count($content) ? $lang_name :
|
||||
'<script language="JavaScript">'."\n".
|
||||
" document.writeln('<input type=\"hidden\" name=\"query_$name\" value=\"\">');\n".
|
||||
" document.writeln('<input type=\"button\" onClick=\"doSearch(this.form.query_$name,\'$prompt\')\" value=\"$lang_name\">');\n".
|
||||
"</script>\n".
|
||||
"<noscript>\n".
|
||||
" $lang_name\n".
|
||||
"</noscript>";
|
||||
|
||||
if (is_array($content))
|
||||
{ // result from search
|
||||
if (!count($content))
|
||||
{ // search was unsuccsessful
|
||||
$ret[$name] = lang('no entries found, try again ...');
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret[$name.'_OK'] = ''; // flag we have something so select
|
||||
$ret[$name] = "<select name=\"id_$name\">\n";
|
||||
while (list( $id,$text ) = each( $content ))
|
||||
{
|
||||
$ret[$name] .= "<option value=\"$id\">" . $GLOBALS['phpgw']->strip_html($text) . "\n";
|
||||
}
|
||||
$ret[$name] .= '<option value="0">'.lang('none')."\n";
|
||||
$ret[$name] .= '</select>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($id_name)
|
||||
{
|
||||
$ret[$name] = $content . "\n<input type=\"hidden\" name=\"id_$name\" value=\"$id_name\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret[$name] = "<span class=note>$note</span>";
|
||||
}
|
||||
}
|
||||
|
||||
$ret[$name.'_nojs'] =
|
||||
"<noscript>\n".
|
||||
" <input name=\"query_$name\" value=\"\" size=10> <input type=\"submit\" value=\"?\">\n".
|
||||
"</noscript>";
|
||||
|
||||
// print_r($ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function addr2name( $addr )
|
||||
{
|
||||
$name = $addr['n_family'];
|
||||
if ($addr['n_given'])
|
||||
{
|
||||
$name .= ', '.$addr['n_given'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($addr['n_prefix'])
|
||||
{
|
||||
$name .= ', '.$addr['n_prefix'];
|
||||
}
|
||||
}
|
||||
if ($addr['org_name'])
|
||||
{
|
||||
$name = $addr['org_name'].': '.$name;
|
||||
}
|
||||
return $GLOBALS['phpgw']->strip_html($name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Allows you to show and select an address from the addressbook (works with and without javascript !!!)
|
||||
* Parameters $name string with basename of all variables (not to conflict with the name other template or submitted vars !!!)
|
||||
* $id_name id of the address for edit or 0 if none selected so far
|
||||
* $query_name have to be called $query_XXX, the search pattern after the submit, has to be passed back to the function
|
||||
* On Submit $id_XXX contains the selected address (if != 0)
|
||||
* $query_XXX search pattern if the search button is pressed by the user, or '' if regular submit
|
||||
* Returns array with vars to set for the template, set with: $template->set_var( getAddress( ... )); (see getId( ))
|
||||
*
|
||||
* Note As query's for an address are submitted, you have to check $query_XXX if it is a search or a regular submit (!$query_string)
|
||||
*/
|
||||
|
||||
function getAddress( $name,$id_name,$query_name,$title='')
|
||||
{
|
||||
// echo "<p>getAddress('$name',$id_name,'$query_name','$title')</p>";
|
||||
if ($id_name || $query_name)
|
||||
{
|
||||
$contacts = createobject('phpgwapi.contacts');
|
||||
|
||||
if ($query_name)
|
||||
{
|
||||
$addrs = $contacts->read( 0,0,'',$query_name,'','DESC','org_name,n_family,n_given' );
|
||||
$content = array( );
|
||||
while ($addrs && list( $key,$addr ) = each( $addrs ))
|
||||
{
|
||||
$content[$addr['id']] = $this->addr2name( $addr );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list( $addr ) = $contacts->read_single_entry( $id_name );
|
||||
if (count($addr))
|
||||
{
|
||||
$content = $this->addr2name( $addr );
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$title)
|
||||
{
|
||||
$title = lang('Addressbook');
|
||||
}
|
||||
|
||||
return $this->getId($name,$title,lang('Pattern for Search in Addressbook'),$id_name,$content,lang('use Button to search for Address'));
|
||||
}
|
||||
|
||||
function addr2email( $addr,$home='' )
|
||||
{
|
||||
if (!is_array($addr))
|
||||
{
|
||||
$home = substr($addr,-1) == 'h';
|
||||
$contacts = createobject('phpgwapi.contacts');
|
||||
list( $addr ) = $contacts->read_single_entry( intval($addr) );
|
||||
}
|
||||
if ($home)
|
||||
{
|
||||
$home = '_home';
|
||||
}
|
||||
|
||||
if (!count($addr) || !$addr['email'.$home])
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if ($addr['n_given'])
|
||||
{
|
||||
$name = $addr['n_given'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($addr['n_prefix'])
|
||||
{
|
||||
$name = $addr['n_prefix'];
|
||||
}
|
||||
}
|
||||
$name .= ($name ? ' ' : '') . $addr['n_family'];
|
||||
|
||||
return $name.' <'.$addr['email'.$home].'>';
|
||||
}
|
||||
|
||||
function getEmail( $name,$id_name,$query_name,$title='')
|
||||
{
|
||||
// echo "<p>getAddress('$name',$id_name,'$query_name','$title')</p>";
|
||||
if ($id_name || $query_name)
|
||||
{
|
||||
$contacts = createobject('phpgwapi.contacts');
|
||||
|
||||
if ($query_name)
|
||||
{
|
||||
$addrs = $contacts->read( 0,0,'',$query_name,'','DESC','org_name,n_family,n_given' );
|
||||
$content = array( );
|
||||
while ($addrs && list( $key,$addr ) = each( $addrs ))
|
||||
{
|
||||
if ($addr['email'])
|
||||
{
|
||||
$content[$addr['id']] = $this->addr2email( $addr );
|
||||
}
|
||||
if ($addr['email_home'])
|
||||
{
|
||||
$content[$addr['id'].'h'] = $this->addr2email( $addr,'_home' );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$content = $this->addr2email( $id_name );
|
||||
}
|
||||
}
|
||||
if (!$title)
|
||||
{
|
||||
$title = lang('Addressbook');
|
||||
}
|
||||
|
||||
return $this->getId($name,$title,lang('Pattern for Search in Addressbook'),$id_name,$content);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function Allows you to show and select an project from the projects-app (works with and without javascript !!!)
|
||||
* Parameters $name string with basename of all variables (not to conflict with the name other template or submitted vars !!!)
|
||||
* $id_name id of the project for edit or 0 if none selected so far
|
||||
* $query_name have to be called $query_XXX, the search pattern after the submit, has to be passed back to the function
|
||||
* On Submit $id_XXX contains the selected address (if != 0)
|
||||
* $query_XXX search pattern if the search button is pressed by the user, or '' if regular submit
|
||||
* Returns array with vars to set for the template, set with: $template->set_var( getProject( ... )); (see getId( ))
|
||||
*
|
||||
* Note As query's for an address are submitted, you have to check $query_XXX if it is a search or a regular submit (!$query_string)
|
||||
*/
|
||||
function getProject( $name,$id_name,$query_name,$title='' )
|
||||
{
|
||||
// echo "<p>getProject('$name',$id_name,'$query_name','$title')</p>";
|
||||
if ($id_name || $query_name)
|
||||
{
|
||||
$projects = createobject('projects.projects');
|
||||
if ($query_name)
|
||||
{
|
||||
$projs = $projects->read_projects( 0,0,$query_name,'','','','',0 );
|
||||
$content = array();
|
||||
while ($projs && list( $key,$proj ) = each( $projs ))
|
||||
{
|
||||
$content[$proj['id']] = $proj['title'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list( $proj ) = $projects->read_single_project( $id_name );
|
||||
if (count($proj))
|
||||
{
|
||||
$content = $proj['title'];
|
||||
// $customer_id = $proj['customer'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$title)
|
||||
{
|
||||
$title = lang('Project');
|
||||
}
|
||||
|
||||
return $this->getId($name,$title,lang('Pattern for Search in Projects'),$id_name,$content,lang('use Button to search for Project'));
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: Allows to show and select one item from an array
|
||||
* Parameters: $name string with name of the submitted var which holds the key of the selected item form array
|
||||
* $key key(s) of already selected item(s) from $arr, eg. '1' or '1,2' or array with keys
|
||||
* $arr array with items to select, eg. $arr = array ( 'y' => 'yes','n' => 'no','m' => 'maybe');
|
||||
* $no_lang if !$no_lang send items through lang()
|
||||
* $options additional options (e.g. 'multiple')
|
||||
* On submit $XXX is the key of the selected item (XXX is the content of $name)
|
||||
* Returns: string to set for a template or to echo into html page
|
||||
*/
|
||||
function getArrayItem($name, $key, $arr=0,$no_lang=0,$options='',$multiple=0)
|
||||
{ // should be in class common.sbox
|
||||
if (!is_array($arr))
|
||||
{
|
||||
$arr = array('no','yes');
|
||||
}
|
||||
if (0+$multiple > 0)
|
||||
{
|
||||
$options .= ' MULTIPLE SIZE='.(0+$multiple);
|
||||
if (substr($name,-2) != '[]')
|
||||
$name .= '[]';
|
||||
}
|
||||
$out = "<select name=\"$name\" $options>\n";
|
||||
|
||||
if (is_array($key)) $key = implode(',',$key);
|
||||
|
||||
while (list($k,$text) = each($arr))
|
||||
{
|
||||
$out .= '<option value="'.$k.'"';
|
||||
if($k == $key || strstr(",$key,",",$k,")) $out .= " SELECTED";
|
||||
$out .= ">" . ($no_lang || $text == '' ? $text : lang($text)) . "</option>\n";
|
||||
}
|
||||
$out .= "</select>\n";
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
function getPercentage($name, $selected=0,$options='')
|
||||
{ // reimplemented using getArrayItem
|
||||
for ($i=0; $i <= 100; $i+=10)
|
||||
$arr[$i] = "$i%";
|
||||
|
||||
return $this->getArrayItem($name,$selected,$arr,1,$options);
|
||||
}
|
||||
|
||||
function getPriority($name, $selected=2,$options='')
|
||||
{ // reimplemented using getArrayItem
|
||||
$arr = array('','low','normal','high');
|
||||
|
||||
return $this->getArrayItem($name,$selected,$arr,0,$options);
|
||||
}
|
||||
|
||||
function getAccessList($name,$selected='private',$options='')
|
||||
{ // reimplemented using getArrayItem
|
||||
$arr = array(
|
||||
"private" => "Private",
|
||||
"public" => "Global public",
|
||||
"group" => "Group public"
|
||||
);
|
||||
|
||||
if (strstr($selected,','))
|
||||
{
|
||||
$selected = "group";
|
||||
}
|
||||
|
||||
return $this->getArrayItem($name,$selected,$arr,0,$options);
|
||||
}
|
||||
|
||||
function getCountry($name='country',$selected=' ',$options='')
|
||||
{ // reimplemented using getArrayItem
|
||||
return $this->getArrayItem($name,$selected,$this->country_array,0,$options);
|
||||
}
|
||||
|
||||
function form_select($name='country',$selected=' ',$options='')
|
||||
{ // reimplemented using getArrayItem (stupid name!!!)
|
||||
return getCountry($name,$selected,$options);
|
||||
}
|
||||
|
||||
function accountInfo($id,$account_data=0,$longnames=0,$show_type=0)
|
||||
{
|
||||
if (!$id)
|
||||
{
|
||||
return ' ';
|
||||
}
|
||||
|
||||
if (!is_array($account_data))
|
||||
{
|
||||
$accounts = createobject('phpgwapi.accounts',$id);
|
||||
$accounts->db = $GLOBALS['phpgw']->db;
|
||||
$accounts->read_repository();
|
||||
$account_data = $accounts->data;
|
||||
}
|
||||
$info = $show_type ? '('.$account_data['account_type'].') ' : '';
|
||||
|
||||
switch ($longnames)
|
||||
{
|
||||
case 2: $info .= '<'.$account_data['account_lid'].'> '; // fall-through
|
||||
case 1: $info .= $account_data['account_firstname'].' '.$account_data['account_lastname']; break;
|
||||
default: $info .= $account_data['account_lid']; break;
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function: Allows to select one accountname
|
||||
* Parameters: $name string with name of the submitted var, which holds the account_id or 0 after submit
|
||||
* $id account_id of already selected account
|
||||
* $longnames 0=account_lid 1=firstname lastname
|
||||
*/
|
||||
|
||||
function getAccount($name,$id,$longnames=0,$type='accounts',$multiple=0,$options='')
|
||||
{
|
||||
$accounts = createobject('phpgwapi.accounts');
|
||||
$accounts->db = $GLOBALS['phpgw']->db;
|
||||
$accs = $accounts->get_list($type);
|
||||
|
||||
if ($multiple < 0)
|
||||
$aarr[] = lang('not assigned');
|
||||
|
||||
while ($a = current($accs))
|
||||
{
|
||||
$aarr[$a['account_id']] = $this->accountInfo($a['account_id'],$a,$longnames,$type=='both');
|
||||
next($accs);
|
||||
}
|
||||
return $this->getArrayItem($name,$id,$aarr,1,$options,$multiple);
|
||||
}
|
||||
|
||||
function getDate($n_year,$n_month,$n_day,$date,$options='')
|
||||
{
|
||||
if (is_array($date))
|
||||
list($year,$month,$day) = $date;
|
||||
elseif (!$date)
|
||||
$day = $month = $year = 0;
|
||||
else
|
||||
{
|
||||
$day = date('d',$date);
|
||||
$month = date('m',$date);
|
||||
$year = date('Y',$date);
|
||||
}
|
||||
return $GLOBALS['phpgw']->common->dateformatorder(
|
||||
$this->getYears($n_year,$year),
|
||||
$this->getMonthText($n_month,$month),
|
||||
$this->getDays($n_day,$day)
|
||||
);
|
||||
}
|
||||
|
||||
function getCategory($name,$cat_id='',$notall=False,$jscript=True,$multiple=0,$options='')
|
||||
{
|
||||
if (!is_object($this->cat))
|
||||
$this->cat = CreateObject('phpgwapi.categories');
|
||||
|
||||
if ($jscript)
|
||||
{
|
||||
$options .= ' onChange="this.form.submit();"';
|
||||
}
|
||||
if (0+$multiple > 0)
|
||||
{
|
||||
$options .= ' MULTIPLE SIZE='.(0+$multiple);
|
||||
if (substr($name,-2) != '[]')
|
||||
$name .= '[]';
|
||||
}
|
||||
/* Setup all and none first */
|
||||
$cats_link = "\n<SELECT NAME=\"$name\" $options>\n";
|
||||
|
||||
if (!$notall)
|
||||
{
|
||||
$cats_link .= '<option value=""';
|
||||
if ($cat_id=='all')
|
||||
{
|
||||
$cats_link .= ' selected';
|
||||
}
|
||||
$cats_link .= '>'.lang("all")."</option>\n";
|
||||
}
|
||||
|
||||
/* Get global and app-specific category listings */
|
||||
$cats_link .= $this->cat->formated_list('select','all',$cat_id,True);
|
||||
$cats_link .= '</select>'."\n";
|
||||
return $cats_link;
|
||||
}
|
||||
|
||||
}
|
557
etemplate/inc/class.soetemplate.inc.php
Normal file
557
etemplate/inc/class.soetemplate.inc.php
Normal file
@ -0,0 +1,557 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - EditableTemplates - Storage Objects *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*!
|
||||
@class soetemplate
|
||||
@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)
|
||||
*/
|
||||
class soetemplate
|
||||
{
|
||||
var $public_functions = array(
|
||||
'init' => True,
|
||||
'read' => True,
|
||||
'save' => True,
|
||||
'delete' => True,
|
||||
'dump2setup' => True,
|
||||
'import_dump' => True,
|
||||
'writeLangFile' => True
|
||||
);
|
||||
var $name; // name of the template, e.g. 'infolog.edit'
|
||||
var $template; // '' = default (not 'default')
|
||||
var $lang; // '' if general template else language short, e.g. 'de'
|
||||
var $group; // 0 = not specific else groupId or if < 0 userId
|
||||
var $version; // like 0.9.13.001
|
||||
var $size; // witdh,height,border of table
|
||||
var $style; // embeded CSS style-sheet
|
||||
var $db,$db_name = 'phpgw_etemplate'; // DB name
|
||||
var $db_key_cols = array('et_name' => 'name','et_template' => 'template','et_lang' => 'lang',
|
||||
'et_group' => 'group','et_version' => 'version');
|
||||
var $db_data_cols = array('et_data' => 'data','et_size' => 'size','et_style' => 'style');
|
||||
var $db_cols;
|
||||
|
||||
/*!
|
||||
@function soetemplate
|
||||
@abstract 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_cols = $this->db_key_cols + $this->db_data_cols;
|
||||
|
||||
$this->read($name,$template,$lang,$group,$version,$rows,$cols);
|
||||
}
|
||||
|
||||
/*!
|
||||
@function num2chrs
|
||||
@abstract generates column-names from index: 'A', 'B', ..., 'AA', 'AB', ..., 'ZZ' (not more!)
|
||||
@param $num index to generate name from 1 => 'A'
|
||||
@returns the name
|
||||
*/
|
||||
function num2chrs($num)
|
||||
{
|
||||
$min = ord('A');
|
||||
$max = ord('Z') - $min + 1;
|
||||
if ($num >= $max)
|
||||
{
|
||||
$chrs = chr(($num / $max) + $min - 1);
|
||||
}
|
||||
$chrs .= chr(($num % $max) + $min);
|
||||
|
||||
return $chrs;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function empty_cell
|
||||
@abstracts constructor for a new / empty cell (nothing fancy so far)
|
||||
@returns the cell
|
||||
*/
|
||||
function empty_cell()
|
||||
{
|
||||
return array('type' => 'label', 'name' => '');
|
||||
}
|
||||
|
||||
/*!
|
||||
@function init
|
||||
@abstract initialises all internal data-structures of the eTemplate and sets the keys
|
||||
@param $name name of the eTemplate or array with the keys
|
||||
@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)
|
||||
{
|
||||
reset($this->db_key_cols);
|
||||
while (list($db_col,$col) = each($this->db_key_cols))
|
||||
{
|
||||
$this->$col = is_array($name) ? $name[$col] : $$col;
|
||||
}
|
||||
if ($this->template == 'default')
|
||||
{
|
||||
$this->template = '';
|
||||
}
|
||||
if ($this->lang == 'default')
|
||||
{
|
||||
$this->lang = '';
|
||||
}
|
||||
$this->size = $this->style = '';
|
||||
$this->data = array();
|
||||
$this->rows = $rows < 0 ? 1 : $rows;
|
||||
$this->cols = $cols < 0 ? 1 : $cols;
|
||||
for ($row = 1; $row <= $rows; ++$row)
|
||||
{
|
||||
for ($col = 0; $col < $cols; ++$col)
|
||||
{
|
||||
$this->data[$row][$this->num2chrs($col)] = $this->empty_cell();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@function read
|
||||
@abstract 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
|
||||
@returns True if a fitting template is found, else False
|
||||
*/
|
||||
function read($name,$template='default',$lang='default',$group=0,$version='')
|
||||
{
|
||||
$this->init($name,$template,$lang,$group,$version);
|
||||
|
||||
if ($this->name)
|
||||
{
|
||||
$this->test_import($this->name); // import updates in setup-dir
|
||||
}
|
||||
|
||||
$pref_lang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
|
||||
$pref_templ = $GLOBALS['phpgw_info']['server']['template_set'];
|
||||
|
||||
$sql = "SELECT * FROM $this->db_name WHERE et_name='$this->name' AND ";
|
||||
if (is_array($name))
|
||||
{
|
||||
$template = $name['template'];
|
||||
}
|
||||
if ($template == 'default')
|
||||
{
|
||||
$sql .= "(et_template='$pref_templ' OR et_template='')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= "et_template='$this->template'";
|
||||
}
|
||||
$sql .= ' AND ';
|
||||
if (is_array($name))
|
||||
{
|
||||
$lang = $name['lang'];
|
||||
}
|
||||
if ($lang == 'default' || $name['lang'] == 'default')
|
||||
{
|
||||
$sql .= "(et_lang='$pref_lang' OR et_lang='')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= "et_lang='$this->lang'";
|
||||
}
|
||||
if ($this->version != '')
|
||||
{
|
||||
$sql .= "AND et_version='$this->version'";
|
||||
}
|
||||
$sql .= " ORDER BY et_lang DESC,et_template DESC,et_version DESC";
|
||||
|
||||
$this->db->query($sql,__LINE__,__FILE__);
|
||||
if (!$this->db->next_record())
|
||||
{
|
||||
return False;
|
||||
}
|
||||
$this->db2obj();
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function db2obj
|
||||
@abstract copies all cols into the obj and unserializes the data-array
|
||||
*/
|
||||
function db2obj()
|
||||
{
|
||||
for (reset($this->db_cols); list($db_col,$name) = each($this->db_cols); )
|
||||
{
|
||||
$this->$name = $this->db->f($db_col);
|
||||
}
|
||||
|
||||
$this->data = unserialize(stripslashes($this->data));
|
||||
|
||||
if ($this->name[0] != '.')
|
||||
{
|
||||
reset($this->data); each($this->data);
|
||||
while (list($row,$cols) = each($this->data))
|
||||
{
|
||||
while (list($col,$cell) = each($cols))
|
||||
{
|
||||
if (is_array($cell['type']))
|
||||
{
|
||||
$this->data[$row][$col]['type'] = $cell['type'][0];
|
||||
//echo "corrected in $this->name cell $col$row attribute type<br>\n";
|
||||
}
|
||||
if (is_array($cell['align']))
|
||||
{
|
||||
$this->data[$row][$col]['align'] = $cell['align'][0];
|
||||
//echo "corrected in $this->name cell $col$row attribute align<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->rows = count($this->data) - 1;
|
||||
$this->cols = count($this->data[1]); // 1 = first row, not 0
|
||||
}
|
||||
|
||||
/*!
|
||||
@function compress_array($arr)
|
||||
@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
|
||||
@returns the compressed array
|
||||
*/
|
||||
function compress_array($arr)
|
||||
{
|
||||
if (!is_array($arr))
|
||||
{
|
||||
return $arr;
|
||||
}
|
||||
|
||||
while (list($key,$val) = each($arr))
|
||||
{
|
||||
if (is_array($val))
|
||||
{
|
||||
$arr[$key] = $this->compress_array($val);
|
||||
}
|
||||
elseif ($val == '' || $val == '0')
|
||||
{
|
||||
unset($arr[$key]);
|
||||
}
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function as_array
|
||||
@abstract returns obj-data as array
|
||||
@param $data_too 0 = no data array, 1 = data array too, 2 = serialize data array
|
||||
@returns the array
|
||||
*/
|
||||
function as_array($data_too=0)
|
||||
{
|
||||
$arr = array();
|
||||
reset($this->db_cols);
|
||||
while (list($db_col,$col) = each($this->db_cols))
|
||||
{
|
||||
if ($col != 'data' || $data_too)
|
||||
{
|
||||
$arr[$col] = $this->$col;
|
||||
}
|
||||
}
|
||||
if ($data_too == 2)
|
||||
{
|
||||
$arr['data'] = serialize($arr['data']);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function save
|
||||
@abstract saves eTemplate-object to db, can be used as saveAs by giving keys as params
|
||||
@params keys see class
|
||||
@returns the number of affected rows, 1 should be ok, 0 somethings wrong
|
||||
*/
|
||||
function save($name='',$template='.',$lang='.',$group='',$version='.')
|
||||
{
|
||||
if ($name != '')
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
if ($lang != '.')
|
||||
{
|
||||
$this->lang = $lang;
|
||||
}
|
||||
if ($template != '.')
|
||||
{
|
||||
$this->template = $template;
|
||||
}
|
||||
if ($group != '')
|
||||
{
|
||||
$this->group = $group;
|
||||
}
|
||||
if ($version != '.')
|
||||
{
|
||||
$this->version = $version;
|
||||
}
|
||||
|
||||
if ($this->name == '')
|
||||
{
|
||||
// name need to be set !!!
|
||||
return False;
|
||||
}
|
||||
|
||||
$this->delete(); // so we have always a new insert
|
||||
|
||||
if ($this->name[0] != '.') // correct up old messed up templates
|
||||
{
|
||||
reset($this->data); each($this->data);
|
||||
while (list($row,$cols) = each($this->data))
|
||||
{
|
||||
while (list($col,$cell) = each($cols))
|
||||
{
|
||||
if (is_array($cell['type'])) {
|
||||
$this->data[$row][$col]['type'] = $cell['type'][0];
|
||||
//echo "corrected in $this->name cell $col$row attribute type<br>\n";
|
||||
}
|
||||
if (is_array($cell['align'])) {
|
||||
$this->data[$row][$col]['align'] = $cell['align'][0];
|
||||
//echo "corrected in $this->name cell $col$row attribute align<br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$data = $this->as_array(1);
|
||||
$data['data'] = serialize($this->compress_array($data['data']));
|
||||
|
||||
$sql = "INSERT INTO $this->db_name (";
|
||||
for (reset($this->db_cols); list($db_col,$col) = each($this->db_cols); )
|
||||
{
|
||||
$sql .= $db_col . ',';
|
||||
$vals .= "'" . addslashes($data[$col]) . "',";
|
||||
}
|
||||
$sql[strlen($sql)-1] = ')';
|
||||
$sql .= " VALUES ($vals";
|
||||
$sql[strlen($sql)-1] = ')';
|
||||
|
||||
$this->db->query($sql,__LINE__,__FILE__);
|
||||
|
||||
return $this->db->affected_rows();
|
||||
}
|
||||
|
||||
/*!
|
||||
@function delete
|
||||
@abstract Deletes the eTemplate from the db, object itself is unchanged
|
||||
@returns the number of affected rows, 1 should be ok, 0 somethings wrong
|
||||
*/
|
||||
function delete()
|
||||
{
|
||||
for (reset($this->db_key_cols); list($db_col,$col) = each($this->db_key_cols); )
|
||||
{
|
||||
$vals .= ($vals ? ' AND ' : '') . $db_col . "='" . $this->$col . "'";
|
||||
}
|
||||
|
||||
$this->db->query("DELETE FROM $this->db_name WHERE $vals",__LINE__,__FILE__);
|
||||
|
||||
return $this->db->affected_rows();
|
||||
}
|
||||
|
||||
/*!
|
||||
@function dump2setup
|
||||
@abstract dumps all eTemplates to <app>/setup/etemplates.inc.php for distribution
|
||||
@param $app app- or template-name
|
||||
@returns the number of templates dumped as message
|
||||
*/
|
||||
function dump2setup($app)
|
||||
{
|
||||
list($app) = explode('.',$app);
|
||||
|
||||
$this->db->query("SELECT * FROM $this->db_name WHERE et_name LIKE '$app%'");
|
||||
|
||||
if (!($f = fopen($path = PHPGW_SERVER_ROOT.'/'.$app.'/setup/etemplates.inc.php','w')))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
fwrite($f,"<?php\n// eTemplates for Application '$app', generated by etemplate.dump() ".date('Y-m-d H:i')."\n\n");
|
||||
for ($n = 0; $this->db->next_record(); ++$n)
|
||||
{
|
||||
$str = '$templ_data[] = array(';
|
||||
for (reset($this->db_cols); list($db_col,$name) = each($this->db_cols); )
|
||||
{
|
||||
$str .= "'$name' => '".addslashes($this->db->f($db_col))."',";
|
||||
}
|
||||
$str .= ");\n\n";
|
||||
fwrite($f,$str);
|
||||
}
|
||||
fclose($f);
|
||||
|
||||
return "$n eTemplates for Application '$app' dumped to '$path'";
|
||||
}
|
||||
|
||||
/*!
|
||||
@function getToTranslate
|
||||
@abstract extracts all texts: labels and helptexts from an eTemplate-object
|
||||
@returns array with messages as key AND value
|
||||
*/
|
||||
function getToTranslate()
|
||||
{
|
||||
$to_trans = array();
|
||||
|
||||
reset($this->data); each($this->data); // skip width
|
||||
while (list($row,$cols) = each($this->data))
|
||||
{
|
||||
while (list($col,$cell) = each($cols))
|
||||
{
|
||||
if (!$cell['no_lang'] && strlen($cell['label']) > 1)
|
||||
{
|
||||
$to_trans[$cell['label']] = $cell['label'];
|
||||
}
|
||||
if (strlen($cell['help']) > 1)
|
||||
{
|
||||
$to_trans[$cell['help']] = $cell['help'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $to_trans;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function getToTranslateApp
|
||||
@abstract Read all eTemplates of an app an extracts the texts to an array
|
||||
@param $app name of the app
|
||||
@returns the array with texts
|
||||
*/
|
||||
function getToTranslateApp($app)
|
||||
{
|
||||
$to_trans = array();
|
||||
|
||||
$tmpl = new soetemplate; // to not alter our own data
|
||||
$tmpl->db->query("SELECT * FROM $this->db_name WHERE et_name LIKE '$app.%'");
|
||||
|
||||
for ($n = 0; $tmpl->db->next_record(); ++$n)
|
||||
{
|
||||
$tmpl->db2obj();
|
||||
$to_trans += $tmpl->getToTranslate();
|
||||
}
|
||||
return $to_trans;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function writeLangFile
|
||||
@abstract 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>)
|
||||
@returns message with number of messages written (total and new)
|
||||
*/
|
||||
function writeLangFile($app,$lang='en',$additional='')
|
||||
{
|
||||
if(!$additional)
|
||||
{
|
||||
$additional = array();
|
||||
}
|
||||
list($app) = explode('.',$app);
|
||||
|
||||
$solangfile = CreateObject('developer_tools.solangfile');
|
||||
|
||||
$langarr = $solangfile->load_app($app,$lang);
|
||||
|
||||
$to_trans = $this->getToTranslateApp($app);
|
||||
if (is_array($additional))
|
||||
{
|
||||
while (list($nul,$msg) = each($additional))
|
||||
{
|
||||
$to_trans[$msg] = $msg;
|
||||
}
|
||||
}
|
||||
for ($new = $n = 0; list($message_id,$content) = each($to_trans); ++$n)
|
||||
{
|
||||
if (!isset($langarr[$message_id]))
|
||||
{
|
||||
$langarr[$message_id] = array('message_id' => $message_id,'app_name' => $app,'content' => $content);
|
||||
++$new;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($langarr);
|
||||
$solangfile->write_file($app,$langarr,$lang);
|
||||
$solangfile->loaddb($app,$lang);
|
||||
|
||||
return "$n ($new new) Messages writen for Application '$app' and Languages '$lang'";
|
||||
}
|
||||
|
||||
/*!
|
||||
@function import_dump
|
||||
@abstract Imports the dump-file /$app/setup/etempplates.inc.php unconditional (!)
|
||||
@param $app app name
|
||||
@returns message with number of templates imported
|
||||
*/
|
||||
function import_dump($app)
|
||||
{
|
||||
include(PHPGW_SERVER_ROOT."/$app/setup/etemplates.inc.php");
|
||||
$templ = new etemplate($app);
|
||||
|
||||
for ($n = 0; isset($templ_data[$n]); ++$n)
|
||||
{
|
||||
for (reset($this->db_cols); list($db_col,$name) = each($this->db_cols); )
|
||||
{
|
||||
$templ->$name = $templ_data[$n][$name];
|
||||
}
|
||||
$templ->data = unserialize(stripslashes($templ->data));
|
||||
$templ->save();
|
||||
}
|
||||
return "$n new eTemplates imported for Application '$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.
|
||||
@param $app app- or template-name
|
||||
*/
|
||||
function test_import($app) // should be done from the setup-App
|
||||
{
|
||||
list($app) = explode('.',$app);
|
||||
|
||||
if ($GLOBALS['phpgw_info']['etemplate']['import_tested'][$app])
|
||||
{
|
||||
return ''; // ensure test is done only once per call and app
|
||||
}
|
||||
$GLOBALS['phpgw_info']['etemplate']['import_tested'][$app] = True; // need to be done before new ...
|
||||
|
||||
$path = PHPGW_SERVER_ROOT."/$app/setup/etemplates.inc.php";
|
||||
|
||||
if ($time = filemtime($path))
|
||||
{
|
||||
$templ = new etemplate(".$app",'','##');
|
||||
if ($templ->lang != '##' || $templ->data[0] < $time) // need to import
|
||||
{
|
||||
$ret = $this->import_dump($app);
|
||||
$templ->data = array($time);
|
||||
$templ->save(".$app",'','##');
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
761
etemplate/inc/class.uietemplate.inc.php
Normal file
761
etemplate/inc/class.uietemplate.inc.php
Normal file
@ -0,0 +1,761 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - EditableTemplates - HTML User Interface *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
include(PHPGW_API_INC . '/../../etemplate/inc/class.boetemplate.inc.php');
|
||||
|
||||
/*!
|
||||
@class etemplate
|
||||
@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,$sbox instances of html and sbox2 class used to generate the html
|
||||
*/
|
||||
class etemplate extends boetemplate
|
||||
{
|
||||
var $debug;//='etemplate.editor.edit'; // 1=calls to show and process_show, 2=content after process_show,
|
||||
// 3=calls to show_cell and process_show_cell, or template-name or cell-type
|
||||
var $html,$sbox; // instance of html / sbox2-class
|
||||
|
||||
/*!
|
||||
@function etemplate
|
||||
@abstract 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)
|
||||
{
|
||||
$this->public_functions += array(
|
||||
'exec' => True,
|
||||
'process_exec' => True,
|
||||
'show' => True,
|
||||
'process_show' => True,
|
||||
);
|
||||
$this->boetemplate();
|
||||
$this->html = CreateObject('etemplate.html'); // should be in the api (older version in infolog)
|
||||
$this->sbox = CreateObject('etemplate.sbox2'); // older version is in the api
|
||||
|
||||
if (!$this->read($name,$template,$lang,$group,$version))
|
||||
{
|
||||
$this->init($name,$template,$lang,$group,$version,$rows,$cols);
|
||||
return False;
|
||||
}
|
||||
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
|
||||
@param $cname Basename for the submitted content in $HTTP_POST_VARS (default = 'cont')
|
||||
@returns nothing
|
||||
*/
|
||||
function exec($method,$content,$sel_options='',$readonlys='',$preserv='',$cname='cont')
|
||||
{
|
||||
if(!$sel_options)
|
||||
{
|
||||
$sel_options = array();
|
||||
}
|
||||
if(!$readonlys)
|
||||
{
|
||||
$readonlys = array();
|
||||
}
|
||||
if(!$preserv)
|
||||
{
|
||||
$preserv = array();
|
||||
}
|
||||
$GLOBALS['phpgw']->common->phpgw_header();
|
||||
echo parse_navbar();
|
||||
|
||||
echo $this->html->nextMatchStyles($this->style)."\n\n". // so they get included once
|
||||
$this->html->form($this->show($content,$sel_options,$readonlys,$cname),array(
|
||||
'etemplate_exec[name]' => $this->name,
|
||||
'etemplate_exec[template]' => $this->template,
|
||||
'etemplate_exec[lang]' => $this->lang,
|
||||
'etemplate_exec[group]' => $this->group,
|
||||
'etemplate_exec[readonlys]' => $readonlys,
|
||||
'etemplate_exec[cname]' => $cname,
|
||||
'etemplate_exec[method]' => $method
|
||||
)+$preserv,'/index.php?menuaction=etemplate.etemplate.process_exec');
|
||||
}
|
||||
|
||||
/*!
|
||||
@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.
|
||||
*/
|
||||
function process_exec()
|
||||
{
|
||||
$exec = $GLOBALS['HTTP_POST_VARS']['etemplate_exec'];
|
||||
//echo "<p>uietemplate.process_exec('${exec['name']}'): exec = "; _debug_array($exec);
|
||||
|
||||
$this->read($exec);
|
||||
$readonlys = unserialize(stripslashes($exec['readonlys']));
|
||||
//echo "<p>uietemplate.process_exec: process_show(cname=${exec['cname']}): readonlys ="; _debug_array($readonlys);
|
||||
$this->process_show($GLOBALS['HTTP_POST_VARS'][$exec['cname']],$readonlys);
|
||||
|
||||
// set application name so that lang, etc. works
|
||||
list($GLOBALS['phpgw_info']['flags']['currentapp']) = explode('.',$exec['method']);
|
||||
|
||||
//echo "<p>uietemplate.process_exec: ExecMethod('${exec['method']}')</p>\n";
|
||||
ExecMethod($exec['method']);
|
||||
}
|
||||
|
||||
/*!
|
||||
@function isset_array($idx,$arr)
|
||||
@abstract checks if idx, which may contain ONE subindex is set in array
|
||||
*/
|
||||
function isset_array($idx,$arr)
|
||||
{
|
||||
if (ereg('^([^[]*)\\[(.*)\\]$',$idx,$regs))
|
||||
{
|
||||
return $regs[2] && isset($arr[$regs[1]][$regs[2]]);
|
||||
}
|
||||
|
||||
return isset($arr[$idx]);
|
||||
}
|
||||
|
||||
/*!
|
||||
@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
|
||||
@returns the generated HTML
|
||||
*/
|
||||
function show($content,$sel_options='',$readonlys='',$cname='cont',$show_c=0,$show_row=0)
|
||||
{
|
||||
if(!$sel_options)
|
||||
{
|
||||
$sel_options = array();
|
||||
}
|
||||
if(!$readonlys)
|
||||
{
|
||||
$readonlys = array();
|
||||
}
|
||||
if ($this->debug >= 1 || $this->debug == $this->name && $this->name)
|
||||
{
|
||||
echo "<p>etemplate.show($this->name): $cname =\n"; _debug_array($content);
|
||||
}
|
||||
if (!is_array($content))
|
||||
{
|
||||
$content = array(); // happens if incl. template has no content
|
||||
}
|
||||
$content += array(
|
||||
'.c' => $show_c,
|
||||
'.col' => $this->num2chrs($show_c-1),
|
||||
'.row' => $show_row // for var-expansion in names in show_cell
|
||||
);
|
||||
|
||||
reset($this->data);
|
||||
if (isset($this->data[0]))
|
||||
{
|
||||
list($nul,$width) = each($this->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$width = array();
|
||||
}
|
||||
for ($r = 0; $row = 1+$r /*list($row,$cols) = each($this->data)*/; ++$r)
|
||||
{
|
||||
$old_cols = $cols; $old_class = $class; $old_height = $height;
|
||||
if (!(list($nul,$cols) = each($this->data))) // no further row
|
||||
{
|
||||
$cols = $old_cols; $class = $old_class; $height = $old_height;
|
||||
list($nul,$cell) = each($cols); reset($cols);
|
||||
if (!($this->autorepeat_idx($cols['A'],0,$r,$idx,$idx_cname) && $idx_cname) &&
|
||||
!($this->autorepeat_idx($cols['B'],1,$r,$idx,$idx_cname) && $idx_cname) ||
|
||||
!$this->isset_array($idx,$content))
|
||||
{
|
||||
break; // no auto-row-repeat
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$height = $this->data[0]["h$row"];
|
||||
$class = $this->data[0]["c$row"];
|
||||
}
|
||||
$row_data = array();
|
||||
for ($c = 0; True /*list($col,$cell) = each($cols)*/; ++$c)
|
||||
{
|
||||
$old_cell = $cell;
|
||||
if (!(list($nul,$cell) = each($cols)))
|
||||
{
|
||||
// no further cols
|
||||
$cell = $old_cell;
|
||||
if (!$this->autorepeat_idx($cell,$c,$r,$idx,$idx_cname,True) ||
|
||||
!$this->isset_array($idx,$content))
|
||||
{
|
||||
break; // no auto-col-repeat
|
||||
}
|
||||
}
|
||||
$col = $this->num2chrs($c);
|
||||
$row_data[$col] = $this->show_cell($cell,$content,$sel_options,$readonlys,$cname,
|
||||
$c,$r,$span);
|
||||
if ($row_data[$col] == '' && $this->rows == 1)
|
||||
{
|
||||
unset($row_data[$col]); // omit empty/disabled cells if only one row
|
||||
continue;
|
||||
}
|
||||
$colspan = $span == 'all' ? $this->cols-$c : 0+$span;
|
||||
if ($colspan > 1)
|
||||
{
|
||||
$row_data[".$col"] .= " COLSPAN=$colspan";
|
||||
for ($i = 1; $i < $colspan; ++$i,++$c)
|
||||
{
|
||||
each($cols); // skip next cell(s)
|
||||
}
|
||||
}
|
||||
elseif ($width[$col]) // width only once for a non colspan cell
|
||||
{
|
||||
$row_data[".$col"] .= ' WIDTH='.$width[$col];
|
||||
$width[$col] = 0;
|
||||
}
|
||||
$row_data[".$col"] .= $this->html->formatOptions($cell['align'],'ALIGN');
|
||||
$row_data[".$col"] .= $this->html->formatOptions($cell['span'],',CLASS');
|
||||
}
|
||||
$rows[$row] = $row_data;
|
||||
|
||||
$rows[".$row"] .= $this->html->formatOptions($height,'HEIGHT');
|
||||
list($cl) = explode(',',$class);
|
||||
if ($cl == 'nmr')
|
||||
{
|
||||
$cl .= $nmr_alternate++ & 1; // alternate color
|
||||
}
|
||||
$rows[".$row"] .= $this->html->formatOptions($cl,'CLASS');
|
||||
$rows[".$row"] .= $this->html->formatOptions($class,',VALIGN');
|
||||
}
|
||||
if (!$GLOBALS['phpgw_info']['etemplate']['styles_included'][$this->name])
|
||||
{
|
||||
$style = $this->html->style($this->style);
|
||||
$GLOBALS['phpgw_info']['etemplate']['styles_included'][$this->name] = True;
|
||||
}
|
||||
return "\n\n<!-- BEGIN $this->name -->\n$style\n".
|
||||
$this->html->table($rows,$this->html->formatOptions($this->size,'WIDTH,HEIGHT,BORDER,CLASS')).
|
||||
"<!-- 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
|
||||
@returns the generated HTML
|
||||
*/
|
||||
function show_cell($cell,$content,$sel_options,$readonlys,$cname,$show_c,$show_row,&$span)
|
||||
{
|
||||
if ($this->debug >= 3 || $this->debug == $cell['type'])
|
||||
{
|
||||
echo "<p>etemplate.show_cell($this->name,name='${cell['name']}',type='${cell['type']}',cname='$cname')</p>\n";
|
||||
}
|
||||
list($span) = explode(',',$cell['span']); // evtl. overriten later for type template
|
||||
|
||||
$name = $this->expand_name($cell['name'],$show_c,$show_row,$content['.c'],$content['.row'],$content);
|
||||
$value = $content[$name];
|
||||
|
||||
$org_name = $name;
|
||||
if ($cname == '') // building the form-field-name depending on prefix $cname and possibl. Array-subscript in name
|
||||
{
|
||||
$form_name = $name;
|
||||
}
|
||||
elseif (ereg('^([^[]*)\\[(.*)\\]$',$name,$regs)) // name contains array-index
|
||||
{
|
||||
$form_name = $cname.'['.$regs[1].']['.$regs[2].']';
|
||||
$value = $content[$regs[1]][$regs[2]];
|
||||
$org_name = $regs[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
$form_name = $cname.'['.$name.']';
|
||||
}
|
||||
|
||||
if ($readonly = $cell['readonly'] || $readonlys[$name] || $readonlys['__ALL__'])
|
||||
{
|
||||
$options .= ' READONLY';
|
||||
}
|
||||
|
||||
if ($cell['disabled'] || $cell['type'] == 'button' && $readonly)
|
||||
{
|
||||
if ($this->rows == 1)
|
||||
{
|
||||
return ''; // if only one row omit cell
|
||||
}
|
||||
$cell = $this->empty_cell(); // show nothing
|
||||
$value = '';
|
||||
}
|
||||
if ($cell['help'])
|
||||
{
|
||||
$options .= " onFocus=\"self.status='".addslashes(lang($cell['help']))."'; return true;\"";
|
||||
$options .= " onBlur=\"self.status=''; return true;\"";
|
||||
if ($cell['type'] == 'button') // for button additionally when mouse over button
|
||||
{
|
||||
$options .= " onMouseOver=\"self.status='".addslashes(lang($cell['help']))."'; return true;\"";
|
||||
$options .= " onMouseOut=\"self.status=''; return true;\"";
|
||||
}
|
||||
}
|
||||
if ($cell['onchange']) // values != '1' can only set by a program (not in the editor so far)
|
||||
{
|
||||
$options .= ' onChange="'.($cell['onchange']=='1'?'this.form.submit();':$cell['onchange']).'"';
|
||||
}
|
||||
switch ($cell['type'])
|
||||
{
|
||||
case 'label': // size: [[b]old][[i]talic]
|
||||
$value = strlen($value) > 1 && !$cell['no_lang'] ? lang($value) : $value;
|
||||
if ($value != '' && strstr($cell['size'],'b'))
|
||||
{
|
||||
$value = $this->html->bold($value);
|
||||
}
|
||||
if ($value != '' && strstr($cell['size'],'i'))
|
||||
{
|
||||
$value = $this->html->italic($value);
|
||||
}
|
||||
$html .= $value;
|
||||
break;
|
||||
case 'raw':
|
||||
$html .= $value;
|
||||
break;
|
||||
case 'text': // size: [length][,maxLength]
|
||||
if ($readonly)
|
||||
{
|
||||
$html .= $this->html->bold($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$html .= $this->html->input($form_name,$value,'',
|
||||
$options.$this->html->formatOptions($cell['size'],'SIZE,MAXLENGTH'));
|
||||
}
|
||||
break;
|
||||
case 'textarea': // Multiline Text Input, size: [rows][,cols]
|
||||
$html .= $this->html->textarea($form_name,$value,
|
||||
$options.$this->html->formatOptions($cell['size'],'ROWS,COLS'));
|
||||
break;
|
||||
case 'date':
|
||||
if ($cell['size'] != '')
|
||||
{
|
||||
$date = split('[/.-]',$value);
|
||||
$mdy = split('[/.-]',$cell['size']);
|
||||
for ($value=array(),$n = 0; $n < 3; ++$n)
|
||||
{
|
||||
switch($mdy[$n])
|
||||
{
|
||||
case 'Y': $value[0] = $date[$n]; break;
|
||||
case 'm': $value[1] = $date[$n]; break;
|
||||
case 'd': $value[2] = $date[$n]; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = array(date('Y',$value),date('m',$value),date('d',$value));
|
||||
}
|
||||
if ($readonly)
|
||||
{
|
||||
$html .= $GLOBALS['phpgw']->common->dateformatorder($value[0],$value[1],$value[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$html .= $this->sbox->getDate($name.'[Y]',$name.'[m]',$name.'[d]',$value,$options);
|
||||
}
|
||||
break;
|
||||
case 'checkbox':
|
||||
if ($value)
|
||||
{
|
||||
$options .= ' CHECKED';
|
||||
}
|
||||
$html .= $this->html->input($form_name,'1','CHECKBOX',$options);
|
||||
break;
|
||||
case 'radio': // size: value if checked
|
||||
if ($value == $cell['size'])
|
||||
{
|
||||
$options .= ' CHECKED';
|
||||
}
|
||||
$html .= $this->html->input($form_name,$cell['size'],'RADIO',$options);
|
||||
break;
|
||||
case 'button':
|
||||
$html .= $this->html->submit_button($form_name,$cell['label'],'',
|
||||
strlen($cell['label']) <= 1 || $cell['no_lang'],$options);
|
||||
break;
|
||||
case 'hrule':
|
||||
$html .= $this->html->hr($cell['size']);
|
||||
break;
|
||||
case 'template': // size: index in content-array (if not full content is past further on)
|
||||
if ($this->autorepeat_idx($cell,$show_c,$show_row,$idx,$idx_cname) || $cell['size'] != '')
|
||||
{
|
||||
if ($span == '' && isset($content[$idx]['span']))
|
||||
{
|
||||
// this allows a colspan in autorepeated cells like the editor
|
||||
$span = explode(',',$content[$idx]['span']); $span = $span[0];
|
||||
if ($span == 'all')
|
||||
{
|
||||
$span = 1 + $content['cols'] - $show_c;
|
||||
}
|
||||
}
|
||||
$readonlys = $readonlys[$idx];
|
||||
$content = $content[$idx];
|
||||
if ($idx_cname != '')
|
||||
{
|
||||
$cname .= $cname == '' ? $idx_cname : "[$idx_cname]";
|
||||
}
|
||||
|
||||
//echo "<p>show_cell-autorepeat($name,$show_c,$show_row,cname='$cname',idx='$idx',idx_cname='$idx_cname',span='$span'): readonlys[$idx] ="; _debug_array($readonlys);
|
||||
}
|
||||
if ($readonly)
|
||||
{
|
||||
$readonlys['__ALL__'] = True;
|
||||
}
|
||||
$templ = is_object($cell['name']) ? $cell['name'] : new etemplate($name);
|
||||
$html .= $templ->show($content,$sel_options,$readonlys,$cname,$show_c,$show_row);
|
||||
break;
|
||||
case 'select': // size:[linesOnMultiselect]
|
||||
if (isset($sel_options[$name]))
|
||||
{
|
||||
$sel_options = $sel_options[$name];
|
||||
}
|
||||
elseif (isset($sel_options[$org_name]))
|
||||
{
|
||||
$sel_options = $sel_options[$org_name];
|
||||
}
|
||||
elseif (isset($content["options-$name"]))
|
||||
{
|
||||
$sel_options = $content["options-$name"];
|
||||
}
|
||||
$html .= $this->sbox->getArrayItem($form_name.'[]',$value,$sel_options,$cell['no_lang'],
|
||||
$options,$cell['size']);
|
||||
break;
|
||||
case 'select-percent':
|
||||
$html .= $this->sbox->getPercentage($form_name,$value,$options);
|
||||
break;
|
||||
case 'select-priority':
|
||||
$html .= $this->sbox->getPriority($form_name,$value,$options);
|
||||
break;
|
||||
case 'select-access':
|
||||
$html .= $this->sbox->getAccessList($form_name,$value,$options);
|
||||
break;
|
||||
case 'select-country':
|
||||
$html .= $this->sbox->getCountry($form_name,$value,$options);
|
||||
break;
|
||||
case 'select-state':
|
||||
$html .= $this->sbox->list_states($form_name,$value); // no helptext - old Function!!!
|
||||
break;
|
||||
case 'select-cat':
|
||||
$html .= $this->sbox->getCategory($form_name.'[]',$value,$cell['size'] >= 0,
|
||||
False,$cell['size'],$options);
|
||||
break;
|
||||
case 'select-account':
|
||||
$type = substr(strstr($cell['size'],','),1);
|
||||
if ($type == '')
|
||||
{
|
||||
$type = 'accounts'; // default is accounts
|
||||
}
|
||||
$html .= $this->sbox->getAccount($form_name.'[]',$value,2,$type,0+$cell['size'],$options);
|
||||
break;
|
||||
case 'image':
|
||||
$image = $this->html->image(substr($this->name,0,strpos($this->name,'.')),
|
||||
$cell['label'],lang($cell['help']),'BORDER=0');
|
||||
$html .= $name == '' ? $image : $this->html->a_href($image,$name);
|
||||
break;
|
||||
default:
|
||||
$html .= '<i>unknown type</i>';
|
||||
break;
|
||||
}
|
||||
if ($cell['type'] != 'button' && $cell['type'] != 'image' && (($label = $cell['label']) != '' || $html == ''))
|
||||
{
|
||||
if (!$cell['no_lang'] && strlen($label) > 1)
|
||||
{
|
||||
$label = lang($label);
|
||||
}
|
||||
|
||||
$html_label = $html != '' && $label != '';
|
||||
|
||||
if (strstr($label,'%s'))
|
||||
{
|
||||
$html = str_replace('%s',$html,$label);
|
||||
}
|
||||
elseif (($html = $label . ' ' . $html) == ' ')
|
||||
{
|
||||
$html = ' ';
|
||||
}
|
||||
|
||||
if ($html_label)
|
||||
{
|
||||
$html = $this->html->label($html);
|
||||
}
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/*!
|
||||
@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 recursivly calls itself for the included eTemplates.
|
||||
@param $vars HTTP_POST_VARS on first call, later (deeper recursions) subscripts of it
|
||||
@param $readonly array with cell- / var-names which should NOT return content (this is to workaround browsers who not understand READONLY correct)
|
||||
@param $cname basename of our returnt content (same as in call to show)
|
||||
@returns the adjusted content (in the simplest case that would be $vars[$cname])
|
||||
*/
|
||||
function process_show(&$content,$readonlys='')
|
||||
{
|
||||
if(!$readonlys)
|
||||
{
|
||||
$readonlys=array();
|
||||
}
|
||||
if (!isset($content) || !is_array($content))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->debug >= 1 || $this->debug == $this->name && $this->name)
|
||||
{
|
||||
echo "<p>process_show($this->name) start: content ="; _debug_array($content);
|
||||
}
|
||||
reset($this->data);
|
||||
if (isset($this->data[0]))
|
||||
{
|
||||
each($this->data); // skip width
|
||||
}
|
||||
for ($r = 0; True /*list($row,$cols) = each($this->data)*/; ++$r)
|
||||
{
|
||||
$old_cols = $cols;
|
||||
if (!(list($nul,$cols) = each($this->data))) // no further row
|
||||
{
|
||||
$cols = $old_cols;
|
||||
list($nul,$cell) = each($cols); reset($cols);
|
||||
if ((!$this->autorepeat_idx($cols['A'],0,$r,$idx,$idx_cname) ||
|
||||
$idx_cname == '' || !$this->isset_array($idx,$content)) &&
|
||||
(!$this->autorepeat_idx($cols['B'],1,$r,$idx,$idx_cname) ||
|
||||
$idx_cname == '' || !$this->isset_array($idx,$content)))
|
||||
{
|
||||
break; // no auto-row-repeat
|
||||
}
|
||||
}
|
||||
$row = 1+$r;
|
||||
for ($c = 0; True /*list($col,$cell) = each($cols)*/; ++$c)
|
||||
{
|
||||
$old_cell = $cell;
|
||||
if (!(list($nul,$cell) = each($cols)))
|
||||
{
|
||||
// no further cols
|
||||
$cell = $old_cell;
|
||||
if (!$this->autorepeat_idx($cell,$c,$r,$idx,$idx_cname,True) ||
|
||||
$idx_cname == '' || !$this->isset_array($idx,$content))
|
||||
{
|
||||
break; // no auto-col-repeat
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->autorepeat_idx($cell,$c,$r,$idx,$idx_cname,True); // get idx_cname
|
||||
}
|
||||
$col = $this->num2chrs($c);
|
||||
|
||||
$name = $this->expand_name($cell['name'],$c,$r);
|
||||
$readonly = $cell['readonly'] || $readonlys[$name] || $readonlys['__ALL__'] ||
|
||||
$cell['type'] == 'label' || $cell['type'] == 'image' || $cell['type'] == 'raw' ||
|
||||
$cell['type'] == 'hrule';
|
||||
|
||||
if ($idx_cname == '' && $cell['type'] == 'template') // only templates
|
||||
{
|
||||
if ($readonly)
|
||||
{
|
||||
// can't unset whole content!!!
|
||||
$readonlys['__ALL__'] = True;
|
||||
}
|
||||
$this->process_show_cell($cell,$name,$c,$r,$readonlys,$content);
|
||||
}
|
||||
elseif (ereg('^([^[]*)\\[(.*)\\]$',$idx_cname,$regs)) // name contains array-index
|
||||
{
|
||||
/* Attention: the unsets here and in the next else are vor two reasons:
|
||||
* 1) some browsers does NOT understand the READONLY-tag and sent content back
|
||||
* this has to be unset, as we only report no-readonly fields
|
||||
* 2) php has a fault / feature :-) that it set unset array-elements passed as
|
||||
* variable / changeable (&$var) to a function, this messes up a lot, as we
|
||||
* depend on the fact variables are set or not for the autorepeat. To work
|
||||
* around that, process_show_cell reports back if a variable is set or not
|
||||
* via the returnvalue and we unset it or even the parent if is was not set.
|
||||
*/
|
||||
$parent_isset = isset($content[$regs[1]]);
|
||||
|
||||
if ($readonly || !$this->process_show_cell($cell,$name,$c,$r,
|
||||
$readonlys[$regs[1]][$regs[2]],$content[$regs[1]][$regs[2]]))
|
||||
{
|
||||
if (!$parent_isset)
|
||||
{
|
||||
unset($content[$regs[1]]);
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($content[$regs[1]][$regs[2]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($readonly || !$this->process_show_cell($cell,$name,$c,$r,
|
||||
$readonlys[$idx_cname],$content[$idx_cname]))
|
||||
{
|
||||
unset($content[$idx_cname]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($this->debug >= 2 || $this->debug == $this->name && $this->name)
|
||||
{
|
||||
echo "<p>process_show($this->name) end: content ="; _debug_array($content);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@function process_show_cell($cell,$name,$c,$r,$readonlys,&$value)
|
||||
@abstract makes necessary adjustments on $value eTemplate / form gots submitted
|
||||
@discussion This is only an internal function, dont call it direct use only exec
|
||||
@discussion process_show recursivly calls itself for the included eTemplates.
|
||||
@param $cell processed cell
|
||||
@param $name expanded name of cell
|
||||
@param $c,$r col,row index
|
||||
@param $readonlys readonlys-array to pass on for templates
|
||||
@param &$value value to change
|
||||
@returns if $value is set
|
||||
*/
|
||||
function process_show_cell($cell,$name,$c,$r,$readonlys,&$value)
|
||||
{
|
||||
if (is_array($cell['type']))
|
||||
{
|
||||
$cell['type'] = $cell['type'][0];
|
||||
}
|
||||
|
||||
if ($this->debug >= 3 || $this->debug == $this->name || $this->debug == $cell['type'])
|
||||
{
|
||||
echo "<p>process_show_cell(c=$c, r=$r, name='$name',type='${cell['type']}) start: isset(value)=".(0+isset($value)).", value=";
|
||||
if (is_array($value))
|
||||
{
|
||||
_debug_array($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "'$value'</p>\n";
|
||||
}
|
||||
}
|
||||
switch ($cell['type'])
|
||||
{
|
||||
case 'text':
|
||||
case 'textarea':
|
||||
if (isset($value))
|
||||
{
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
break;
|
||||
case 'date':
|
||||
if ($value['d'])
|
||||
{
|
||||
if (!$value['m'])
|
||||
{
|
||||
$value['m'] = date('m');
|
||||
}
|
||||
if (!$value['Y'])
|
||||
{
|
||||
$value['Y'] = date('Y');
|
||||
}
|
||||
if ($cell['size'] == '')
|
||||
{
|
||||
$value = mktime(0,0,0,$value['m'],$value['d'],$value['Y']);
|
||||
}
|
||||
else
|
||||
{
|
||||
for ($n = 0,$str = ''; $n < strlen($cell['size']); ++$n)
|
||||
{
|
||||
if (strstr('Ymd',$c = $cell['size'][$n]))
|
||||
{
|
||||
$str .= sprintf($c=='Y'?'%04d':'%02d',$value[$c]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$str .= $c;
|
||||
}
|
||||
}
|
||||
$value = $str;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = '';
|
||||
}
|
||||
break;
|
||||
case 'checkbox':
|
||||
if (!isset($value))
|
||||
{
|
||||
// checkbox was not checked
|
||||
$value = 0; // need to be reported too
|
||||
}
|
||||
break;
|
||||
case 'template':
|
||||
$templ = new etemplate($name);
|
||||
$templ->process_show($value,$readonlys);
|
||||
break;
|
||||
case 'select':
|
||||
case 'select-cat':
|
||||
case 'select-account':
|
||||
if (is_array($value))
|
||||
{
|
||||
$value = count($value) <= 1 ? $value[0] : implode(',',$value);
|
||||
}
|
||||
break;
|
||||
default: // do nothing, $value is correct as is
|
||||
}
|
||||
if ($this->debug >= 3 || $this->debug == $this->name || $this->debug == $cell['type'])
|
||||
{
|
||||
echo "<p>process_show_cell(name='$name',type='${cell['type']}) end: isset(value)=".(0+isset($value)).", value=";
|
||||
if (is_array($value))
|
||||
{
|
||||
_debug_array($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "'$value'</p>\n";
|
||||
}
|
||||
}
|
||||
return isset($value);
|
||||
}
|
||||
}
|
27
etemplate/index.php
Normal file
27
etemplate/index.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - eTemplates - Editor *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$GLOBALS['phpgw_info']['flags'] = array(
|
||||
'currentapp' => 'etemplate',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
$editor = CreateObject('etemplate.editor');
|
||||
|
||||
$editor->edit();
|
||||
|
||||
$GLOBALS['phpgw']->common->phpgw_footer();
|
||||
?>
|
73
etemplate/setup/etemplates.inc.php
Normal file
73
etemplate/setup/etemplates.inc.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
// eTemplates for Application 'etemplate', generated by etemplate.dump() 2002-02-05 10:21
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor','template' => '','lang' => '','group' => '0','version' => '0.9.13.004','data' => 'a:8:{i:0;a:1:{s:1:\"A\";s:2:\"5%\";}i:1;a:1:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:2:\"bi\";s:5:\"label\";s:27:\"Editable Templates - Editor\";s:4:\"name\";s:3:\"msg\";}}i:2;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"hrule\";s:4:\"span\";s:3:\"all\";}}i:3;a:1:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:21:\"etemplate.editor.keys\";}}i:4;a:1:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:24:\"etemplate.editor.buttons\";}}i:5;a:1:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:21:\"etemplate.editor.edit\";}}i:6;a:1:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:10:\"CSS-styles\";}}i:7;a:1:{s:1:\"A\";a:5:{s:4:\"type\";s:8:\"textarea\";s:4:\"size\";s:5:\"10,80\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:5:\"style\";s:4:\"help\";s:155:\"embeded CSS styles, eg. \'.red { background: red; }\' (note the \'.\' before the class-name) or \'@import url(...)\' (class names are global for the whole page!)\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.show','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:7:{i:0;a:2:{s:1:\"E\";s:2:\"5%\";s:1:\"F\";s:3:\"85%\";}i:1;a:6:{s:1:\"A\";a:5:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:34:\"Editable Templates - Show Template\";s:4:\"name\";s:3:\"msg\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:2;a:6:{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\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:3;a:6:{s:1:\"A\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"30\";s:4:\"span\";s:1:\"3\";s:5:\"label\";s:4:\"Name\";s:4:\"name\";s:4:\"name\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"C\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"D\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"span\";s:1:\"1\";s:5:\"label\";s:8:\"Template\";s:4:\"name\";s:8:\"template\";}s:1:\"E\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"label\";s:4:\"Lang\";s:4:\"name\";s:4:\"lang\";}s:1:\"F\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:5:\"label\";s:7:\"Version\";s:4:\"name\";s:7:\"version\";}}i:4;a:6:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Read\";s:4:\"name\";s:4:\"read\";}s:1:\"B\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:11:\"Show Values\";s:4:\"name\";s:4:\"show\";}s:1:\"C\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Edit\";s:4:\"name\";s:4:\"edit\";}s:1:\"D\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:6:\"Delete\";s:4:\"name\";s:6:\"delete\";}s:1:\"E\";a:6:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:21:\"Width, Height, Border\";s:4:\"name\";s:4:\"size\";s:8:\"readonly\";s:1:\"1\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:5;a:6:{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\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:6;a:6:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:4:\"cont\";s:4:\"span\";s:3:\"all\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.delete','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:7:{i:0;a:4:{s:1:\"A\";s:3:\"25%\";s:1:\"B\";s:3:\"30%\";s:1:\"E\";s:3:\"10%\";s:1:\"F\";s:3:\"35%\";}i:1;a:6:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:36:\"Editable Templates - Delete Template\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:2;a:6:{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\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:3;a:6:{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\";}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: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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"B\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"30\";s:5:\"label\";s:15:\"Delete Template\";s:4:\"name\";s:4:\"name\";s:8:\"readonly\";s:1:\"1\";}s:1:\"C\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"name\";s:8:\"template\";s:8:\"readonly\";s:1:\"1\";}s:1:\"D\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"name\";s:4:\"lang\";s:8:\"readonly\";s:1:\"1\";}s:1:\"E\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:5:\"label\";s:7:\"Version\";s:4:\"name\";s:7:\"version\";s:8:\"readonly\";s:1:\"1\";}s:1:\"F\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:1:\"?\";}}i:5;a:6:{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\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:6;a:6:{s:1:\"A\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"B\";a:5:{s:4:\"type\";s:6:\"button\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:3:\"Yes\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:3:\"yes\";}s:1:\"C\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"D\";a:4:{s:4:\"type\";s:6:\"button\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:2:\"No\";s:4:\"name\";s:2:\"no\";}s:1:\"E\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.db-tools.cols','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:3:{i:0;a:2:{s:2:\"c1\";s:3:\"nmh\";s:2:\"c2\";s:3:\"nmr\";}i:1;a:11:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:1:\"#\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";}s:1:\"B\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:10:\"ColumnName\";}s:1:\"C\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Type\";}s:1:\"D\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:9:\"Precision\";}s:1:\"E\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:8:\"Nullable\";}s:1:\"F\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:6:\"Unique\";}s:1:\"G\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:11:\"Primary Key\";}s:1:\"H\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:7:\"Indexed\";}s:1:\"I\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:11:\"Foreign Key\";}s:1:\"J\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:7:\"Default\";}s:1:\"K\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:10:\"Add Column\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:10:\"add_column\";}}i:2;a:11:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:12:\"Row${row}[n]\";}s:1:\"B\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"20\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:15:\"Row${row}[name]\";s:4:\"help\";s:127:\"need to be unique in the table and no reseved word from SQL, best prefix all with a common 2-digit short for the app, eg. \'et_\'\";}s:1:\"C\";a:4:{s:4:\"type\";s:6:\"select\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:15:\"Row${row}[type]\";s:4:\"help\";s:18:\"type of the column\";}s:1:\"D\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:20:\"Row${row}[precision]\";s:4:\"help\";s:64:\"length for char+varchar, precisions int: 2, 4, 8 and float: 4, 8\";}s:1:\"E\";a:4:{s:4:\"type\";s:8:\"checkbox\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:19:\"Row${row}[nullable]\";s:4:\"help\";s:32:\"can have sepecial SQL-value NULL\";}s:1:\"F\";a:4:{s:4:\"type\";s:8:\"checkbox\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:13:\"Row${row}[uc]\";s:4:\"help\";s:59:\"DB ensures that every row has a unique value in that column\";}s:1:\"G\";a:4:{s:4:\"type\";s:8:\"checkbox\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:13:\"Row${row}[pk]\";s:4:\"help\";s:52:\"Primary key for the table, gets automaticaly indexed\";}s:1:\"H\";a:4:{s:4:\"type\";s:8:\"checkbox\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:13:\"Row${row}[ix]\";s:4:\"help\";s:81:\"an indexed column speeds up querys using that column (cost space on the disk !!!)\";}s:1:\"I\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"20\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:13:\"Row${row}[fk]\";s:4:\"help\";s:46:\"name of other table where column is a key from\";}s:1:\"J\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"20\";s:4:\"name\";s:18:\"Row${row}[default]\";s:4:\"help\";s:54:\"enter \'\' for an empty default, nothing mean no default\";}s:1:\"K\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:13:\"Delete Column\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:12:\"delete[$row]\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.values','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:3:{i:0;a:2:{s:2:\"c1\";s:3:\"nmh\";s:2:\"c2\";s:3:\"nmr\";}i:1;a:2:{s:1:\"A\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:3:\"Key\";}s:1:\"B\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:5:\"Value\";}}i:2;a:2:{s:1:\"A\";a:2:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:8:\"$col$row\";}s:1:\"B\";a:2:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:8:\"$col$row\";}}}','size' => ',,1','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor','template' => '','lang' => '','group' => '0','version' => '0.9.13.005','data' => 'a:8:{i:0;a:0:{}i:1;a:2:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:2:\"bi\";s:5:\"label\";s:27:\"Editable Templates - Editor\";s:4:\"name\";s:3:\"msg\";}s:1:\"B\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:8:\"DB-Tools\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:8:\"db_tools\";s:4:\"help\";s:21:\"to start the DB-Tools\";}}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:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:21:\"etemplate.editor.keys\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:4;a:2:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:24:\"etemplate.editor.buttons\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:5;a:2:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:21:\"etemplate.editor.edit\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:6;a:2:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:10:\"CSS-styles\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}i:7;a:2:{s:1:\"A\";a:5:{s:4:\"type\";s:8:\"textarea\";s:4:\"size\";s:5:\"10,80\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:5:\"style\";s:4:\"help\";s:155:\"embeded CSS styles, eg. \'.red { background: red; }\' (note the \'.\' before the class-name) or \'@import url(...)\' (class names are global for the whole page!)\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.row_header.top','template' => '','lang' => '','group' => '0','version' => '0.9.13.005','data' => 'a:2:{i:0;a:0:{}i:1;a:2:{s:1:\"A\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:13:\"insert_row[0]\";s:4:\"help\";s:37:\"insert new row in front of first Line\";}s:1:\"B\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"X\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:19:\"exchange_row[$row_]\";s:4:\"help\";s:22:\"exchange this two rows\";}}}','size' => '100%,100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.row_header','template' => '','lang' => '','group' => '0','version' => '0.9.13.005','data' => 'a:5:{i:0;a:0:{}i:1;a:2:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:31:\"etemplate.editor.row_header.top\";}s:1:\"B\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:6:\"Height\";s:5:\"align\";s:6:\"center\";}}i:2;a:2:{s:1:\"A\";a:5:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:4:\".row\";}s:1:\"B\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"name\";s:14:\"height[h$row_]\";s:4:\"help\";s:35:\"height of row (in percent or pixel)\";}}i:3;a:2:{s:1:\"A\";a:6:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"-\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:17:\"delete_row[$row_]\";s:4:\"help\";s:33:\"remove Row (can NOT be undone!!!)\";}s:1:\"B\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:5:\"class\";s:5:\"align\";s:6:\"center\";}}i:4;a:2:{s:1:\"A\";a:6:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:17:\"insert_row[$row_]\";s:4:\"help\";s:29:\"insert new row after this one\";}s:1:\"B\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"name\";s:13:\"class[c$row_]\";s:4:\"help\";s:112:\"CSS-class name for this row, preset: \'nmh\' = NextMatch header, \'nmr\' = alternating NM row, \'nmr0\'+\'nmr1\' NM rows\";}}}','size' => ',100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.cell','template' => '','lang' => '','group' => '0','version' => '0.9.13.005','data' => 'a:5:{i:0;a:4:{s:2:\"c1\";s:3:\"nmr\";s:2:\"c2\";s:3:\"nmr\";s:2:\"c3\";s:3:\"nmr\";s:2:\"c4\";s:3:\"nmr\";}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:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Size\";}s:1:\"D\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"6\";s:4:\"name\";s:4:\"size\";s:4:\"help\";s:176:\"Label:[b[old]][i[tylic]] Text:[len][,max] Textarea:[rows][,cols] Radiobutton:value H.Rule:[width] Template:[IndexInContent] Select:[multiselectLines] 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:83:\"select if label and other content (depending on fieldtype) should not be 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:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:1:\"4\";s:4:\"name\";s:26:\"etemplate.editor.cell_opts\";}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:\"50\";s:4:\"span\";s:3:\"all\";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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => ',100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.keys','template' => '','lang' => '','group' => '0','version' => '0.9.13.003','data' => 'a:2:{i:0;a:0:{}i:1;a:4:{s:1:\"A\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"30\";s:5:\"label\";s:4:\"Name\";s:4:\"name\";s:4:\"name\";s:4:\"help\";s:75:\"name of the eTemplate, should be in form application.function[.subTemplate]\";}s:1:\"B\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:5:\"label\";s:8:\"Template\";s:4:\"name\";s:8:\"template\";s:4:\"help\";s:125:\"name of phpgw-template set (e.g. verdilak): \'\' = default (will read pref. template, us \'default\' to read default template \'\')\";}s:1:\"C\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"label\";s:4:\"Lang\";s:4:\"name\";s:4:\"lang\";s:4:\"help\";s:162:\"language-short (eg. \'en\' for english) for language-dependent template (\'\' reads your pref. languages or the default, us \'default\' to read the default template \'\')\";}s:1:\"D\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:5:\"label\";s:7:\"Version\";s:4:\"name\";s:7:\"version\";s:4:\"help\";s:116:\"version-number, should be in the form: major.minor.revision.number (eg. 0.9.13.001 all numbers filled up with zeros)\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.show','template' => '','lang' => '','group' => '0','version' => '0.9.13.002','data' => 'a:7:{i:0;a:0:{}i:1;a:1:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:2:\"bi\";s:5:\"label\";s:34:\"Editable Templates - Show Template\";s:4:\"name\";s:3:\"msg\";}}i:2;a:1:{s:1:\"A\";a:1:{s:4:\"type\";s:5:\"hrule\";}}i:3;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:21:\"etemplate.editor.keys\";}}i:4;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:24:\"etemplate.editor.buttons\";}}i:5;a:1:{s:1:\"A\";a:1:{s:4:\"type\";s:5:\"hrule\";}}i:6;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:4:\"cont\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.controls','template' => '','lang' => '','group' => '0','version' => '0.9.13.004','data' => 'a:3:{i:0;a:0:{}i:1;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:21:\"etemplate.editor.keys\";}}i:2;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:24:\"etemplate.editor.buttons\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.delete','template' => '','lang' => '','group' => '0','version' => '0.9.13.002','data' => 'a:7:{i:0;a:0:{}i:1;a:2:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:36:\"Editable Templates - Delete Template\";}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:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:6:\"Delete\";s:5:\"align\";s:5:\"right\";}s:1:\"B\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:21:\"etemplate.editor.keys\";s:8:\"readonly\";s:1:\"1\";}}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:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:3:\"Yes\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:3:\"yes\";s:4:\"help\";s:70:\"deletes the above spez. eTemplate from the database, can NOT be undone\";}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:32:\"returns savely, WITHOUT deleting\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.db-tools.ask_save','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:7:{i:0;a:0:{}i:1;a:2:{s:1:\"A\";a:5:{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: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: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:5:\"align\";s:6:\"center\";s:4:\"name\";s:5:\"table\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}}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: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' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.row_header','template' => '','lang' => '','group' => '0','version' => '0.9.13.004','data' => 'a:5:{i:0;a:0:{}i:1;a:2:{s:1:\"A\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:13:\"insert_row[0]\";s:4:\"help\";s:37:\"insert new row in front of first Line\";}s:1:\"B\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:6:\"Height\";s:5:\"align\";s:6:\"center\";}}i:2;a:2:{s:1:\"A\";a:5:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:4:\".row\";}s:1:\"B\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"name\";s:14:\"height[h$row_]\";s:4:\"help\";s:35:\"height of row (in percent or pixel)\";}}i:3;a:2:{s:1:\"A\";a:6:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"-\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:17:\"delete_row[$row_]\";s:4:\"help\";s:33:\"remove Row (can NOT be undone!!!)\";}s:1:\"B\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:5:\"class\";s:5:\"align\";s:6:\"center\";}}i:4;a:2:{s:1:\"A\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:17:\"insert_row[$row_]\";s:4:\"help\";s:29:\"insert new row after this one\";}s:1:\"B\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"name\";s:13:\"class[c$row_]\";s:4:\"help\";s:112:\"CSS-class name for this row, preset: \'nmh\' = NextMatch header, \'nmr\' = alternating NM row, \'nmr0\'+\'nmr1\' NM rows\";}}}','size' => ',100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.buttons','template' => '','lang' => '','group' => '0','version' => '0.9.13.003','data' => 'a:2:{i:0;a:0:{}i:1;a:10:{s:1:\"A\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Read\";s:4:\"name\";s:4:\"read\";s:4:\"help\";s:49:\"read eTemplate from database (for the keys above)\";}s:1:\"B\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:14:\"Show (no save)\";s:4:\"name\";s:4:\"show\";s:4:\"help\";s:61:\"shows/displays eTemplate for testing, does NOT save it before\";}s:1:\"C\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:11:\"Show Values\";s:4:\"name\";s:6:\"values\";s:4:\"help\";s:65:\"shows / allows you to enter values into the eTemplate for testing\";}s:1:\"D\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Save\";s:4:\"name\";s:4:\"save\";s:4:\"help\";s:77:\"save the eTemplate under the above keys (name, ...), change them for a SaveAs\";}s:1:\"E\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Edit\";s:4:\"name\";s:4:\"edit\";s:4:\"help\";s:30:\"edit the eTemplate spez. above\";}s:1:\"F\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:6:\"Delete\";s:4:\"name\";s:6:\"delete\";s:4:\"help\";s:33:\"deletes the eTemplate spez. above\";}s:1:\"G\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:10:\"Dump4Setup\";s:4:\"name\";s:4:\"dump\";s:4:\"help\";s:88:\"writes a \'etemplates.inc.php\' file (for application in Name) in the setup-dir of the app\";}s:1:\"H\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:14:\"Write Langfile\";s:4:\"name\";s:8:\"langfile\";s:4:\"help\";s:85:\"creates an english (\'en\') langfile from label and helptexts (for application in Name)\";}s:1:\"I\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"J\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:5:\"label\";s:28:\"Width, Height, Border, class\";s:4:\"name\";s:4:\"size\";s:4:\"help\";s:95:\"width, height, border-line-thickness of the table / template and CSS-class name (for TABLE tag)\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.cell_opts','template' => '','lang' => '','group' => '0','version' => '0.9.13.003','data' => 'a:2:{i:0;a:0:{}i:1;a:3:{s:1:\"A\";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:95:\"select if content should only be displayed but not altered (the content is not send back then!)\";}s:1:\"B\";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\";}s:1:\"C\";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\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.cell','template' => '','lang' => '','group' => '0','version' => '0.9.13.004','data' => 'a:5:{i:0;a:4:{s:2:\"c1\";s:3:\"nmr\";s:2:\"c2\";s:3:\"nmr\";s:2:\"c3\";s:3:\"nmr\";s:2:\"c4\";s:3:\"nmr\";}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:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Size\";}s:1:\"D\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"6\";s:4:\"name\";s:4:\"size\";s:4:\"help\";s:176:\"Label:[b[old]][i[tylic]] Text:[len][,max] Textarea:[rows][,cols] Radiobutton:value H.Rule:[width] Template:[IndexInContent] Select:[multiselectLines] 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:83:\"select if label and other content (depending on fieldtype) should not be 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:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:1:\"4\";s:4:\"name\";s:26:\"etemplate.editor.cell_opts\";}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:\"50\";s:4:\"span\";s:3:\"all\";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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => ',100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.row_header','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:4:{i:1;a:1:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:4:\"name\";s:13:\"insert_row[0]\";}}i:2;a:1:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:4:\".row\";}}i:3;a:1:{s:1:\"A\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"-\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:16:\"delete_row[$row]\";}}i:4;a:1:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:4:\"name\";s:16:\"insert_row[$row]\";}}}','size' => ',100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.col_header','template' => '','lang' => '','group' => '0','version' => '0.9.13.003','data' => 'a:2:{i:0;a:4:{s:1:\"A\";s:2:\"5%\";s:1:\"B\";s:2:\"5%\";s:1:\"C\";s:3:\"60%\";s:1:\"D\";s:3:\"30%\";}i:1;a:6:{s:1:\"A\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:13:\"insert_col[0]\";s:4:\"help\";s:33:\"insert new column in front of all\";}s:1:\"B\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:3:\">|<\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:17:\"exchange_col[$c_]\";s:4:\"help\";s:25:\"exchange this two columns\";}s:1:\"C\";a:5:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:4:\".col\";}s:1:\"D\";a:6:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"label\";s:5:\"Width\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:12:\"width[$col_]\";s:4:\"help\";s:37:\"width of column (in percent or pixel)\";}s:1:\"E\";a:6:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"-\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:15:\"delete_col[$c_]\";s:4:\"help\";s:42:\"delete whole column (can NOT be undone!!!)\";}s:1:\"F\";a:6:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:15:\"insert_col[$c_]\";s:4:\"help\";s:33:\"insert new column behind this one\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:6:{i:0;a:2:{s:1:\"F\";s:2:\"5%\";s:1:\"G\";s:3:\"85%\";}i:1;a:7:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:27:\"Editable Templates - Editor\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}}i:2;a:7:{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\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}}i:3;a:7:{s:1:\"A\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"30\";s:4:\"span\";s:1:\"3\";s:5:\"label\";s:4:\"Name\";s:4:\"name\";s:4:\"name\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"C\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"D\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:8:\"Language\";s:4:\"name\";s:4:\"lang\";}s:1:\"E\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:5:\"label\";s:7:\"Version\";s:4:\"name\";s:7:\"version\";}s:1:\"G\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"6\";s:5:\"label\";s:11:\"Group/-User\";s:4:\"name\";s:5:\"group\";}}i:4;a:7:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Read\";s:4:\"name\";s:4:\"read\";}s:1:\"B\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:14:\"Show (no save)\";s:4:\"name\";s:4:\"show\";}s:1:\"C\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Save\";s:4:\"name\";s:4:\"save\";}s:1:\"D\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:6:\"Delete\";s:4:\"name\";s:6:\"delete\";}s:1:\"E\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:10:\"Dump4Setup\";s:4:\"name\";s:4:\"dump\";}s:1:\"F\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:21:\"Width, Height, Border\";s:4:\"name\";s:4:\"size\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}}i:5;a:7:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:21:\"etemplate.editor.edit\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.col_header','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:2:{i:0;a:2:{s:1:\"A\";s:3:\"40%\";s:1:\"C\";s:3:\"40%\";}i:1;a:5:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:4:\"name\";s:13:\"insert_col[0]\";}s:1:\"B\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:4:\"name\";s:4:\".col\";}s:1:\"C\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"label\";s:5:\"Width\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:11:\"width[$col]\";}s:1:\"D\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"-\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:14:\"delete_col[$c]\";}s:1:\"E\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:14:\"insert_col[$c]\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.edit','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:3:{i:0;a:0:{}i:1;a:2:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:57:\"../../developer_tools/templates/default/images/navbar.gif\";s:5:\"align\";s:6:\"center\";}s:1:\"B\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:8:\"Col$col,\";s:4:\"name\";s:27:\"etemplate.editor.col_header\";}}i:2;a:2:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:8:\"Row$row,\";s:4:\"name\";s:27:\"etemplate.editor.row_header\";}s:1:\"B\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:8:\"$col$row\";s:4:\"name\";s:26:\"etemplate.editor.edit_cell\";}}}','size' => ',,1','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.edit_cell','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:3:{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:2:{s:4:\"type\";s:6:\"select\";s:4:\"name\";s:4:\"type\";}s:1:\"C\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Size\";}s:1:\"D\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"6\";s:4:\"name\";s:4:\"size\";}s:1:\"E\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Span\";}s:1:\"F\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"name\";s:4:\"span\";}}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:2:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:5:\"label\";}s:1:\"C\";a:5:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:8:\"L. after\";s:7:\"l_after\";s:1:\"1\";s:4:\"name\";s:7:\"l_after\";}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:5:\"Align\";}s:1:\"F\";a:2:{s:4:\"type\";s:6:\"select\";s:4:\"name\";s:5:\"align\";}}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:2:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:4:\"name\";}s:1:\"C\";a:5:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:8:\"Readonly\";s:7:\"l_after\";s:1:\"1\";s:4:\"name\";s:8:\"readonly\";}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:5:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:8:\"Disabled\";s:7:\"l_after\";s:1:\"1\";s:4:\"name\";s:8:\"disabled\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.edit','template' => '','lang' => '','group' => '0','version' => '0.9.13.002','data' => 'a:3:{i:0;a:1:{s:2:\"c1\";s:3:\"nmh\";}i:1;a:2:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"image\";s:5:\"label\";s:8:\"test.gif\";s:5:\"align\";s:6:\"center\";}s:1:\"B\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:8:\"Col$col,\";s:4:\"name\";s:27:\"etemplate.editor.col_header\";}}i:2;a:2:{s:1:\"A\";a:4:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:8:\"Row$row,\";s:4:\"span\";s:4:\",nmh\";s:4:\"name\";s:27:\"etemplate.editor.row_header\";}s:1:\"B\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"size\";s:8:\"$col$row\";s:4:\"name\";s:21:\"etemplate.editor.cell\";}}}','size' => ',,1,editorEdit','style' => '.editorEdit { border-color: black }',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor','template' => '','lang' => '','group' => '0','version' => '0.9.13.002','data' => 'a:6:{i:0;a:2:{s:1:\"F\";s:2:\"5%\";s:1:\"G\";s:3:\"85%\";}i:1;a:7:{s:1:\"A\";a:5:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:27:\"Editable Templates - Editor\";s:4:\"name\";s:3:\"msg\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}}i:2;a:7:{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\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}}i:3;a:7:{s:1:\"A\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"30\";s:4:\"span\";s:1:\"3\";s:5:\"label\";s:4:\"Name\";s:4:\"name\";s:4:\"name\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"C\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"D\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:8:\"Template\";s:4:\"name\";s:8:\"template\";}s:1:\"E\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"label\";s:4:\"Lang\";s:4:\"name\";s:4:\"lang\";}s:1:\"G\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:5:\"label\";s:7:\"Version\";s:4:\"name\";s:7:\"version\";}}i:4;a:7:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Read\";s:4:\"name\";s:4:\"read\";}s:1:\"B\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:14:\"Show (no save)\";s:4:\"name\";s:4:\"show\";}s:1:\"C\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Save\";s:4:\"name\";s:4:\"save\";}s:1:\"D\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:6:\"Delete\";s:4:\"name\";s:6:\"delete\";}s:1:\"E\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:10:\"Dump4Setup\";s:4:\"name\";s:4:\"dump\";}s:1:\"F\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:21:\"Width, Height, Border\";s:4:\"name\";s:4:\"size\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}}i:5;a:7:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:21:\"etemplate.editor.edit\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.col_header','template' => '','lang' => '','group' => '0','version' => '0.9.13.002','data' => 'a:2:{i:0;a:0:{}i:1;a:5:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:4:\"name\";s:13:\"insert_col[0]\";}s:1:\"B\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:4:\"name\";s:4:\".col\";}s:1:\"C\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"label\";s:5:\"Width\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:12:\"width[$col_]\";}s:1:\"D\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"-\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:15:\"delete_col[$c_]\";}s:1:\"E\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:15:\"insert_col[$c_]\";}}}','size' => '100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.row_header','template' => '','lang' => '','group' => '0','version' => '0.9.13.002','data' => 'a:5:{i:0;a:0:{}i:1;a:1:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:4:\"name\";s:13:\"insert_row[0]\";}}i:2;a:1:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:4:\".row\";}}i:3;a:1:{s:1:\"A\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"-\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:17:\"delete_row[$row_]\";}}i:4;a:1:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:4:\"name\";s:17:\"insert_row[$row_]\";}}}','size' => ',100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.controls','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:3:{i:0;a:0:{}i:1;a:8:{s:1:\"A\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"30\";s:4:\"span\";s:1:\"3\";s:5:\"label\";s:4:\"Name\";s:4:\"name\";s:4:\"name\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"C\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"D\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:8:\"Template\";s:4:\"name\";s:8:\"template\";}s:1:\"E\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"label\";s:4:\"Lang\";s:4:\"name\";s:4:\"lang\";}s:1:\"G\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:7:\"Version\";}s:1:\"H\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"name\";s:7:\"version\";}}i:2;a:8:{s:1:\"A\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Read\";s:4:\"name\";s:4:\"read\";}s:1:\"B\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:14:\"Show (no save)\";s:4:\"name\";s:4:\"show\";}s:1:\"C\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Save\";s:4:\"name\";s:4:\"save\";}s:1:\"D\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:6:\"Delete\";s:4:\"name\";s:6:\"delete\";}s:1:\"E\";a:3:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:10:\"Dump4Setup\";s:4:\"name\";s:4:\"dump\";}s:1:\"F\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:21:\"Width, Height, Border\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"H\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"name\";s:4:\"size\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.edit_cell','template' => '','lang' => '','group' => '0','version' => '0.9.13.002','data' => 'a:5:{i:0;a:0:{}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:2:{s:4:\"type\";s:6:\"select\";s:4:\"name\";s:4:\"type\";}s:1:\"C\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Size\";}s:1:\"D\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"6\";s:4:\"name\";s:4:\"size\";}s:1:\"E\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Span\";}s:1:\"F\";a:3:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"name\";s:4:\"span\";}}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:2:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:5:\"label\";}s:1:\"C\";a:4:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:13:\"%s No Transl.\";s:4:\"name\";s:7:\"no_lang\";}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:5:\"Align\";}s:1:\"F\";a:2:{s:4:\"type\";s:6:\"select\";s:4:\"name\";s:5:\"align\";}}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:2:{s:4:\"type\";s:4:\"text\";s:4:\"name\";s:4:\"name\";}s:1:\"C\";a:4:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:11:\"%s Readonly\";s:4:\"name\";s:8:\"readonly\";}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:4:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:11:\"%s Disabled\";s:4:\"name\";s:8:\"disabled\";}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:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"50\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:4:\"help\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.row_header','template' => '','lang' => '','group' => '0','version' => '0.9.13.003','data' => 'a:5:{i:0;a:0:{}i:1;a:1:{s:1:\"A\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:13:\"insert_row[0]\";s:4:\"help\";s:37:\"insert new row in front of first Line\";}}i:2;a:1:{s:1:\"A\";a:5:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:1:\"b\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:4:\".row\";}}i:3;a:1:{s:1:\"A\";a:6:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"-\";s:7:\"no_lang\";s:1:\"1\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:17:\"delete_row[$row_]\";s:4:\"help\";s:33:\"remove Row (can NOT be undone!!!)\";}}i:4;a:1:{s:1:\"A\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:1:\"+\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:17:\"insert_row[$row_]\";s:4:\"help\";s:29:\"insert new row after this one\";}}}','size' => ',100%','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.edit_cell','template' => '','lang' => '','group' => '0','version' => '0.9.13.003','data' => 'a:5:{i:0;a:0:{}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:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Size\";}s:1:\"D\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"6\";s:4:\"name\";s:4:\"size\";s:4:\"help\";s:184:\"Label:[b[old]][i[tylic]] Text:[length][,maxLength] Textarea:[rows][,cols] Radiobutton:valueIfChecked HorizontalRule:[width] Template:[IndexInContent] Select:[multiselectLinesDisplayed]\";}s:1:\"E\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Span\";}s:1:\"F\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:4:\"name\";s:4:\"span\";s:4:\"help\";s:78:\"number of colums the field/cell should span or \'all\' for the remaining columns\";}}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:5:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:13:\"%s No Transl.\";s:4:\"name\";s:7:\"no_lang\";s:4:\"help\";s:83:\"select if label and other content (depending on fieldtype) should not be translated\";}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:5:\"Align\";}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:5:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:11:\"%s Readonly\";s:4:\"name\";s:8:\"readonly\";s:4:\"help\";s:95:\"select if content should only be displayed but not altered (the content is not send back then!)\";}s:1:\"D\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"E\";a:5:{s:4:\"type\";s:8:\"checkbox\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:11:\"%s Disabled\";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\";}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:\"50\";s:4:\"span\";s:3:\"all\";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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor.controls','template' => '','lang' => '','group' => '0','version' => '0.9.13.003','data' => 'a:3:{i:0;a:0:{}i:1;a:8:{s:1:\"A\";a:6:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"30\";s:4:\"span\";s:1:\"3\";s:5:\"label\";s:4:\"Name\";s:4:\"name\";s:4:\"name\";s:4:\"help\";s:75:\"name of the eTemplate, should be in form application.function[.subTemplate]\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"C\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"D\";a:6:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:8:\"Template\";s:4:\"name\";s:8:\"template\";s:4:\"help\";s:125:\"name of phpgw-template set (e.g. verdilak): \'\' = default (will read pref. template, us \'default\' to read default template \'\')\";}s:1:\"E\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:1:\"5\";s:5:\"label\";s:4:\"Lang\";s:4:\"name\";s:4:\"lang\";s:4:\"help\";s:161:\"language-short (eg. \'en\' for english) for language-dependent template (\'\' reads your pref. languages or the default, us \'default to read the default template \'\')\";}s:1:\"G\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:7:\"Version\";}s:1:\"H\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"name\";s:7:\"version\";s:4:\"help\";s:116:\"version-number, should be in the form: major.minor.revision.number (eg. 0.9.13.001 all numbers filled up with zeros)\";}}i:2;a:8:{s:1:\"A\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Read\";s:4:\"name\";s:4:\"read\";s:4:\"help\";s:48:\"read template from database (for the keys above)\";}s:1:\"B\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:14:\"Show (no save)\";s:4:\"name\";s:4:\"show\";s:4:\"help\";s:64:\"shows/displays the template for testing, does NOT save it before\";}s:1:\"C\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Save\";s:4:\"name\";s:4:\"save\";s:4:\"help\";s:76:\"save the template under the above keys (name, ...), change them for a SaveAs\";}s:1:\"D\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:6:\"Delete\";s:4:\"name\";s:6:\"delete\";s:4:\"help\";s:21:\"deletes the eTemplate\";}s:1:\"E\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:10:\"Dump4Setup\";s:4:\"name\";s:4:\"dump\";s:4:\"help\";s:88:\"writes a \'etemplates.inc.php\' file (for application in Name) in the setup-dir of the app\";}s:1:\"F\";a:3:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:1:\"2\";s:5:\"label\";s:21:\"Width, Height, Border\";}s:1:\"G\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"H\";a:4:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"10\";s:4:\"name\";s:4:\"size\";s:4:\"help\";s:63:\"width, height and border-line-thickness of the table / template\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.editor','template' => '','lang' => '','group' => '0','version' => '0.9.13.003','data' => 'a:6:{i:0;a:0:{}i:1;a:1:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:2:\"bi\";s:5:\"label\";s:27:\"Editable Templates - Editor\";s:4:\"name\";s:3:\"msg\";}}i:2;a:1:{s:1:\"A\";a:1:{s:4:\"type\";s:5:\"hrule\";}}i:3;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:21:\"etemplate.editor.keys\";}}i:4;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:24:\"etemplate.editor.buttons\";}}i:5;a:1:{s:1:\"A\";a:2:{s:4:\"type\";s:8:\"template\";s:4:\"name\";s:21:\"etemplate.editor.edit\";}}}','size' => '','style' => '',);
|
||||
|
||||
$templ_data[] = array('name' => 'etemplate.db-tools.edit','template' => '','lang' => '','group' => '0','version' => '0.9.13.001','data' => 'a:6:{i:0;a:0:{}i:1;a:6:{s:1:\"A\";a:5:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:2:\"bi\";s:4:\"span\";s:1:\"5\";s:5:\"label\";s:29:\"Editable Templates - DB-Tools\";s:4:\"name\";s:3:\"msg\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:16:\"eTemplate Editor\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:6:\"editor\";s:4:\"help\";s:29:\"to start the eTemplate editor\";}}i:2;a:6:{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\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:3;a:6:{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\";}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: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:6:{s:4:\"type\";s:6:\"select\";s:5:\"label\";s:11:\"Application\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:3:\"app\";s:8:\"onchange\";s:1:\"1\";s:4:\"help\";s:21:\"Select an application\";}s:1:\"B\";a:6:{s:4:\"type\";s:6:\"select\";s:5:\"label\";s:9:\"TableName\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:10:\"table_name\";s:8:\"onchange\";s:1:\"1\";s:4:\"help\";s:34:\"Select an table of the application\";}s:1:\"C\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"20\";s:5:\"align\";s:5:\"right\";s:4:\"name\";s:14:\"new_table_name\";s:4:\"help\";s:20:\"Name of table to add\";}s:1:\"D\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:9:\"Add Table\";s:4:\"name\";s:9:\"add_table\";s:4:\"help\";s:38:\"Create a new table for the application\";}s:1:\"E\";a:5:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:10:\"Drop Table\";s:4:\"name\";s:10:\"drop_table\";s:8:\"disabled\";s:1:\"1\";s:4:\"help\";s:37:\"Drop a table - this can NOT be undone\";}s:1:\"F\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:12:\"Write Tables\";s:4:\"name\";s:12:\"write_tables\";s:4:\"help\";s:40:\"Write <app>/setup/tables_current.inc.php\";}}i:5;a:6:{s:1:\"A\";a:3:{s:4:\"type\";s:8:\"template\";s:4:\"span\";s:3:\"all\";s:4:\"name\";s:23:\"etemplate.db-tools.cols\";}s:1:\"B\";a:1:{s:4:\"type\";s:5:\"label\";}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:1:{s:4:\"type\";s:5:\"label\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}}','size' => '100%','style' => '',);
|
||||
|
157
etemplate/setup/phpgw_en.lang
Normal file
157
etemplate/setup/phpgw_en.lang
Normal file
@ -0,0 +1,157 @@
|
||||
%s Disabled etemplate en %s Disabled
|
||||
%s No Transl. etemplate en %s No Transl.
|
||||
%s NoTranslation etemplate en %s NoTranslation
|
||||
%s Readonly etemplate en %s Readonly
|
||||
%s onChange etemplate en %s onChange
|
||||
../../developer_tools/templates/default/images/navbar.gif etemplate en ../../developer_tools/templates/default/images/navbar.gif
|
||||
Add Column etemplate en Add Column
|
||||
Add Table etemplate en Add Table
|
||||
Align etemplate en Align
|
||||
CSS-class name for this row, preset: 'nmh' = NextMatch header, 'nmr' = alternating NM row, 'nmr0'+'nmr1' NM rows etemplate en CSS-class name for this row, preset: 'nmh' = NextMatch header, 'nmr' = alternating NM row, 'nmr0'+'nmr1' NM rows
|
||||
CSS-styles etemplate en CSS-styles
|
||||
Center etemplate en Center
|
||||
Checkbox etemplate en Checkbox
|
||||
ColumnName etemplate en ColumnName
|
||||
Create a new table for the application etemplate en Create a new table for the application
|
||||
DB ensures that every row has a unique value in that column etemplate en DB ensures that every row has a unique value in that column
|
||||
DB-Tools etemplate en DB-Tools
|
||||
Date etemplate en Date
|
||||
Date Timestamp etemplate en Date Timestamp
|
||||
Date m/d/Y etemplate en Date m/d/Y
|
||||
Default etemplate en Default
|
||||
Delete etemplate en Delete
|
||||
Delete Column etemplate en Delete Column
|
||||
Delete Template etemplate en Delete Template
|
||||
Disabled etemplate en Disabled
|
||||
Do you want to save the changes you made in table %s? etemplate en Do you want to save the changes you made in table %s?
|
||||
Drop Table etemplate en Drop Table
|
||||
Drop a table - this can NOT be undone etemplate en Drop a table - this can NOT be undone
|
||||
Dump4Setup etemplate en Dump4Setup
|
||||
Edit etemplate en Edit
|
||||
Editable Templates - DB-Tools etemplate en Editable Templates - DB-Tools
|
||||
Editable Templates - Delete Template etemplate en Editable Templates - Delete Template
|
||||
Editable Templates - Editor etemplate en Editable Templates - Editor
|
||||
Editable Templates - Show Template etemplate en Editable Templates - Show Template
|
||||
Error: Template not found !!! etemplate en Error: Template not found !!!
|
||||
Error: while saveing !!! etemplate en Error: while saveing !!!
|
||||
Foreign Key etemplate en Foreign Key
|
||||
Group/-User etemplate en Group/-User
|
||||
Height etemplate en Height
|
||||
Help etemplate en Help
|
||||
Horizontal Rule etemplate en Horizontal Rule
|
||||
Image etemplate en Image
|
||||
Indexed etemplate en Indexed
|
||||
Key etemplate en Key
|
||||
L. after etemplate en L. after
|
||||
Label etemplate en Label
|
||||
Label:[b[old]][i[tylic]] Text:[len][,max] Textarea:[rows][,cols] Radiobutton:value H.Rule:[width] Template:[IndexInContent] Select:[multiselectLines] Date:[values: eg. 'Y-m-d'] etemplate en Label:[b[old]][i[tylic]] Text:[len][,max] Textarea:[rows][,cols] Radiobutton:value H.Rule:[width] Template:[IndexInContent] Select:[multiselectLines] Date:[values: eg. 'Y-m-d']
|
||||
Label:[b[old]][i[tylic]] Text:[length][,maxLength] Textarea:[rows][,cols] Radiobutton:valueIfChecked HorizontalRule:[width] Template:[IndexInContent] Select:[multiselectLinesDisplayed] etemplate en Label:[b[old]][i[tylic]] Text:[length][,maxLength] Textarea:[rows][,cols] Radiobutton:valueIfChecked HorizontalRule:[width] Template:[IndexInContent] Select:[multiselectLinesDisplayed]
|
||||
Lang etemplate en Lang
|
||||
Language etemplate en Language
|
||||
Left etemplate en Left
|
||||
Name etemplate en Name
|
||||
Name of table to add etemplate en Name of table to add
|
||||
No etemplate en No
|
||||
Nullable etemplate en Nullable
|
||||
Precision etemplate en Precision
|
||||
Primary Key etemplate en Primary Key
|
||||
Primary key for the table, gets automaticaly indexed etemplate en Primary key for the table, gets automaticaly indexed
|
||||
Radiobutton etemplate en Radiobutton
|
||||
Raw etemplate en Raw
|
||||
Read etemplate en Read
|
||||
Readonly etemplate en Readonly
|
||||
Right etemplate en Right
|
||||
Save etemplate en Save
|
||||
Select Access etemplate en Select Access
|
||||
Select Account etemplate en Select Account
|
||||
Select Cathegory etemplate en Select Cathegory
|
||||
Select Country etemplate en Select Country
|
||||
Select Percentage etemplate en Select Percentage
|
||||
Select Priority etemplate en Select Priority
|
||||
Select State etemplate en Select State
|
||||
Select an application etemplate en Select an application
|
||||
Select an table of the application etemplate en Select an table of the application
|
||||
Selectbox etemplate en Selectbox
|
||||
Show (no save) etemplate en Show (no save)
|
||||
Show Values etemplate en Show Values
|
||||
Size etemplate en Size
|
||||
Span etemplate en Span
|
||||
Span, Class etemplate en Span, Class
|
||||
Submitbutton etemplate en Submitbutton
|
||||
Template etemplate en Template
|
||||
Template deleted etemplate en Template deleted
|
||||
Template saved etemplate en Template saved
|
||||
Text etemplate en Text
|
||||
Textarea etemplate en Textarea
|
||||
Type etemplate en Type
|
||||
Unique etemplate en Unique
|
||||
Value etemplate en Value
|
||||
Version etemplate en Version
|
||||
Width etemplate en Width
|
||||
Width, Height, Border etemplate en Width, Height, Border
|
||||
Width, Height, Border, class etemplate en Width, Height, Border, class
|
||||
Write <app>/setup/tables_current.inc.php etemplate en Write <app>/setup/tables_current.inc.php
|
||||
Write Langfile etemplate en Write Langfile
|
||||
Write Tables etemplate en Write Tables
|
||||
Yes etemplate en Yes
|
||||
alignment of label and input-field in table-cell etemplate en alignment of label and input-field in table-cell
|
||||
an indexed column speeds up querys using that column (cost space on the disk !!!) etemplate en an indexed column speeds up querys using that column (cost space on the disk !!!)
|
||||
can have sepecial SQL-value NULL etemplate en can have sepecial SQL-value NULL
|
||||
class etemplate en class
|
||||
creates an english ('en') langfile from label and helptexts (for application in Name) etemplate en creates an english ('en') langfile from label and helptexts (for application in Name)
|
||||
delete whole column (can NOT be undone!!!) etemplate en delete whole column (can NOT be undone!!!)
|
||||
deletes the above spez. eTemplate from the database, can NOT be undone etemplate en deletes the above spez. eTemplate from the database, can NOT be undone
|
||||
deletes the eTemplate etemplate en deletes the eTemplate
|
||||
deletes the eTemplate spez. above etemplate en deletes the eTemplate spez. above
|
||||
discard changes etemplate en discard changes
|
||||
displayed in front of input or input is inserted for a '%s' in the label (label of the Submitbutton or Image-filename) etemplate en displayed in front of input or input is inserted for a '%s' in the label (label of the Submitbutton or Image-filename)
|
||||
displayed in front of input or input is inserted for a '%s' in the label (label of the Submitbutton) etemplate en displayed in front of input or input is inserted for a '%s' in the label (label of the Submitbutton)
|
||||
displayed in statusline of browser if input-field gets focus etemplate en displayed in statusline of browser if input-field gets focus
|
||||
eTemplate Editor etemplate en eTemplate Editor
|
||||
edit the eTemplate spez. above etemplate en edit the eTemplate spez. above
|
||||
embeded CSS styles, eg. '.red { background red; }' (note the '.' before the class-name) or '@import url(...)' (class names are global for the whole page!) etemplate en embeded CSS styles, eg. '.red { background red; }' (note the '.' before the class-name) or '@import url(...)' (class names are global for the whole page!)
|
||||
embeded CSS styles, eg. '.red { background: red; }' (note the '.' before the class-name) or '@import url(...)' (class names are global for the whole page!) etemplate en embeded CSS styles, eg. '.red { background: red; }' (note the '.' before the class-name) or '@import url(...)' (class names are global for the whole page!)
|
||||
enable JavaScript onChange submit etemplate en enable JavaScript onChange submit
|
||||
enter '' for an empty default, nothing mean no default etemplate en enter '' for an empty default, nothing mean no default
|
||||
exchange this two columns etemplate en exchange this two columns
|
||||
exchange this two rows etemplate en exchange this two rows
|
||||
height of row (in percent or pixel) etemplate en height of row (in percent or pixel)
|
||||
if field is disabled an empty table-cell is displayed, for (temporal) removement of a field/cell etemplate en if field is disabled an empty table-cell is displayed, for (temporal) removement of a field/cell
|
||||
index/name of returned content (name of the Template) etemplate en index/name of returned content (name of the Template)
|
||||
index/name of returned content (name of the Template, Link / Method for Image) etemplate en index/name of returned content (name of the Template, Link / Method for Image)
|
||||
insert new column behind this one etemplate en insert new column behind this one
|
||||
insert new column in front of all etemplate en insert new column in front of all
|
||||
insert new row after this one etemplate en insert new row after this one
|
||||
insert new row in front of first Line etemplate en insert new row in front of first Line
|
||||
language-short (eg. 'en' for english) for language-dependent template ('' reads your pref. languages or the default, us 'default to read the default template '') etemplate en language-short (eg. 'en' for english) for language-dependent template ('' reads your pref. languages or the default, us 'default to read the default template '')
|
||||
language-short (eg. 'en' for english) for language-dependent template ('' reads your pref. languages or the default, us 'default' to read the default template '') etemplate en language-short (eg. 'en' for english) for language-dependent template ('' reads your pref. languages or the default, us 'default' to read the default template '')
|
||||
length for char+varchar, precisions int: 2, 4, 8 and float: 4, 8 etemplate en length for char+varchar, precisions int: 2, 4, 8 and float: 4, 8
|
||||
name of other table where column is a key from etemplate en name of other table where column is a key from
|
||||
name of phpgw-template set (e.g. verdilak): '' = default (will read pref. template, us 'default' to read default template '') etemplate en name of phpgw-template set (e.g. verdilak): '' = default (will read pref. template, us 'default' to read default template '')
|
||||
name of the eTemplate, should be in form application.function[.subTemplate] etemplate en name of the eTemplate, should be in form application.function[.subTemplate]
|
||||
need to be unique in the table and no reseved word from SQL, best prefix all with a common 2-digit short for the app, eg. 'et_' etemplate en need to be unique in the table and no reseved word from SQL, best prefix all with a common 2-digit short for the app, eg. 'et_'
|
||||
number of colums the field/cell should span or 'all' for the remaining columns etemplate en number of colums the field/cell should span or 'all' for the remaining columns
|
||||
number of colums the field/cell should span or 'all' for the remaining columns, CSS-class name (for the TD tag) etemplate en number of colums the field/cell should span or 'all' for the remaining columns, CSS-class name (for the TD tag)
|
||||
read eTemplate from database (for the keys above) etemplate en read eTemplate from database (for the keys above)
|
||||
read template from database (for the keys above) etemplate en read template from database (for the keys above)
|
||||
remove Row (can NOT be undone!!!) etemplate en remove Row (can NOT be undone!!!)
|
||||
returns savely, WITHOUT deleting etemplate en returns savely, WITHOUT deleting
|
||||
save the eTemplate under the above keys (name, ...), change them for a SaveAs etemplate en save the eTemplate under the above keys (name, ...), change them for a SaveAs
|
||||
save the template under the above keys (name, ...), change them for a SaveAs etemplate en save the template under the above keys (name, ...), change them for a SaveAs
|
||||
saves changes to tables_current.inc.php etemplate en saves changes to tables_current.inc.php
|
||||
select if content should only be displayed but not altered (the content is not send back then!) etemplate en select if content should only be displayed but not altered (the content is not send back then!)
|
||||
select if label and other content (depending on fieldtype) should not be translated etemplate en select if label and other content (depending on fieldtype) should not be translated
|
||||
shows / allows you to enter values into the eTemplate for testing etemplate en shows / allows you to enter values into the eTemplate for testing
|
||||
shows/displays eTemplate for testing, does NOT save it before etemplate en shows/displays eTemplate for testing, does NOT save it before
|
||||
shows/displays the template for testing, does NOT save it before etemplate en shows/displays the template for testing, does NOT save it before
|
||||
test.gif etemplate en test.gif
|
||||
to start the DB-Tools etemplate en to start the DB-Tools
|
||||
to start the eTemplate editor etemplate en to start the eTemplate editor
|
||||
type of the column etemplate en type of the column
|
||||
type of the field (select Label if field should be empty) etemplate en type of the field (select Label if field should be empty)
|
||||
value is key for an other table etemplate en value is key for an other table
|
||||
version-number, should be in the form: major.minor.revision.number (eg. 0.9.13.001 all numbers filled up with zeros) etemplate en version-number, should be in the form: major.minor.revision.number (eg. 0.9.13.001 all numbers filled up with zeros)
|
||||
width of column (in percent or pixel) etemplate en width of column (in percent or pixel)
|
||||
width, height and border-line-thickness of the table / template etemplate en width, height and border-line-thickness of the table / template
|
||||
width, height, border-line-thickness of the table / template and CSS-class name (for TABLE tag) etemplate en width, height, border-line-thickness of the table / template and CSS-class name (for TABLE tag)
|
||||
writes a 'etemplates.inc.php' file (for application in Name) in the setup-dir of the app etemplate en writes a 'etemplates.inc.php' file (for application in Name) in the setup-dir of the app
|
32
etemplate/setup/setup.inc.php
Normal file
32
etemplate/setup/setup.inc.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Editable Templates *
|
||||
* http://www.phpgroupware.org *
|
||||
" Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$setup_info['etemplate']['name'] = 'etemplate';
|
||||
$setup_info['etemplate']['title'] = 'eTemplates';
|
||||
$setup_info['etemplate']['version'] = '0.9.13.001';
|
||||
$setup_info['etemplate']['app_order'] = 8; // just behind the developers-tools
|
||||
$setup_info['etemplate']['tables'] = array('phpgw_etemplate');
|
||||
$setup_info['etemplate']['enable'] = 1;
|
||||
|
||||
/* The hooks this app includes, needed for hooks registration */
|
||||
//$setup_info['etemplate']['hooks'][] = 'preferences';
|
||||
//$setup_info['etemplate']['hooks'][] = 'admin';
|
||||
//$setup_info['etemplate']['hooks'][] = 'about';
|
||||
|
||||
/* Dependacies for this app to work */
|
||||
$setup_info['etemplate']['depends'][] = array(
|
||||
'appname' => 'phpgwapi',
|
||||
'versions' => Array('0.9.13','0.9.14','0.9.15')
|
||||
);
|
||||
?>
|
34
etemplate/setup/tables_current.inc.php
Normal file
34
etemplate/setup/tables_current.inc.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Editable Templates *
|
||||
* http://www.phpgroupware.org *
|
||||
" Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$phpgw_baseline = array(
|
||||
'phpgw_etemplate' => array(
|
||||
'fd' => array(
|
||||
'et_name' => array('type' => 'char','precision' => 80,'nullable' => False),
|
||||
'et_template' => array('type' => 'char','precision' => 20,'nullable' => False,'default' => ''),
|
||||
'et_lang' => array('type' => 'char', 'precision' => 5,'nullable' => False,'default' => ''),
|
||||
'et_group' => array('type' => 'int', 'precision' => 4,'nullable' => False, 'default' => 0),
|
||||
'et_version' => array('type' => 'char','precision' => 20,'nullable' => False,'default' => ''),
|
||||
'et_data' => array('type' => 'varchar', 'precision' => 32000,'nullable' => True),
|
||||
'et_size' => array('type' => 'char','precision' => 20,'nullable' => True),
|
||||
'et_style' => array('type' => 'varchar', 'precision' => 32000,'nullable' => True)
|
||||
),
|
||||
'pk' => array('et_name','et_template','et_lang','et_group','et_version'),
|
||||
'fk' => array(),
|
||||
'ix' => array(),
|
||||
'uc' => array()
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user