From: Michael M Slusarz Date: Sun, 16 Aug 2009 23:19:01 +0000 (-0600) Subject: Bug #8465: Print view now handled entirely by HTML/CSS X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a349de9ba92bc4e879b46b6e955f59f134ec4c07;p=horde.git Bug #8465: Print view now handled entirely by HTML/CSS --- diff --git a/turba/contact.php b/turba/contact.php index baab1dd0b..b87d089b4 100644 --- a/turba/contact.php +++ b/turba/contact.php @@ -52,14 +52,11 @@ if ($vars->get('action') == 'mark_own') { $notification->push(_("This contact has been marked as your own."), 'horde.success'); } -// Are we printing? -$print_view = (bool)Horde_Util::getFormData('print'); - // Get view. $viewName = Horde_Util::getFormData('view', 'Contact'); switch ($viewName) { case 'Contact': - $view = new Turba_View_Contact($contact, $print_view); + $view = new Turba_View_Contact($contact); if (!$vars->get('url')) { $vars->set('url', $contact->url(null, true)); } @@ -104,15 +101,9 @@ if ($own_source == $source && $own_id == $contact->getValue('__key')) { $title = $view->getTitle(); Horde::addScriptFile('contact_tabs.js', 'turba', true); require TURBA_TEMPLATES . '/common-header.inc'; -if ($print_view) { - require_once $registry->get('templates', 'horde') . '/javascript/print.js'; -} else { - require TURBA_TEMPLATES . '/menu.inc'; -} +require TURBA_TEMPLATES . '/menu.inc'; echo '
'; -if (!$print_view) { - echo $tabs->render($viewName); -} +echo $tabs->render($viewName); echo '

' . $own_link . ($contact->getValue('name') ? htmlspecialchars($contact->getValue('name')) diff --git a/turba/lib/Turba.php b/turba/lib/Turba.php index 68ba6016e..093a7fb7b 100644 --- a/turba/lib/Turba.php +++ b/turba/lib/Turba.php @@ -601,11 +601,6 @@ class Turba { $menu->add(Horde::applicationUrl('data.php'), _("_Import/Export"), 'data.png', $GLOBALS['registry']->getImageDir('horde')); } - /* Print. */ - if (isset($GLOBALS['print_link'])) { - $menu->add($GLOBALS['print_link'], _("_Print"), 'print.png', $GLOBALS['registry']->getImageDir('horde'), '_blank', Horde::popupJs($GLOBALS['print_link'], array('urlencode' => true)) . 'return false);', '__noselection'); - } - return $menu; } diff --git a/turba/lib/View/Contact.php b/turba/lib/View/Contact.php index 9183c3207..da9a14f60 100644 --- a/turba/lib/View/Contact.php +++ b/turba/lib/View/Contact.php @@ -16,24 +16,11 @@ class Turba_View_Contact { var $contact; /** - * @var boolean - */ - var $print = false; - - /** * @param Turba_Object &$contact */ - public function __construct(&$contact, $print = null) + public function __construct(&$contact) { $this->contact = &$contact; - if (!is_null($print)) { - $this->print = $print; - } - - /* Set print link. */ - if (!$this->print) { - $GLOBALS['print_link'] = Horde_Util::addParameter($this->contact->url(), 'print', 1); - } } function getTitle() @@ -104,7 +91,7 @@ class Turba_View_Contact { if (!empty($comments['threads'])) { echo '
' . $comments['threads']; } - if (!empty($comments['comments']) && !$this->print) { + if (!empty($comments['comments'])) { echo '
' . $comments['comments']; } diff --git a/turba/themes/screen.css b/turba/themes/screen.css index 058b001b9..1c722081f 100644 --- a/turba/themes/screen.css +++ b/turba/themes/screen.css @@ -105,3 +105,9 @@ table#addressbook-list th.sortdown { margin-right: 2px; cursor: default; } + +@media print { + .tabset, #page h1.header span.smallheader { + display: none !important; + } +}