Changeset 6584

Show
Ignore:
Timestamp:
09/06/08 22:37:04 (5 years ago)
Author:
p_lindheimer
Message:

re #3166 and re #2461 the remove the linefeed that the xml parser inserts before and after an ampersand in menuitems and catagories so that translations can have a better chance of matching

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.5/amp_conf/htdocs/admin/functions.inc.php

    r6578 r6584  
    31823182    if (isset($xmlarray['module'])) { 
    31833183      // add a couple fields first 
    3184       $xmlarray['module']['displayname'] = $xmlarray['module']['name']
     3184      $xmlarray['module']['displayname'] = str_replace("\n&\n","&",$xmlarray['module']['name'])
    31853185      if (isset($xmlarray['module']['menuitems'])) { 
    31863186         
    31873187        foreach ($xmlarray['module']['menuitems'] as $item=>$displayname) { 
     3188          $displayname = str_replace("\n&\n","&",$displayname); 
     3189          $xmlarray['module']['menuitems'][$item] = $displayname; 
    31883190          $path = '/module/menuitems/'.$item; 
    31893191           
    31903192          // find category 
    31913193          if (isset($parser->attributes[$path]['category'])) { 
    3192             $category = $parser->attributes[$path]['category']
     3194            $category = str_replace("\n&\n","&",$parser->attributes[$path]['category'])
    31933195          } else if (isset($xmlarray['module']['category'])) { 
    3194             $category = $xmlarray['module']['category']
     3196            $category = str_replace("\n&\n","&",$xmlarray['module']['category'])
    31953197          } else { 
    31963198            $category = 'Basic'; 
     
    32453247        } 
    32463248      } 
    3247        
    32483249      return $xmlarray['module']; 
    32493250    } 
     
    35383539    $notifications->delete('freepbx', 'modules_broken'); 
    35393540  } 
     3541} 
     3542 
     3543/** Log a debug message to a debug file 
     3544 * @param  string   debug message to be printed 
     3545 * @param  string   optional mode, default 'a' 
     3546 * @param  string   optinal filename, default /tmp/freepbx_debug.log 
     3547 */ 
     3548function freepbx_debug($string, $option='a', $filename='/tmp/freepbx_debug.log') { 
     3549  $fh = fopen($filename,$option); 
     3550  fwrite($fh,$string."\n"); 
     3551  fclose($fh); 
    35403552} 
    35413553