Re: [PHPTAL] [multi dimension array] problem with repeat

2009-02-22 Thread Torsten Hinze
Hi,

I think your current $options isn't well defined. If I have to create a
dictionary that contain a menu/submenu structure, then I had chose
something like that:
---
$options = array([mainNavItem1], [mainNavItem2], ...);

[mainNavItem] is defined as
array(
 'id' => 'mainnav1',
 'title' => 'MainNav 1',
 'icon' => 'image_for_mainnav1.png',
 'sub' => array([subNavItem1], [subNavItem2], ...),
 )
 
[subNavItem] has equal definition as [mainNavItem]
---
^^ So you can have unlimited subitem-levels and your TAL macro can walk
recusivly throught the array.

Sure you have to rewrite your navigation template, but you earn more
flexibility.

th

majkel schrieb:
> Yes exaclty. Array looks like this.
>  
> Greetings
> Majkel
> 
>
> ___
> PHPTAL mailing list
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>   

-- 
+=+
| Torsten Hinze - powered by Python   |
| --- |
| Ich suche noch Hilfebietende für ein deutsches  |
| Zope-Board, da viele Einsteiger erst nach Foren |
| suchen in denen sie ihre Frage stellen können.  |
| |
| URL: www.forum-hilfe.de/viewforum.php?f=65  |
+=+


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] [multi dimension array] problem with repeat

2009-02-22 Thread majkel
Yes exaclty. Array looks like this.

Greetings
Majkel
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] [multi dimension array] problem with repeat

2009-02-22 Thread Torsten Hinze
Hmmm ... I think your $options means this:

[ $options[0][0]
is the first menu item and his subitems are defined in $options[2]

[ $options[0][1]
is the first menu item and his subitems are defined in $options[2]

and so on

Is this right?

majkel schrieb:
> Hi to all.
> I am new on this list.
> I got the following problem
> I have an array:
>
> $options = array(array('t_products','t_users','t_orders','t_settings'),
> 
> array('products.png','user.png','orders.png','settings.png'),
> 
> array(array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
>array('t_manage1','t_linked','t_status')),
>  
> array(array('index-multi.php','index-multi.php','index-multi.php','index-multi.php'),
>   array('t_manage','Content 2 1
> 2','Content 2 1
> 3','Content 2 2 1')),
>  
> array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
> array('t_manage1','t_linked','t_status')),
> 
> array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
> array('t_manage1','t_linked','t_status')),
>
> and I want to generate such a menu:
>
> 
>   />t_products
>  
>  
>t_manage
>t_linked
>t_status
>  
>  
> 
> 
>   />t_users
>  
>t_manage
>Content 2 1 2
>Content 2 1 3
> 
>   
>   
> 
> ..
>
> etc..
>
> My script in SMARTY looks like this and works fine:
>
> 
>
>   {foreach from=$options[0] key="key" item="entry"}
>
>  src="../gfx/icons/{$options[1][$key]}"
> />{$options[0][$key]}
> 
> 
> {foreach from=$options[2][$key][0] key="key2"
> item="entry2"}
>href="{$entry2}">{$options[2][$key][1][$key2]}
> {/foreach}
> 
> 
>
>   {/foreach}
>   
> 
>
> My PHPTAL script (not complited):
>
>
>
>
>  src="../gfx/icons/${options/1/key}/" />${option}
> 
> 
> 
> 
> 
>
>   
> 
>
>
> How to access second row in array (
> array('products.png','user.png',...) )
> inside  to set proper path in  src=".">??
>
> Greetings
> Majkel
> 
>
> ___
> PHPTAL mailing list
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>   

-- 
+=+
| Torsten Hinze - powered by Python   |
| --- |
| Ich suche noch Hilfebietende für ein deutsches  |
| Zope-Board, da viele Einsteiger erst nach Foren |
| suchen in denen sie ihre Frage stellen können.  |
| |
| URL: www.forum-hilfe.de/viewforum.php?f=65  |
+=+


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] [multi dimension array] problem with repeat

2009-02-21 Thread majkel
Hi to all.
I am new on this list.
I got the following problem
I have an array:

$options = array(array('t_products','t_users','t_orders','t_settings'),
 array('products.png','user.png','orders.png','settings.png'),
 
array(array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
   array('t_manage1','t_linked','t_status')),
  
array(array('index-multi.php','index-multi.php','index-multi.php','index-multi.php'),
  array('t_manage','Content 2 1 2','Content 2 1 
3','Content 2 2 1')),
  
array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
array('t_manage1','t_linked','t_status')),
 
array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
array('t_manage1','t_linked','t_status')),

and I want to generate such a menu:


 t_products
 
 
   t_manage
   t_linked
   t_status
 
 


 t_users
 
   t_manage
   Content 2 1 2
   Content 2 1 3

  
  

..

etc..

My script in SMARTY looks like this and works fine:


   
  {foreach from=$options[0] key="key" item="entry"}
   
{$options[0][$key]}


{foreach from=$options[2][$key][0] key="key2" 
item="entry2"}
  {$options[2][$key][1][$key2]}
{/foreach}


   
  {/foreach}
  


My PHPTAL script (not complited):

   
   
   
${option}





   
  



How to access second row in array ( array('products.png','user.png',...) ) 
inside  to set proper path in ??

Greetings
Majkel
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


[PHPTAL] [multi dimension array] problem with repeat

2009-02-21 Thread majkel

Hi to all.
I am new on this list.
I got the following problem
I have an array:

$options = array(array('t_products','t_users','t_orders','t_settings'),
array('products.png','user.png','orders.png','settings.png'),

array(array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
  array('t_manage1','t_linked','t_status')),
 
array(array('index-multi.php','index-multi.php','index-multi.php','index-multi.php'),
 array('t_manage','Content 2 1 2','Content 2 1 
3','Content 2 2 1')),

 
array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
   array('t_manage1','t_linked','t_status')),

array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
   array('t_manage1','t_linked','t_status')),

and I want to generate such a menu:


/>t_products



  t_manage
  t_linked
  t_status




/>t_users


  t_manage
  Content 2 1 2
  Content 2 1 3
   
 
 

..

etc..

My script in SMARTY looks like this and works fine:


  
 {foreach from=$options[0] key="key" item="entry"}
  
   src="../gfx/icons/{$options[1][$key]}" />{$options[0][$key]}

   
   
   {foreach from=$options[2][$key][0] key="key2" 
item="entry2"}
 href="{$entry2}">{$options[2][$key][1][$key2]}

   {/foreach}
   
   
  
 {/foreach}
 


My PHPTAL script (not complited):

  
  
  
   src="../gfx/icons/${options/1/key}/" />${option}

   
   
   
   
   
  
 



How to access second row in array ( array('products.png','user.png',...) ) 
inside  to set proper path in src=".">??


Greetings
Majkel


___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal