tweak panel display when displaying display_cals.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 2 Sep 2009 20:18:57 +0000 (16:18 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 2 Sep 2009 20:18:57 +0000 (16:18 -0400)
Add displayed calendar(s) name, and allow expanding/collapsing.
Tweak text to display 'Return to calendars' when anonymous user.

kronolith/templates/panel.inc
kronolith/themes/screen.css

index 118076a..ea9b469 100644 (file)
@@ -1,8 +1,3 @@
-<?php if (!empty($_SESSION['kronolith']['display_cal'])): ?>
-<div id="pageControls">
- <a id="sbarClose" href="<?php echo Horde_Util::addParameter(Horde::selfUrl(true), 'display_cal', '') ?>"><?php echo _("Return to my calendars")?></a>
-</div>
-<?php else: ?>
 <script type="text/javascript">
 function toggleTags(domid)
 {
@@ -31,13 +26,19 @@ foreach (Kronolith::listCalendars() as $id => $cal) {
 
 $tagger = Kronolith::getTagger();
 ?>
-
 <div id="pageControls">
-
-<a id="sbarShow" href="#" onclick="sbarToggle(); return false;"><?php echo _("Calendars") ?></a>
-<a id="sbarHide" href="#" onclick="sbarToggle(); return false;"><?php echo _("Calendars") ?></a>
-
+ <a id="sbarShow" href="#" onclick="sbarToggle(); return false;"><?php echo _("Calendars") ?></a>
+ <a id="sbarHide" href="#" onclick="sbarToggle(); return false;"><?php echo _("Calendars") ?></a>
+ <?php if (!empty($_SESSION['kronolith']['display_cal'])): ?>
+   <a id="sbarClose" href="<?php echo Horde_Util::addParameter(Horde::selfUrl(true), 'display_cal', '') ?>"><?php echo sprintf(_("Return to %s calendars"), Horde_Auth::getAuth() ? _("my") : '') ?></a>
+ <?php endif; ?>
 <div id="pageControlsInner">
+<?php if (!empty($_SESSION['kronolith']['display_cal'])): ?>
+  <h4><?php echo ngettext("Showing calendar:", "Showing Calendars", count($calendar_names)) ?></h4>
+  <?php foreach ($calendar_names as $name): ?>
+   <h4><?php echo $name ?></h4>
+  <?php endforeach; ?>
+<?php else: ?>
 <form action="<?php echo Horde::selfUrl() ?>" method="post">
 <?php echo Horde_Util::formInput() ?>
  <h4><?php echo _("Search for Calendars:") ?></h4>
index 5628dde..73f3caa 100644 (file)
@@ -220,11 +220,12 @@ body.rightPanel #page {
 body #pageControlsInner {
     display: none;
 }
-body #sbarShow, body #sbarHide, body #sbarClose {
+body #sbarShow, body #sbarHide {
     padding-left: 18px;
     white-space: nowrap;
     font-weight: bold;
 }
+
 body #sbarShow {
     display: block;
     background: transparent url("graphics/plus.png") center left no-repeat;
@@ -233,6 +234,12 @@ body #sbarHide {
     display: none;
     background: transparent url("graphics/minus.png") center left no-repeat;
 }
+
+body #sbarClose {
+       white-space: nowrap;
+       padding-left: 18px;
+}
+
 body.rightPanel #pageControlsInner {
     display: block;
 }