[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: etemplate/inc class.xul_io.inc.php,1.3,1.4
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: etemplate/inc class.xul_io.inc.php,1.3,1.4 |
Date: |
Thu, 12 Sep 2002 17:43:44 -0400 |
Update of /cvsroot/phpgroupware/etemplate/inc
In directory subversions:/tmp/cvs-serv24393
Modified Files:
class.xul_io.inc.php
Log Message:
added tab and image import/export
the label's get now exported as <description ...>
Index: class.xul_io.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.xul_io.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.xul_io.inc.php 12 Sep 2002 17:57:27 -0000 1.3
--- class.xul_io.inc.php 12 Sep 2002 21:43:41 -0000 1.4
***************
*** 34,38 ****
$this->widget2xul = array( // how to translate
widget-names and widget-spec. attr.
'label' => array(
! '.name' => 'label',
'label' => 'value'
),
--- 34,38 ----
$this->widget2xul = array( // how to translate
widget-names and widget-spec. attr.
'label' => array(
! '.name' => 'description',
'label' => 'value'
),
***************
*** 62,69 ****
'.name' => 'grid',
'size' => 'content'
)
);
$this->xul2widget = array(
! 'menupopup' => 'select'
);
}
--- 62,77 ----
'.name' => 'grid',
'size' => 'content'
+ ),
+ 'image' => array(
+ '.name' => 'image',
+ 'label' => 'src'
+ ),
+ 'tab' => array(
+ '.name' => 'tabbox,tabs,tabpanels'
)
);
$this->xul2widget = array(
! 'menupopup' => 'select',
! 'description' => 'label'
);
}
***************
*** 144,150 ****
$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
{
--- 152,163 ----
$widgetattr2xul =
isset($this->widget2xul[$type]) ? $this->widget2xul[$type] : array();
$type = isset($widgetattr2xul['.name'])
? $widgetattr2xul['.name'] : $type;
! list($parent,$child,$child2) =
explode(',',$type);
$widget = new xmlnode($child ? $child :
$parent);
! if ($child2)
! {
! $child2 = new xmlnode($child2);
! $child = $widget;
! $widget = new xmlnode($parent);
! }
if (isset($widgetattr2xul['.set']))
// set default-attr for type
{
***************
*** 156,159 ****
--- 169,189 ----
}
}
+ if ($parent == 'tabbox')
+ {
+ $labels =
explode('|',$cell['label']); unset($cell['label']);
+ $helps =
explode('|',$cell['help']); unset($cell['help']);
+ $names =
explode('|',$cell['name']); unset($cell['name']);
+ for ($n = 0; $n <
count($labels); ++$n)
+ {
+ $tab = new
xmlnode('tab');
+
$tab->set_attribute('label',$labels[$n]);
+
$tab->set_attribute('statustext',$helps[$n]);
+ $child->add_node($tab);
+
+ $grid = new
xmlnode('grid');
+
$grid->set_attribute('id',$names[$n]);
+
$child2->add_node($grid);
+ }
+ }
while (list($attr,$val) = each($cell))
{
***************
*** 172,176 ****
$this->set_attributes($widget,$attr,$val,&$spanned);
}
! if ($child)
{
$parent = new xmlnode($parent);
--- 202,206 ----
$this->set_attributes($widget,$attr,$val,&$spanned);
}
! if ($child && !$child2)
{
$parent = new xmlnode($parent);
***************
*** 180,183 ****
--- 210,218 ----
else
{
+ if ($child2)
+ {
+
$widget->add_node($child);
+
$widget->add_node($child2);
+ }
$xul_row->add_node($widget);
}
***************
*** 237,241 ****
$attr['name'] = $attr['id'];
unset($attr['id']);
}
! if ($tag == 'grid' && $type == 'complete')
{
$tag = 'template';
--- 272,276 ----
$attr['name'] = $attr['id'];
unset($attr['id']);
}
! if ($tag == 'grid' && $type == 'complete' &&
!is_array($tab_attr))
{
$tag = 'template';
***************
*** 252,255 ****
--- 287,295 ----
{
case 'grid':
+ if ($type != 'close' &&
is_array($tab_attr))
+ {
+ $tab_names[] =
$attr['name'];
+ break;
+ }
if ($node['level'] > 2) //
level 1 is the overlay
{
***************
*** 292,296 ****
break;
case 'styles':
! $etempl->style = $node['value'];
break;
case 'textbox':
--- 332,370 ----
break;
case 'styles':
! $etempl->style =
trim($node['value']);
! break;
! case 'tabbox':
! if ($type == 'open')
! {
! $tab_labels =
$tab_helps = $tab_names = array();
! $tab_attr = $attr;
! }
! else
! {
! $tab_attr['type'] =
'tab';
! $tab_attr['label'] =
implode('|',$tab_labels);
! $tab_attr['name'] =
implode('|',$tab_names);
! $tab_attr['help'] =
implode('|',$tab_helps);
! $spanned =
$tab_attr['span'] == 'all' ? $etempl->cols - $col : $tab_attr['span'];
! $tab_attr['span'] .=
$tab_attr['class'] ? ','.$tab_attr['class'] : '';
!
unset($tab_attr['class']);
!
$etempl->data[$etempl->rows][$etempl->num2chrs($col++)] = $tab_attr;
! unset($tab_attr);
!
! while (--$spanned > 0)
! {
!
$etempl->data[$etempl->rows][$etempl->num2chrs($col++)] = $etempl->empty_cell();
! }
! }
! break;
! case 'tabs':
! case 'tabpanels':
! break;
! case 'tab':
! if ($type != 'close')
! {
! $tab_labels[] =
$attr['label'];
! $tab_helps[] =
$attr['statustext'];
! }
break;
case 'textbox':
***************
*** 318,322 ****
switch ($tag)
{
! case 'label':
$attr['label']
= $attr['value'];
unset($attr['value']);
--- 392,396 ----
switch ($tag)
{
! case 'description':
$attr['label']
= $attr['value'];
unset($attr['value']);
***************
*** 325,328 ****
--- 399,406 ----
$attr['size'] =
$attr['content'];
unset($attr['content']);
+ break;
+ case 'image':
+ $attr['label']
= $attr['src'];
+
unset($attr['src']);
break;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: etemplate/inc class.xul_io.inc.php,1.3,1.4,
Ralf Becker <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: etemplate/doc referenz.html,NONE,1.1 etemplate.html,1.11,1.12
- Next by Date:
[Phpgroupware-cvs] CVS: etemplate/inc class.xul_io.inc.php,1.4,1.5
- Previous by thread:
[Phpgroupware-cvs] CVS: etemplate/doc referenz.html,NONE,1.1 etemplate.html,1.11,1.12
- Next by thread:
[Phpgroupware-cvs] CVS: etemplate/inc class.xul_io.inc.php,1.4,1.5
- Index(es):