From: Michael M Slusarz Date: Sat, 15 Aug 2009 18:50:44 +0000 (-0600) Subject: Bug #8463: First attempt at converting print view in kronolith to pure CSS X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c55a8e85b3baa9773aacc458cb381d9dbf87c8a5;p=horde.git Bug #8463: First attempt at converting print view in kronolith to pure CSS --- diff --git a/kronolith/config/conf.xml b/kronolith/config/conf.xml index 2aeb714ce..5f339f51b 100644 --- a/kronolith/config/conf.xml +++ b/kronolith/config/conf.xml @@ -81,8 +81,6 @@ Menu Settings - true true '; -if (!$print_view) { - Kronolith::tabs(); -} +Kronolith::tabs(); $view->html(KRONOLITH_TEMPLATES); echo ''; -if ($print_view) { - require KRONOLITH_TEMPLATES . '/calendar_titles.inc'; -} else { - require KRONOLITH_TEMPLATES . '/panel.inc'; -} +require KRONOLITH_TEMPLATES . '/calendar_titles.inc'; +require KRONOLITH_TEMPLATES . '/panel.inc'; require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/kronolith/event.php b/kronolith/event.php index 4e71f64bb..7dc6fe476 100644 --- a/kronolith/event.php +++ b/kronolith/event.php @@ -44,19 +44,11 @@ case 'EditEvent': } $title = $view->getTitle(); -$print_view = (bool)Horde_Util::getFormData('print'); require KRONOLITH_TEMPLATES . '/common-header.inc'; - -if ($print_view) { - require_once $registry->get('templates', 'horde') . '/javascript/print.js'; -} else { - require KRONOLITH_TEMPLATES . '/menu.inc'; -} +require KRONOLITH_TEMPLATES . '/menu.inc'; echo '
'; -if (!$print_view) { - Kronolith::eventTabs($viewName, $view->event); -} +Kronolith::eventTabs($viewName, $view->event); $view->html(); echo '
'; require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/kronolith/js/views.js b/kronolith/js/views.js index eb3e90f9f..ef2e39142 100644 --- a/kronolith/js/views.js +++ b/kronolith/js/views.js @@ -92,7 +92,6 @@ function _ShowView() if (viewVars) { kronolithView = viewVars.readAttribute('view'); kronolithDate = new Date(viewVars.readAttribute('date')); - kronolithPrintLink = viewVars.readAttribute('print'); } } diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 5fa886cf1..39e734770 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -1783,31 +1783,21 @@ class Kronolith } /** - * Should we show event location, based on the show_location - * preference and $print_view? + * Should we show event location, based on the show_location pref? */ public static function viewShowLocation() { $show = @unserialize($GLOBALS['prefs']->getValue('show_location')); - if (!empty($GLOBALS['print_view'])) { - return @in_array('print', $show); - } else { - return @in_array('screen', $show); - } + return @in_array('screen', $show); } /** - * Should we show event time, based on the show_time preference - * and $print_view? + * Should we show event time, based on the show_time preference? */ public static function viewShowTime() { $show = @unserialize($GLOBALS['prefs']->getValue('show_time')); - if (!empty($GLOBALS['print_view'])) { - return @in_array('print', $show); - } else { - return @in_array('screen', $show); - } + return @in_array('screen', $show); } /** @@ -1891,12 +1881,6 @@ class Kronolith $menu->add(Horde::applicationUrl('data.php'), _("_Import/Export"), 'data.png', $registry->getImageDir('horde')); } - /* Print. */ - if ($conf['menu']['print'] && ($view = Horde_Util::nonInputVar('view'))) { - Horde::addScriptFile('popup.js', 'horde', true); - $menu->add(Horde_Util::addParameter($view->link(), 'print', 1), _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', 'Horde.popup({ url: kronolithPrintLink ? kronolithPrintLink : this.href });return false;', '__noselection'); - } - return $menu; } diff --git a/kronolith/month.php b/kronolith/month.php index f656b90e4..4e76c055e 100644 --- a/kronolith/month.php +++ b/kronolith/month.php @@ -12,27 +12,16 @@ require_once dirname(__FILE__) . '/lib/base.php'; $view = Kronolith::getView('Month'); $title = $view->date->strftime('%B %Y'); -$print_view = (bool)Horde_Util::getFormData('print'); Horde::addScriptFile('tooltips.js', 'horde', true); require KRONOLITH_TEMPLATES . '/common-header.inc'; - -if ($print_view) { - require $registry->get('templates', 'horde') . '/javascript/print.js'; -} else { - require KRONOLITH_TEMPLATES . '/menu.inc'; -} +require KRONOLITH_TEMPLATES . '/menu.inc'; echo '
'; -if (!$print_view) { - Kronolith::tabs(); -} +Kronolith::tabs(); $view->html(); echo '
'; -if ($print_view) { - require KRONOLITH_TEMPLATES . '/calendar_titles.inc'; -} else { - require KRONOLITH_TEMPLATES . '/panel.inc'; -} +require KRONOLITH_TEMPLATES . '/calendar_titles.inc'; +require KRONOLITH_TEMPLATES . '/panel.inc'; require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/kronolith/templates/calendar_titles.inc b/kronolith/templates/calendar_titles.inc index 2ebd8ba95..587bc99ee 100644 --- a/kronolith/templates/calendar_titles.inc +++ b/kronolith/templates/calendar_titles.inc @@ -4,6 +4,8 @@ foreach ($GLOBALS['display_calendars'] as $calendarId) { $calendar_names[] = htmlspecialchars($GLOBALS['all_calendars'][$calendarId]->get('name')); } ?> -
-

