Skip to content
Permalink
Browse files

added unbookmark-button and link to share public lists

  • Loading branch information...
Slini11 committed Aug 31, 2015
1 parent 2948047 commit 0f2b49075f0a2aa5c4c40ac8e2d510782fcef855
Showing with 7 additions and 3 deletions.
  1. +3 −0 htdocs/cachelist.php
  2. +4 −3 htdocs/templates2/ocstyle/search.result.caches.tpl
@@ -14,6 +14,7 @@
$watch = isset($_REQUEST['watch']);
$dontwatch = isset($_REQUEST['dontwatch']);
$bookmark = isset($_REQUEST['bookmark']);
$unbookmark = isset($_REQUEST['unbookmark']);
if ($id)
{
@@ -26,6 +27,8 @@
$list->watch($watch);
if ($bookmark)
$list->bookmark($password);
if ($unbookmark)
$list->unbookmark();
}
$tpl->redirect("search.php?searchto=searchbylist&listid=" . $id .
@@ -17,19 +17,20 @@
{if $cachelist.bookmarked}<a href="mylists.php#bookmarks"><img src="resource2/{$opt.template.style}/images/viewcache/cache-rate.png" title="{t}I have bookmarked this list.{/t}" /></a>{/if}
{if $cachelist.watched_by_me}<img src="resource2/{$opt.template.style}/images/viewcache/16x16-watch.png" title="{t}I am watching this list.{/t}" />{/if}
{if $cachelist.user_id != $login.userid}{t}by{/t} <a href="viewprofile.php?userid={$cachelist.user_id}">{$cachelist.username|escape}</a>{elseif $cachelist.visibility<=1}({if $cachelist.password}<a class="jslink" onclick="cl = getElementById('sharelist_{$cachelist.id}'); cl.style.display = (cl.style.display=='none'?'block':'none'); getElementById('permalink_text_{$cachelist.id}').select();" {if $cachelist.user_id==$login.userid}title="{t}List has password; click here to share it{/t}"{/if} >{t}private{/t} <img src="resource2/{$opt.template.style}/images/action/18x16-offer.png" /></a>{else}{t}private{/t}{/if}){/if}
{if $cachelist.visibility>=2}(<a class="jslink" onclick="cl = getElementById('sharelist_{$cachelist.id}'); cl.style.display = (cl.style.display=='none'?'block':'none'); getElementById('permalink_text_{$cachelist.id}').select();" title="{t}click here to share the cachelist{/t}" >{t}share public list{/t} <img src="resource2/{$opt.template.style}/images/viewcache/link.png" /></a>){/if}
&nbsp;
{if $cachelist.user_id==$login.userid}[<a class="systemlink" href="mylists.php?edit={$cachelist.id}&fromsearch=1">{t}edit{/t}</a>]{/if}
{if $login.userid}[<a class="systemlink" href="cachelist.php?id={$cachelist.id}&{if $cachelist.watched_by_me}dont{/if}watch">{if $cachelist.watched_by_me}{t}don't watch{/t}{else}{t}watch{/t}{/if}</a>]{/if}
{if $login.userid && !$cachelist.bookmarked && $cachelist.user_id!=$login.userid}[<a class="systemlink" href="cachelist.php?id={$cachelist.id}&key={$cachelist_pw|urlencode}&bookmark">{t}bookmark{/t}</a>]{/if}
{if $login.userid && $cachelist.bookmarked && $cachelist.user_id!=$login.userid}[<a class="systemlink" href="javascript:if(confirm('{t 1=$cachelist.name|escapejs}Do you really want to unbookmark the list \'%1\'?{/t}'))location.href='cachelist.php?id={$cachelist.id}&unbookmark'">{t}unbookmark{/t}</a>]{/if}
</p>
{if $cachelist.password}
<div id="sharelist_{$cachelist.id}" class="cachelist-popup mapboxframe mapboxshadow" style="display:none" >
<table>
<tr><td><img src="resource2/ocstyle/images/viewcache/link.png" alt="" height="16" width="16" /> {t}Link to share this cache list:{/t}</td><td align="right"><a class="jslink" onclick="getElementById('sharelist_{$cachelist.id}').style.display='none'"><img src="resource2/ocstyle/images/navigation/19x19-close.png" style="opacity:0.7" /></a></td></tr>
<tr><td><input id="permalink_text_{$cachelist.id}" type="text" value="{$opt.page.absolute_url}cachelist.php?id={$cachelist.id}&key={$cachelist.password|urlencode}" size="65" /></td></tr>
<tr><td><input id="permalink_text_{$cachelist.id}" type="text" value="{$opt.page.absolute_url}cachelist.php?id={$cachelist.id}{if $cachelist.password}&key={$cachelist.password|urlencode}{/if}" size="65" /></td></tr>
</table>
</div>
{/if}

{if $cachelist.description != ''}
<div style="padding: 0 8px 4px 10px">
{$cachelist.description}

0 comments on commit 0f2b490

Please sign in to comment.
You can’t perform that action at this time.