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:  * Wicked LikePages class.
 4:  *
 5:  * Copyright 2003-2012 Horde LLC (http://www.horde.org/)
 6:  *
 7:  * See the enclosed file COPYING for license information (GPL). If you
 8:  * did not receive this file, see http://www.horde.org/licenses/gpl.
 9:  *
10:  * @author  Tyler Colbert <tyler@colberts.us>
11:  * @package Wicked
12:  */
13: class Wicked_Page_LikePages extends Wicked_Page {
14: 
15:     /**
16:      * Display modes supported by this page.
17:      *
18:      * @var array
19:      */
20:     public $supportedModes = array(
21:         Wicked::MODE_DISPLAY => true);
22: 
23:     /**
24:      * The page that we're displaying similar pages to.
25:      *
26:      * @var string
27:      */
28:     protected $_referrer = null;
29: 
30:     public function __construct($referrer)
31:     {
32:         $this->_referrer = $referrer;
33:     }
34: 
35:     /**
36:      * Renders this page in display or block mode.
37:      *
38:      * @return string  The contents.
39:      * @throws Wicked_Exception
40:      */
41:     public function displayContents($isBlock)
42:     {
43:         $referrer = $this->referrer();
44:         $summaries = $GLOBALS['wicked']->getLikePages($referrer);
45:         Horde::addScriptFile('tables.js', 'horde', true);
46:         ob_start();
47:         require WICKED_TEMPLATES . '/pagelist/header.inc';
48:         foreach ($summaries as $page) {
49:             if (!empty($page['page_history'])) {
50:                 $page = new Wicked_Page_StandardHistoryPage($page);
51:             } else {
52:                 $page = new Wicked_Page_StandardPage($page);
53:             }
54:             require WICKED_TEMPLATES . '/pagelist/summary.inc';
55:         }
56:         require WICKED_TEMPLATES . '/pagelist/footer.inc';
57:         return ob_get_clean();
58:     }
59: 
60:     public function pageName()
61:     {
62:         return 'LikePages';
63:     }
64: 
65:     public function pageTitle()
66:     {
67:         return sprintf(_("Similar Pages: %s"), $this->referrer());
68:     }
69: 
70:     public function referrer()
71:     {
72:         return $this->_referrer;
73:     }
74: 
75: }
76: 
API documentation generated by ApiGen