Fully convert nag to Horde_Registry_Application
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 20 Jan 2010 00:31:08 +0000 (17:31 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 20 Jan 2010 15:35:07 +0000 (08:35 -0700)
24 files changed:
nag/data.php
nag/lib/Api.php
nag/lib/Application.php
nag/lib/Block/summary.php
nag/lib/Block/tree_alarms.php
nag/lib/Block/tree_menu.php
nag/lib/base.load.php [deleted file]
nag/lib/base.php [deleted file]
nag/list.php
nag/quick.php
nag/scripts/import_vtodos.php
nag/scripts/upgrades/2006-04-18_add_creator_and_assignee_fields.php
nag/scripts/upgrades/convert_datatree_shares_to_sql.php
nag/scripts/upgrades/create_missing_add_histories_sql.php
nag/search.php
nag/task.php
nag/tasklists/create.php
nag/tasklists/delete.php
nag/tasklists/edit.php
nag/tasklists/index.php
nag/tasklists/info.php
nag/tasks/index.php
nag/themes/categoryCSS.php
nag/view.php

index 01685c7..17f94e2 100644 (file)
@@ -17,7 +17,8 @@ function _cleanup()
     return Horde_Data::IMPORT_FILE;
 }
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('nag');
 
 if (!$conf['menu']['import_export']) {
     require NAG_BASE . '/index.php';
index 868b8e3..ada54af 100644 (file)
@@ -25,7 +25,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function ajaxDefaults()
     {
-        require_once dirname(__FILE__) . '/base.php';
         return array(
             'default_tasklist' => Nag::getDefaultTasklist(Horde_Perms::EDIT),
         );
@@ -55,8 +54,6 @@ class Nag_Api extends Horde_Registry_Api
                               $altsortby = null, $tasklists = null,
                               $completed = null, $json = false)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $completedArray = array('incomplete' => Nag::VIEW_INCOMPLETE,
                                 'all' => Nag::VIEW_ALL,
                                 'complete' => Nag::VIEW_COMPLETE,
@@ -102,7 +99,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function listTasklists($owneronly, $permission)
     {
-        require_once dirname(__FILE__) . '/base.php';
         return Nag::listTasklists($owneronly, $permission);
     }
 
@@ -117,7 +113,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function addTasklist($name, $description = '', $color = '')
     {
-        require_once dirname(__FILE__) . '/base.php';
         $tasklist = Nag::addTasklist(array('name' => $name, 'description' => $description, 'color' => $color));
         if (is_a($tasklist, 'PEAR_Error')) {
             return $tasklist;
@@ -133,7 +128,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public static function updateTasklist($id, $info)
     {
-        require_once dirname(__FILE__) . '/base.php';
         $tasklist = $GLOBALS['nag_shares']->getShare($id);
         if (is_a($tasklist, 'PEAR_Error')) {
             return $tasklist;
@@ -148,7 +142,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function deleteTasklist($id)
     {
-        require_once dirname(__FILE__) . '/base.php';
         $tasklist = $GLOBALS['nag_shares']->getShare($id);
         if (is_a($tasklist, 'PEAR_Error')) {
             return $tasklist;
@@ -184,7 +177,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function browse($path = '', $properties = array())
     {
-        require_once dirname(__FILE__) . '/base.php';
         global $registry;
 
         // Default properties.
@@ -406,8 +398,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function put($path, $content, $content_type)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (substr($path, 0, 3) == 'nag') {
             $path = substr($path, 3);
         }
@@ -578,8 +568,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function path_delete($path)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (substr($path, 0, 3) == 'nag') {
             $path = substr($path, 3);
         }
@@ -648,8 +636,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function listTaskUids($tasklist = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!isset($GLOBALS['conf']['storage']['driver'])) {
             return PEAR::raiseError(_("Not configured"));
         }
@@ -690,8 +676,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function listBy($action, $timestamp, $tasklist = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if ($tasklist === null) {
             $tasklist = Nag::getDefaultTasklist(Horde_Perms::READ);
         }
@@ -723,8 +707,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function getActionTimestamp($uid, $action, $tasklist = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if ($tasklist === null) {
             $tasklist = Nag::getDefaultTasklist(Horde_Perms::READ);
         }
@@ -757,8 +739,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function import($content, $contentType, $tasklist = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if ($tasklist === null) {
             $tasklist = Nag::getDefaultTasklist(Horde_Perms::EDIT);
         }
@@ -859,8 +839,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function addTask($task)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!Horde_Auth::isAdmin() &&
             !array_key_exists($task['tasklist'],
                               Nag::listTasklists(false, Horde_Perms::EDIT))) {
@@ -899,8 +877,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function quickAdd($text, $tasklist = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if ($tasklist === null) {
             $tasklist = Nag::getDefaultTasklist(Horde_Perms::EDIT);
         }
@@ -919,8 +895,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function toggleCompletion($task_id, $tasklist_id)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!array_key_exists($tasklist_id,
             Nag::listTasklists(false, Horde_Perms::EDIT))) {
                 return PEAR::raiseError(_("Permission Denied"));
@@ -962,8 +936,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function export($uid, $contentType)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $storage = Nag_Driver::singleton();
         $task = $storage->getByUID($uid);
         if (is_a($task, 'PEAR_Error')) {
@@ -1008,8 +980,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function getTask($tasklist, $id)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!array_key_exists($tasklist,
                               Nag::listTasklists(false, Horde_Perms::READ))) {
             return PEAR::raiseError(_("Permission Denied"));
@@ -1036,8 +1006,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function exportTasklist($tasklist, $contentType)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!array_key_exists($tasklist,
             Nag::listTasklists(false, Horde_Perms::READ))) {
                 return PEAR::raiseError(_("Permission Denied"));
@@ -1090,8 +1058,6 @@ class Nag_Api extends Horde_Registry_Api
             return true;
         }
 
-        require_once dirname(__FILE__) . '/base.php';
-
         $storage = Nag_Driver::singleton();
         $task = $storage->getByUID($uid);
         if (is_a($task, 'PEAR_Error')) {
@@ -1115,8 +1081,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function deleteTask($tasklist, $id)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!Horde_Auth::isAdmin() &&
             !array_key_exists($tasklist,
                               Nag::listTasklists(false, Horde_Perms::DELETE))) {
@@ -1146,8 +1110,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function replace($uid, $content, $contentType)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $storage = Nag_Driver::singleton();
         $existing = $storage->getByUID($uid);
         if (is_a($existing, 'PEAR_Error')) {
@@ -1220,8 +1182,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function updateTask($tasklist, $id, $task)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!Horde_Auth::isAdmin() &&
             !array_key_exists($tasklist,
                               Nag::listTasklists(false, Horde_Perms::EDIT))) {
@@ -1262,8 +1222,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function listCostObjects($criteria)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $tasks = Nag::listTasks(null, null, null, null, 1);
         $result = array();
         $tasks->reset();
@@ -1286,8 +1244,6 @@ class Nag_Api extends Horde_Registry_Api
 
     public function listTimeObjectCategories()
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $categories = array();
         $tasklists = Nag::listTasklists(false, Horde_Perms::SHOW | Horde_Perms::READ);
         foreach ($tasklists as $tasklistId => $tasklist) {
@@ -1306,8 +1262,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function listTimeObjects($categories, $start, $end)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $allowed_tasklists = Nag::listTasklists(false, Horde_Perms::READ);
         foreach ($categories as $tasklist) {
             if (!array_key_exists($tasklist, $allowed_tasklists)) {
@@ -1357,7 +1311,6 @@ class Nag_Api extends Horde_Registry_Api
      */
     public function listAlarms($time, $user = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
         require_once 'Horde/Group.php';
 
         if ((empty($user) || $user != Horde_Auth::getAuth()) && !Horde_Auth::isAdmin()) {
index 6b5f94e..a5b4d74 100644 (file)
@@ -2,8 +2,34 @@
 /**
  * Nag application API.
  *
+ * This file defines Horde's core API interface. Other core Horde libraries
+ * can interact with Horde through this API.
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
  * @package Nag
  */
+
+/* Determine the base directories. */
+if (!defined('NAG_BASE')) {
+    define('NAG_BASE', dirname(__FILE__) . '/..');
+}
+
+if (!defined('HORDE_BASE')) {
+    /* If Horde does not live directly under the app directory, the HORDE_BASE
+     * constant should be defined in config/horde.local.php. */
+    if (file_exists(NAG_BASE . '/config/horde.local.php')) {
+        include NAG_BASE . '/config/horde.local.php';
+    } else {
+        define('HORDE_BASE', NAG_BASE . '/..');
+    }
+}
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once HORDE_BASE . '/lib/core.php';
+
 class Nag_Application extends Horde_Registry_Application
 {
     /**
@@ -14,6 +40,37 @@ class Nag_Application extends Horde_Registry_Application
     public $version = 'H4 (3.0-git)';
 
     /**
+     * Initialization function.
+     *
+     * Global variables defined:
+     *   $nag_shares - TODO
+     */
+    protected function _init()
+    {
+       // Set the timezone variable.
+       Horde_Nls::setTimeZone();
+
+       // Create a share instance.
+       $GLOBALS['nag_shares'] = Horde_Share::singleton($GLOBALS['registry']->getApp());
+
+       Nag::initialize();
+    }
+
+    /**
+     * Initialization for Notification system.
+     *
+     * Global variables defined:
+     *   $kronolith_notify - A Horde_Notification_Listener object.
+     *
+     * @param Horde_Notification_Handler_Base $notify  The notification
+     *                                                 object.
+     */
+    protected function _initNotification($notify)
+    {
+        $notify->attach('status', null, 'Nag_Notification_Listener_Status');
+    }
+
+    /**
      * Returns a list of available permissions.
      *
      * @return array  An array describing all available permissions.
@@ -102,8 +159,6 @@ class Nag_Application extends Horde_Registry_Application
      */
     public function removeUserData($user)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (!Horde_Auth::isAdmin() && $user != Horde_Auth::getAuth()) {
             return PEAR::raiseError(_("You are not allowed to remove user data."));
         }
index 74536ca..b9a5d26 100644 (file)
@@ -23,7 +23,6 @@ class Horde_Block_nag_summary extends Horde_Block {
 
     function _params()
     {
-        require_once dirname(__FILE__) . '/../base.php';
         $cManager = new Horde_Prefs_CategoryManager();
         $categories = array();
         foreach ($cManager->get() as $c) {
@@ -87,7 +86,6 @@ class Horde_Block_nag_summary extends Horde_Block {
     function _content()
     {
         global $registry, $prefs;
-        require_once dirname(__FILE__) . '/../base.php';
 
         $now = time();
         $html = '';
index 619dfc4..7a17dff 100644 (file)
@@ -12,8 +12,6 @@ class Horde_Block_nag_tree_alarms extends Horde_Block {
 
     function _buildTree(&$tree, $indent = 0, $parent = null)
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         $horde_alarm = null;
         if (!empty($GLOBALS['conf']['alarms']['driver'])) {
             $horde_alarm = Horde_Alarm::factory();
index 1e54846..b5b2bd6 100644 (file)
@@ -14,8 +14,6 @@ class Horde_Block_nag_tree_menu extends Horde_Block {
     {
         global $registry;
 
-        require_once dirname(__FILE__) . '/../base.php';
-
         $add = Horde::applicationUrl('task.php?actionID=add_task');
         $icondir = $registry->getImageDir();
 
diff --git a/nag/lib/base.load.php b/nag/lib/base.load.php
deleted file mode 100644 (file)
index c8f1077..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Script to determine the correct *_BASE values.
- *
- * Copyright 2009-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package Nag
- */
-
-if (!defined('NAG_BASE')) {
-    define('NAG_BASE', dirname(__FILE__) . '/..');
-}
-
-if (!defined('HORDE_BASE')) {
-    /* If horde does not live directly under the app directory, the HORDE_BASE
-     * constant should be defined in config/horde.local.php. */
-    if (file_exists(NAG_BASE . '/config/horde.local.php')) {
-        include NAG_BASE . '/config/horde.local.php';
-    } else {
-        define('HORDE_BASE', NAG_BASE . '/..');
-    }
-}
diff --git a/nag/lib/base.php b/nag/lib/base.php
deleted file mode 100644 (file)
index 65dfea6..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Nag base inclusion file.
- *
- * This file brings in all of the dependencies that every Nag
- * script will need and sets up objects that all scripts use.
- *
- * The following global variables are used:
- *   $no_compress  -  Controls whether the page should be compressed
- */
-
-// Determine BASE directories.
-require_once dirname(__FILE__) . '/base.load.php';
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$s_ctrl = 0;
-switch (Horde_Util::nonInputVar('nag_session_control')) {
-case 'none':
-    $s_ctrl = Horde_Registry::SESSION_NONE;
-    break;
-
-case 'readonly':
-    $s_ctrl = Horde_Registry::SESSION_READONLY;
-    break;
-}
-$registry = Horde_Registry::singleton($s_ctrl);
-
-try {
-    $registry->pushApp('nag', array('check_perms' => (Horde_Util::nonInputVar('nag_authentication') != 'none'), 'logintasks' => true));
-} catch (Horde_Exception $e) {
-    Horde_Auth::authenticateFailure('nag', $e);
-}
-$conf = &$GLOBALS['conf'];
-@define('NAG_TEMPLATES', $registry->get('templates'));
-
-// Notification system.
-$notification = Horde_Notification::singleton();
-$notification->attach('status', null, 'Nag_Notification_Listener_Status');
-
-// Start compression.
-if (!Horde_Util::nonInputVar('no_compress')) {
-    Horde::compressOutput();
-}
-
-// Set the timezone variable.
-Horde_Nls::setTimeZone();
-
-// Create a share instance.
-$GLOBALS['nag_shares'] = Horde_Share::singleton($registry->getApp());
-
-Nag::initialize();
index 34ac45c..df3d74a 100644 (file)
@@ -8,7 +8,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('nag');
 
 $vars = Horde_Variables::getDefaultVariables();
 
index 1323376..7205686 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('nag');
 
 if ($quickText = Horde_Util::getPost('quickText')) {
     $result = $registry->tasks->quickAdd($quickText);
index 33d3dc8..7fabdf3 100755 (executable)
@@ -14,8 +14,7 @@
  */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
index 387c99e..e28335d 100755 (executable)
@@ -13,8 +13,7 @@
  */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -25,8 +24,7 @@ if (!Horde_Cli::runningFromCLI()) {
 // variables, etc.
 Horde_Cli::init();
 
-$nag_authentication = 'none';
-require_once NAG_BASE . '/lib/base.php';
+Horde_Registry::appInit('nag', array('authentication' => 'none'));
 
 if ($conf['storage']['driver'] != 'sql') {
     exit('No conversion for drivers other than SQL currently.');
index fc2d1a5..a74d320 100755 (executable)
@@ -7,8 +7,7 @@
  */
 
 /* Set up the CLI environment */
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 if (!Horde_Cli::runningFromCli()) {
     exit("Must be run from the command line\n");
 }
index 4832a7c..e65442b 100755 (executable)
@@ -10,8 +10,7 @@
  */
 
 // Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
 
 // Make sure no one runs this from the web.
 if (!Horde_Cli::runningFromCLI()) {
@@ -23,8 +22,7 @@ if (!Horde_Cli::runningFromCLI()) {
 $cli = Horde_Cli::singleton();
 $cli->init();
 
-$nag_authentication = 'none';
-require_once NAG_BASE . '/lib/base.php';
+Horde_Registry::appInit('nag', array('authentication' => 'none'));
 
 $history = Horde_History::singleton();
 
index 3aa775a..0872b57 100644 (file)
@@ -6,7 +6,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('nag');
 
 $title = _("Search");
 $notification->push('document.search.search_pattern.focus()', 'javascript');
index 62eb0a4..e0de647 100644 (file)
@@ -45,7 +45,9 @@ function _delete($task_id, $tasklist_id)
     exit;
 }
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('nag');
+
 require_once NAG_BASE . '/lib/Forms/task.php';
 $vars = Horde_Variables::getDefaultVariables();
 
index ccb9172..e2ea100 100644 (file)
@@ -6,7 +6,9 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('nag');
+
 require_once NAG_BASE . '/lib/Forms/CreateTaskList.php';
 
 // Exit if this isn't an authenticated user or if the user can't
index 417debe..3f31243 100644 (file)
@@ -6,7 +6,9 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('nag');
+
 require_once NAG_BASE . '/lib/Forms/DeleteTaskList.php';
 
 // Exit if this isn't an authenticated user.
index e01f9c1..c481772 100644 (file)
@@ -6,7 +6,9 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('nag');
+
 require_once NAG_BASE . '/lib/Forms/EditTaskList.php';
 
 // Exit if this isn't an authenticated user.
index ddfbb9b..403fd8a 100644 (file)
@@ -21,7 +21,8 @@ function shorten_url($url, $separator = '...', $first_chunk_length = 35, $last_c
     return $url;
 }
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('nag');
 
 /* Exit if this isn't an authenticated user. */
 if (!Horde_Auth::getAuth()) {
index 3bef1e9..ca9782e 100644 (file)
@@ -6,7 +6,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('nag');
 
 // Exit if this isn't an authenticated user.
 if (!Horde_Auth::getAuth()) {
index 77a442d..b8a0de5 100644 (file)
@@ -6,7 +6,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('nag');
 
 $search = Horde_Util::getGet('q');
 if (!$search) {
index d609501..0afa812 100644 (file)
@@ -8,9 +8,8 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-@define('AUTH_HANDLER', true);
-@define('NAG_BASE', dirname(__FILE__) . '/..');
-require_once NAG_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('nag');
 
 header('Content-Type: text/css');
 
index f2773dc..5cba965 100644 (file)
@@ -6,7 +6,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('nag');
 
 /* We can either have a UID or a taskId and a tasklist. Check for
  * UID first. */