]> git.mxchange.org Git - friendica.git/commitdiff
Move mod/lockview to Module\PermissionTooltip
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 26 Jul 2020 22:35:02 +0000 (18:35 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 Jul 2020 05:58:53 +0000 (01:58 -0400)
- Add explicit type parameter to lockview() in main.js

20 files changed:
doc/Addons.md
doc/de/Addons.md
src/Module/PermissionTooltip.php [new file with mode: 0644]
static/routes.config.php
view/js/main.js
view/templates/photo_view.tpl
view/templates/search_item.tpl
view/templates/wall_thread.tpl
view/theme/frio/templates/photo_view.tpl
view/theme/frio/templates/search_item.tpl
view/theme/frio/templates/wall_thread.tpl
view/theme/quattro/templates/photo_view.tpl
view/theme/quattro/templates/search_item.tpl
view/theme/quattro/templates/wall_thread.tpl
view/theme/smoothly/templates/search_item.tpl
view/theme/smoothly/templates/wall_thread.tpl
view/theme/vier/templates/photo_item.tpl
view/theme/vier/templates/photo_view.tpl
view/theme/vier/templates/search_item.tpl
view/theme/vier/templates/wall_thread.tpl

index 54363cb1d7e7abaacd5ffe74f31e14230db29bed..c1861c79135434cad135217c6811c6e838ed9020 100644 (file)
@@ -604,10 +604,6 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
 
     Hook::callAll('post_local_end', $arr);
 
-### mod/lockview.php
-
-    Hook::callAll('lockview_content', $item);
-
 ### mod/uexport.php
 
     Hook::callAll('uexport_options', $options);
@@ -679,6 +675,10 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
     Hook::callAll('register_account', $uid);
     Hook::callAll('remove_user', $user);
 
+### src/Module/PermissionTooltip.php
+
+    Hook::callAll('lockview_content', $item);
+
 ### src/Content/ContactBlock.php
 
     Hook::callAll('contact_block_end', $arr);
index 745010ff4eecbceca37dc6a29ef70eadf04abe9d..2ff7495497de01d4ea7452bf6d4f4147ccd3b519 100644 (file)
@@ -312,10 +312,6 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
 
     Hook::callAll('post_local_end', $arr);
 
-### mod/lockview.php
-
-    Hook::callAll('lockview_content', $item);
-
 ### mod/uexport.php
 
     Hook::callAll('uexport_options', $options);
@@ -422,6 +418,10 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
 
     Hook::callAll('storage_instance', $data);
 
+### src/Module/PermissionTooltip.php
+
+    Hook::callAll('lockview_content', $item);
+
 ### src/Worker/Directory.php
 
     Hook::callAll('globaldir_update', $arr);
diff --git a/src/Module/PermissionTooltip.php b/src/Module/PermissionTooltip.php
new file mode 100644 (file)
index 0000000..59478b3
--- /dev/null
@@ -0,0 +1,122 @@
+<?php
+
+namespace Friendica\Module;
+
+use Friendica\Core\Hook;
+use Friendica\Database\DBA;
+use Friendica\DI;
+use Friendica\Model\Item;
+use Friendica\Model\Group;
+use Friendica\Network\HTTPException;
+
+/**
+ * Outputs the permission tooltip HTML content for the provided item, photo or event id.
+ */
+class PermissionTooltip extends \Friendica\BaseModule
+{
+       public static function rawContent(array $parameters = [])
+       {
+               parent::rawContent($parameters); // TODO: Change the autogenerated stub
+
+               $type = $parameters['type'];
+               $referenceId = $parameters['id'];
+
+               $expectedTypes = ['item', 'photo', 'event'];
+               if (!in_array($type, $expectedTypes)) {
+                       throw new HTTPException\BadRequestException(DI::l10n()->t('Wrong type "%s", expected one of: %s', $type, implode(', ', $expectedTypes)));
+               }
+
+               $condition = ['id' => $referenceId];
+               if ($type == 'item') {
+                       $fields = ['uid', 'psid', 'private'];
+                       $model = Item::selectFirst($fields, $condition);
+               } else {
+                       $fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
+                       $model = DBA::selectFirst($type, $fields, $condition);
+               }
+
+               if (!DBA::isResult($model)) {
+                       throw new HttpException\NotFoundException(DI::l10n()->t('Model not found'));
+               }
+
+               if (isset($model['psid'])) {
+                       $permissionSet = DI::permissionSet()->selectFirst(['id' => $model['psid']]);
+                       $model['allow_cid'] = $permissionSet->allow_cid;
+                       $model['allow_gid'] = $permissionSet->allow_gid;
+                       $model['deny_cid']  = $permissionSet->deny_cid;
+                       $model['deny_gid']  = $permissionSet->deny_gid;
+               }
+
+               // Kept for backwards compatiblity
+               Hook::callAll('lockview_content', $model);
+
+               if ($model['uid'] != local_user() ||
+                       isset($model['private'])
+                       && $model['private'] == Item::PRIVATE
+                       && empty($model['allow_cid'])
+                       && empty($model['allow_gid'])
+                       && empty($model['deny_cid'])
+                       && empty($model['deny_gid']))
+               {
+                       echo DI::l10n()->t('Remote privacy information not available.');
+                       exit;
+               }
+
+               $aclFormatter = DI::aclFormatter();
+
+               $allowed_users  = $aclFormatter->expand($model['allow_cid']);
+               $allowed_groups = $aclFormatter->expand($model['allow_gid']);
+               $deny_users     = $aclFormatter->expand($model['deny_cid']);
+               $deny_groups    = $aclFormatter->expand($model['deny_gid']);
+
+               $o = DI::l10n()->t('Visible to:') . '<br />';
+               $l = [];
+
+               if (count($allowed_groups)) {
+                       $key = array_search(Group::FOLLOWERS, $allowed_groups);
+                       if ($key !== false) {
+                               $l[] = '<b>' . DI::l10n()->t('Followers') . '</b>';
+                               unset($allowed_groups[$key]);
+                       }
+
+                       $key = array_search(Group::MUTUALS, $allowed_groups);
+                       if ($key !== false) {
+                               $l[] = '<b>' . DI::l10n()->t('Mutuals') . '</b>';
+                               unset($allowed_groups[$key]);
+                       }
+
+                       foreach (DI::dba()->selectToArray('group', ['name'], ['id' => $allowed_groups]) as $group) {
+                               $l[] = '<b>' . $group['name'] . '</b>';
+                       }
+               }
+
+               foreach (DI::dba()->selectToArray('contact', ['name'], ['id' => $allowed_users]) as $contact) {
+                       $l[] = $contact['name'];
+               }
+
+               if (count($deny_groups)) {
+                       $key = array_search(Group::FOLLOWERS, $deny_groups);
+                       if ($key !== false) {
+                               $l[] = '<b><strike>' . DI::l10n()->t('Followers') . '</strike></b>';
+                               unset($deny_groups[$key]);
+                       }
+
+                       $key = array_search(Group::MUTUALS, $deny_groups);
+                       if ($key !== false) {
+                               $l[] = '<b><strike>' . DI::l10n()->t('Mutuals') . '</strike></b>';
+                               unset($deny_groups[$key]);
+                       }
+
+                       foreach (DI::dba()->selectToArray('group', ['name'], ['id' => $allowed_groups]) as $group) {
+                               $l[] = '<b><strike>' . $group['name'] . '</strike></b>';
+                       }
+               }
+
+               foreach (DI::dba()->selectToArray('contact', ['name'], ['id' => $deny_users]) as $contact) {
+                       $l[] = '<strike>' . $contact['name'] . '</strike>';
+               }
+
+               echo $o . implode(', ', $l);
+               exit();
+       }
+}
index 8c3fba99b7623ac2d416f7af648bf765949c447d..ddfabd77801dc3a813b91da3a6b8432cd178b3cf 100644 (file)
@@ -237,6 +237,8 @@ return [
        '/openid'         => [Module\Security\OpenID::class, [R::GET]],
        '/opensearch'     => [Module\OpenSearch::class,      [R::GET]],
 
+       '/permission/tooltip/{type}/{id:\d+}' => [Module\PermissionTooltip::class, [R::GET]],
+
        '/photo' => [
                '/{name}'                    => [Module\Photo::class, [R::GET]],
                '/{type}/{name}'             => [Module\Photo::class, [R::GET]],
index 60337918b4ecd3addb4e4fcdf0dd5382a03df3c3..36c9cbb88d75dd0c9e3b12f3b2bc0a41b1f2beb2 100644 (file)
@@ -750,26 +750,23 @@ function getPosition(e) {
 
 var lockvisible = false;
 
-function lockview(event,id) {
+function lockview(event, type, id) {
        event = event || window.event;
        cursor = getPosition(event);
        if (lockvisible) {
-               lockviewhide();
+               lockvisible = false;
+               $('#panel').hide();
        } else {
                lockvisible = true;
-               $.get('lockview/' + id, function(data) {
-                       $('#panel').html(data);
-                       $('#panel').css({'left': cursor.x + 5 , 'top': cursor.y + 5});
-                       $('#panel').show();
+               $.get('permission/tooltip/' + type + '/' + id, function(data) {
+                       $('#panel')
+                               .html(data)
+                               .css({'left': cursor.x + 5 , 'top': cursor.y + 5})
+                               .show();
                });
        }
 }
 
-function lockviewhide() {
-       lockvisible = false;
-       $('#panel').hide();
-}
-
 function post_comment(id) {
        unpause();
        commentBusy = true;
@@ -940,14 +937,6 @@ function groupChangeMember(gid, cid, sec_token) {
        });
 }
 
-function profChangeMember(gid,cid) {
-       $('body .fakelink').css('cursor', 'wait');
-       $.get('profperm/' + gid + '/' + cid, function(data) {
-                       $('#prof-update-wrapper').html(data);
-                       $('body .fakelink').css('cursor', 'auto');
-       });
-}
-
 function contactgroupChangeMember(checkbox, gid, cid) {
        let url;
        // checkbox.checked is the checkbox state after the click
index 7170ceb333a054db29d79897879e66e1601a4377..0d7ccb20fa2ccd07cbbbad870366ebc343577b68 100644 (file)
@@ -17,7 +17,7 @@
                | <a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
        {{/if}}
        {{if $tools.lock}}
-               | <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event,'photo/{{$id}}');" />
+               | <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event, 'photo', {{$id}});" />
        {{/if}}
 {{/if}}
 </div>
index 38aa947498cb974c237474ffcdc05c86ae34259c..1a756db8a33e001eacd65e7a5d5a70972df10bdd 100644 (file)
@@ -17,7 +17,7 @@
                        </div>
                        <div class="wall-item-photo-end"></div> 
                        <div class="wall-item-wrapper" id="wall-item-wrapper-{{$item.id}}" >
-                               {{if $item.lock}}<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="{{$item.lock}}" onclick="lockview(event,{{$item.id}});" /></div>
+                               {{if $item.lock}}<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="{{$item.lock}}" onclick="lockview(event, 'item', {{$item.id}});" /></div>
                                {{else}}<div class="wall-item-lock"></div>{{/if}}       
                                <div class="wall-item-location" id="wall-item-location-{{$item.id}}">{{$item.location nofilter}}</div>
                        </div>
index 0d8c896e164d63610ce99b103d8609b9da0f2860..cec886253f98abee9ae9680317c1ef4e77025557 100644 (file)
@@ -43,7 +43,7 @@
                        </div>
                        <div class="wall-item-photo-end"></div>
                        <div class="wall-item-wrapper" id="wall-item-wrapper-{{$item.id}}" >
-                               {{if $item.lock}}<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="{{$item.lock}}" onclick="lockview(event,{{$item.id}});" /></div>
+                               {{if $item.lock}}<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="{{$item.lock}}" onclick="lockview(event, 'item', {{$item.id}});" /></div>
                                {{else}}<div class="wall-item-lock"></div>{{/if}}
                                <div class="wall-item-location" id="wall-item-location-{{$item.id}}">{{$item.location nofilter}}</div>
                        </div>
index 91e9dafe4426dad38458ea974a9ab23372df57f6..de45eecff0c5a02b2542cee1f35bfcf4a54990ae 100644 (file)
@@ -37,7 +37,7 @@
        {{/if}}
        {{if $tools.lock}}
                <span class="icon-padding"> </span>
-               <a id="photo-lock-link" onclick="lockview(event,'photo/{{$id}}');" title="{{$tools.lock}}" data-toggle="tooltip">
+               <a id="photo-lock-link" onclick="lockview(event, 'photo', {{$id}});" title="{{$tools.lock}}" data-toggle="tooltip">
                        <i class="page-action faded-icon fa fa-lock"></i>
                </a>
        {{/if}}
index a5b6d52d6dc5a2d4b21b8e828381ea2b080236fb..2cd231f8fbd48f2225e2fdecec5d81f5e7fb5030 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TODO => Unknow block -->
 <div class="wall-item-decor" style="display:none;">
        <span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>
-       {{if $item.lock}}<span class="navicon lock fakelink" onclick="lockview(event, {{$item.id}});" title="{{$item.lock}}"></span><span class="fa fa-lock" aria-hidden="true"></span>{{/if}}
+       {{if $item.lock}}<span class="navicon lock fakelink" onclick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}"></span><span class="fa fa-lock" aria-hidden="true"></span>{{/if}}
 </div>
 <!-- ./TODO => Unknow block -->
 
@@ -56,7 +56,7 @@
                                        </a>
                                {{/if}}
                                {{if $item.lock}}
-                                       <span class="navicon lock fakelink" onClick="lockview(event, {{$item.id}});" title="{{$item.lock}}">
+                                       <span class="navicon lock fakelink" onClick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}">
                                                &nbsp;<small><i class="fa fa-lock" aria-hidden="true"></i></small>
                                        </span>
                                {{/if}}
index c15b110ec9b91c9d98824e8b0e311c12b19ce24a..5e7f49bf48cb0a595e4bc70276862a0406d7fea5 100644 (file)
@@ -63,7 +63,7 @@ as the value of $top_child_total (this is done at the end of this file)
        {{if $item.star}}
        <span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>
        {{/if}}
-       {{if $item.lock}}<span class="navicon lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}"></span><span class="fa fa-lock"></span>{{/if}}
+       {{if $item.lock}}<span class="navicon lock fakelink" onclick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}"></span><span class="fa fa-lock"></span>{{/if}}
 </div>
 {{* /TODO => Unknown block *}}
 
@@ -138,7 +138,7 @@ as the value of $top_child_total (this is done at the end of this file)
                                </a>
                        {{/if}}
                        {{if $item.lock}}
-                               <span class="navicon lock fakelink" onClick="lockview(event,{{$item.id}});" title="{{$item.lock}}" data-toggle="tooltip">
+                               <span class="navicon lock fakelink" onClick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}" data-toggle="tooltip">
                                        &nbsp;<small><i class="fa fa-lock" aria-hidden="true"></i></small>
                                </span>
                        {{/if}}
index 1ce336b0a61b22bbac4c746cb5451cf72e4790a0..11947643c61fec47ff5c2838f45425f08ac4a179 100644 (file)
@@ -16,7 +16,7 @@
         | <a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
     {{/if}}
     {{if $tools.lock}}
-        | <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event,'photo/{{$id}}');" />
+        | <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event, 'photo', {{$id}});" />
     {{/if}}
 {{/if}}
 </div>
