C:\xampp2_not used\php\pear\Text\Wiki\Render\Latex\Wikilink.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php

class Text_Wiki_Render_Latex_Wikilink extends Text_Wiki_Render {
    var 
$conf = array(
        
'pages' => array(),
        
'view_url' => 'http://example.com/index.php?page=%s',
        
'new_url'  => 'http://example.com/new.php?page=%s',
        
'new_text' => '?'
    
);

    
/**
    *
    * Renders a token into XHTML.
    *
    * @access public
    *
    * @param array $options The "options" portion of the token (second
    * element).
    *
    * @return string The text rendered from the token options.
    *
    */

    
function token($options)
    {
        
// make nice variable names (page, anchor, text)
        
extract($options);

        
// are we checking page existence?
        
$list $this->getConf('pages');
        if (
is_array($list)) {
            
// yes, check against the page list
            
$exists in_array($page$list);
        } else {
            
// no, assume it exists
            
$exists true;
        }

        
// convert *after* checking against page names so as not to mess
        // up what the user typed and what we're checking.
        
$page $this->textEncode($page);
        
$anchor $this->textEncode($anchor);
        
$text $this->textEncode($text);

        
$href $this->getConf('view_url');

        if (
strpos($href'%s') === false) {
            
// use the old form (page-at-end)
            
$href $href $page $anchor;
        } else {
            
// use the new form (sprintf format string)
            
$href sprintf($href$page $anchor);
        }

        
// get the CSS class and generate output
        
$css $this->formatConf(' class="%s"''css');
        return 
$text '\footnote{' $href '}';
    }
}
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586