Fully convert agora to Horde_Registry_Application
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 20 Jan 2010 16:45:50 +0000 (09:45 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 20 Jan 2010 17:02:04 +0000 (10:02 -0700)
Remove extra ws; fix some mode issues; autoloading.

65 files changed:
agora/README [changed mode: 0755->0644]
agora/ban.php
agora/config/.htaccess [changed mode: 0755->0644]
agora/config/conf.xml [changed mode: 0755->0644]
agora/config/menu.php.dist [changed mode: 0755->0644]
agora/config/prefs.php.dist [changed mode: 0755->0644]
agora/deleteforum.php
agora/docs/CREDITS [changed mode: 0755->0644]
agora/docs/INSTALL [changed mode: 0755->0644]
agora/docs/TODO [changed mode: 0755->0644]
agora/editforum.php
agora/forums.php
agora/index.php [changed mode: 0755->0644]
agora/lib/.htaccess [changed mode: 0755->0644]
agora/lib/Agora.php
agora/lib/Api.php
agora/lib/Application.php
agora/lib/Block/forums.php
agora/lib/Block/thread.php
agora/lib/Block/threads.php
agora/lib/Messages.php
agora/lib/base.php [deleted file]
agora/messages/abuse.php
agora/messages/delete.php
agora/messages/edit.php
agora/messages/index.php
agora/messages/lock.php
agora/messages/merge.php
agora/messages/move.php
agora/messages/split.php
agora/moderate.php
agora/moderators.php
agora/owner.php
agora/rss/index.php
agora/rss/messages.php
agora/rss/threads.php
agora/scripts/phorum2agora.php
agora/scripts/upgrades/2006-10-26_forums_table.php
agora/scripts/upgrades/2006-10-26_messages_table.php
agora/scripts/upgrades/2006-10-28_update_counts.php
agora/scripts/upgrades/2007-09-23_last_message.php
agora/search.php
agora/templates/.htaccess [changed mode: 0755->0644]
agora/templates/ban.html.php [changed mode: 0755->0644]
agora/templates/block/forums.html.php [changed mode: 0755->0644]
agora/templates/block/thread.html.php [changed mode: 0755->0644]
agora/templates/block/threads.html.php [changed mode: 0755->0644]
agora/templates/forums.html.php [changed mode: 0755->0644]
agora/templates/main.html.php [changed mode: 0755->0644]
agora/templates/messages/edit.html.php [changed mode: 0755->0644]
agora/templates/messages/flat.html.php
agora/templates/messages/flat_thread.html.php [changed mode: 0755->0644]
agora/templates/messages/form.html.php [changed mode: 0755->0644]
agora/templates/messages/index.html.php [changed mode: 0755->0644]
agora/templates/messages/message.html.php [changed mode: 0755->0644]
agora/templates/messages/threads.html.php [changed mode: 0755->0644]
agora/templates/moderate.html.php [changed mode: 0755->0644]
agora/templates/moderators.html.php [changed mode: 0755->0644]
agora/templates/search.html.php [changed mode: 0755->0644]
agora/templates/threads.html.php [changed mode: 0755->0644]
agora/themes/bluewhite/graphics/comment_box.png [changed mode: 0755->0644]
agora/themes/bluewhite/screen.css [changed mode: 0755->0644]
agora/themes/screen.css [changed mode: 0755->0644]
agora/threads.php
agora/view.php

old mode 100755 (executable)
new mode 100644 (file)
index 9409895..ecb9e2b 100644 (file)
@@ -8,10 +8,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
-
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Make sure we have a forum id. */
 list($forum_id, , $scope) = Agora::getAgoraId();
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 88c98dc..e796b11 100644 (file)
@@ -11,8 +11,8 @@
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the forums object. */
 $scope = Horde_Util::getFormData('scope', 'agora');
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 65c0408..7ee0e20 100644 (file)
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Forms/Forum.php';
-
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the forums object. */
 $forums = &Agora_Messages::singleton();
index 9d62ef5..f9113fa 100644 (file)
@@ -11,7 +11,8 @@
  * @author Marko Djukic <marko@oblo.com>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the forums object. */
 $scope = Horde_Util::getGet('scope', 'agora');
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index d3c36a8..abc3153 100644 (file)
@@ -226,7 +226,6 @@ class Agora {
             return PEAR::raiseError(_("The VFS backend needs to be configured to enable attachment uploads."));
         }
 
-        require_once 'VFS.php';
         return VFS::singleton($conf['vfs']['type'], Horde::getDriverConfig('vfs'));
     }
 