index 0e4aaaf8f72a2156acb8131eaca2e9d34f8fc125..cb400ac4f5486792b1ced3ddc2b0d7487cd361ec 100644 (file)
@@ -1,6 +1,6 @@
 <div class="wall-item-decor">
        {{if $item.star}}<span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>{{/if}}
-       {{if $item.lock}}<span class="icon s22 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
+       {{if $item.lock}}<span class="icon s22 lock fakelink" onclick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
        <img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
 </div>
 
index e6d8b97547d62685a73d5ea7d3f4c6f29d0ed95c..b6907219ffd2cc8fb63ec93731057617e41b3d66 100644 (file)
@@ -24,7 +24,7 @@
 
 <div class="wall-item-decor">
        {{if $item.star}}<span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>{{/if}}
-       {{if $item.lock}}<span class="icon s22 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
+       {{if $item.lock}}<span class="icon s22 lock fakelink" onclick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
        <img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
 </div>
 
index 23af1b794b18f71acf9b7b63cca542601fb242f1..b3ae01eb4eb1da1823a95fff208bd0a51b2fcadc 100644 (file)
@@ -18,7 +18,7 @@
                        <div class="wall-item-location" id="wall-item-location-{{$item.id}}">{{if $item.location}}<span class="icon globe"></span>{{$item.location nofilter}} {{/if}}</div>
                </div>
                <div class="wall-item-lock-wrapper">
