auth: store global user metadata in User object
[minimedit.git] / foto / album.inc.php
index e961196e34ad6e9e439fe652212b6374aff9c6de..6d706ca99769bd5c37a3dfc7c46d20c2f55f1cb4 100644 (file)
@@ -24,9 +24,9 @@ function openphotoswipe(index) {
                closeElClasses: [], 
                shareButtons: [
 <?php
-if (!empty($User['admin'])) {
+if ($User and $User->admin) {
        printf("\t\t\t{id:'%s', label:'%s', url:'%s'},\n",
-               'cover', 'Cover instellen', "/edit/fotocover$Args?img={{image_url}}"
+               'cover', 'Cover instellen', "/edit/foto/cover$Args?img={{image_url}}"
        );
 }
 ?>
@@ -104,6 +104,11 @@ function imgjustify() {
        }
 };
 
+if (request = window.location.hash.match(/pid=(.*)/)) {
+       index = images.findIndex(row => row.src == request[1]);
+       openphotoswipe(index);
+}
+
 window.addEventListener('resize', imgjustify, false);
 imgjustify();