Changeset 11487


Ignore:
Timestamp:
06/22/11 18:38:58 (8 years ago)
Author:
mistic100
Message:

feature:2322 display all localisations as independant tags in TokenInput

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r11317 r11487  
    21052105  while ($row = pwg_db_fetch_assoc($result)) 
    21062106  { 
    2107     array_push( 
    2108       $taglist, 
    2109       array( 
    2110         'name' => trigger_event('render_tag_name', $row['tag_name']), 
    2111         'id' => '~~'.$row['tag_id'].'~~', 
    2112         ) 
    2113       ); 
     2107    if (preg_match_all('#\[lang=(.*?)\](.*?)\[/lang\]#is', $row['tag_name'], $matches)) 
     2108    { 
     2109      foreach ($matches[2] as $tag_name) 
     2110      { 
     2111        array_push( 
     2112          $taglist, 
     2113          array( 
     2114            'name' => trigger_event('render_tag_name', $tag_name), 
     2115            'id' => '~~'.$row['tag_id'].'~~', 
     2116            ) 
     2117          ); 
     2118      } 
     2119 
     2120      $row['tag_name'] = preg_replace('#\[lang=(.*?)\](.*?)\[/lang\]#is', null, $row['tag_name']); 
     2121    } 
     2122     
     2123    if (strlen($row['tag_name']) > 0) 
     2124    { 
     2125      array_push( 
     2126        $taglist, 
     2127        array( 
     2128          'name' => trigger_event('render_tag_name', $row['tag_name']), 
     2129          'id' => '~~'.$row['tag_id'].'~~', 
     2130          ) 
     2131        ); 
     2132    } 
    21142133  } 
    21152134   
    21162135  $cmp = create_function('$a,$b', 'return strcasecmp($a["name"], $b["name"]);'); 
    21172136  usort($taglist, $cmp); 
    2118    
     2137 
    21192138  return $taglist; 
    21202139} 
  • trunk/admin/tags.php

    r11317 r11487  
    222222foreach ($orphan_tags as $tag) 
    223223{ 
    224   array_push($orphan_tag_names, $tag['name']); 
     224  array_push($orphan_tag_names, trigger_event('render_tag_name', $tag['name'])); 
    225225} 
    226226 
Note: See TracChangeset for help on using the changeset viewer.