includes/render.php
changeset 326 ab66d6d1f1f4
parent 313 854eecfada20
parent 322 5f1cd51bf1be
child 335 67bd3121a12e
equal deleted inserted replaced
314:474f8be55943 326:ab66d6d1f1f4
     1 <?php
     1 <?php
     2 
     2 
     3 /*
     3 /*
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
     5  * Version 1.0.2 (Coblynau)
     5  * Version 1.0.3 (Dyrad)
     6  * Copyright (C) 2006-2007 Dan Fuhry
     6  * Copyright (C) 2006-2007 Dan Fuhry
     7  * render.php - handles fetching pages and parsing them into HTML
     7  * render.php - handles fetching pages and parsing them into HTML
     8  *
     8  *
     9  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
     9  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
    10  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    10  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    42   {
    42   {
    43     global $db, $session, $paths, $template, $plugins; // Common objects
    43     global $db, $session, $paths, $template, $plugins; // Common objects
    44     
    44     
    45     $perms =& $session;
    45     $perms =& $session;
    46     
    46     
    47     if ( $page_id != $paths->cpage['urlname_nons'] || $namespace != $paths->namespace )
    47     if ( $page_id != $paths->page_id || $namespace != $paths->namespace )
    48     {
    48     {
    49       unset($perms);
    49       unset($perms);
    50       unset($perms); // PHP <5.1.5 Zend bug
    50       unset($perms); // PHP <5.1.5 Zend bug
    51       $perms = $session->fetch_page_acl($page_id, $namespace);
    51       $perms = $session->fetch_page_acl($page_id, $namespace);
    52     }
    52     }
   887         $clear_text = '';
   887         $clear_text = '';
   888         if ( !empty($clear) )
   888         if ( !empty($clear) )
   889         {
   889         {
   890           $side = ( $clear == '|left' ) ? 'left' : 'right';
   890           $side = ( $clear == '|left' ) ? 'left' : 'right';
   891           $opposite = ( $clear == '|left' ) ? 'right' : 'left';
   891           $opposite = ( $clear == '|left' ) ? 'right' : 'left';
   892           $clear_text .= "float: $side; margin-$opposite: 20px;";
   892           $clear_text .= "float: $side; margin-$opposite: 20px; width: {$r_width}px;";
   893           $complete_tag .= 'style="' . $clear_text . '" ';
   893           $complete_tag .= 'style="' . $clear_text . '" ';
   894         }
   894         }
   895         $complete_tag .= '>';
   895         $complete_tag .= '>';
   896         
   896         
   897         $complete_tag .= '<a href="' . makeUrlNS('File', $filename) . '" style="display: block;">';
   897         $complete_tag .= '<a href="' . makeUrlNS('File', $filename) . '" style="display: block;">';