Show
Ignore:
Timestamp:
04/29/2008 10:22:48 PM (2 years ago)
Author:
BrianKoontz
Message:

Standard phpdoc header and lang strings added; user-friendly error
message displayed if target page not accessible. Refs #710, #749.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.1.6.5/actions/include.php

    r836 r1060  
    11<?php 
     2/** 
     3 * Include contents of a target page at the point of invocation  
     4 * 
     5 * @package             Actions 
     6 * @version             $Id$ 
     7 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
     8 * @filesource 
     9 * 
     10 * @uses                Wakka::HasAccess() 
     11 * @uses                Wakka::LoadPage() 
     12 * @uses                Wakka::Format() 
     13 */ 
     14 
     15// defaults 
     16if(!defined('ERROR_CIRCULAR_REF')) define('ERROR_CIRCULAR_REF', 'Circular reference detected'); 
     17if(!defined('ERROR_TARGET_ACL')) define('ERROR_TARGET_ACL', "You aren't allowed to read included page <tt>%s</tt>"); 
    218 
    319if (!$page) $page = $wikka_vars; 
     20$orig_page = $page; 
    421$page = strtolower($page); 
    522if (!$this->config["includes"]) $this->config["includes"][] = strtolower($this->tag); 
     
    1128                print $this->Format($page["body"]); 
    1229        } 
    13 } else print "<em class='error'>Circular reference detected</em>"; 
     30        else printf("<em class='error'>".ERROR_TARGET_ACL."</em>", $orig_page); 
     31} else print "<em class='error'>".ERROR_CIRCULAR_REF."</em>"; 
    1432 
    1533?>