return false;
}
+ $vars = Horde_Variables::getDefaultVariables();
+
if (method_exists($this, $this->_action)) {
- return call_user_func(array($this, $this->_action), Horde_Variables::getDefaultVariables());
+ return call_user_func(array($this, $this->_action), $vars);
}
+ /* Look for hook in application. */
+ try {
+ return Horde::callHook('ajaxaction', array($this->_action, $vars), $this->_app);
+ } catch (Horde_Exception_HookNotSet $e) {
+ } catch (Horde_Ajax_Exception $e) {}
+
throw new Horde_Ajax_Exception('Handler for action "' . $this->_action . '" does not exist.');
}
* This hook is used to do any local processing necessary to initialize an
* application. It is passed no parameters and expects no return value.
*
+ *
+ * AJAX Hooks
+ * ==========
+ * These are hookos that are available in any application that has an AJAX
+ * interface configured.
+ *
+ * ajaxaction
+ * ----------
+ * This hook is used to add user-defined AJAX action handlers to an
+ * application.
+ *
+ * Parameters in:
+ * $action (string): The AJAX action.
+ * $vars (Horde_Variables): The URL parameters.
+ *
+ * The return value from this hook is as follows:
+ * [throw Horde_Ajax_Exception] - Fatal error.
+ * [mixed] - The data to send to the browser (will be JSON encoded).
+ *
+ *
* TODO: groupldap, share_add, share_modify, share_remove
*
* $Id$
// }
/**
+ * AJAX HOOK: Add user-defined AJAX action handlers.
+ *
+ * @param string $action The AJAX action.
+ * @param Horde_Variables $vars The URL parameters.
+ *
+ * @return mixed The data to send to the browser (will be JSON encoded).
+ * @throws Horde_Ajax_Exception
+ */
+// function ajaxaction($action, $vars)
+// {
+// switch ($action) {
+// case 'Foo':
+// return 'bar';
+// }
+//
+// throw new Horde_Ajax_Exception('Unknown action');
+// }
+
+ /**
* Perform an action after a message has been sent successfully.
*
* @param Horde_Mime_Part $message The message content object.
--- /dev/null
+<?php
+/**
+ * Kronolith Hooks configuration file.
+ *
+ * THE HOOKS PROVIDED IN THIS FILE ARE EXAMPLES ONLY. DO NOT ENABLE THEM
+ * BLINDLY IF YOU DO NOT KNOW WHAT YOU ARE DOING. YOU HAVE TO CUSTOMIZE THEM
+ * TO MATCH YOUR SPECIFIC NEEDS AND SYSTEM ENVIRONMENT.
+ *
+ * For more information please see the horde/config/hooks.php.dist file.
+ *
+ * $Id$
+ */
+
+class Kronolith_Hooks
+{
+ /**
+ * AJAX HOOK: Add user-defined AJAX action handlers.
+ *
+ * @param string $action The AJAX action.
+ * @param Horde_Variables $vars The URL parameters.
+ *
+ * @return mixed The data to send to the browser (will be JSON encoded).
+ * @throws Horde_Ajax_Exception
+ */
+// function ajaxaction($action, $vars)
+// {
+// switch ($action) {
+// case 'Foo':
+// return 'bar';
+// }
+//
+// throw new Horde_Ajax_Exception('Unknown action');
+// }
+
+}
--- /dev/null
+<?php
+/**
+ * Shout Hooks configuration file.
+ *
+ * THE HOOKS PROVIDED IN THIS FILE ARE EXAMPLES ONLY. DO NOT ENABLE THEM
+ * BLINDLY IF YOU DO NOT KNOW WHAT YOU ARE DOING. YOU HAVE TO CUSTOMIZE THEM
+ * TO MATCH YOUR SPECIFIC NEEDS AND SYSTEM ENVIRONMENT.
+ *
+ * For more information please see the horde/config/hooks.php.dist file.
+ *
+ * $Id$
+ */
+
+class Kronolith_Hooks
+{
+ /**
+ * AJAX HOOK: Add user-defined AJAX action handlers.
+ *
+ * @param string $action The AJAX action.
+ * @param Horde_Variables $vars The URL parameters.
+ *
+ * @return mixed The data to send to the browser (will be JSON encoded).
+ * @throws Horde_Ajax_Exception
+ */
+// function ajaxaction($action, $vars)
+// {
+// switch ($action) {
+// case 'Foo':
+// return 'bar';
+// }
+//
+// throw new Horde_Ajax_Exception('Unknown action');
+// }
+
+}