Overview

Packages

  • None
  • Wicked

Classes

  • Text_Wiki_Parse_Heading2
  • Text_Wiki_Parse_Toc2
  • Text_Wiki_Render_Latex_Heading2
  • Text_Wiki_Render_Latex_Toc2
  • Text_Wiki_Render_Plain_Heading2
  • Text_Wiki_Render_Plain_Toc2
  • Text_Wiki_Render_Rst
  • Text_Wiki_Render_Rst_Blockquote
  • Text_Wiki_Render_Rst_Bold
  • Text_Wiki_Render_Rst_Code
  • Text_Wiki_Render_Rst_Deflist
  • Text_Wiki_Render_Rst_Emphasis
  • Text_Wiki_Render_Rst_Freelink
  • Text_Wiki_Render_Rst_Heading2
  • Text_Wiki_Render_Rst_Links
  • Text_Wiki_Render_Rst_List
  • Text_Wiki_Render_Rst_Newline
  • Text_Wiki_Render_Rst_Paragraph
  • Text_Wiki_Render_Rst_Raw
  • Text_Wiki_Render_Rst_Toc2
  • Text_Wiki_Render_Rst_Tt
  • Text_Wiki_Render_Rst_Url
  • Text_Wiki_Render_Xhtml_Attribute
  • Text_Wiki_Render_Xhtml_Code2
  • Text_Wiki_Render_Xhtml_Freelink2
  • Text_Wiki_Render_Xhtml_Heading2
  • Text_Wiki_Render_Xhtml_Image2
  • Text_Wiki_Render_Xhtml_Interwiki
  • Text_Wiki_Render_Xhtml_Registrylink
  • Text_Wiki_Render_Xhtml_Toc2
  • Text_Wiki_Render_Xhtml_Url
  • Text_Wiki_Render_Xhtml_Wickedblock
  • Text_Wiki_Render_Xhtml_Wikilink2
  • Wicked
  • Wicked_Api
  • Wicked_Driver
  • Wicked_Driver_Sql
  • Wicked_Exception
  • Wicked_Factory_Driver
  • Wicked_Page
  • Wicked_Page_AddPage
  • Wicked_Page_AllPages
  • Wicked_Page_AttachedFiles
  • Wicked_Page_BackLinks
  • Wicked_Page_DeletePage
  • Wicked_Page_EditPage
  • Wicked_Page_LeastPopular
  • Wicked_Page_LikePages
  • Wicked_Page_MergeOrRename
  • Wicked_Page_MostPopular
  • Wicked_Page_NewPage
  • Wicked_Page_RecentChanges
  • Wicked_Page_RevertPage
  • Wicked_Page_Search
  • Wicked_Page_StandardHistoryPage
  • Wicked_Page_StandardPage
  • Wicked_Page_SyncDiff
  • Wicked_Page_SyncPages
  • Wicked_Sync
  • Wicked_Sync_Wicked
  • Wicked_Test
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * @package Wicked
 4:  */
 5: class Text_Wiki_Render_Xhtml_Attribute extends Text_Wiki_Render
 6: {
 7:     /**
 8:      * Renders a token into text matching the requested format.
 9:      *
10:      * @param array $options  The "options" portion of the token (second
11:      *                        element).
12:      *
13:      * @return string  The text rendered from the token options.
14:      */
15:     public function token($options)
16:     {
17:         $output = '<table width="100%" class="attributes"><tbody>';
18: 
19:         foreach ($options['attributes'] as $attribute) {
20: 
21:             $link = array('page' => $attribute['name'],
22:                           'anchor' => '',
23:                           'text' => $attribute['name']);
24: 
25:             // We should do full wiki formatting, I guess, but there isn't
26:             // a convenient way to do it.
27:             if (preg_match('/^(' . Wicked::REGEXP_WIKIWORD . ')$/',
28:                            $attribute['value'], $matches)) {
29:                 $vlink = array('page' => $matches[1],
30:                                'anchor' => '',
31:                                'text' => $matches[1]);
32:                 $value = $this->wiki->renderObj['Wikilink']->token($vlink);
33:             } elseif (preg_match('/^\(\((.*)\)\)$/', $attribute['value'],
34:                                  $matches)) {
35:                 $vlink = array('page' => $matches[1],
36:                                'anchor' => '',
37:                                'text' => $matches[1]);
38:                 $value = $this->wiki->renderObj['Wikilink']->token($vlink);
39:             } else {
40:                 $value = htmlspecialchars($attribute['value']);
41:             }
42: 
43:             $output .= '<tr><td width="1%" nowrap="nowrap"><strong><em>' .
44:                        $this->wiki->renderObj['Wikilink']->token($link) .
45:                        ' :</em></strong></td><td>' . $value .
46:                        '</td></tr>';
47:         }
48: 
49:         $output .= '</tbody></table>';
50: 
51:         return $output;
52:     }
53: }
54: 
API documentation generated by ApiGen