-

+
+
+

+

+
diff --git a/kronolith/templates/common-header.inc b/kronolith/templates/common-header.inc index 52112099c..0740ed137 100644 --- a/kronolith/templates/common-header.inc +++ b/kronolith/templates/common-header.inc @@ -40,7 +40,6 @@ $currentDate = Kronolith::currentDate(); <?php echo htmlspecialchars($page_title) ?> diff --git a/kronolith/themes/graphics/az.png b/kronolith/themes/graphics/az.png deleted file mode 100644 index 2b646f94c..000000000 Binary files a/kronolith/themes/graphics/az.png and /dev/null differ diff --git a/kronolith/themes/graphics/redbox_spinner.gif b/kronolith/themes/graphics/redbox_spinner.gif deleted file mode 100644 index 35218b31b..000000000 Binary files a/kronolith/themes/graphics/redbox_spinner.gif and /dev/null differ diff --git a/kronolith/themes/graphics/za.png b/kronolith/themes/graphics/za.png deleted file mode 100644 index a154237b5..000000000 Binary files a/kronolith/themes/graphics/za.png and /dev/null differ diff --git a/kronolith/themes/print/screen.css b/kronolith/themes/print/screen.css deleted file mode 100644 index 660b2201b..000000000 --- a/kronolith/themes/print/screen.css +++ /dev/null @@ -1,53 +0,0 @@ -.rowEven td, .rowOdd td { - background: #fff; - color: #000; - border-bottom: thin solid #000; -} -.rowEven td td, .rowOdd td td { - border: none; -} -.selected-control { - background: #fff; - border-bottom: thin solid #000; -} - -.iconAlarm, .iconDelete, .iconEdit, .iconRecur, .iconAdd, a.newEvent, .iconNav { - display: none; -} - -.day, .othermonth, .weekend { - background-color: #fff; - color: #000; -} -.day { - border-right: thin solid #000; - border-bottom: thin solid #000; -} -.year-event { - background: #fff; -} -table.monthgrid { - border-top: thin solid #000; - border-left: thin solid #000; -} -table.monthgrid th, table.monthgrid td { - border-right: thin solid #000; - border-bottom: thin solid #000; - padding: 2px; -} -table.monthgrid td.today { - border-top: none; - border-left: none; - border-right: thin solid #000; - border-bottom: thin solid #000; -} -.month-eventbox { - border: none; - -moz-border-radius: 0; - -webkit-border-radius: 0; - border-bottom: thin solid #000; -} - -body.rightPanel #page { - margin: 0; -} diff --git a/kronolith/themes/screen.css b/kronolith/themes/screen.css index 02d1757b8..134bbb6c1 100644 --- a/kronolith/themes/screen.css +++ b/kronolith/themes/screen.css @@ -1,70 +1,3 @@ -#menu { - /* Menu bottom margin, added for BC. */ - margin-bottom: 8px; -} - -/* Image alignment, added for BC. */ -img { - vertical-align: middle; -} - -/* Added for BC. */ -.hidden { - display: none; -} - -/* Alternating styles. item0, item1 are deprecated. */ -.rowEven { - background: #eee; -} -.rowOdd { - background: #ddd; -} - -/* Sort arrow styles, added for BC. */ -.sortup { - background: #bbcbff url("graphics/za.png") center left no-repeat; - padding-left: 10px; -} -.sortdown { - background: #bbcbff url("graphics/az.png") center left no-repeat; - padding-left: 10px; -} - -/* Calendar Popup, added for BC. */ -table.calendarPopup { - border: 1px solid #ccc; - background: #fff; - width: auto; -} -.calendarPopup thead { - font-weight: bold; -} -.calendarPopup th { - border-bottom: 1px solid #ccc; -} -.calendarPopup tbody { - text-align: right; -} -.calendarPopup a { - color: #000; - display: block; - padding: 2px; -} -.calendarPopup tbody a:hover { - background: #ffc; -} -.calendarPopup .week { - font-style: italic; -} -.calendarPopup .current { - font-weight: bold; - background: #eef; -} -.calendarPopup .today { - font-weight: bold; -} - /* Autocomplete styles. */ .autocomplete { background: #f4f4f4; @@ -100,8 +33,6 @@ table.calendarPopup { font-weight: bold; vertical-align: super; } -.event { -} .event-tentative { font-style: italic; } @@ -371,14 +302,6 @@ table#calendar-list td { border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; } -table#calendar-list th.sortup { - background: #bbcbff url("graphics/za.png") center left no-repeat; - padding-left: 10px; -} -table#calendar-list th.sortdown { - background: #bbcbff url("graphics/az.png") center left no-repeat; - padding-left: 10px; -} #calendar-list-buttons { padding: 1em; @@ -401,41 +324,6 @@ table#calendar-list th.sortdown { width: 1%; } -/* Redbox styles. */ -#RB_overlay { - position: absolute; - z-index: 100; - width: 100%; - height: 100%; - top: 0; - left: 0; - right: 0; - bottom: 0; - min-height: 100%; - background-color: #000; - opacity: .6; - filter: alpha(opacity=60); -} -#RB_loading { - z-index: 101; - width: 66; - margin-left: auto; - margin-right: auto; - margin-top: 200px; - padding-bottom: 66px; - text-align: center; - background: url("graphics/redbox_spinner.gif") no-repeat center bottom; -} -#RB_window { - z-index: 102; - background-color: #fff; - display: block; - text-align: left; - overflow: hidden; - margin: 20px auto 0 auto; - position: absolute; -} - #RB_confirm { width: 20em; padding: 1em; @@ -1414,3 +1302,70 @@ li.panel-tags { border-color: #807b00; color: #000; } + +#calendarPrint { + display: none; +} + +@media print { + .rowEven td, .rowOdd td { + background: #fff; + color: #000; + border-bottom: thin solid #000; + } + .rowEven td td, .rowOdd td td { + border: none; + } + .selected-control { + background: #fff; + border-bottom: thin solid #000; + } + + .iconAlarm, .iconDelete, .iconEdit, .iconRecur, .iconAdd, a.newEvent, .iconNav, #kronolithMenu, #kronolithBar, #kronolithHeader, .tabset { + display: none; + } + + #kronolithBody { + position: static; + } + + #calendarPrint { + display: block; + } + + .day, .othermonth, .weekend { + background-color: #fff; + color: #000; + } + .day { + border-right: thin solid #000; + border-bottom: thin solid #000; + } + .year-event { + background: #fff; + } + table.monthgrid { + border-top: thin solid #000; + border-left: thin solid #000; + } + table.monthgrid th, table.monthgrid td { + border-right: thin solid #000; + border-bottom: thin solid #000; + padding: 2px; + } + table.monthgrid td.today { + border-top: none; + border-left: none; + border-right: thin solid #000; + border-bottom: thin solid #000; + } + .month-eventbox { + border: none; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-bottom: thin solid #000; + } + body.rightPanel #page { + margin: 0; + } +} diff --git a/kronolith/view.php b/kronolith/view.php index 921a8f5c6..77ef9bcb3 100644 --- a/kronolith/view.php +++ b/kronolith/view.php @@ -12,8 +12,7 @@ require_once dirname(__FILE__) . '/lib/base.php'; $view = Kronolith::getView(Horde_Util::getFormData('view')); if ($view) { - $print_view = false; Kronolith::tabs(strtolower(str_replace('kronolith_view_', '', Horde_String::lower(get_class($view))))); $view->html(); - echo '