-                               {{if $item.lock}}<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="{{$item.lock}}" onclick="lockview(event,{{$item.id}});" /></div>
+                               {{if $item.lock}}<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="{{$item.lock}}" onclick="lockview(event, 'item', {{$item.id}});" /></div>
                                {{else}}<div class="wall-item-lock"></div>{{/if}}                       
                </div>
                <div class="wall-item-tools" id="wall-item-tools-{{$item.id}}">
index 85d480c31f551be1c2fed6150221dfdddfe73ee2..4ff34aed112a177256038b6c7c653cc09a42da15 100644 (file)
@@ -42,7 +42,7 @@
                <div class="wall-item-lock-wrapper">
                        {{if $item.lock}}
                        <div class="wall-item-lock">
-                       <img src="images/lock_icon.gif" class="lockview" alt="{{$item.lock}}" onclick="lockview(event,{{$item.id}});" />
+                       <img src="images/lock_icon.gif" class="lockview" alt="{{$item.lock}}" onclick="lockview(event, 'item', {{$item.id}});" />
                        </div>
                        {{else}}
                        <div class="wall-item-lock"></div>
index f0b7a608904e5b3f29685efaf40ffd977ceddfe0..94e9232af548d2e86a8d19e83c8b5af993952244 100644 (file)
@@ -11,7 +11,7 @@
                        <a href="{{$profile_url}}" target="redir" title="{{$linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$sparkle}}">{{$name}}</span></a>
                        <span class="wall-item-ago">
                                {{if $plink}}<a class="link" title="{{$plink.title}}" href="{{$plink.href}}" style="color: #999">{{$ago}}</a>{{else}} {{$ago}} {{/if}}
