From: Michael M Slusarz Date: Wed, 29 Jul 2009 18:31:49 +0000 (-0600) Subject: Re-use common header code in common-header.inc for DIMP X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e9dcd531ad12852fe3d47fe116dfea2f0c6dbf7f;p=horde.git Re-use common header code in common-header.inc for DIMP --- diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index 71d2d7f7f..63e6f1ecf 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -78,22 +78,8 @@ class DIMP $page_title .= ' :: ' . $title; } - if (isset($GLOBALS['language'])) { - header('Content-type: text/html; charset=' . Horde_Nls::getCharset()); - header('Vary: Accept-Language'); - } - - echo "\n" . - (!empty($GLOBALS['language']) ? '\n". - "\n"; - - echo '' . htmlspecialchars($page_title) . "\n" . - '\n"; - include IMP_BASE . '/templates/javascript_defs_dimp.php'; - - IMP::includeStylesheetFiles('dimp'); - - echo "\n"; + $GLOBALS['imp_view'] = 'dimp'; + include IMP_BASE . '/templates/common-header.inc'; // Send what we have currently output so the browser can start // loading CSS/JS. See: @@ -190,7 +176,7 @@ class DIMP * 'l' (label) = The folder display label. [string] [DEFAULT: 'm' val] * 'm' (mbox) = The mailbox value. [string] * 'pa' (parent) = The parent element. [string] [DEFAULT: - * DIMP.conf.base_mbox] + * DIMP.conf.base_mbox] * 'po' (polled) = Is the element polled? [boolean] [DEFAULT: no] * 's' (special) = Is this a "special" element? [boolean] [DEFAULT: no] * 't' (title) = The title value. [string] [DEFAULT: 'm' val] diff --git a/imp/templates/common-header.inc b/imp/templates/common-header.inc index 5f84225bb..ea29eb9a1 100644 --- a/imp/templates/common-header.inc +++ b/imp/templates/common-header.inc @@ -12,12 +12,25 @@ if (!empty($title)) $page_title .= ' :: ' . $title; if (!empty($refresh_time) && !empty($refresh_url)) { echo "\n"; } -echo Horde_Util::bufferOutput('require', IMP_TEMPLATES . '/javascript_defs.php'); -IMP::includeScriptFiles(); -IMP::includeStylesheetFiles(); +$imp_view = Horde_Util::nonInputVar('imp_view'); +switch ($imp_view) { +case 'dimp': + include IMP_TEMPLATES . '/javascript_defs_dimp.php'; + IMP::includeStylesheetFiles('dimp'); + break; + +default: + include IMP_TEMPLATES . '/javascript_defs.php'; + IMP::includeScriptFiles(); + IMP::includeStylesheetFiles(); + break; +} ?> <?php echo htmlspecialchars($page_title) ?> + + + @@ -45,3 +58,4 @@ IMP::includeStylesheetFiles(); > +