Part 1 of switch to use of SM_PATH with require_once.
[squirrelmail.git] / src / load_prefs.php
index fb2dd9e51dc4a29645a9061eca4b683cfc869006..965c6c11fcfadc1c298511660bb9eca1d530ec76 100644 (file)
  * $Id$
  */
 
-require_once('../src/validate.php');
-require_once('../functions/prefs.php');
-require_once('../functions/plugin.php');
-require_once('../functions/constants.php');
+/* Path for SquirrelMail required files. */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'src/validate.php');
+require_once(SM_PATH . 'functions/prefs.php');
+require_once(SM_PATH . 'functions/plugin.php');
+require_once(SM_PATH . 'functions/constants.php');
 
 $username = ( !isset($username) ? '' : $username );
 
@@ -37,8 +41,8 @@ $chosen_theme = (!$found_theme ? '' : $chosen_theme);
 if (isset($chosen_theme) && $found_theme && (file_exists($chosen_theme))) {
     @include_once($chosen_theme);
 } else {
-    if (isset($theme) && isset($theme[0]) && file_exists($theme[0]['PATH'])) {
-        @include_once($theme[0]['PATH']);
+    if (isset($theme) && isset($theme[$theme_default]) && file_exists($theme[$theme_default]['PATH'])) {
+        @include_once($theme[$theme_default]['PATH']);
     } else {
         /**
          * This theme as a failsafe if no themes were found. It makes
@@ -185,9 +189,11 @@ $location_of_buttons =
 $collapse_folders =
     getPref($data_dir, $username, 'collapse_folders', SMPREF_ON);
 
-/* show_html_default is a int value. */
 $show_html_default =
-    intval(getPref($data_dir, $username, 'show_html_default', SMPREF_OFF));
+   getPref($data_dir, $username, 'show_html_default', SMPREF_OFF);
+
+$enable_forward_as_attachment =
+   getPref($data_dir, $username, 'enable_forward_as_attachment', SMPREF_ON);
 
 $show_xmailer_default =
     getPref($data_dir, $username, 'show_xmailer_default', SMPREF_OFF );