-                               {{if $lock}}<span class="fakelink" style="color: #999" onclick="lockview(event,{{$id}});">{{$lock}}</span> {{/if}}
+                               {{if $lock}}<span class="fakelink" style="color: #999" onclick="lockview(event, 'item', {{$id}});">{{$lock}}</span> {{/if}}
                        </span>
                </div>
                <div class="wall-item-content">
index f70ec5b561ed40bc5ad93b96cc3084f50c1e5f32..87501c031a01c685bedd934c673ca72f3845dc99 100644 (file)
@@ -17,7 +17,7 @@
                | <a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
        {{/if}}
        {{if $tools.lock}}
-               | <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event,'photo/{{$id}}');" />
+               | <img src="images/lock_icon.gif" class="lockview" alt="{{$tools.lock}}" onclick="lockview(event, 'photo', {{$id}});" />
        {{/if}}
 {{/if}}
 </div>
index 1813dd49f641314b0919b07ba94ab3ae3279916b..1da18b0867c1bc08db364d13d8658c3d509cb9bf 100644 (file)
@@ -2,7 +2,7 @@
 
 <div class="wall-item-decor">
        {{if $item.star}}<span class="icon star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>{{/if}}
-       {{if $item.lock}}<span class="icon lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
+       {{if $item.lock}}<span class="icon lock fakelink" onclick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
        <img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
 </div>
 
