From 849a0e3835566a0d545df1bd1a0bc7b985913a65 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 12 Sep 2002 00:35:20 +0000 Subject: [PATCH] first version of xml/xul import & export of etemplates --- etemplate/inc/class.editor.inc.php | 53 +- etemplate/inc/class.uietemplate.inc.php | 2 +- etemplate/inc/class.xul_io.inc.php | 324 ++++++++++++ etemplate/inc/xmltools.php | 476 ++++++++++++++++++ etemplate/setup/etemplates.inc.php | 8 +- etemplate/setup/phpgw_en.lang | 2 + .../default/etemplate.db-tools.cols.xul | 49 ++ .../default/etemplate.db-tools.edit.xul | 40 ++ 8 files changed, 949 insertions(+), 5 deletions(-) create mode 100644 etemplate/inc/class.xul_io.inc.php create mode 100644 etemplate/inc/xmltools.php create mode 100644 etemplate/templates/default/etemplate.db-tools.cols.xul create mode 100644 etemplate/templates/default/etemplate.db-tools.edit.xul diff --git a/etemplate/inc/class.editor.inc.php b/etemplate/inc/class.editor.inc.php index cb5be46c2c..9254d0730e 100644 --- a/etemplate/inc/class.editor.inc.php +++ b/etemplate/inc/class.editor.inc.php @@ -351,6 +351,10 @@ } $msg = $this->etemplate->writeLangFile($content['name'],'en',$additional); } + elseif ($content['export_xml']) + { + $msg = $this->export_xml(); + } elseif ($content['db_tools']) { ExecMethod('etemplate.db_tools.edit'); @@ -359,6 +363,52 @@ $this->edit($msg); } + function export_xml() + { + $name = $this->etemplate->name; + $template = $this->etemplate->template != '' ? $this->etemplate->template : 'default'; + + list($app) = explode('.',$name); + + $dir = PHPGW_SERVER_ROOT . "/$app/templates/$template"; + if ($create_it = !is_dir($dir)) + { + $dir = PHPGW_SERVER_ROOT . "/$app/templates"; + } + if (!is_writeable($dir)) + { + return "Error: webserver is not allowed to write into '$dir' !!!"; + } + if ($create) + { + mkdir($dir .= "/$template"); + } + $file = "$dir/$name"; + if ($this->etemplate->lang) + { + $file .= '.' . $this->etemplate->lang; + } + $old_file = $file . '.old.xul'; + $file .= '.xul'; + if (file_exists($file)) + { + rename($file,$old_file); + } + + if (!($f = fopen($file,'w'))) + { + return 0; + } + $xul_io = CreateObject('etemplate.xul_io'); + $xul = $xul_io->export(&$this->etemplate); + + fwrite($f,$xul); + fclose($f); + + return $xul_io->import(&$this->etemplate,$xul); + return "eTemplate '$name' written to '$file'"; + } + function delete($post_vars='',$back = 'edit') { if ($this->debug) @@ -508,7 +558,8 @@ 'show' => True, 'dump' => True, 'langfile' => True, - 'size' => True + 'size' => True, + 'export_xml' => True ); if (!$msg && isset($post_vars['values']) && !isset($post_vars['vals'])) { diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index f885a88c49..ac6562cc82 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -545,7 +545,7 @@ default: if (!isset($this->extension[$cell['type']])) { - $html .= 'unknown type'; + $html .= "unknown type '$cell[type]'"; } else { diff --git a/etemplate/inc/class.xul_io.inc.php b/etemplate/inc/class.xul_io.inc.php new file mode 100644 index 0000000000..464ad84163 --- /dev/null +++ b/etemplate/inc/class.xul_io.inc.php @@ -0,0 +1,324 @@ + * + * -------------------------------------------- * + * 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_SERVER_ROOT . '/etemplate/inc/xmltools.php'); + + + class xul_io + { + var $widget2xul; + var $attr2xul; + var $xul2widget; + + function xul_io() + { + $this->attr2xul = array( // how to translate attr, common to all widgets + 'name' => 'id', + 'help' => 'statustext', + 'span' => 'span,class', + 'type' => '', // this is the widget-name => dont write as attr + 'disabled' => 'disabled=true', + 'readonly' => 'readonly=true' + ); + $this->widget2xul = array( // how to translate widget-names ( 0 => ) and widget-spec. attr. + 'label' => array( + '.name' => 'label', + 'label' => 'value' + ), + 'text' => array( + '.name' => 'textbox', + 'size' => 'size,maxlength' + ), + 'textarea' => array( + '.name' => 'textbox', + '.set' => 'multiline=true', + 'size' => 'cols,rows' + ), + 'integer' => array( + '.name' => 'textbox', + '.set' => 'type=integer', + 'size' => 'min,max,size' + ), + 'float' => array( + '.name' => 'textbox', + '.set' => 'type=float', + 'size' => 'min,max,size' + ), + 'select' => array( + '.name' => 'menulist,menupopup' + ) + ); + $this->xul2widget = array( + 'menupopup' => 'select' + ); + } + + function set_attributes(&$widget,$attr,$val,$spanned='') + { + if ($attr != '') + { + $attrs = explode(',',$attr); + + if (count($attrs)) + { + $vals = count($attrs) > 1 ? explode(',',$val) : array($val); + while (list($n,$attr) = each($attrs)) + { + if ($val = $vals[$n]) + { + if ($attr == 'span') + { + $spanned = $val == 'all' ? 999 : $val - 1; + } + list($attr,$set) = explode('=',$attr); + $widget->set_attribute($attr,$set != '' ? $set : $val); + } + } + } + } + } + + function export($etempl) + { + if ($this->debug) + { + echo "

etempl->data = "; _debug_array($etempl->data); + } + $doc = new xmldoc(); + + $xul_grid = new xmlnode('grid'); + $xul_grid->set_attribute('id',$etempl->name); + $xul_grid->set_attribute('template',$etempl->template); + $xul_grid->set_attribute('lang',$etempl->lang); + $xul_grid->set_attribute('group',$etempl->group); + $xul_grid->set_attribute('version',$etempl->version); + $this->set_attributes($xul_grid,'width,height,border,class,spacing,padding',$etempl->size); + + $xul_columns = new xmlnode('columns'); + $xul_rows = new xmlnode('rows'); + + reset($etempl->data); + list(,$opts) = each ($etempl->data); // read over options-row + while (list($r,$row) = each ($etempl->data)) + { + $xul_row = new xmlnode('row'); + $this->set_attributes($xul_row,'class,valign',$opts["c$r"]); + $this->set_attributes($xul_row,'height',$opts["h$r"]); + + $spanned = 0; + while (list($c,$cell) = each($row)) + { + if ($r == '1') // write columns only once in the first row + { + $xul_column = new xmlnode('column'); + $this->set_attributes($xul_column,'width',$opts[$c]); + $xul_columns->add_node($xul_column); + } + if ($spanned) + { + --$spanned; + continue; // spanned cells are not written + } + $type = $cell['type']; + if (is_array($type)) + { + list(,$type) = each($type); + } + $widgetattr2xul = isset($this->widget2xul[$type]) ? $this->widget2xul[$type] : array(); + $type = isset($widgetattr2xul['.name']) ? $widgetattr2xul['.name'] : $type; + list($parent,$child) = explode(',',$type); + $widget = new xmlnode($child ? $child : $parent); + + if (isset($widgetattr2xul['.set'])) // set default-attr for type + { + $attrs = explode(',',$widgetattr2xul[1]); + while (list(,$attr) = each($attr)) + { + list($attr,$val) = explode('=',$attr); + $widget->set_attribute($attr,$val); + } + } + while (list($attr,$val) = each($cell)) + { + if (is_array($val)) // correct old buggy etemplates + { + list(,$val) = each($val); + } + if (isset($widgetattr2xul[$attr])) + { + $attr = $widgetattr2xul[$attr]; + } + elseif (isset($this->attr2xul[$attr])) + { + $attr = $this->attr2xul[$attr]; + } + $this->set_attributes($widget,$attr,$val,&$spanned); + } + if ($child) + { + $parent = new xmlnode($parent); + $parent->add_node($widget); + $xul_row->add_node($parent); + } + else + { + $xul_row->add_node($widget); + } + } + $xul_rows->add_node($xul_row); + } + $xul_grid->add_node($xul_columns); + $xul_grid->add_node($xul_rows); + + if ($etempl->style != '') + { + $styles = new xmlnode('styles'); + $styles->set_text($etempl->style); + $xul_grid->add_node($styles); + } + $doc->add_root($xul_grid); + $xml = $doc->dump_mem(); + + if ($this->debug) + { + echo "

\n" . htmlentities($xml) . "\n
\n"; + } + return $xml; + } + + function import(&$etempl,$data) + { + //if ($this->debug) + { + echo "
\n" . htmlentities($data) . "\n

\n"; + } + $parser = xml_parser_create(); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parse_into_struct($parser, $data, $vals, $index); + + xml_parser_free($parser); + + while (list($n,$node) = each($vals)) + { + $type = $node['type']; + $tag = $node['tag']; + $attr = is_array($node['attributes']) ? $node['attributes'] : array(); + if ($attr['id']) + { + $attr['name'] = $attr['id']; unset($attr['id']); + } + if ($tag != 'textbox') + { + $attr['type'] = $this->xul2widget[$tag] ? $this->xul2widget[$tag] : $tag; + } + if ($this->debug) + { + echo "

$node[level]: $tag/$type: value='$node[value]' attr="; _debug_array($attr); + } + switch ($tag) + { + case 'grid': + if ($type != 'open') + { + break; + } + if ($node['level'] > 1) + { + return "Can't import nested $node[type]'s !!!"; + } + $etempl->init($attr); + $size_opts = array('padding','spacing','class','border','height','width'); + for ($size = ''; list(,$opt) = each($size_opts); ) + { + $size = $attr[$opt] . ($size != '' ? ",$size" : ''); + } + $etempl->size = $size; + $etempl->cols = $etempl->rows = 0; + $etempl->data = array(); + break; + case 'columns': + case 'rows': + case 'menulist': + break; + case 'column': + if ($type != 'complete') + { + return 'place widgets in and not in !!!'; + } + $etempl->data[0][$etempl->num2chrs($etempl->cols++)] = $attr['width']; + break; + case 'row': + if ($type != 'open') + { + break; + } + $r = ++$etempl->rows; + $col = 0; + $etempl->data[0]["c$r"] = $attr['class'] . ($attr['valign'] ? ','.$attr['valign'] : ''); + $etempl->data[0]["h$r"] = $attr['height']; + break; + case 'styles': + $etempl->style = $node['value']; + case 'textbox': + if ($attr['multiline']) + { + $attr['type'] = 'textarea'; + $attr['size'] = $attr['cols'] . ($attr['rows'] ? ','.$attr['rows'] : ''); + unset($attr['cols']); + unset($attr['rows']); + } + elseif ($attr['type']) // integer,float + { + $attr['size'] = $attr['min'] . ($attr['max'] ? ','.$attr['max'] : ($attr['size'] ? ',':'')) . ','.$attr['size']; + unset($attr['min']); + unset($attr['max']); + } + else // input + { + $attr['type'] = 'text'; + $attr['size'] .= $attr['maxlength']!='' ? ','.$attr['maxlength'] : ''; + unset($attr['maxlength']); + } + // fall-through + default: + if ($tag == 'label') + { + $attr['label'] = $attr['value']; unset($attr['value']); + } + $attr['help'] = $attr['statustext']; unset($attr['statustext']); + $spanned = $attr['span'] == 'all' ? $etempl->cols - $col : $attr['span']; + $attr['span'] .= $attr['class'] ? ','.$attr['class'] : ''; unset($attr['class']); + if ($type == 'close') + { + break; + } + $etempl->data[$etempl->rows][$etempl->num2chrs($col++)] = $attr; + + while (--$spanned > 0) + { + $etempl->data[$etempl->rows][$etempl->num2chrs($col++)] = $etempl->empty_cell(); + } + break; + } + } + //if ($this->debug) + { + _debug_array($etempl->data); + } + return ''; + } + } + +?> \ No newline at end of file diff --git a/etemplate/inc/xmltools.php b/etemplate/inc/xmltools.php new file mode 100644 index 0000000000..3cf7edc822 --- /dev/null +++ b/etemplate/inc/xmltools.php @@ -0,0 +1,476 @@ + $vals[$i]['tag'], + 'attributes' => isset($vals[$i]['attributes']) ? $vals[$i]['attributes'] : null, + 'value' => $vals[$i]['value'], + ); + break; + case 'open': + $children[] = array( + 'tag' => $vals[$i]['tag'], + 'attributes' => isset($vals[$i]['attributes']) ? $vals[$i]['attributes'] : null, + 'children' => xml_get_children($vals, $i), + ); + break; + case 'close': + return $children; + } + } + } + + function xml_get_tree($data) + { + $parser = xml_parser_create(); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parse_into_struct($parser, $data, $vals, $index); + xml_parser_free($parser); + + return array( + 'tag' => $vals[0]['tag'], + 'attributes' => isset($vals[0]['attributes']) ? $vals[0]['attributes'] : null, + 'children' => xml_get_children($vals, $i = 0), + ); + } + + function xml2array ($xmldata,$is_start = True) + { + if($is_start) + { + $xmldata = xml_get_tree($xmldata); + } + + if(!is_array($xmldata['children'])) + { + $found_at = strstr($xmldata['value'],'PHP_SERIALIZED_OBJECT:'); + if($found_at != False) + { + $xmldata['value'] = str_replace ('PHP_SERIALIZED_OBJECT:', '', $xmldata['value']); + $xmldata['value'] = unserialize ($xmldata['value']); + } + if($is_start) + { + $xml_array[$xmldata['tag']] = $xmldata['value']; + } + else + { + return $xmldata['value']; + } + } + else + { + $new_index = False; + reset($xmldata['children']); + while(list($key,$val) = each($xmldata['children'])) + { + if(!isset($found_keys[$val['tag']])) + { + $found_keys[$val['tag']] = True; + } + else + { + $new_index = True; + } + } + + if($new_index) + { + reset($xmldata['children']); + while(list($key,$val) = each($xmldata['children'])) + { + $xml_array[$val['tag']][] = xml2array($val,False); + } + } + else + { + reset($xmldata['children']); + while(list($key,$val) = each($xmldata['children'])) + { + $xml_array[$val['tag']] = xml2array($val,False); + } + } + } + return $xml_array; + } + + function var2xml ($name, $value,$is_root=True) + { + $node = new xmlnode($name); + switch (gettype($value)) + { + case 'string': + case 'integer': + case 'double': + case 'NULL': + $node->set_text($value); + break; + case 'boolean': + if($value == True) + { + $node->set_text('1'); + } + else + { + $node->set_text('0'); + } + break; + case 'array': + $new_index = False; + while (list ($idxkey, $idxval) = each ($value)) + { + if(is_array($idxval)) + { + while (list ($k, $i) = each ($idxval)) + { + if (is_int($k)) + { + $new_index = True; + } + } + } + } + reset($value); + while (list ($key, $val) = each ($value)) + { + if($new_index) + { + $keyname = $name; + $nextkey = $key; + } + else + { + $keyname = $key; + $nextkey = $key; + } + switch (gettype($val)) + { + case 'string': + case 'integer': + case 'double': + case 'NULL': + $subnode = new xmlnode($nextkey); + $subnode->set_text($val); + $node->add_node($subnode); + break; + case 'boolean': + $subnode = new xmlnode($nextkey); + if($val == True) + { + $subnode->set_text('1'); + } + else + { + $subnode->set_text('0'); + } + $node->add_node($subnode); + break; + case 'array': + if($new_index) + { + while (list ($subkey, $subval) = each ($val)) + { + $node->add_node(var2xml ($nextkey, $subval, False)); + } + } + else + { + $subnode = var2xml ($nextkey, $val, False); + $node->add_node($subnode); + } + break; + case 'object': + $subnode = new xmlnode($nextkey); + $subnode->set_cdata('PHP_SERIALIZED_OBJECT:'.serialize($val)); + $node->add_node($subnode); + break; + case 'resource': + echo 'Halt: Cannot package PHP resource pointers into XML
'; + exit; + default: + echo 'Halt: Invalid or unknown data type
'; + exit; + } + } + break; + case 'object': + $node->set_cdata('PHP_SERIALIZED_OBJECT:'.serialize($value)); + break; + case 'resource': + echo 'Halt: Cannot package PHP resource pointers into XML
'; + exit; + default: + echo 'Halt: Invalid or unknown data type
'; + exit; + } + + if($is_root) + { + $xmldoc = new xmldoc(); + $xmldoc->add_root($node); + return $xmldoc; + } + else + { + return $node; + } + } + + class xmldoc + { + var $xmlversion = ''; + var $root_node; + var $doctype = Array(); + var $comments = Array(); + + function xmldoc ($version = '1.0') + { + $this->xmlversion = $version; + } + + function add_root ($node_object) + { + if(is_object($node_object)) + { + $this->root_node = $node_object; + } + else + { + echo 'Not a valid xmlnode object
'; + exit; + } + } + + function set_doctype ($name, $uri = '') + { + $this->doctype[$name] = $uri; + } + + function add_comment ($comment) + { + $this->comments[] = $comment; + } + + function dump_mem() + { + $result = 'xmlversion.'"?>'."\n"; + if(count($this->doctype) == 1) + { + list($doctype_name,$doctype_uri) = each($this->doctype); + $result .= ''."\n"; + } + if(count($this->comments) > 0 ) + { + reset($this->comments); + while(list($key,$val) = each ($this->comments)) + { + $result .= "\n"; + } + } + + if(is_object($this->root_node)) + { + $indent = 0; + $result .= $this->root_node->dump_mem($indent); + } + return $result; + } + } + + class xmlnode + { + var $name = ''; + var $data; + var $data_type; + var $attributes = Array(); + var $comments = Array(); + var $indentstring = " "; + + function xmlnode ($name) + { + $this->name = $name; + } + + function add_node ($node_object , $name = '') + { + if (is_object($node_object)) + { + if(!is_array($this->data)) + { + $this->data = Array(); + $this->data_type = 'node'; + } + if ($name != '') + { + $this->data[$name] = $node_object; + } + else + { + $this->data[] = $node_object; + } + } + else + { + if(!is_array($this->data)) + { + $this->data = Array(); + $this->data_type = 'node'; + } + $this->data[$name] = var2xml ($name, $node_object, False); + //echo 'Not a valid xmlnode object
'; + //exit; + } + } + + function set_text ($string) + { + $this->data = $string; + $this->data_type = 'text'; + } + + function set_cdata ($string) + { + $this->data = $string; + $this->data_type = 'cdata'; + } + + function set_attribute ($name, $value = '') + { + $this->attributes[$name] = $value; + } + + function add_comment ($comment) + { + $this->comments[] = $comment; + } + + function dump_mem($indent = 1) + { + for ($i = 0; $i < $indent; $i++) + { + $indentstring .= $this->indentstring; + } + + $result = $indentstring.'<'.$this->name; + if(count($this->attributes) > 0 ) + { + reset($this->attributes); + while(list($key,$val) = each ($this->attributes)) + { + $result .= ' '.$key.'="'.$val.'"'; + } + } + + $endtag_indent = $indentstring; + if (empty($this->data_type)) + { + $result .= '/>'."\n"; + } + else + { + $result .= '>'; + + switch ($this->data_type) + { + case 'text': + if(is_array($this->data)) + { + $type_error = True; + break; + } + + if(strlen($this->data) > 30) + { + $result .= "\n".$indentstring.$this->indentstring.$this->data."\n"; + $endtag_indent = $indentstring; + } + else + { + $result .= $this->data; + $endtag_indent = ''; + } + break; + case 'cdata': + if(is_array($this->data)) + { + $type_error = True; + break; + } + $result .= 'data.']]>'; + $endtag_indent = ''; + break; + case 'node': + $result .= "\n"; + if(!is_array($this->data)) + { + $type_error = True; + break; + } + + $subindent = $indent+1; + while(list($key,$val) = each ($this->data)) + { + if(is_object($val)) + { + $result .= $val->dump_mem($subindent); + } + } + break; + default: + if($this->data != '') + { + echo 'Invalid or unset data type ('.$this->data_type.'). This should not be possible if using the class as intended
'; + } + } + + if ($type_error) + { + echo 'Invalid data type. Tagged as '.$this->data_type.' but data is '.gettype($this->data).'
'; + } + + $result .= $endtag_indent.'name.'>'; + if($indent != 0) + { + $result .= "\n"; + } + } + if(count($this->comments) > 0 ) + { + reset($this->comments); + while(list($key,$val) = each ($this->comments)) + { + $result .= $endtag_indent."\n"; + } + } + return $result; + } + } + diff --git a/etemplate/setup/etemplates.inc.php b/etemplate/setup/etemplates.inc.php index 3a827b3354..85eaad2701 100644 --- a/etemplate/setup/etemplates.inc.php +++ b/etemplate/setup/etemplates.inc.php @@ -1,5 +1,5 @@ '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' => '',); @@ -95,7 +95,9 @@ $templ_data[] = array('name' => 'etemplate.tab_widget.test.note','template' => ' $templ_data[] = array('name' => 'etemplate.tab_widget.tab_active','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:1:{s:2:\"c1\";s:3:\"nmh\";}i:1;a:1:{s:1:\"A\";a:4:{s:4:\"type\";s:5:\"label\";s:4:\"span\";s:21:\",etemplate_tab_active\";s:5:\"label\";s:6:\"@label\";s:4:\"help\";s:5:\"@help\";}}}','size' => ',,,,0,0','style' => '.etemplate_tab_active { border-style:solid; border-width:2px 2px 0px; border-color:black; padding:6px; }',); -$templ_data[] = array('name' => 'etemplate.editor.list_result.list','template' => '','lang' => '','group' => '0','version' => '0.9.15.001','data' => 'a:3:{i:0;a:2:{s:2:\"c1\";s:3:\"nmh\";s:2:\"c2\";s:3:\"nmr\";}i:1;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:5:\"label\";s:5:\"label\";s:8:\"Template\";}s:1:\"C\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Lang\";}s:1:\"D\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:7:\"Version\";s:5:\"align\";s:6:\"center\";}s:1:\"E\";a:6:{s:4:\"type\";s:6:\"button\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:6:\"Search\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:6:\"search\";s:4:\"help\";s:38:\"start new search for the above pattern\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:2;a:6:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:15:\"${row}[et_name]\";}s:1:\"B\";a:3:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:19:\"${row}[et_template]\";}s:1:\"C\";a:3:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:15:\"${row}[et_lang]\";}s:1:\"D\";a:3:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:18:\"${row}[et_version]\";}s:1:\"E\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Edit\";s:4:\"name\";s:10:\"read[$row]\";s:4:\"help\";s:34:\"load this template into the editor\";}s:1:\"F\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:6:\"Delete\";s:4:\"name\";s:12:\"delete[$row]\";s:4:\"help\";s:21:\"delete this eTemplate\";}}}','size' => '','style' => '',); - $templ_data[] = array('name' => 'etemplate.editor.list_result','template' => '','lang' => '','group' => '0','version' => '0.9.15.001','data' => 'a:5:{i:0;a:0:{}i:1;a:1:{s:1:\"A\";a:6:{s:4:\"type\";s:5:\"label\";s:4:\"size\";s:2:\"bi\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:27:\"Editable Templates - Search\";s:7:\"no_lang\";s:1:\"1\";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:2:{s:4:\"type\";s:8:\"template\";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:33:\"etemplate.editor.list_result.list\";}}}','size' => '100%','style' => '',); +$templ_data[] = array('name' => 'etemplate.editor.list_result.list','template' => '','lang' => '','group' => '0','version' => '0.9.15.001','data' => 'a:3:{i:0;a:2:{s:2:\"c1\";s:3:\"nmh\";s:2:\"c2\";s:3:\"nmr\";}i:1;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:5:\"label\";s:5:\"label\";s:8:\"Template\";}s:1:\"C\";a:2:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:4:\"Lang\";}s:1:\"D\";a:3:{s:4:\"type\";s:5:\"label\";s:5:\"label\";s:7:\"Version\";s:5:\"align\";s:6:\"center\";}s:1:\"E\";a:6:{s:4:\"type\";s:6:\"button\";s:4:\"span\";s:3:\"all\";s:5:\"label\";s:6:\"Search\";s:5:\"align\";s:6:\"center\";s:4:\"name\";s:6:\"search\";s:4:\"help\";s:38:\"start new search for the above pattern\";}s:1:\"F\";a:1:{s:4:\"type\";s:5:\"label\";}}i:2;a:6:{s:1:\"A\";a:3:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:15:\"${row}[et_name]\";}s:1:\"B\";a:3:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:19:\"${row}[et_template]\";}s:1:\"C\";a:3:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:15:\"${row}[et_lang]\";}s:1:\"D\";a:3:{s:4:\"type\";s:5:\"label\";s:7:\"no_lang\";s:1:\"1\";s:4:\"name\";s:18:\"${row}[et_version]\";}s:1:\"E\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:4:\"Edit\";s:4:\"name\";s:10:\"read[$row]\";s:4:\"help\";s:34:\"load this template into the editor\";}s:1:\"F\";a:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:6:\"Delete\";s:4:\"name\";s:12:\"delete[$row]\";s:4:\"help\";s:21:\"delete this eTemplate\";}}}','size' => '','style' => '',); + +$templ_data[] = array('name' => 'etemplate.editor.buttons','template' => '','lang' => '','group' => '0','version' => '0.9.15.001','data' => 'a:2:{i:0;a:0:{}i:1;a:11:{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:4:{s:4:\"type\";s:6:\"button\";s:5:\"label\";s:10:\"Export XML\";s:4:\"name\";s:10:\"export_xml\";s:4:\"help\";s:43:\"export the loaded eTemplate into a xml-file\";}s:1:\"J\";a:1:{s:4:\"type\";s:5:\"label\";}s:1:\"K\";a:5:{s:4:\"type\";s:4:\"text\";s:4:\"size\";s:2:\"20\";s:5:\"label\";s:46:\"Width, Height, Border, class, Spacing, Padding\";s:4:\"name\";s:4:\"size\";s:4:\"help\";s:96:\"width, height, border-line-thickness, CSS-class name, Celspaceing, Cellpadding (for TABLE tag), \";}}}','size' => '','style' => '',); + diff --git a/etemplate/setup/phpgw_en.lang b/etemplate/setup/phpgw_en.lang index 0a7b67d5a8..a58cfd6f65 100644 --- a/etemplate/setup/phpgw_en.lang +++ b/etemplate/setup/phpgw_en.lang @@ -71,6 +71,8 @@ error: while saveing !!! etemplate en Error: while saveing !!! etemplate editor etemplate en eTemplate Editor exchange this two columns etemplate en exchange this two columns exchange this two rows etemplate en exchange this two rows +export the loaded etemplate into a xml-file etemplate en export the loaded eTemplate into a xml-file +export xml etemplate en Export XML extensions loaded: etemplate en Extensions loaded: familyname etemplate en Familyname fax etemplate en Fax diff --git a/etemplate/templates/default/etemplate.db-tools.cols.xul b/etemplate/templates/default/etemplate.db-tools.cols.xul new file mode 100644 index 0000000000..69fe941a90 --- /dev/null +++ b/etemplate/templates/default/etemplate.db-tools.cols.xul @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + +