Move the tag section into it's own toggle-able node for events.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 29 Jan 2009 19:52:42 +0000 (14:52 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 29 Jan 2009 22:39:53 +0000 (17:39 -0500)
The keyword section will probably go away

kronolith/lib/Views/Event.php
kronolith/templates/edit/edit.inc
kronolith/templates/edit/javascript.inc
kronolith/templates/view/view.inc

index 2587ed9..1aee049 100644 (file)
@@ -112,6 +112,12 @@ class Kronolith_View_Event {
         $dateFormat = $prefs->getValue('date_format');
         $timeFormat = $prefs->getValue('twentyFour') ? 'G:i' : 'g:ia';
 
+        // Tags
+        $tagger = new Kronolith_Tagger();
+        $tags = $tagger->getTags($this->event->getUID(), 'event');
+        $tags = implode(',', array_values($tags));
+
+
         echo '<div id="Event"' . ($active ? '' : ' style="display:none"') . '>';
         require KRONOLITH_TEMPLATES . '/view/view.inc';
         echo '</div>';
index f5842a9..5007393 100644 (file)
   <input type="checkbox" class="checkbox" id="private" name="private"<?php if ($event->isPrivate()) echo ' checked="checked"' ?> />
  </td>
 </tr>
-<!-- tags  -->
-<tr>
- <td class="rightAlign">
-     <strong><?php echo Horde::label('tags', _("Tags"))?></strong>
- </td>
- <td colspan="4">
-   <input type="text" name="tags" id="tags" value="<?php echo $tags?>" size="40" value="<?php echo $tags?>" />
- </td>
-</tr>
 <?php require KRONOLITH_TEMPLATES . '/edit/edit_timespan.inc' ?>
 
 <!-- alarm -->
@@ -414,6 +405,22 @@ endif;
 </tr>
 <?php endif; ?>
 
+<!-- tags  -->
+<tr>
+<td colspan="5" class="control toggle" onclick="toggleSection('tags')">
+ <?php echo Horde::img('tree/blank.png', '', array('id' => 'toggle_tags'), $GLOBALS['registry']->getImageDir('horde')) . ' <strong>' . _("Tags") ?></strong>
+  <span class="extra" id="extra_tags"><?php echo $tags?></span>
+  </td>
+</tr>
+<tr id="section_tags">
+ <td class="rightAlign">
+     <strong><?php echo Horde::label('tags', _("Tags"))?></strong>
+ </td>
+ <td colspan="4">
+   <input type="text" name="tags" id="tags" value="<?php echo $tags?>" size="40" value="<?php echo $tags?>" />
+ </td>
+</tr>
+
 <!-- spacer -->
 <tr>
  <td style="line-height:4px;">&nbsp;</td>
index 936fb91..32a8c39 100644 (file)
@@ -279,6 +279,7 @@ Event.observe(window, 'load', function() {
     toggleSection('description');
     toggleSection('attendees');
     toggleSection('recurrence');
+    toggleSection('tags');
 <?php if ($GLOBALS['conf']['metadata']['keywords']): ?>
     toggleSection('keywords');
 <?php endif; ?>
index 9c8f424..2aa6b55 100644 (file)
@@ -151,6 +151,15 @@ if ($this->event->isInitialized() && $this->event->alarm > 0):
 <?php endforeach; ?>
 <?php endif; ?>
 
+<!-- tags  -->
+<?php if (!empty($tags)):?>
+    <tr>
+     <td colspan="2" class="control"><strong><?php echo _("Tags")?></strong></td>
+    </tr>
+    <tr>
+     <td colspan="2"><?php echo $tags?></td>
+    </tr>
+<?php endif;?>
 <?php if (!$private && !empty($description)): ?>
 <!-- description -->
 <tr>