@@ -25,7 +25,7 @@
                        <a href="{{$item.profile_url}}" target="redir" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}">{{$item.name}}</span></a>
                        <span class="wall-item-ago">
                                {{if $item.plink}}<a class="link" title="{{$item.plink.title}}" href="{{$item.plink.href}}" style="color: #999">{{$item.ago}}</a>{{else}} {{$item.ago}} {{/if}}
-                               {{if $item.lock}}<span class="fakelink" style="color: #999" onclick="lockview(event,{{$item.id}});">{{$item.lock}}</span> {{/if}}
+                               {{if $item.lock}}<span class="fakelink" style="color: #999" onclick="lockview(event, 'item', {{$item.id}});">{{$item.lock}}</span> {{/if}}
                        </span>
                </div>
                <div class="wall-item-content">
index 04ea7b424d09fda02075dc5e807e83a3f16602d9..430a6943e3a2a47ade1679447776e06796df57d0 100644 (file)
@@ -65,7 +65,7 @@
                                {{/if}}
                                <span class="pinned">{{$item.pinned}}</span>
                        </span>
-                       {{if $item.lock}}<span class="icon s10 lock fakelink" onclick="lockview(event,{{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
+                       {{if $item.lock}}<span class="icon s10 lock fakelink" onclick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}">{{$item.lock}}</span>{{/if}}
                        <span class="wall-item-network" title="{{$item.app}}">
                                {{$item.network_name}}
                        </span>