summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/bookmarkcommondescriptionedit.tpl.php55
-rw-r--r--templates/bookmarks.tpl.php32
-rw-r--r--templates/sidebar.block.tagactions.php8
-rw-r--r--templates/tagcommondescriptionedit.tpl.php48
-rw-r--r--templates/tags.tpl.php3
5 files changed, 144 insertions, 2 deletions
diff --git a/templates/bookmarkcommondescriptionedit.tpl.php b/templates/bookmarkcommondescriptionedit.tpl.php
new file mode 100644
index 0000000..c1723de
--- /dev/null
+++ b/templates/bookmarkcommondescriptionedit.tpl.php
@@ -0,0 +1,55 @@
+<?php
+$this->includeTemplate($GLOBALS['top_include']);
+$userservice = & ServiceFactory :: getServiceInstance('UserService');
+list ($url, $hash) = explode('/', $_SERVER['PATH_INFO']);
+?>
+<script type="text/javascript">
+window.onload = function() {
+ document.getElementById("title").focus();
+}
+</script>
+
+<form action="<?php echo $formaction; ?>" method="post">
+<table>
+<tr>
+ <th align="left"><?php echo T_('Title'); ?></th>
+ <td><input type="text" id="title" name="title" size="75" maxlength="255" value="<?php echo $description['cdTitle']; ?>" onkeypress="this.style.backgroundImage = 'none';" /></td>
+ <td></td>
+</tr>
+<tr>
+ <th align="left"><?php echo T_('Description'); ?></th>
+ <td><textarea name="description" cols="75" rows="10"><?php echo $description['cdDescription']; ?></textarea></td>
+</tr>
+<tr>
+ <td></td>
+ <td>
+ <?php
+ if(strlen($description['cdDatetime'])>0) {
+ echo T_('Last modification: ').$description['cdDatetime'].', ';
+ $lastUser = $userservice->getUser($description['uId']);
+ echo $lastUser['username'];
+ }
+ ?>
+ </td>
+ <td></td>
+</tr>
+<tr>
+ <td></td>
+ <td>
+ <input type="submit" name="confirm" value="<?php echo T_('Update'); ?>" />
+ <input type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" />
+ </td>
+ <td></td>
+</tr>
+</table>
+</p>
+
+<?php if (isset($referrer)): ?>
+<div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div>
+<?php endif; ?>
+<div><input type="hidden" name="hash" value="<?php echo $hash; ?>" /></div>
+</form>
+
+<?php
+$this->includeTemplate($GLOBALS['bottom_include']);
+?>
diff --git a/templates/bookmarks.tpl.php b/templates/bookmarks.tpl.php
index 42015ef..13ee3a0 100644
--- a/templates/bookmarks.tpl.php
+++ b/templates/bookmarks.tpl.php
@@ -1,14 +1,44 @@
<?php
$userservice =& ServiceFactory::getServiceInstance('UserService');
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
$logged_on_userid = $userservice->getCurrentUserId();
$this->includeTemplate($GLOBALS['top_include']);
include('search.inc.php');
-if (count($bookmarks) > 0) {
?>
+<?php
+if((isset($currenttag) && $GLOBALS['enableCommonTagDescription'])
+ || (isset($hash) && $GLOBALS['enableCommonBookmarkDescription'])):?>
+<p class="commondescription">
+
+<?php
+if(isset($currenttag) && $cdservice->getLastTagDescription($currenttag)) {
+ $description = $cdservice->getLastTagDescription($currenttag);
+ echo filter($description['cdDescription']);
+} elseif(isset($hash) && $cdservice->getLastBookmarkDescription($hash)) {
+ $description = $cdservice->getLastBookmarkDescription($hash);
+ echo filter($description['cdTitle']). "<br/>";
+ echo filter($description['cdDescription']). "<br/>";
+}
+
+if($logged_on_userid>0) {
+ if(isset($currenttag)) {
+ echo ' (<a href="'. createURL('tagcommondescriptionedit', $currenttag).'">';
+ echo T_('edit common description').'</a>)';
+ } elseif(isset($hash)) {
+ echo ' (<a href="'.createURL('bookmarkcommondescriptionedit', $hash).'">';
+ echo T_('edit common description').'</a>)';
+ }
+}
+?>
+</p>
+<?php endif ?>
+
+
+<?php if (count($bookmarks) > 0) { ?>
<script type="text/javascript">
window.onload = playerLoad;
</script>
diff --git a/templates/sidebar.block.tagactions.php b/templates/sidebar.block.tagactions.php
index 836c40c..a19db0b 100644
--- a/templates/sidebar.block.tagactions.php
+++ b/templates/sidebar.block.tagactions.php
@@ -1,5 +1,7 @@
<?php
$userservice =& ServiceFactory::getServiceInstance('UserService');
+$tagservice =& ServiceFactory::getServiceInstance('TagService');
+
if ($userservice->isLoggedOn()) {
$currentUser = $userservice->getCurrentUser();
$currentUsername = $currentUser[$userservice->getFieldName('username')];
@@ -9,6 +11,7 @@ if ($userservice->isLoggedOn()) {
$renametext = T_ngettext('Rename Tag', 'Rename Tags', count($tags));
$renamelink = createURL('tagrename', $currenttag);
$deletelink = createURL('tagdelete', $currenttag);
+ $commondesclink = createURL('tagcommondescriptionedit', $currenttag);
?>
<h2><?php echo T_('Actions'); ?></h2>
@@ -18,10 +21,13 @@ if ($userservice->isLoggedOn()) {
<?php if (count($tags) == 1): ?>
<li><a href="<?php echo $deletelink; ?>"><?php echo T_('Delete Tag') ?></a></li>
<?php endif; ?>
+ <?php if ($GLOBALS['enableCommonTagDescription']): ?>
+ <li><a href="<?php echo $commondesclink; ?>"><?php echo T_('Edit Tag Common Description') ?></a></li>
+ <?php endif; ?>
</ul>
</div>
<?php
}
}
-?> \ No newline at end of file
+?>
diff --git a/templates/tagcommondescriptionedit.tpl.php b/templates/tagcommondescriptionedit.tpl.php
new file mode 100644
index 0000000..6e09374
--- /dev/null
+++ b/templates/tagcommondescriptionedit.tpl.php
@@ -0,0 +1,48 @@
+<?php
+$this->includeTemplate($GLOBALS['top_include']);
+$userservice = & ServiceFactory :: getServiceInstance('UserService');
+?>
+<script type="text/javascript">
+window.onload = function() {
+ document.getElementById("description").focus();
+}
+</script>
+<form action="<?php echo $formaction; ?>" method="post">
+<table>
+<tr>
+ <th align="left"><?php echo T_('Description'); ?></th>
+ <td><textarea name="description" cols="75" rows="10"><?php echo $description['cdDescription']; ?></textarea></td>
+</tr>
+<tr>
+ <td></td>
+ <td>
+ <?php
+ if(strlen($description['cdDatetime'])>0) {
+ echo T_('Last modification: ').$description['cdDatetime'].', ';
+ $lastUser = $userservice->getUser($description['uId']);
+ echo $lastUser['username'];
+ }
+ ?>
+ </td>
+ <td></td>
+</tr>
+<tr>
+ <td></td>
+ <td>
+ <input type="submit" name="confirm" value="<?php echo T_('Update'); ?>" />
+ <input type="submit" name="cancel" value="<?php echo T_('Cancel'); ?>" />
+ </td>
+ <td></td>
+</tr>
+</table>
+</p>
+
+<?php if (isset($referrer)): ?>
+<div><input type="hidden" name="referrer" value="<?php echo $referrer; ?>" /></div>
+<?php endif; ?>
+<div><input type="hidden" name="tag" value="<?php echo $tag; ?>" /></div>
+</form>
+
+<?php
+$this->includeTemplate($GLOBALS['bottom_include']);
+?>
diff --git a/templates/tags.tpl.php b/templates/tags.tpl.php
index d5de176..d6259cc 100644
--- a/templates/tags.tpl.php
+++ b/templates/tags.tpl.php
@@ -1,5 +1,8 @@
<?php
$this->includeTemplate($GLOBALS['top_include']);
+?>
+
+<?php
if ($tags && count($tags) > 0) {
?>