Overview

Packages

  • None
  • Wicked

Classes

  • Text_Wiki_Parse_Attribute
  • Text_Wiki_Parse_Code2
  • Text_Wiki_Parse_Freelink2
  • Text_Wiki_Parse_Image2
  • Text_Wiki_Parse_Registrylink
  • Text_Wiki_Parse_Wickedblock
  • Text_Wiki_Parse_Wikilink2
  • Wicked_Application
  • Wicked_Block_Page
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Wicked application API.
 4:  *
 5:  * This file defines Horde's core API interface. Other core Horde libraries
 6:  * can interact with Wicked through this API.
 7:  *
 8:  * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
 9:  *
10:  * See the enclosed file COPYING for license information (GPL). If you
11:  * did not receive this file, see http://www.horde.org/licenses/gpl.
12:  *
13:  * @package Wicked
14:  */
15: 
16: /* Determine the base directories. */
17: if (!defined('WICKED_BASE')) {
18:     define('WICKED_BASE', dirname(__FILE__) . '/..');
19: }
20: 
21: if (!defined('HORDE_BASE')) {
22:     /* If Horde does not live directly under the app directory, the HORDE_BASE
23:      * constant should be defined in config/horde.local.php. */
24:     if (file_exists(WICKED_BASE . '/config/horde.local.php')) {
25:         include WICKED_BASE . '/config/horde.local.php';
26:     } else {
27:         define('HORDE_BASE', WICKED_BASE . '/..');
28:     }
29: }
30: 
31: /* Load the Horde Framework core (needed to autoload
32:  * Horde_Registry_Application::). */
33: require_once HORDE_BASE . '/lib/core.php';
34: 
35: class Wicked_Application extends Horde_Registry_Application
36: {
37:     /**
38:      */
39:     public $version = 'H4 (1.0.3-git)';
40: 
41:     /**
42:      * Global variables defined:
43:      * - $wicked:   The Wicked_Driver object.
44:      * - $linkTags: <link> tags for common-header.inc.
45:      */
46:     protected function _init()
47:     {
48:         $GLOBALS['injector']->bindFactory('Wicked_Driver', 'Wicked_Factory_Driver', 'create');
49:         $GLOBALS['wicked'] = $GLOBALS['injector']->getInstance('Wicked_Driver');
50:         $GLOBALS['linkTags'] = array('<link href="' . Horde::url('opensearch.php', true, -1) . '" rel="search" type="application/opensearchdescription+xml" title="' . $GLOBALS['registry']->get('name') . ' (' . Horde::url('', true) . ')" />');
51:     }
52: 
53:     /**
54:      */
55:     public function perms()
56:     {
57:         $perms = array(
58:             'pages' => array(
59:                 'title' => _("Pages")
60:             )
61:         );
62: 
63:         foreach (array('AllPages', 'LeastPopular', 'MostPopular', 'RecentChanges') as $val) {
64:             $perms['pages:' . $val] = array(
65:                 'title' => $val
66:             );
67:         }
68: 
69:         try {
70:             $pages = $GLOBALS['wicked']->getPages();
71:             sort($pages);
72:             foreach ($pages as $pagename) {
73:                 $perms['pages:' .$GLOBALS['wicked']->getPageId($pagename)] = array(
74:                     'title' => $pagename
75:                 );
76:             }
77:         } catch (Wicked_Exception $e) {}
78: 
79:         return $perms;
80:     }
81: 
82: }
83: 
API documentation generated by ApiGen