includes/render.php
changeset 136 f2ee42f026f7
parent 133 af0f6ec48de3
child 142 ca9118d9c0f2
equal deleted inserted replaced
135:c5dbad7ec2d0 136:f2ee42f026f7
    17   
    17   
    18   function strToPageID($string)
    18   function strToPageID($string)
    19   {
    19   {
    20     global $db, $session, $paths, $template, $plugins; // Common objects
    20     global $db, $session, $paths, $template, $plugins; // Common objects
    21     $k = array_keys($paths->nslist);
    21     $k = array_keys($paths->nslist);
       
    22     $proj_alt = 'Project:';
       
    23     if ( substr($string, 0, (strlen($proj_alt))) == $proj_alt )
       
    24     {
       
    25       $ns = 'Project';
       
    26       $pg = substr($string, strlen($proj_alt), strlen($string));
       
    27       return Array($pg, $ns);
       
    28     }
    22     for($i=0;$i<sizeof($paths->nslist);$i++)
    29     for($i=0;$i<sizeof($paths->nslist);$i++)
    23     {
    30     {
    24       $ln = strlen($paths->nslist[$k[$i]]);
    31       $ln = strlen($paths->nslist[$k[$i]]);
    25       if(substr($string, 0, $ln) == $paths->nslist[$k[$i]])
    32       if(substr($string, 0, $ln) == $paths->nslist[$k[$i]])
    26       {
    33       {
   424    * @return string
   431    * @return string
   425    */
   432    */
   426   
   433   
   427   function parse_internal_links($text)
   434   function parse_internal_links($text)
   428   {
   435   {
       
   436     global $db, $session, $paths, $template, $plugins; // Common objects
   429     
   437     
   430     // stage 1 - links with alternate text
   438     // stage 1 - links with alternate text
   431     preg_match_all('/\[\[([^\[\]<>\{\}\|]+)\|(.+?)\]\]/', $text, $matches);
   439     preg_match_all('/\[\[([^\[\]<>\{\}\|]+)\|(.+?)\]\]/', $text, $matches);
   432     foreach ( $matches[0] as $i => $match )
   440     foreach ( $matches[0] as $i => $match )
   433     {
   441     {