From ebd2391cb0c5e3049870f90fa8a8b28707e9571a Mon Sep 17 00:00:00 2001 From: kink Date: Sat, 14 Jul 2007 17:30:44 +0000 Subject: [PATCH] add PAGE_NAME constant to every page under src/. These can/will be used in various tests, and for consistency every page sets the constant to the appropriate setting. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12530 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/about.php | 3 +++ src/addrbook_popup.php | 3 +++ src/addrbook_search.php | 3 +++ src/addrbook_search_html.php | 3 +++ src/addressbook.php | 4 +++- src/compose.php | 3 +++ src/configtest.php | 4 +++- src/delete_message.php | 3 ++- src/download.php | 3 +++ src/empty_trash.php | 4 +++- src/folders.php | 4 +++- src/help.php | 4 +++- src/image.php | 3 +++ src/left_main.php | 3 +++ src/login.php | 3 +++ src/mailto.php | 4 +++- src/options.php | 3 +++ src/options_highlight.php | 4 +++- src/options_identities.php | 4 +++- src/options_order.php | 4 +++- src/printer_friendly_bottom.php | 3 +++ src/printer_friendly_main.php | 3 +++ src/printer_friendly_top.php | 4 +++- src/read_body.php | 4 +++- src/redirect.php | 3 +++ src/right_main.php | 3 +++ src/search.php | 4 +++- src/squirrelmail_rpc.php | 4 ++++ src/style.php | 3 +++ src/vcard.php | 4 +++- src/view_header.php | 4 +++- src/view_html.php | 6 ++++-- src/view_text.php | 4 +++- src/webmail.php | 3 +++ 34 files changed, 103 insertions(+), 18 deletions(-) diff --git a/src/about.php b/src/about.php index f54c1cd6..47a55851 100644 --- a/src/about.php +++ b/src/about.php @@ -16,6 +16,9 @@ * @package squirrelmail */ +/** This is the about page */ +define('PAGE_NAME', 'about'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/addrbook_popup.php b/src/addrbook_popup.php index dc5d30ae..90d2d2b5 100644 --- a/src/addrbook_popup.php +++ b/src/addrbook_popup.php @@ -12,6 +12,9 @@ * @subpackage addressbook */ +/** This is the addrbook_popup page */ +define('PAGE_NAME', 'addrbook_popup'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/addrbook_search.php b/src/addrbook_search.php index b2e33774..1b086945 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -15,6 +15,9 @@ * @subpackage addressbook */ +/** This is the addrbook_search page */ +define('PAGE_NAME', 'addrbook_search'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index a534da0a..0322132f 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -20,6 +20,9 @@ * init.php. */ if (!isset($bInit)) { + /** This is the addrbook_search_html page */ + define('PAGE_NAME', 'addrbook_search_html'); + include('../include/init.php'); } diff --git a/src/addressbook.php b/src/addressbook.php index 69e45f7b..302170fb 100644 --- a/src/addressbook.php +++ b/src/addressbook.php @@ -12,6 +12,9 @@ * @subpackage addressbook */ +/** This is the addressbook page */ +define('PAGE_NAME', 'addressbook'); + /** * Include the SquirrelMail initialization file. */ @@ -279,4 +282,3 @@ echo "\n"; do_hook('addressbook_bottom', $null); $oTemplate->display('footer.tpl'); -?> diff --git a/src/compose.php b/src/compose.php index 4bc00a2f..e49b174b 100644 --- a/src/compose.php +++ b/src/compose.php @@ -16,6 +16,9 @@ * @package squirrelmail */ +/** This is the compose page */ +define('PAGE_NAME', 'compose'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/configtest.php b/src/configtest.php index 703645f6..9a92669c 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -15,6 +15,9 @@ * If it throws errors you need to adjust your config. * ************************************************************/ +/** This is the configtest page */ +define('PAGE_NAME', 'configtest'); + // This script could really use some restructuring as it has grown quite rapidly // but is not very 'clean'. Feel free to get some structure into this thing. @@ -920,4 +923,3 @@ if ($warnings) { EOF; echo $footer; } -?> diff --git a/src/delete_message.php b/src/delete_message.php index 1eb2cdf8..4918d98e 100644 --- a/src/delete_message.php +++ b/src/delete_message.php @@ -11,10 +11,11 @@ * @package squirrelmail */ +define('PAGE_NAME', 'delete_message'); + /** * Include the SquirrelMail initialization file. */ include('../include/init.php'); error_box('delete_message.php script is obsolete since 1.5.1.'); $oTemplate->display('footer.tpl'); -?> \ No newline at end of file diff --git a/src/download.php b/src/download.php index 36610292..77b5e040 100644 --- a/src/download.php +++ b/src/download.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the download page */ +define('PAGE_NAME', 'download'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/empty_trash.php b/src/empty_trash.php index 604b8607..67adce7b 100644 --- a/src/empty_trash.php +++ b/src/empty_trash.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the empty_trash page */ +define('PAGE_NAME', 'empty_trash'); + /** * Include the SquirrelMail initialization file. */ @@ -71,4 +74,3 @@ session_write_close(); $location = get_location(); header ("Location: $location/left_main.php"); -?> diff --git a/src/folders.php b/src/folders.php index ae3c8967..60a8861d 100644 --- a/src/folders.php +++ b/src/folders.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the folders page */ +define('PAGE_NAME', 'folders'); + /** * Include the SquirrelMail initialization file. */ @@ -193,4 +196,3 @@ $oTemplate->assign('subbox_option_list', $subbox_option_list); $oTemplate->display('folder_manip.tpl'); $oTemplate->display('footer.tpl'); -?> diff --git a/src/help.php b/src/help.php index ebfa81b1..0b3dad8d 100644 --- a/src/help.php +++ b/src/help.php @@ -11,6 +11,9 @@ * @package squirrelmail */ +/** This is the help page */ +define('PAGE_NAME', 'help'); + /** * Include the SquirrelMail initialization file. */ @@ -237,4 +240,3 @@ if ( $chapter == 0 || !isset( $helpdir[$chapter-1] ) ) { do_hook('help_bottom', $null); $oTemplate->display('footer.tpl'); -?> diff --git a/src/image.php b/src/image.php index 2bf417c5..a2ef223b 100644 --- a/src/image.php +++ b/src/image.php @@ -11,6 +11,9 @@ * @package squirrelmail */ +/** This is the image page */ +define('PAGE_NAME', 'image'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/left_main.php b/src/left_main.php index 6d4f8eb5..de005537 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the left_main page */ +define('PAGE_NAME', 'left_main'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/login.php b/src/login.php index 9c9389b7..d3abfc28 100644 --- a/src/login.php +++ b/src/login.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the login page */ +define('PAGE_NAME', 'login'); + // reduces the files included in init.php $sInitLocation = 'login'; diff --git a/src/mailto.php b/src/mailto.php index e6afd7e1..94a8e726 100644 --- a/src/mailto.php +++ b/src/mailto.php @@ -17,6 +17,9 @@ * @package squirrelmail */ +/** This is the mailto page */ +define('PAGE_NAME', 'mailto'); + // reduce the included files in int.php $bLogin = true; @@ -78,4 +81,3 @@ if($force_login == false && sqsession_is_registered('user_is_logged_in')) { session_write_close(); header('Location: ' . get_location() . '/' . $redirect); -?> diff --git a/src/options.php b/src/options.php index 480dde5c..b13e04a0 100644 --- a/src/options.php +++ b/src/options.php @@ -13,6 +13,9 @@ * @subpackage prefs */ +/** This is the options page */ +define('PAGE_NAME', 'options'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/options_highlight.php b/src/options_highlight.php index 1b9768b5..872a5cdc 100644 --- a/src/options_highlight.php +++ b/src/options_highlight.php @@ -12,6 +12,9 @@ * @subpackage prefs */ +/** This is the options_highlight page */ +define('PAGE_NAME', 'options_highlight'); + /** * Include the SquirrelMail initialization file. */ @@ -346,4 +349,3 @@ if ($action == 'edit' || $action == 'add') { do_hook('options_highlight_bottom', $null); $oTemplate->display('footer.tpl'); -?> diff --git a/src/options_identities.php b/src/options_identities.php index 33c5c730..087cc0e5 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -13,6 +13,9 @@ * @since 1.1.3 */ +/** This is the options_identities page */ +define('PAGE_NAME', 'options_identities'); + /** * Include the SquirrelMail initialization file. */ @@ -226,4 +229,3 @@ function sti_textarea( $title, $name, $data, $bgcolor ) { } -?> diff --git a/src/options_order.php b/src/options_order.php index 29ed772f..bfc0a678 100644 --- a/src/options_order.php +++ b/src/options_order.php @@ -11,6 +11,9 @@ * @subpackage prefs */ +/** This is the options_order page */ +define('PAGE_NAME', 'options_order'); + /** * Include the SquirrelMail initialization file. */ @@ -161,4 +164,3 @@ $oTemplate->assign('addField_action', $PHP_SELF); $oTemplate->display('options_order.tpl'); $oTemplate->display('footer.tpl'); -?> diff --git a/src/printer_friendly_bottom.php b/src/printer_friendly_bottom.php index b65da692..da14209b 100644 --- a/src/printer_friendly_bottom.php +++ b/src/printer_friendly_bottom.php @@ -14,6 +14,9 @@ * @package squirrelmail */ +/** This is the printer_friendly_bottom page */ +define('PAGE_NAME', 'printer_friendly_bottom'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/printer_friendly_main.php b/src/printer_friendly_main.php index 7979ea55..8c0c03d6 100644 --- a/src/printer_friendly_main.php +++ b/src/printer_friendly_main.php @@ -9,6 +9,9 @@ * @package squirrelmail */ +/** This is the printer_friendly_main page */ +define('PAGE_NAME', 'printer_friendly_main'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/printer_friendly_top.php b/src/printer_friendly_top.php index 063b6deb..2473f1a5 100644 --- a/src/printer_friendly_top.php +++ b/src/printer_friendly_top.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the printer_friendly_top page */ +define('PAGE_NAME', 'printer_friendly_top'); + /** * Include the SquirrelMail initialization file. */ @@ -23,4 +26,3 @@ $oErrorHandler->setDelayedErrors(true); $oTemplate->display('printer_friendly_top.tpl'); $oTemplate->display('footer.tpl'); -?> \ No newline at end of file diff --git a/src/read_body.php b/src/read_body.php index e737e129..a814cd6c 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the read_body page */ +define('PAGE_NAME', 'read_body'); + /** * Include the SquirrelMail initialization file. */ @@ -978,4 +981,3 @@ formatMenuBar($aMailbox, $passed_id, $passed_ent_id, $message, false, FALSE); do_hook('read_body_bottom', $null); sqimap_logout($imapConnection); $oTemplate->display('footer.tpl'); -?> diff --git a/src/redirect.php b/src/redirect.php index bfa88bef..39e44880 100644 --- a/src/redirect.php +++ b/src/redirect.php @@ -12,6 +12,9 @@ */ $sInitLocation = 'redirect'; +/** This is the redirect page */ +define('PAGE_NAME', 'redirect'); + /** * Include the SquirrelMail initialization file. */ diff --git a/src/right_main.php b/src/right_main.php index 7d24ede6..0522221f 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the right_main page */ +define('PAGE_NAME', 'right_main'); + //xdebug_start_profiling("/var/spool/xdebug/right_main.txt"); diff --git a/src/search.php b/src/search.php index 1606105d..114f8d9c 100644 --- a/src/search.php +++ b/src/search.php @@ -17,6 +17,9 @@ * @todo explain why references are used in function calls */ +/** This is the search page */ +define('PAGE_NAME', 'search'); + /** * Include the SquirrelMail initialization file. */ @@ -1634,4 +1637,3 @@ sqimap_logout($imapConnection); $oTemplate->display('footer.tpl'); sqsession_register($mailbox_cache,'mailbox_cache'); -?> diff --git a/src/squirrelmail_rpc.php b/src/squirrelmail_rpc.php index 6b0f179c..35969afd 100644 --- a/src/squirrelmail_rpc.php +++ b/src/squirrelmail_rpc.php @@ -13,6 +13,10 @@ * @since 1.5.2 * */ + +/** This is the squirrelmail_rpc page */ +define('PAGE_NAME', 'squirrelmail_rpc'); + //FIXME: If we decide to route ALL requests, even normal page // requests through this file, need to change page requests // to something like this diff --git a/src/style.php b/src/style.php index 341d89ff..c79dcb4f 100644 --- a/src/style.php +++ b/src/style.php @@ -20,6 +20,9 @@ * @package squirrelmail */ +/** This is the style page */ +define('PAGE_NAME', 'style'); + /** * Set the location in order to skip unneeded validation and other includes * in the SquirrelMail initialisation file. diff --git a/src/vcard.php b/src/vcard.php index b9766fb9..a1f8005e 100644 --- a/src/vcard.php +++ b/src/vcard.php @@ -11,6 +11,9 @@ * @package squirrelmail */ +/** This is the vcard page */ +define('PAGE_NAME', 'vcard'); + /** * Include the SquirrelMail initialization file. */ @@ -185,4 +188,3 @@ $oTemplate->assign('info', $opts); $oTemplate->display('vcard.tpl'); $oTemplate->display('footer.tpl'); -?> diff --git a/src/view_header.php b/src/view_header.php index 2d81aa62..0e0b2e21 100644 --- a/src/view_header.php +++ b/src/view_header.php @@ -11,6 +11,9 @@ * @package squirrelmail */ +/** This is the view_header page */ +define('PAGE_NAME', 'view_header'); + /** * Include the SquirrelMail initialization file. */ @@ -115,4 +118,3 @@ $oTemplate->assign('headers', $aTemplateHeaders); $oTemplate->display('view_header.tpl'); $oTemplate->display('footer.tpl'); -?> \ No newline at end of file diff --git a/src/view_html.php b/src/view_html.php index 28aa5a78..c0d2932a 100644 --- a/src/view_html.php +++ b/src/view_html.php @@ -1,7 +1,7 @@ diff --git a/src/view_text.php b/src/view_text.php index e2ea3f02..dbdc16b8 100644 --- a/src/view_text.php +++ b/src/view_text.php @@ -11,6 +11,9 @@ * @package squirrelmail */ +/** This is the view_text page */ +define('PAGE_NAME', 'view_text'); + /** SquirrelMail required files. */ include('../include/init.php'); include(SM_PATH . 'functions/imap_general.php'); @@ -85,4 +88,3 @@ $oTemplate->assign('body', $body); $oTemplate->display('view_text.tpl'); $oTemplate->display('footer.tpl'); -?> diff --git a/src/webmail.php b/src/webmail.php index cdd66223..442a0d82 100644 --- a/src/webmail.php +++ b/src/webmail.php @@ -12,6 +12,9 @@ * @package squirrelmail */ +/** This is the webmail page */ +define('PAGE_NAME', 'webmail'); + /** * Include the SquirrelMail initialization file. */ -- 2.25.1