@@ -377,7 +376,7 @@ class Agora {
      *
      * @param int $message_id  Identifier of message to be distributed
      *
-     * @return mixed           Boolean true on success; PEAR_Error on failure
+     * @throws Horde_Mime_Exception
      */
     function distribute($message_id)
     {
@@ -388,15 +387,10 @@ class Agora {
         $forum = $storage->getForum($message['forum_id']);
 
         if (empty($forum['forum_distribution_address'])) {
-            return false;
+            return;
         }
 
-        require_once 'Mail.php';
-        require_once 'Horde/MIME.php';
-        require_once 'Horde/MIME/Headers.php';
-        require_once 'Horde/MIME/Message.php';
-
-        $msg_headers = new MIME_Headers();
+        $msg_headers = new Horde_Mime_Headers();
         $msg_headers->addMessageIdHeader();
         $msg_headers->addAgentHeader();
         $msg_headers->addHeader('Date', date('r'));
@@ -406,14 +400,11 @@ class Agora {
         $msg_headers->addHeader('From', $message['message_author']);
         $msg_headers->addHeader('Subject', '[' . $forum['forum_name'] . '] ' . $message['message_subject']);
 
-        $mime = new MIME_Message();
-        $body = new MIME_Part('text/plain', $message['body'],
-                              Horde_Nls::getCharset());
-        $mime->addPart($body);
-        $msg_headers->addMIMEHeaders($mime);
-        $result = $mime->send($forum['forum_distribution_address'], $msg_headers, $conf['mailer']['type'], $conf['mailer']['params']);
-        if (is_a($result, 'PEAR_Error')) {
-            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
-        }
+        $body = new Horde_Mime_Part();
+        $body->setType('text/plain');
+        $body->setCharset(Horde_Nls::getCharset());
+        $body->setContents($message['body']);
+
+        $body->send($forum['forum_distribution_address'], $msg_headers, $conf['mailer']['type'], $conf['mailer']['params']);
     }
 }
index 6b35e2c..88070cb 100644 (file)
@@ -28,8 +28,6 @@ class Agora_Api extends Horde_Registry_Api
      */
     public function listForums($forum_id = 0, $scope = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
         return $forums->getForums($forum_id, true, 'forum_name', 0, isset($scope));
     }
@@ -44,8 +42,6 @@ class Agora_Api extends Horde_Registry_Api
      */
     public function getForumName($scope, $forum_id)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
         $forum = $forums->getForum($forum_id);
         if ($forum instanceof PEAR_Error) {
@@ -67,8 +63,6 @@ class Agora_Api extends Horde_Registry_Api
      */
     public function saveForum($scope, $parent, $info)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
         $forum_info = $this->prepareFormData($scope, $parent, $info);
         if ($forum_info instanceof PEAR_Error) {
@@ -89,8 +83,6 @@ class Agora_Api extends Horde_Registry_Api
      */
     public function deleteForum($scope, $forum_name)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
         $id = $forums->getForumId($forum_name);
         if ($id instanceof PEAR_Error) {
@@ -128,8 +120,6 @@ class Agora_Api extends Horde_Registry_Api
     public function getThreads($forum_name, $sort_by = 'message_timestamp', $sort_dir = 0, $bodies = false,
                             $scope = 'agora', $base_url = null, $from = 0, $count = 0)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
         if (empty($forum_name)) {
             return $forums->getThreads(0, false, $sort_by, $sort_dir, true, '', $base_url, $from, $count);
@@ -168,8 +158,6 @@ class Agora_Api extends Horde_Registry_Api
     public function getThreadsBatch($forum_names, $sort_by = 'message_timestamp', $sort_dir = 0, $bodies = false,
                             $scope = 'agora', $base_url = null, $from = 0, $count = 0)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $results = array();
         $forums = &Agora_Messages::singleton($scope);
         $results = array();
@@ -207,8 +195,6 @@ class Agora_Api extends Horde_Registry_Api
     public function getThreadsByForumOwner($owner, $sort_by = 'message_timestamp', $sort_dir = 0, $bodies = false,
                             $scope = 'agora', $from = 0, $count = 0)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
 
         return $forums->getThreadsByForumOwner($owner, 0, true, $sort_by, $sort_dir, true, $from, $count);
@@ -227,8 +213,6 @@ class Agora_Api extends Horde_Registry_Api
      */
     public function numMessages($forum_name, $scope = 'agora', $thread_id = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
 
         if (($forum_id = $forums->getForumId($forum_name)) instanceof PEAR_Error) {
@@ -259,8 +243,6 @@ class Agora_Api extends Horde_Registry_Api
      */
     public function numMessagesBatch($forum_name, $scope = 'agora', $thread_id = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
         if ($forums instanceof PEAR_Error) {
             return $forums;
@@ -367,8 +349,6 @@ class Agora_Api extends Horde_Registry_Api
             return '';
         }
 
-        require_once dirname(__FILE__) . '/base.php';
-
         /* Check if the forum exists and fetch the ID, or create a new one. */
         $forums = &Agora_Messages::singleton($scope);
         if (($params['forum_id'] = $forums->getForumId($forum_name)) instanceof PEAR_Error) {
@@ -435,8 +415,6 @@ class Agora_Api extends Horde_Registry_Api
             return '';
         }
 
-        require_once dirname(__FILE__) . '/base.php';
-
         /* Create a separate notification queue. */
         $queue = Horde_Notification::singleton('agoraPostMessage');
         $queue->attach('status');
@@ -582,8 +560,6 @@ class Agora_Api extends Horde_Registry_Api
             return '';
         }
 
-        require_once dirname(__FILE__) . '/base.php';
-
         /* Create a separate notification queue. */
         $queue = Horde_Notification::singleton('agoraRemoveMessage');
         $queue->attach('status');
@@ -673,8 +649,6 @@ class Agora_Api extends Horde_Registry_Api
                             $base_url = null, $url = null, $variables = null,
                             $template_file = false)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         if (is_null($base_url)) {
             $base_url = Horde::selfUrl(true);
         }
@@ -738,8 +712,6 @@ class Agora_Api extends Horde_Registry_Api
      */
     public function prepareFormData($scope, $parent = false, $info = array(), $callback = null)
     {
-        require_once dirname(__FILE__) . '/base.php';
-
         $forums = &Agora_Messages::singleton($scope);
 
         if ($parent) {
@@ -810,8 +782,6 @@ class Agora_Api extends Horde_Registry_Api
     {
         global $notification, $prefs, $registry;
 
-        require_once dirname(__FILE__) . '/base.php';
-
         $api_call = true;
 
         return require AGORA_BASE . '/moderate.php';
index 58cf5f5..92dbf84 100644 (file)
@@ -2,8 +2,8 @@
 /**
  * Agora external API interface.
  *
- * This file defines Agora's external API interface. Other
- * applications can interact with Agora through this API.
+ * This file defines Horde's core API interface. Other core Horde libraries
+ * can interact with Agora through this API.
  *
  * Copyright 2003-2010 The Horde Project (http://www.horde.org/)
  *
  * @package Agora
  */
 
+/* Determine the base directories. */
+if (!defined('AGORA_BASE')) {
+    define('AGORA_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(AGORA_BASE . '/config/horde.local.php')) {
+        include AGORA_BASE . '/config/horde.local.php';
+    } else {
+        define('HORDE_BASE', AGORA_BASE . '/..');
+    }
+}
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once HORDE_BASE . '/lib/core.php';
+
 class Agora_Application extends Horde_Registry_Application
 {
+    /**
+     * The application's version.
+     *
+     * @var string
+     */
     public $version = 'H4 (1.0-git)';
 
     /**
+     * TODO
+     */
+    static protected $_perms = array();
+
+    /**
      * Returns a list of available permissions.
      *
      * @return array  An array describing all available permissions.
      */
     public function perms()
     {
-        static $perms = array();
-        if (!empty($perms)) {
-            return $perms;
+        if (!empty(self::$_perms)) {
+            return self::$_perms;
         }
 
-        require_once dirname(__FILE__) . '/base.php';
-
-        $perms['tree']['agora']['admin'] = true;
-        $perms['title']['agora:admin'] = _("Admin");
-        $perms['title']['agora:forums'] = _("Forums");
+        self::$_perms['tree']['agora']['admin'] = true;
+        self::$_perms['title']['agora:admin'] = _("Admin");
+        self::$_perms['title']['agora:forums'] = _("Forums");
 
         foreach ($GLOBALS['registry']->listApps() as $scope) {
-            $perms['title']['agora:forums:' . $scope] = $GLOBALS['registry']->get('name', $scope);
-            $perms['tree']['agora']['forums'][$scope] = false;
+            self::$_perms['title']['agora:forums:' . $scope] = $GLOBALS['registry']->get('name', $scope);
+            self::$_perms['tree']['agora']['forums'][$scope] = false;
 
             $forums = &Agora_Messages::singleton($scope);
             $forums_list = $forums->getBareForums();
@@ -48,13 +74,13 @@ class Agora_Application extends Horde_Registry_Application
             }
 
             foreach ($forums_list as $id => $title) {
-                $perms['tree']['agora']['forums'][$scope][$id] = false;
-                $perms['title']['agora:forums:' . $scope . ':' . $id] = $title;
+                self::$_perms['tree']['agora']['forums'][$scope][$id] = false;
+                self::$_perms['title']['agora:forums:' . $scope . ':' . $id] = $title;
             }
 
         }
 
-        return $perms;
+        return self::$_perms;
     }
 
     /**
@@ -66,4 +92,5 @@ class Agora_Application extends Horde_Registry_Application
     {
         return Agora::getMenu();
     }
+
 }
index cab5c02..e6b1caa 100644 (file)
@@ -42,8 +42,6 @@ class Horde_Block_agora_forums extends Horde_Block {
     {
         global $registry;
 
-        require_once dirname(__FILE__) . '/../base.php';
-
         /* Set up the forums object. */
         $forums = array(Agora_Messages::singleton());
         if (Horde_Auth::isAdmin()) {
index 0e982ac..52d5e89 100644 (file)
@@ -22,8 +22,6 @@ class Horde_Block_agora_thread extends Horde_Block {
 
     function _params()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         $forumOb = &Agora_Messages::singleton();
         $forums_list = $forumOb->getForums(0, true, 'forum_name', 0, true);
 
@@ -57,8 +55,6 @@ class Horde_Block_agora_thread extends Horde_Block {
             return '';
         }
 
-        require_once dirname(__FILE__) . '/../base.php';
-
         /* Set up the message object. */
         list($forum_id, $message_id) = explode('.', $this->_params['thread_id']);
         $messages = &Agora_Messages::singleton('agora', $forum_id);
index 94e8921..2c8b168 100644 (file)
@@ -34,8 +34,6 @@ class Horde_Block_agora_threads extends Horde_Block {
      */
     function _params()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         $forums = Agora_Messages::singleton();
 
         /* Get the list of forums to display. */
@@ -62,8 +60,6 @@ class Horde_Block_agora_threads extends Horde_Block {
      */
     function _title()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         if (!isset($this->_params['forum_id'])) {
             return _("Threads");
         }
@@ -89,8 +85,6 @@ class Horde_Block_agora_threads extends Horde_Block {
      */
     function _content()
     {
-        require_once dirname(__FILE__) . '/../base.php';
-
         if (!isset($this->_params['forum_id'])) {
             return _("No forum selected");
         }
index 88fa2b3..0f23255 100644 (file)
@@ -1644,14 +1644,6 @@ class Agora_Messages {
             return $files;
         }
 
-        global $mime_drivers, $mime_drivers_map;
-        $result = Horde::loadConfiguration('mime_drivers.php', array('mime_drivers', 'mime_drivers_map'), 'horde');
-        extract($result);
-        require_once 'Horde/MIME/Part.php';
-        require_once 'Horde/MIME/Viewer.php';
-        require_once 'Horde/MIME/Magic.php';
-        require_once 'Horde/MIME/Contents.php';
-
         /* Make sure we have the tooltips javascript. */
         Horde::addScriptFile('tooltips.js', 'horde', true);
 
@@ -1659,7 +1651,7 @@ class Agora_Messages {
         $html = '<br />';
         $view_url = Horde::applicationUrl('view.php');
         foreach ($files as $file_id => $file) {
-            $mime_icon = MIME_Viewer::getIcon($file['file_type']);
+            $mime_icon = Horde_Mime_Viewer::getIcon($file['file_type']);
             $title = _("download") . ': ' . $file['file_name'];
             $tooltip = $title . "\n" . sprintf(_("size: %s"), $this->formatSize($file['file_size'])) . "\n" . sprintf(_("type: %s"), $file['file_type']);
             $url = Horde_Util::addParameter($view_url, array('forum_id' => $this->_forum_id,
@@ -2236,8 +2228,6 @@ class Agora_Messages {
      */
     private function _connect()
     {
-        require_once 'MDB2.php';
-
         $this->_params = Horde::getDriverConfig('storage', 'sql');
         Horde::assertDriverConfig($this->_params, 'storage',
                                   array('phptype', 'charset'));
diff --git a/agora/lib/base.php b/agora/lib/base.php
deleted file mode 100644 (file)
index 7cd01da..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * The Agora base inclusion library.
- *
- * Copyright 2003-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.
- */
-
-// Check for a prior definition of HORDE_BASE (perhaps by an
-// auto_prepend_file definition for site customization).
-if (!defined('HORDE_BASE')) {
-    define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths and autoloading.
-require_once HORDE_BASE . '/lib/core.php';
-
-/* Set up the registry. */
-$registry = Horde_Registry::singleton();
-try {
-    $registry->pushApp('agora');
-} catch (Horde_Exception $e) {
-    Horde_Auth::authenticateFailure('agora', $e);
-}
-$conf = &$GLOBALS['conf'];
-define('AGORA_TEMPLATES', $registry->get('templates'));
-
-// Notification system.
-$notification = Horde_Notification::singleton();
-$notification->attach('status');
-
-/* Agora base library. */
-if (!defined('AGORA_BASE')) {
-    define('AGORA_BASE', dirname(__FILE__) . '/..');
-}
-
-require_once AGORA_BASE . '/lib/Agora.php';
-require_once AGORA_BASE . '/lib/Messages.php';
-require_once AGORA_BASE . '/lib/View.php';
-
-// Start compression.
-if (!Horde_Util::nonInputVar('no_compress')) {
-     Horde::compressOutput();
-}
index 4d93765..111527e 100644 (file)
@@ -8,9 +8,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the messages object. */
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
@@ -56,10 +55,9 @@ if ($form->validate()) {
     }
 
     /* Collect moderators emails, and send them the notify */
-    require_once 'Horde/Identity.php';
     $emails = array();
     foreach ($forum['moderators'] as $moderator) {
-        $identity = &Identity::singleton('none', $moderator);
+        $identity = Horde_Prefs_Identity::singleton('none', $moderator);
         $address = $identity->getValue('from_addr');
         if (!empty($address)) {
             $emails[] = $address;
index 5e8dbfe..9985b59 100644 (file)
@@ -10,9 +10,8 @@
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the messages object. */
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
index 3b62781..39bc680 100644 (file)
@@ -11,9 +11,8 @@
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
 
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
 $message_parent_id = Horde_Util::getFormData('message_parent_id');
index 24c4218..16d63bb 100644 (file)
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
-require_once 'Horde/Identity.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the messages object. */
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
@@ -79,7 +77,7 @@ $view = new Agora_View();
 if (!$view_bodies) {
     /* Get the author's avatar. */
     if ($conf['avatar']['allow_avatars']) {
-        $identity = &Identity::singleton('none', $message['message_author']);
+        $identity = Horde_Prefs_Identity::singleton('none', $message['message_author']);
         $avatar_path = $identity->getValue('avatar_path');
         $message_author_avatar = Agora::validateAvatar($avatar_path) ? Agora::getAvatarUrl($avatar_path) : false;
         $view->message_author_avatar = $message_author_avatar;
index cd07aee..9cc818d 100644 (file)
@@ -10,9 +10,8 @@
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the messages object. */
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
index 0e0e963..4cf98d3 100644 (file)
@@ -8,9 +8,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the messages object. */
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
index f69a7a1..12427c8 100644 (file)
@@ -8,9 +8,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the messages object. */
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
index 3803953..9fc0457 100644 (file)
@@ -8,9 +8,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the messages object. */
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
index 8c58bb3..8344c1f 100644 (file)
@@ -8,9 +8,8 @@
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
 
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Set up the messages object. */
 $scope = Horde_Util::getGet('scope', 'agora');
@@ -79,7 +78,7 @@ if (isset($api_call)) {
     $title = _("Messages Awaiting Moderation");
     $view->menu = Agora::getMenu('string');
     Horde::addScriptFile('stripe.js', 'horde', true);
-    require_once AGORA_TEMPLATES . '/common-header.inc';
+    require AGORA_TEMPLATES . '/common-header.inc';
     echo $view->render('moderate.html.php');
-    require_once $registry->get('templates', 'horde') . '/common-footer.inc';
+    require $registry->get('templates', 'horde') . '/common-footer.inc';
 }
index ce9b639..ef753ee 100644 (file)
@@ -11,8 +11,8 @@
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
 
 if (!Horde_Auth::isAdmin()) {
     header('Location: ' . Horde::applicationUrl('forums.php'));
index 41e6f32..043e0f8 100644 (file)
@@ -10,7 +10,8 @@
  * @author Duck  <duck@oabla.net>
  */
 
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
 
 /* Only authenticated users should be using this. */
 if (!Horde_Auth::isAuthenticated()) {
index 1280e58..12e47fd 100644 (file)
@@ -8,17 +8,16 @@
  * @author Duck <duck@obala.net>
  */
 
-define('AUTH_HANDLER', true);
-define('AGORA_BASE', dirname(__FILE__) . '/../');
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none'));
 
 // Show a specific scope?
 $scope = Horde_Util::getGet('scope', 'agora');
 $cache_key = 'agora_rss_' . $scope;
 
 /* Initialize the Cache object. */
-$cache = &Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'],
-                                    Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
+$cache = Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'],
+                                Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
 
 $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
 if (!$rss) {
index 33f40a9..bd31ebd 100644 (file)
@@ -8,9 +8,8 @@
  * @author Duck <duck@obala.net>
  */
 
-define('AUTH_HANDLER', true);
-define('AGORA_BASE', dirname(__FILE__) . '/../');
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none'));
 
 // Show a specific scope?
 list($forum_id, $message_id, $scope) = Agora::getAgoraId();
index dca8fa0..bfc3484 100644 (file)
@@ -8,9 +8,8 @@
  * @author Duck <duck@obala.net>
  */
 
-define('AUTH_HANDLER', true);
-define('AGORA_BASE', dirname(__FILE__) . '/../');
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none'));
 
 // Detect forum id
 $scope = Horde_Util::getGet('scope', 'agora');
index 76a1413..f96eb97 100755 (executable)
  * TODO: Moderation, attachments, ID swaping
  */
 
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('AGORA_BASE', dirname(dirname(__FILE__)));
-define('HORDE_BASE', dirname(AGORA_BASE));
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-require_once 'Horde/CLI.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
-    exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment.
-Horde_Cli::init();
-$cli = &Horde_Cli::singleton();
-
-require_once 'DB.php';
-require_once HORDE_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
+$cli = Horde_Cli::singleton();
 
 /* Open Agora database. */
 $db_agora = &DB::connect($conf['sql']);
@@ -53,7 +34,6 @@ if ($db_phorum instanceof PEAR_Error) {
 }
 
 // We accept the user name on the command-line.
-require_once 'Console/Getopt.php';
 $ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'h:p:a:t:f:c:',
                               array('help', 'phorum_id=', 'agora_id=', 'phorum_table=', 'from=', 'count='));
 
index e402ed9..eba5702 100755 (executable)
@@ -4,28 +4,8 @@
  * Script to migrate forums from datatree agora_forms table
  */
 
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('HORDE_BASE', dirname(__FILE__) . '/../../..');
-define('AGORA_BASE', dirname(__FILE__) . '/../..');
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-require_once 'Horde/Cli.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
-    exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init
-// some variables, etc.
-Horde_Cli::init();
-
-require_once 'DB.php';
-require_once HORDE_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
 
 /* Open the database. */
 $db = DB::connect($conf['sql']);
index 254a1d7..f3b00a4 100755 (executable)
@@ -6,27 +6,8 @@
  * Script to migrate forums from datatree agora_forms table
  */
 
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('HORDE_BASE', dirname(__FILE__) . '/../../..');
-define('AGORA_BASE', dirname(__FILE__) . '/../..');
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
-    exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init
-// some variables, etc.
-Horde_Cli::init();
-
-require_once 'DB.php';
-require_once HORDE_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
 
 /* Open the database. */
 $db = &DB::connect($conf['sql']);
index 4198f7e..61d3061 100755 (executable)
@@ -6,28 +6,8 @@
  * TODO Get rid of moderation
  */
 
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('AGORA_BASE', dirname(dirname(dirname(__FILE__))));
-define('HORDE_BASE', dirname(AGORA_BASE));
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
-    exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init
-// some variables, etc.
-Horde_Cli::init();
-
-require_once 'DB.php';
-require_once HORDE_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
 
 /* Open the database. */
 $db = &DB::connect($conf['sql']);
index 638411a..b4f002f 100644 (file)
@@ -4,28 +4,9 @@
  * Upgrades last messages
  */
 
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('AGORA_BASE', dirname(dirname(dirname(__FILE__))));
-define('HORDE_BASE', dirname(AGORA_BASE));
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
-    exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment.
-Horde_Cli::init();
-$cli = &Horde_Cli::singleton();
-
-require_once 'MDB2.php';
-require_once HORDE_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
+$cli = Horde_Cli::singleton();
 
 /* Open the database. */
 $params = Horde::getDriverConfig('storage', 'sql');
index a92f399..18f8439 100644 (file)
@@ -10,8 +10,9 @@
  * @author  Jason Felice <jason.m.felice@gmail.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
+
 require_once AGORA_BASE . '/lib/Forms/Search.php';
 
 /* Set up the forums object. */
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index fb98d0a..0b85372
 <h1 class="header"><?php echo _('Banned'); ?></h1>
 <ul>
 <?php foreach ($this->banned as $k1 => $v1): ?>
-    <li><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->banned)) { echo $this->banned; } ?></li> 
+    <li><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->banned)) { echo $this->banned; } ?></li>
 <?php endforeach; ?>
 </ul>
 <br class="spacer">
 <?php endif; ?>
 
-<?php echo $this->formbox; ?>
\ No newline at end of file
+<?php echo $this->formbox; ?>
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 7ffe404..adf392b
@@ -2,42 +2,42 @@
 <?php echo $this->notify; ?>
 
 <h1 class="header">
- <?php if (!empty($this->actions)): ?> 
-  <span class="smallheader rightFloat"> 
-    <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->actions)) { echo $this->actions; } ?><?php if (--$i1 != 0) { echo ' | '; }; endforeach; ?></span> 
- <?php endif; ?> 
- <?php echo _('Forums'); ?> 
-</h1> 
-<?php if (!empty($this->forums_list) || !empty($this->forums_list)): ?> 
-<table class="linedRow" style="width:100%; border-collapse:collapse;"> 
- <tr class="item"> 
+ <?php if (!empty($this->actions)): ?>
+  <span class="smallheader rightFloat">
+    <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->actions)) { echo $this->actions; } ?><?php if (--$i1 != 0) { echo ' | '; }; endforeach; ?></span>
+ <?php endif; ?>
+ <?php echo _('Forums'); ?>
+</h1>
+<?php if (!empty($this->forums_list) || !empty($this->forums_list)): ?>
+<table class="linedRow" style="width:100%; border-collapse:collapse;">
+ <tr class="item">
   <th style="width:75%"<?php echo $this->col_headers['forum_name_class']; ?>>
    <?php echo $this->col_headers['forum_name']; ?>
   </th>
   <th style="width:5%; text-align:center"<?php echo $this->col_headers['message_count_class']; ?>>
    <?php echo $this->col_headers['message_count']; ?>
-  </th> 
+  </th>
   <th style="width:5%; text-align:center"<?php echo $this->col_headers['thread_count_class']; ?>>
    <?php echo $this->col_headers['thread_count']; ?>
-  </th> 
+  </th>
   <th style="width:20%"<?php echo $this->col_headers['message_timestamp_class']; ?>>
    <?php echo $this->col_headers['message_timestamp']; ?>
   </th>
  </tr>
 
- <?php foreach ($this->forums_list as $k2 => $v2): ?> 
+ <?php foreach ($this->forums_list as $k2 => $v2): ?>
  <tr valign="top">
   <td>
    <strong><?php echo $v2['indent']; ?><?php if (!empty($v2['url'])): ?><a href="<?php echo $v2['url']; ?>"><?php endif; ?><?php echo $v2['forum_name']; ?><?php if (!empty($v2['url'])): ?></a><?php endif; ?></strong>
    <p><?php echo $v2['forum_description']; ?></p>
    <?php if (!empty($v2['actions'])): ?>
    <?php echo _('Options'); ?>:
-   <?php $i3 = count($v2['actions']); foreach ($v2['actions'] as $k3 => $v3): ?><?php if (isset($v3)) { echo is_array($v3) ? $k3 : $v3; } elseif (isset($v2['actions'])) { echo $v2['actions']; } ?><?php if (--$i3 != 0) { echo ', '; }; endforeach; ?> 
-   <?php endif; ?> 
+   <?php $i3 = count($v2['actions']); foreach ($v2['actions'] as $k3 => $v3): ?><?php if (isset($v3)) { echo is_array($v3) ? $k3 : $v3; } elseif (isset($v2['actions'])) { echo $v2['actions']; } ?><?php if (--$i3 != 0) { echo ', '; }; endforeach; ?>
+   <?php endif; ?>
    <?php if (!empty($v2['moderators'])): ?>
    <br />
    <?php echo _('Moderators'); ?>:
-   <?php $i4 = count($v2['moderators']); foreach ($v2['moderators'] as $k4 => $v4): ?><?php if (isset($v4)) { echo is_array($v4) ? $k4 : $v4; } elseif (isset($v2['moderators'])) { echo $v2['moderators']; } ?><?php if (--$i4 != 0) { echo ', '; }; endforeach; ?>    <?php endif; ?> 
+   <?php $i4 = count($v2['moderators']); foreach ($v2['moderators'] as $k4 => $v4): ?><?php if (isset($v4)) { echo is_array($v4) ? $k4 : $v4; } elseif (isset($v2['moderators'])) { echo $v2['moderators']; } ?><?php if (--$i4 != 0) { echo ', '; }; endforeach; ?>    <?php endif; ?>
   </td>
   <td style="text-align:center">
    <?php echo $v2['message_count']; ?>
    <a href="<?php echo $v2['last_message_url']; ?>"><?php echo $v2['last_message_date']; ?></a><br />
    <?php echo _('by'); ?>
    <?php echo $v2['last_message_author']; ?>
-   <?php endif; ?> 
-  </td> 
- </tr> 
- <?php endforeach; ?> 
+   <?php endif; ?>
+  </td>
+ </tr>
+ <?php endforeach; ?>
 </table>
  <?php echo $this->pager_link;?>
 <?php else: ?>
  <p><em><?php echo _('No forums have been created.'); ?></em></p>
-<?php endif; ?> 
+<?php endif; ?>
old mode 100755 (executable)
new mode 100644 (file)
index 9cc0788..f46a0cb
@@ -1,3 +1,3 @@
 <div id="menu"><?php echo $this->menu; ?></div>
-<?php echo $this->notify; ?> 
+<?php echo $this->notify; ?>
 <?php echo $this->main; ?>
old mode 100755 (executable)
new mode 100644 (file)
index cd81b14..40f96fb
@@ -3,16 +3,16 @@
 
 <?php echo $this->formbox; ?>
 
-<?php if (!empty($this->replying)): ?> 
+<?php if (!empty($this->replying)): ?>
 
 <br class="spacer" />
 <h1 class="header">
  <?php echo $this->message_subject; ?>
 </h1>
 
-<table style="padding: 2px; width: 100%" class="item"> 
+<table style="padding: 2px; width: 100%" class="item">
  <tr>
-  <td style="width: 10%" valign="top"> 
+  <td style="width: 10%" valign="top">
    <?php if (!empty($this->message_author_avatar)): ?>
     <img src="<?php echo $this->message_author_avatar; ?>" alt="<?php echo $this->message_author; ?>" />
     <br />
index 5e805f0..137a3a4 100644 (file)
@@ -6,7 +6,7 @@
  <?php echo $v1['link']; ?><strong><?php echo $v1['message_subject']; ?></strong></a>
   <span style="font-size: 0.9em;">
   <?php
-  echo sprintf(_("Posted by %s on %s"), $v1['message_author'], $v1['message_date']); 
+  echo sprintf(_("Posted by %s on %s"), $v1['message_author'], $v1['message_date']);
   if (!empty($v1['message_author_moderator'])): ?>
    <?php echo _('Moderator'); ?>
   <?php endif; ?>
old mode 100755 (executable)
new mode 100644 (file)
index edd032f..471e107
@@ -1,8 +1,8 @@
 <?php foreach ($this->threads_list as $k1 => $v1): ?>
+
 <div class="messageContainer" style="margin-left: <?php echo $v1['indent']; ?>0px">
 
-<div class="messageAuthor"> 
+<div class="messageAuthor">
  <?php echo $v1['link']; ?><strong><?php echo $v1['message_subject']; ?></strong></a><br />
   <?php echo _('Posted by'); ?> <?php echo $v1['message_author']; ?><br />
   <?php echo _('on: '); ?> <?php echo $v1['message_date']; ?>
@@ -14,7 +14,7 @@
   <?php $i2 = count($v1['actions']); foreach ($v1['actions'] as $k2 => $v2): ?>
     <?php if (isset($v2)) { echo is_array($v2) ? $k2 : $v2; } elseif (isset($v1['actions'])) { echo $v1['actions']; } ?>
   <?php if (--$i2 != 0) { echo ', '; }; endforeach; ?> ]
-  </span> 
+  </span>
 </div>
 
 <div class="messageBody">
@@ -26,4 +26,4 @@
 <br class="clear" />
 </div>
 
-<?php endforeach; ?> 
+<?php endforeach; ?>
old mode 100755 (executable)
new mode 100644 (file)
index f746ccb..945b5c7
@@ -1,24 +1,24 @@
 <div id="menu"><?php echo $this->menu; ?></div>
 <?php echo $this->notify; ?>
+
 <?php echo $this->formbox; ?>
-<br class="spacer" /> 
-<h1 class="header"> 
+
+<br class="spacer" />
+<h1 class="header">
  <?php echo $this->message_subject; ?>
-</h1> 
-<table style="padding: 2px; width: 100%" class="item"> 
- <tr> 
-  <td style="width: 10%" valign="top"> 
+</h1>
+
+<table style="padding: 2px; width: 100%" class="item">
+ <tr>
+  <td style="width: 10%" valign="top">
    <?php if (!empty($this->message_author_avatar)): ?>
     <img src="<?php echo $this->message_author_avatar; ?>" alt="<?php echo $this->message_author; ?>" />
-    <br /> 
-   <?php endif; ?> 
+    <br />
+   <?php endif; ?>
    <?php echo $this->message_author; ?>
-  </td> 
-  <td style="width: 90%" valign="top" class="box"> 
+  </td>
+  <td style="width: 90%" valign="top" class="box">
    <?php echo $this->message_body; ?>
-  </td> 
- </tr> 
-</table> 
+  </td>
+ </tr>
+</table>
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 261e94b..227b117
@@ -1,40 +1,40 @@
 <div id="menu"><?php echo $this->menu; ?></div>
 <?php echo $this->notify; ?>
 
-<div class="header"> 
- <?php if (!empty($this->actions)): ?> 
+<div class="header">
+ <?php if (!empty($this->actions)): ?>
   <span class="smallheader rightFloat">
-   <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->actions)) { echo $this->actions; } ?><?php if (--$i1 != 0) { echo ', '; }; endforeach; ?> 
-  </span> 
- <?php endif; ?> 
+   <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->actions)) { echo $this->actions; } ?><?php if (--$i1 != 0) { echo ', '; }; endforeach; ?>
+  </span>
+ <?php endif; ?>
  <?php if (!empty($this->message_subject)): ?><?php echo $this->message_subject; ?><?php else: ?>&nbsp;<?php endif; ?>
 </div>
 
-<div class="messageContainer"> 
- <div class="messageAuthor"> 
+<div class="messageContainer">
+ <div class="messageAuthor">
   <?php if (!empty($this->message_author_avatar)): ?>
    <img src="<?php echo $this->message_author_avatar; ?>" alt="<?php echo $this->message_author; ?>" />
-   <br /> 
-  <?php endif; ?> 
+   <br />
+  <?php endif; ?>
   <?php echo $this->message_author; ?>
   <?php if (!empty($this->message_author_moderator)): ?>
    <br /><?php echo _('Moderator'); ?>
   <?php endif; ?>
  </div>
  <div class="messageBody">
-  <p> 
+  <p>
    <?php echo $this->message_body; ?>
    <?php if (!empty($this->message_attachment)): ?><br /><?php echo $this->message_attachment; ?><?php endif; ?>
-  </p> 
- </div> 
+  </p>
+ </div>
  <br class="clear" />
 </div>
 
-<h1 class="header"> 
- <?php echo _('Thread Summary'); ?> 
+<h1 class="header">
+ <?php echo _('Thread Summary'); ?>
 </h1>
 
-<div class="item"> 
+<div class="item">
  <?php echo $this->threads; ?>
 </div>
 
old mode 100755 (executable)
new mode 100644 (file)
index 91dfcb5..89b87bd
@@ -1,12 +1,12 @@
-<table style="width:100%; border-collapse:collapse;" class="item linedRow"> 
- <tr class="item"> 
-  <th style="width:60%" class="leftAlign"> 
+<table style="width:100%; border-collapse:collapse;" class="item linedRow">
+ <tr class="item">
+  <th style="width:60%" class="leftAlign">
    <?php echo $this->col_headers['message_thread']; ?>
-  </th> 
-  <th style="width:20%" class="leftAlign"> 
+  </th>
+  <th style="width:20%" class="leftAlign">
    <?php echo $this->col_headers['message_author']; ?>
-  </th> 
-  <th style="width:19%" class="leftAlign"> 
+  </th>
+  <th style="width:19%" class="leftAlign">
    <?php echo $this->col_headers['message_timestamp']; ?>
   </th>
  </tr>
@@ -46,5 +46,5 @@
  </tr>
  <?php endif; ?>
  <?php endforeach; ?>
-</table> 
+
+</table>
old mode 100755 (executable)
new mode 100644 (file)
index 901591c..05dadc2
@@ -32,7 +32,7 @@
  </tr>
 </thead>
 <tbody>
- <?php foreach ($this->messages as $k1 => $v1): ?> 
+ <?php foreach ($this->messages as $k1 => $v1): ?>
  <tr style="vertical-align:top">
   <td><input type="checkbox" class="checkbox" name="message_ids[]" value="<?php echo $v1['message_id']; ?>" /></td>
   <td class="nowrap"><?php echo $v1['forum_name']; ?></td>
old mode 100755 (executable)
new mode 100644 (file)
index 3cca586..0994450
@@ -1,33 +1,33 @@
 <div id="menu"><?php echo $this->menu; ?></div>
 <?php echo $this->notify; ?>
-<h1 class="header"><?php echo _('Moderators'); ?></h1> 
-<?php if (!empty($this->forums)): ?> 
-<table class="striped"> 
-<tr> 
-    <td class="control"><?php echo _('Forum'); ?></td> 
-    <td class="control"><?php echo _('Forum name'); ?></td> 
-    <td class="control"><?php echo _('Moderators'); ?></td> 
-</tr> 
-<?php foreach ($this->forums as $k1 => $v1): ?> 
-<tr> 
-    <td><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->forums)) { echo $this->forums; } ?></td> 
+
+<h1 class="header"><?php echo _('Moderators'); ?></h1>
+<?php if (!empty($this->forums)): ?>
+<table class="striped">
+<tr>
+    <td class="control"><?php echo _('Forum'); ?></td>
+    <td class="control"><?php echo _('Forum name'); ?></td>
+    <td class="control"><?php echo _('Moderators'); ?></td>
+</tr>
+<?php foreach ($this->forums as $k1 => $v1): ?>
+<tr>
+    <td><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->forums)) { echo $this->forums; } ?></td>
     <td><?php echo $v1['forum_name']; ?></td>
-    <td> 
-        <?php if (!empty($v1['moderators'])): ?> 
-            <?php foreach ($v1['moderators'] as $k2 => $v2): ?> 
-                <?php if (isset($v2)) { echo is_array($v2) ? $k2 : $v2; } elseif (isset($v1['moderators'])) { echo $v1['moderators']; } ?><br /> 
-            <?php endforeach; ?> 
-        <?php endif; ?> 
-    </td> 
-</tr> 
-<?php endforeach; ?> 
-</table> 
-<?php else: ?> 
- <p><em><?php echo _('No moderators have been created.'); ?></em></p> 
-<?php endif; ?> 
-<br class="spacer"> 
-<?php echo $this->formbox; ?>
\ No newline at end of file
+    <td>
+        <?php if (!empty($v1['moderators'])): ?>
+            <?php foreach ($v1['moderators'] as $k2 => $v2): ?>
+                <?php if (isset($v2)) { echo is_array($v2) ? $k2 : $v2; } elseif (isset($v1['moderators'])) { echo $v1['moderators']; } ?><br />
+            <?php endforeach; ?>
+        <?php endif; ?>
+    </td>
+</tr>
+<?php endforeach; ?>
+</table>
+<?php else: ?>
+ <p><em><?php echo _('No moderators have been created.'); ?></em></p>
+
+<?php endif; ?>
+
+<br class="spacer">
+
+<?php echo $this->formbox; ?>
old mode 100755 (executable)
new mode 100644 (file)
index 808c2c2..b77618e
@@ -1,36 +1,36 @@
 <div id="menu"><?php echo $this->menu; ?></div>
 <?php echo $this->notify; ?>
-<?php if (!empty($this->searchResults)): ?> 
+
+<?php if (!empty($this->searchResults)): ?>
 <h1 class="header"><?php echo _('Search Results'); ?> (<?php echo $this->searchTotal; ?>)</h1>
-<table style="width: 100%" class="item linedRow" cellspacing="0"> 
-<?php foreach ($this->searchResults as $k1 => $v1): ?> 
-<tr class="item"> 
- <th colspan="4" style="width:99%" class="leftAlign item"> 
+<table style="width: 100%" class="item linedRow" cellspacing="0">
+<?php foreach ($this->searchResults as $k1 => $v1): ?>
+<tr class="item">
+ <th colspan="4" style="width:99%" class="leftAlign item">
   <a href="<?php echo $v1['forum_url']; ?>"><strong><?php echo $v1['forum_name']; ?></strong></a>
- </th> 
-</tr> 
-<?php foreach ($v1['messages'] as $k2 => $v2): ?> 
-<tr class="item"> 
- <td style="width:5%" class="item">&nbsp;</td> 
- <td style="width:54%" class="leftAlign item"> 
+ </th>
+</tr>
+<?php foreach ($v1['messages'] as $k2 => $v2): ?>
+<tr class="item">
+ <td style="width:5%" class="item">&nbsp;</td>
+ <td style="width:54%" class="leftAlign item">
    <a href="<?php echo $v2['message_url']; ?>"><?php echo $v2['message_subject']; ?></a>
- </td> 
- <td style="width:20%" class="leftAlign item"> 
+ </td>
+ <td style="width:20%" class="leftAlign item">
    <strong><?php echo $v2['message_author']; ?></strong>
- </td> 
- <td style="width:20%" class="leftAlign item"> 
+ </td>
+ <td style="width:20%" class="leftAlign item">
    <?php echo $v2['message_date']; ?>
- </td> 
-</tr> 
-<?php endforeach; ?> 
-<?php endforeach; ?> 
-</table> 
+ </td>
+</tr>
+<?php endforeach; ?>
+<?php endforeach; ?>
+</table>
+
 <?php echo $this->pager_link; ?>
-<br class="spacer" /> 
-<?php endif; ?> 
+
+<br class="spacer" />
+
+<?php endif; ?>
+
 <?php echo $this->searchForm; ?>
old mode 100755 (executable)
new mode 100644 (file)
index 9da20e6..9eea3d9
@@ -2,20 +2,20 @@
 <div id="menu"><?php echo $this->menu; ?></div>
 <?php echo $this->notify; ?>
 
-<div class="header"> 
- <?php if (!empty($this->actions)): ?> 
-  <span class="smallheader rightFloat"> 
+<div class="header">
+ <?php if (!empty($this->actions)): ?>
+  <span class="smallheader rightFloat">
    <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><a href="<?php echo $v1['url']; ?>" class="smallheader"><?php echo $v1['label']; ?></a><?php if (--$i1 != 0) { echo ', '; }; endforeach; ?>
   </span>
  <?php endif; ?>
  <?php echo $this->forum_name; ?>
 </div>
-<div class="control"> 
+<div class="control">
  <?php echo $this->forum_description; ?>
 </div>
 
 <?php if (!empty($this->threads)): ?>
-<table style="width:100%; border-collapse:collapse;" class="linedRow"> 
+<table style="width:100%; border-collapse:collapse;" class="linedRow">
  <tr class="item">
   <th style="width:50%"<?php echo $this->col_headers['message_subject_class']; ?>>
    <?php echo $this->col_headers['message_subject']; ?>
   </th>
   <th style="width:20%; text-align: center;"<?php echo $this->col_headers['message_author_class']; ?>>
    <?php echo $this->col_headers['message_author']; ?>
-  </th> 
+  </th>
   <th style="width:19%"<?php echo $this->col_headers['message_modifystamp_class']; ?>>
    <?php echo $this->col_headers['message_modifystamp']; ?>
-  </th> 
- </tr> 
- <?php foreach ($this->threads as $k2 => $v2): ?> 
+  </th>
+ </tr>
+
+ <?php foreach ($this->threads as $k2 => $v2): ?>
  <tr>
-  <td> 
+  <td>
    <?php echo $v2['link']; ?><?php echo $v2['message_subject']; ?></a>
    <?php if (isset($v2['hot'])) { echo $v2['hot']; } ?>
    <?php if (isset($v2['new'])) { echo $v2['new']; } ?>
-   <small> 
+   <small>
     <?php if (!empty($v2['pages'])): ?><br />[ <?php echo _('Goto page:'); ?> <?php $i3 = count($v2['pages']); foreach ($v2['pages'] as $k3 => $v3): ?><?php if (isset($v3)) { echo is_array($v3) ? $k3 : $v3; } elseif (isset($v2['pages'])) { echo $v2['pages']; } ?><?php if (--$i3 != 0) { echo ', '; }; endforeach; ?> ]<?php endif; ?>
     <?php if (!empty($v2['actions'])): ?><br />[<?php $i4 = count($v2['actions']); foreach ($v2['actions'] as $k4 => $v4): ?><?php if (isset($v4)) { echo is_array($v4) ? $k4 : $v4; } elseif (isset($v2['actions'])) { echo $v2['actions']; } ?><?php if (--$i4 != 0) { echo ', '; }; endforeach; ?> ]<?php endif; ?>
-   </small> 
-  </td> 
+   </small>
+  </td>
   <td style="text-align: center;">
    <?php echo $v2['message_seq']; ?>
-  </td> 
-  <td style="text-align: center;"> 
+  </td>
+  <td style="text-align: center;">
    <?php echo $v2['view_count']; ?>
-  </td> 
-  <td style="text-align: center;"> 
+  </td>
+  <td style="text-align: center;">
    <?php echo $v2['message_author']; ?>
-  </td> 
-  <td> 
+  </td>
+  <td>
    <?php if (!empty($v2['message_url'])): ?>
     <?php echo $v2['message_url']; ?><?php echo $v2['last_message_date']; ?></a><br />
-    <?php echo _('by'); ?> 
+    <?php echo _('by'); ?>
     <?php echo $v2['last_message_author']; ?>
    <?php endif; ?>
   </td>
@@ -65,7 +65,7 @@
  <?php endforeach; ?>
 </table>
  <?php echo $this->pager_link; ?>
-<?php else: ?> 
- <p><em><?php echo _('There are no threads in this forum.'); ?></em></p> 
-<?php endif; ?> 
+<?php else: ?>
+ <p><em><?php echo _('There are no threads in this forum.'); ?></em></p>
+
+<?php endif; ?>
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 5b470ae..d760dea 100644 (file)
@@ -11,9 +11,8 @@
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
 
 /* Make sure we have a forum id. */
 list($forum_id, , $scope) = Agora::getAgoraId();
index 1a1b368..3ef6c56 100644 (file)
@@ -10,8 +10,8 @@
  * @author Marko Djukic <marko@oblo.com>
  */
 
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
 
 $action_id = Horde_Util::getFormData('action_id', 'download');
 $file_id = Horde_Util::getFormData('file_id');