Use shell exec so we can escape the fortune output.
[squirrelmail.git] / plugins / fortune / setup.php
CommitLineData
9b5edd1d 1<?php
9b5edd1d 2/**
28e62e6d 3 * Fortune plugin setup script
9b5edd1d 4 *
6c84ba1e 5 * @copyright (c) 1999-2005 The SquirrelMail Project Team
0fe5da50 6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
7 * @version $Id$
ea5f4b8e 8 * @package plugins
9 * @subpackage fortune
9b5edd1d 10 */
11
ea5f4b8e 12/**
28e62e6d 13 * If SM_PATH isn't defined, define it.
14 * @ignore
0fe5da50 15 */
28e62e6d 16if (!defined('SM_PATH')) {
17 define('SM_PATH','../../');
9b5edd1d 18}
19
0fe5da50 20/**
28e62e6d 21 * Init plugin
7413ef70 22 * @access private
0fe5da50 23 */
28e62e6d 24function squirrelmail_plugin_init_fortune() {
25 global $squirrelmail_plugin_hooks;
7413ef70 26
28e62e6d 27 $squirrelmail_plugin_hooks['mailbox_index_before']['fortune'] = 'fortune';
28 $squirrelmail_plugin_hooks['loading_prefs']['fortune'] = 'fortune_load';
29 $squirrelmail_plugin_hooks['optpage_loadhook_display']['fortune'] = 'fortune_options';
9b5edd1d 30}
31
0fe5da50 32/**
28e62e6d 33 * Call fortune display function
7413ef70 34 * @access private
0fe5da50 35 */
28e62e6d 36function fortune() {
37 include_once(SM_PATH . 'plugins/fortune/functions.php');
38 fortune_function();
9b5edd1d 39}
40
0fe5da50 41/**
28e62e6d 42 * Call fortune option display function
7413ef70 43 * @access private
0fe5da50 44 */
9b5edd1d 45function fortune_options() {
28e62e6d 46 include_once(SM_PATH . 'plugins/fortune/functions.php');
47 fortune_function_options();
9b5edd1d 48}
49
0fe5da50 50/**
28e62e6d 51 * Call fortune prefs load function
7413ef70 52 * @access private
0fe5da50 53 */
28e62e6d 54function fortune_load() {
55 include_once(SM_PATH . 'plugins/fortune/functions.php');
56 fortune_function_load();
9b5edd1d 57}
28e62e6d 58?>