commit bf921ae0db288df936581f5129d7f091c86f4811
parent 66d86e20483061b4079936edeab268386dd5a6b1
Author: dankert <devnull@localhost>
Date: Tue, 3 Mar 2009 22:08:09 +0100
Umstellung der Baumanzeige auf Template-System (Ausbau RAW-Template).
Diffstat:
5 files changed, 38 insertions(+), 50 deletions(-)
diff --git a/actionClasses/TreeAction.class.php b/actionClasses/TreeAction.class.php
@@ -20,6 +20,9 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------
// $Log$
+// Revision 1.13 2009-03-03 21:08:09 dankert
+// Umstellung der Baumanzeige auf Template-System (Ausbau RAW-Template).
+//
// Revision 1.12 2007-11-08 23:11:58 dankert
// SubAction "load()" reaktiviert.
//
@@ -135,8 +138,6 @@ class TreeAction extends Action
}
Session::setTree( $this->tree );
-
- // Weiter mit show()
}
@@ -156,7 +157,8 @@ class TreeAction extends Action
{
if ( $isLast[$i] )
$zeile['cols'][] = 'blank';
- else $zeile['cols'][] = 'line';
+ else
+ $zeile['cols'][] = 'line';
}
if ( $tiefe == 0 )
@@ -205,7 +207,8 @@ class TreeAction extends Action
if ( $treeElement->target != "" )
$zeile['target'] = $treeElement->target;
else $zeile['target'] = 'cms_main';
-
+
+ $zeile['colspan'] = 20 - count( $zeile['cols'] );
$zeilen[] = $zeile;
// Rekursiv alle Unter-Elemente lesen
@@ -235,20 +238,10 @@ class TreeAction extends Action
$tree_last,
$var;
- $var['zeilen']=array();
-
-// echo '<pre>';
-// print_r($tree);
-// echo '</pre>';
-
+ $var['zeilen'] = array();
$var['zeilen'] = $this->outputElement( 0,0,array() );
-// echo '<pre>';
-// print_r($var['zeilen']);
-// echo '</pre>';
-
$this->setTemplateVars( $var );
- $this->forward('tree');
}
}
diff --git a/themes/default/include/elements.ini.php b/themes/default/include/elements.ini.php
@@ -18,13 +18,13 @@ hidden = name:*,default
editor = name:*,type:*
else =
if = equals,value,invert,not,empty,present,contains,greaterthan,lessthan,true,false
-image = config,file,url,icon,align:left,type,elementtype,fileext
+image = config,file,url,icon,align:left,type,elementtype,fileext,tree
input = class:,default:,type:text,index,name:*,prefix,value,size:40,maxlength:256,onchange:,readonly:false
inputarea= name,rows:10,cols:40,value,index,onchange,prefix,class:,default:
insert = file:*
label = for:*,value
fieldset = title
-link = title:,config,target:_self,var,url,class:,action,subaction,id,var1,value1,var2,value2,var3,value3,var4,value4,var5,value5,accesskey
+link = title:,config,target:_self,var,url,class:,action,subaction,id,var1,value1,var2,value2,var3,value3,var4,value4,var5,value5,accesskey,name,anchor
list = list:*,extract:false,key:list_key,value:list_value
logo = name:*
newline =
diff --git a/themes/default/include/html/image.inc.php b/themes/default/include/html/image.inc.php
@@ -5,6 +5,8 @@ if (isset($attr_elementtype)) {
?><img src="<?php echo $image_dir.'icon_'.$attr_type.IMG_ICON_EXT ?>" border="0" align="<?php echo $attr_align ?>"><?php
} elseif (isset($attr_icon)) {
?><img src="<?php echo $image_dir.'icon_'.$attr_icon.IMG_ICON_EXT ?>" border="0" align="<?php echo $attr_align ?>"><?php
+} elseif (isset($attr_tree)) {
+?><img src="<?php echo $image_dir.'tree_'.$attr_tree.IMG_EXT ?>" border="0" align="<?php echo $attr_align ?>"><?php
} elseif (isset($attr_url)) {
?><img src="<?php echo $attr_url ?>" border="0" align="<?php echo $attr_align ?>"><?php
} elseif (isset($attr_fileext)) {
diff --git a/themes/default/include/html/link.inc.php b/themes/default/include/html/link.inc.php
@@ -19,4 +19,6 @@
$tmp_url = $attr_url;
else
$tmp_url = Html::url($attr_action,$attr_subaction,!empty($attr_id)?$attr_id:$this->getRequestId(),$params);
-?><a href="<?php echo $tmp_url ?>" class="<?php echo $attr_class ?>" target="<?php echo $attr_target ?>"<?php if (isset($attr_accesskey)) echo ' accesskey="'.$attr_accesskey.'"' ?> title="<?php echo encodeHtml($attr_title) ?>">-
\ No newline at end of file
+
+
+?><a<?php if (isset($attr_name)) echo ' name="'.$attr_name.'"'; else echo ' href="'.$tmp_url.($attr_anchor?'#'.$attr_anchor:'').'"' ?> class="<?php echo $attr_class ?>" target="<?php echo $attr_target ?>"<?php if (isset($attr_accesskey)) echo ' accesskey="'.$attr_accesskey.'"' ?> title="<?php echo encodeHtml($attr_title) ?>">+
\ No newline at end of file
diff --git a/themes/default/templates/tree/show.tpl.src.php b/themes/default/templates/tree/show.tpl.src.php
@@ -1,33 +1,24 @@
page class:tree
-RAW
-<!-- $Id$ -->
-
-<table cellpadding="0" cellspacing="0" border="0">
-
-<?php foreach( $zeilen as $z )
- { ?>
-<tr>
-
-<?php if (is_array($z['cols'])) foreach( $z['cols'] as $i )
- { ?>
-<td width="1%"><img src="<?php echo $image_dir.'tree_'.$i.IMG_EXT ?>" border="0" alt=""></td>
-<?php } ?>
-
-<?php if (isset($z['image']))
- { ?>
-<td width="1%">
-<?php if (isset($z['image_url'])) { ?><a href="<?php echo $z['image_url'].'#'.$z['name'] ?>" class="tree" target="_self" title="<?php echo encodeHtml($z['image_url_desc']) ?>"><?php } ?><img src="<?php echo $image_dir.'tree_'.$z['image'].IMG_EXT ?>" alt="" border="0"><?php if (isset($z['image_url'])) { ?></a><?php } ?>
-</td>
-<?php } ?>
-
-<td colspan="<?php echo intval(20-count($z['cols'])) ?>" id="<?php echo $z['name'] ?>" valign="middle" style="white-space:nowrap;">
-<a name="<?php echo $z['name'] ?>"></a>
-<?php if (isset($z['url'])) { ?><a href="<?php echo $z['url'] ?>" <?php if($z['desc']!='') echo 'title="'.encodeHtml($z['desc']).'" ' ?>class="tree" target="<?php echo $z['target'] ?>"><?php } ?><img src="<?php echo $image_dir.'icon_'.$z['icon'].IMG_ICON_EXT ?>" border="0" alt="" align="left"><?php echo $z['text'] ?><?php if (isset($z['url'])) { ?></a><?php if(isset($z['add'])) echo ' <small>'.$z['add'].'<small>' ?><?php } ?>
-</td>
-
-</tr>
-<?php } ?>
-
-</table>
-END
+ table space:0 padding:0 class:tree
+ list list:zeilen extract:true
+ row
+ list list:cols value:i
+ cell class:treecol
+ image tree:var:i
+ if present:image
+ cell class:treeimage
+ if present:image_url
+ link url:var:image_url class:tree target:_self title:image_url_desc anchor:var:name
+ image tree:var:image
+ else
+ image tree:var:image
+ cell colspan:var:colspan class:treevalue
+ link name:var:name
+ if present:url
+ link url:var:url title:var:desc class:tree target:var:target
+ image icon:var:icon
+ text var:text
+ else
+ image icon:var:icon
+ text var:text