Overview

Packages

  • Horde
    • Block
  • Klutz
  • None

Classes

  • Klutz_Application
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Klutz application API.
  4:  *
  5:  * This file defines Klutz's core API interface. Other core Horde libraries can
  6:  * interact with Klutz through this API.
  7:  *
  8:  * See the enclosed file COPYING for license information (GPL). If you
  9:  * did not receive this file, see http://www.horde.org/licenses/gpl.
 10:  *
 11:  * @package Klutz
 12:  */
 13: 
 14: /* Determine the base directories. */
 15: if (!defined('KLUTZ_BASE')) {
 16:     define('KLUTZ_BASE', dirname(__FILE__) . '/..');
 17: }
 18: 
 19: if (!defined('HORDE_BASE')) {
 20:     /* If Horde does not live directly under the app directory, the HORDE_BASE
 21:      * constant should be defined in config/horde.local.php. */
 22:     if (file_exists(KLUTZ_BASE . '/config/horde.local.php')) {
 23:         include KLUTZ_BASE . '/config/horde.local.php';
 24:     } else {
 25:         define('HORDE_BASE', KLUTZ_BASE . '/..');
 26:     }
 27: }
 28: 
 29: /* Load the Horde Framework core (needed to autoload
 30:  * Horde_Registry_Application::). */
 31: require_once HORDE_BASE . '/lib/core.php';
 32: 
 33: class Klutz_Application extends Horde_Registry_Application
 34: {
 35:     /**
 36:      */
 37:     public $version = 'H4 (2.0.0-git)';
 38: 
 39:     /**
 40:      * Global variables defined:
 41:      */
 42:     protected function _init()
 43:     {
 44:         $GLOBALS['registry']->setTimeZone();
 45: 
 46:         $GLOBALS['klutz'] = new Klutz();
 47:         $GLOBALS['klutz_driver'] = Klutz_Driver::factory();
 48:     }
 49: 
 50:     /**
 51:      */
 52:     public function perms()
 53:     {
 54:         return array(
 55:             'admin' => array(
 56:                 'title' => _("Administration"),
 57:             )
 58:         );
 59:     }
 60: 
 61:     /**
 62:      */
 63:     public function menu($menu)
 64:     {
 65:         global $conf, $injector;
 66: 
 67:         $today = Horde::url('comics.php');
 68:         $today = Horde_Util::addParameter($today, array('actionID' => 'day',
 69:                                                   'date' => mktime(0, 0, 0)));
 70: 
 71:         $me = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
 72: 
 73:         /* Klutz's menu items. */
 74:         $menu->add(Horde::url('comics.php'), _("_Browse"), 'klutz.png',
 75:                    null, '', null, ($me == $today) ? '__noselection' : (basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null));
 76: 
 77:         $menu->add($today, _("_Today"), 'today.png', null, '', null,
 78:                    ($me == $today) ? 'current' : '__noselection');
 79: 
 80:         if ($GLOBALS['registry']->isAdmin(array('permission' => 'klutz:admin'))) {
 81:             $menu->add(Horde::url('backend.php'), _("_Update"), 'klutz.png');
 82:         }
 83:     }
 84: 
 85:     public function prefsInit($ui)
 86:     {
 87:     }
 88: 
 89:     /**
 90:      */
 91:     public function prefsGroup($ui)
 92:     {
 93:         /*
 94: function handle_comic_select($updated)
 95: {
 96:     $viewcomics = Horde_Util::getFormData('viewcomics');
 97:     if (!is_null($viewcomics)) {
 98:         $GLOBALS['prefs']->setValue('viewcomics', $viewcomics);
 99:         return true;
100:     } else {
101:         return false;
102:     }
103: }
104: 
105: $comicgallery_options = array();
106: if (!$prefs->isLocked('comicgallery') &&
107:     $registry->hasMethod('images/listGalleries')) {
108: 
109:     $gals = $registry->call('images/listGalleries', array(null, PERMS_EDIT));
110:     foreach ($gals as $key => $gal) {
111:         $comicgallery_options[$key] = $gal['attribute_name'];
112:     }
113: }
114:         */
115:     }
116: 
117:     /**
118:      */
119:     public function prefsSpecial($ui, $item)
120:     {
121:     }
122: 
123:     /**
124:      */
125:     public function prefsSpecialUpdate($ui, $item)
126:     {
127:     }
128: }
129: 
API documentation generated by ApiGen