diff options
47 files changed, 94 insertions, 1131 deletions
diff --git a/actions/photos/admin/upgrade.php b/actions/photos/admin/upgrade.php index c9ae1da48..8e03c6bc5 100644 --- a/actions/photos/admin/upgrade.php +++ b/actions/photos/admin/upgrade.php @@ -5,7 +5,7 @@ $plugins_path = elgg_get_plugins_path(); -require_once "{$plugins_path}tidypics/version.php"; +require_once "{$plugins_path}lightpics/version.php"; $local_version = elgg_get_plugin_setting('version', 'tidypics'); @@ -16,7 +16,7 @@ if ($version <= $local_version) { set_time_limit(0); -$base_dir = "{$plugins_path}tidypics/upgrades"; +$base_dir = "{$plugins_path}lightpics/upgrades"; // taken from engine/lib/version.php if ($handle = opendir($base_dir)) { diff --git a/actions/photos/image/tag.php b/actions/photos/image/tag.php deleted file mode 100644 index e623bd546..000000000 --- a/actions/photos/image/tag.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php -/** - * Add photo tag action - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$coordinates_str = get_input('coordinates'); -$username = get_input('username'); -$image_guid = get_input('guid'); - -if ($image_guid == 0) { - register_error(elgg_echo("tidypics:phototagging:error")); - forward(REFERER); -} - -$image = get_entity($image_guid); -if (!$image) { - register_error(elgg_echo("tidypics:phototagging:error")); - forward(REFERER); -} - -if (empty($username)) { - register_error(elgg_echo("tidypics:phototagging:error")); - forward(REFERER); -} - -$user = get_user_by_username($username); -if (!$user) { - // plain tag - $relationships_type = 'word'; - $value = $username; -} else { - $relationships_type = 'user'; - $value = $user->guid; -} - -/* // not adding as plain tag yet -$new_word_tag = false; -if ($user_id != 0) { - $relationships_type = 'user'; - $value = $user_id; -} else { - $relationships_type = 'word'; - $value = $word; - - // check to see if the photo has this tag and add if not - if (!is_array($image->tags)) { - if ($image->tags != $word) { - $new_word_tag = true; - $tagarray = $image->tags . ',' . $word; - $tagarray = string_to_tag_array($tagarray); - } - } else { - if (!in_array($word, $image->tags)) { - $new_word_tag = true; - $tagarray = $image->tags; - $tagarray[] = $word; - } - } -} - -// add new tag now so it is available in search -if ($new_word_tag) { - $image->clearMetadata('tags'); - $image->tags = $tagarray; -} -*/ - -$tag = new stdClass(); -$tag->coords = $coordinates_str; -$tag->type = $relationships_type; -$tag->value = $value; -$access_id = $image->getAccessID(); - -$annotation_id = $image->annotate('phototag', serialize($tag), $access_id); -if ($annotation_id) { - // if tag is a user id, add relationship for searching (find all images with user x) - if ($tag->type === 'user') { - if (!check_entity_relationship($tag->value, 'phototag', $image_guid)) { - add_entity_relationship($tag->value, 'phototag', $image_guid); -/* - // also add this to the river - subject is image, object is the tagged user - add_to_river('river/object/image/tag', 'tag', $tagger->guid, $user_id, $access_id, 0, $annotation_id); - - // notify user of tagging as long as not self - if ($owner_id != $user_id) { - notify_user( - $user_id, - $owner_id, - elgg_echo('tidypics:tag:subject'), - sprintf( - elgg_echo('tidypics:tag:body'), - $image->getTitle(), - $tagger->name, - $image->getURL() - ) - ); - } - * - */ - } - } - - system_message(elgg_echo("tidypics:phototagging:success")); -} - -forward(REFERER); diff --git a/actions/photos/image/untag.php b/actions/photos/image/untag.php deleted file mode 100644 index 11c433a61..000000000 --- a/actions/photos/image/untag.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * Remove photo tag action - */ - -$annotation = elgg_get_annotation_from_id(get_input('annotation_id')); - -if (!$annotation instanceof ElggAnnotation || $annotation->name != 'phototag') { - register_error(elgg_echo("tidypics:phototagging:delete:error")); - forward(REFERER); -} - -if (!$annotation->canEdit()) { - register_error(elgg_echo("tidypics:phototagging:delete:error")); - forward(REFERER); -} - -if ($annotation->delete()) { - system_message(elgg_echo("tidypics:phototagging:delete:success")); -} else { - system_message(elgg_echo("tidypics:phototagging:delete:error")); -} - -forward(REFERER); diff --git a/activate.php b/activate.php index 6b8390406..b0f4a0c7f 100644 --- a/activate.php +++ b/activate.php @@ -19,7 +19,6 @@ if (get_subtype_id('object', 'image')) { } // set default settings -$plugin = elgg_get_plugin_from_id('tidypics'); $image_sizes = array(); $image_sizes['large_image_width'] = $image_sizes['large_image_height'] = 600; @@ -46,7 +45,7 @@ $defaults = array( ); foreach ($defaults as $name => $value) { - if ($plugin->getSetting($name) === null) { - $plugin->setSetting($name, $value); + if (elgg_get_plugin_setting($name, 'tidypics') === null) { + elgg_set_plugin_setting($name, $value, 'tidypics'); } } diff --git a/classes/TidypicsAlbum.php b/classes/TidypicsAlbum.php index a03df2d37..0cb8bd84e 100644 --- a/classes/TidypicsAlbum.php +++ b/classes/TidypicsAlbum.php @@ -128,7 +128,7 @@ class TidypicsAlbum extends ElggObject { 'list_type' => 'gallery', 'list_type_toggle' => false, 'pagination' => true, - 'gallery_class' => 'tidypics-gallery', + 'gallery_class' => 'tidypics-gallery elgg-lightbox-gallery', ); $options = array_merge($defaults, (array) $options); diff --git a/languages/da.php b/languages/da.php index c90e8f55d..3e454540c 100644 --- a/languages/da.php +++ b/languages/da.php @@ -56,14 +56,12 @@ $danish = array( 'tidypics:admin:instructions' => 'Dette er de centrale Tidypics indstillinger. Tilpas dem til din opsætning og klik derefter på Gem.',
'tidypics:settings:image_lib' => "Foto arkiv: ",
'tidypics:settings:download_link' => "Vis download-link",
- 'tidypics:settings:tagging' => "Tillad fotolinks",
'tidypics:settings:photo_ratings' => "Tillad karakterergivning af foto (kræver plugin af Miguel Montes eller andet kompatibelt plugin)",
'tidypics:settings:exif' => "Vis EXIF data",
'tidypics:settings:view_count' => "Vis tæller",
'tidypics:settings:grp_perm_override' => "Giv gruppens medlemmer fuld adgang til gruppe-album",
'tidypics:settings:maxfilesize' => "Maksimal billedstørrelse i megabytes (MB):",
'tidypics:settings:quota' => "Tildelt plads til brugere / grupper (MB) (0 = Ingen plads)",
- 'tidypics:settings:watermark' => "Indtast teksten for vandmærke - ImageMagick cmdline skal vælges for billedbiblioteket",
'tidypics:settings:im_path' => "Angiv stien til ImageMagick kommandoer (som slutter med et Slash/)",
'tidypics:settings:img_river_view' => "Hvor mange poster i aktivitetslisten for hvert parti af uploadede billeder",
'tidypics:settings:album_river_view' => "Vis albumcover eller et sæt af fotos til nye album",
@@ -104,22 +102,6 @@ $danish = array( 'image:back' => "Forrige",
'image:next' => "Næste",
- // tagging
- 'tidypics:taginstruct' => 'Vælg et område på billedet, som du ønsker at linke',
- 'tidypics:deltag_title' => 'Vælg at slette links',
- 'tidypics:finish_tagging' => 'Annuller',
- 'tidypics:tagthisphoto' => 'Tilføj link til foto',
- 'tidypics:deletetag' => 'Slet foto link',
- 'tidypics:actiontag' => 'Link',
- 'tidypics:actiondelete' => 'Slet',
- 'tidypics:actioncancel' => 'Annuller',
- 'tidypics:inthisphoto' => 'Links i billedet',
- 'tidypics:usertag' => "Foto links til medlem %s",
- 'tidypics:phototagging:success' => 'Foto link tilføjet',
- 'tidypics:phototagging:error' => 'Uventet fejl ved linket',
- 'tidypics:deletetag:success' => 'Udvalgte links er blevet fjernet',
-
-
//rss
'tidypics:posted' => 'Billedet indstilles individuelt:',
@@ -137,8 +119,6 @@ $danish = array( 'image:river:created:multiple' => "%s added %u photos to album %s",
'image:river:item' => "et billede",
'image:river:annotate' => "en kommentar til billedet",
- 'image:river:tagged' => "%s tagged %s in the photo %s",
- 'image:river:tagged:unknown' => "%s tagged %s in a photo",
'album:river:created' => "%s har tilføjet et nyt album",
'album:river:group' => "i gruppen",
'album:river:item' => "et album",
diff --git a/languages/de.php b/languages/de.php index b6817c589..67763d622 100644 --- a/languages/de.php +++ b/languages/de.php @@ -64,14 +64,12 @@ $german = array( 'tidypics:settings:thumbnail' => "Erzeugung von Vorschaubildern",
'tidypics:settings:help' => "Hilfe",
'tidypics:settings:download_link' => "Zeige Download-Link",
- 'tidypics:settings:tagging' => "Tagging von Bildern erlauben",
'tidypics:settings:photo_ratings' => "Bewerten von Bildern erlauben (benötigt das Elggx Fivestar-Plugin oder ein vergleichbares)",
'tidypics:settings:exif' => "EXIF-Daten anzeigen",
'tidypics:settings:view_count' => "Zugriffszähler anzeigen",
'tidypics:settings:grp_perm_override' => "Gruppen-Mitgliedern unbeschränkten Zugriff auf die Verwaltung von Gruppen-Alben geben",
'tidypics:settings:maxfilesize' => "Maximal erlaubte Bildgröße in Megabytes (MB):",
'tidypics:settings:quota' => "Quota für Benutzer in Megabytes (MB) (0 = kein Quota)",
- 'tidypics:settings:watermark' => "Gib den Text ein, der als Wasserzeichen eingefügt wird",
'tidypics:settings:im_path' => "Der Pfad zu den ImageMagick-Kommandozeilentools auf dem Server",
'tidypics:settings:img_river_view' => "Anzahl der Einträge im River beim gleichzeitigen Hochladen mehrerer Bilder",
'tidypics:settings:album_river_view' => "Anzeige des Albumcovers oder eines Sets von Bildern für neue Alben",
@@ -167,29 +165,6 @@ $german = array( 'image:next' => "Nächstes",
'image:index' => "%u von %u",
- // tagging
- 'tidypics:taginstruct' => 'Wähle den Bereich auf dem Bild, für das Du ein Tag setzen willst, oder %s.',
- 'tidypics:finish_tagging' => 'Taggen beenden',
- 'tidypics:deltag_title' => 'Wähle die Tags, die gelöscht werden sollen',
- 'tidypics:finish_tagging' => 'Tagging abbrechen',
- 'tidypics:tagthisphoto' => 'Bild taggen',
- 'tidypics:actiontag' => 'Tag setzen',
- 'tidypics:actioncancel' => 'Abbrechen',
- 'tidypics:inthisphoto' => 'Tags in diesem Bild',
- 'tidypics:usertag' => "Bilder mit Tags, die sich auf %s beziehen",
- 'tidypics:phototagging:success' => 'Das Bild wurde getaggt.',
- 'tidypics:phototagging:error' => 'Beim Hinzufügen des Tags ist ein Fehler aufgetreten.',
-
- 'tidypics:phototagging:delete:success' => 'Das Tag wurde entfernt.',
- 'tidypics:phototagging:delete:error' => 'Beim Entfernen des Tags ist ein Fehler aufgetreten.',
- 'tidypics:phototagging:delete:confirm' => 'Dieses Tag entfernen?',
-
- 'tidypics:tag:subject' => "Du wurdest in einem Bild getaggt",
- 'tidypics:tag:body' => "Du wurdest im Bild %s von %s getaggt.
-
-Um das Bild zu sehen, folge diesem Link: %s",
-
-
//rss
'tidypics:posted' => 'hat ein Bild hinzugefügt:',
@@ -208,8 +183,6 @@ Um das Bild zu sehen, folge diesem Link: %s", 'image:river:created:multiple' => "%s hat %u Bilder zum Album %s hinzugefügt.",
'image:river:item' => "ein Bild",
'image:river:annotate' => "einen Kommentar zum Bild",
- 'image:river:tagged' => "%s hat %s im Bild %s getaggt.",
- 'image:river:tagged:unknown' => "%s hat %s in einem Bild getaggt.",
'river:create:object:album' => "%s hat das neue Bilderalbum %s hinzugefügt.",
'album:river:group' => "in der Gruppe",
'album:river:item' => "ein Album",
diff --git a/languages/en.php b/languages/en.php index 9d8773efd..65a7ea417 100644 --- a/languages/en.php +++ b/languages/en.php @@ -71,14 +71,12 @@ $english = array( 'tidypics:settings:thumbnail' => "Thumbnail Creation", 'tidypics:settings:help' => "Help", 'tidypics:settings:download_link' => "Show download link", - 'tidypics:settings:tagging' => "Enable photo tagging", 'tidypics:settings:photo_ratings' => "Enable photo ratings (requires rate plugin of Miguel Montes or compatible)", 'tidypics:settings:exif' => "Display EXIF data", 'tidypics:settings:view_count' => "Display view count", 'tidypics:settings:grp_perm_override' => "Allow group members full access to group albums", 'tidypics:settings:maxfilesize' => "Maximum image size in megabytes (MB):", 'tidypics:settings:quota' => "User Quota (MB) - 0 equals no quota", - 'tidypics:settings:watermark' => "Enter text to appear in the watermark", 'tidypics:settings:im_path' => "Enter the path to your ImageMagick commands", 'tidypics:settings:img_river_view' => "How many entries in activity river for each batch of uploaded images", 'tidypics:settings:album_river_view' => "Show the album cover or a set of photos for new album", @@ -181,29 +179,6 @@ $english = array( 'image:next' => "Next", 'image:index' => "%u of %u", - // tagging - 'tidypics:taginstruct' => 'Select the area that you want to tag or %s', - 'tidypics:finish_tagging' => 'Stop tagging', - 'tidypics:tagthisphoto' => 'Tag this photo', - 'tidypics:actiontag' => 'Tag', - 'tidypics:actioncancel' => 'Cancel', - 'tidypics:inthisphoto' => 'In this photo', - 'tidypics:usertag' => "Photos tagged with user %s", - 'tidypics:phototagging:success' => 'Photo tag was successfully added', - 'tidypics:phototagging:error' => 'Unexpected error occurred during tagging', - - 'tidypics:phototagging:delete:success' => 'Photo tag was removed.', - 'tidypics:phototagging:delete:error' => 'Unexpceted error occurred when removing photo tag.', - 'tidypics:phototagging:delete:confirm' => 'Remove this tag?', - - - - 'tidypics:tag:subject' => "You have been tagged in a photo", - 'tidypics:tag:body' => "You have been tagged in the photo %s by %s. - -The photo can be viewed here: %s", - - //rss 'tidypics:posted' => 'posted a photo:', @@ -222,8 +197,6 @@ The photo can be viewed here: %s", 'image:river:created:multiple' => "%s added %u photos to the album %s", 'image:river:item' => "a photo", 'image:river:annotate' => "a comment on the photo", - 'image:river:tagged' => "%s tagged %s in the photo %s", - 'image:river:tagged:unknown' => "%s tagged %s in a photo", 'river:create:object:album' => "%s created a new photo album %s", 'album:river:group' => "in the group", 'album:river:item' => "an album", diff --git a/languages/es.php b/languages/es.php index efe65d976..154d7188a 100644 --- a/languages/es.php +++ b/languages/es.php @@ -51,14 +51,12 @@ $spanish = array( 'tidypics:admin:instructions' => 'Este es el corazón de las preferencias de Tidypics. Cambialas y luego guardalas.',
'tidypics:settings:image_lib' => "Libreria de Imagenes: ",
'tidypics:settings:download_link' => "Mostrar vinculo de descarga",
- 'tidypics:settings:tagging' => "Habilitar etiquetas en las fotos",
'tidypics:settings:photo_ratings' => "Habilitar ratings de fotos(requiere instalar el e plugin de Miguel Montes o compatible)",
'tidypics:settings:exif' => "Mostrar data de EXIF",
'tidypics:settings:view_count' => "Ver contador",
'tidypics:settings:grp_perm_override' => "Permitir acceso completo a los miembros de este grupo al album de fotos",
'tidypics:settings:maxfilesize' => "Tamaño máximo de la imagen en megabytes (MB):",
'tidypics:settings:quota' => "Usuario/Grupo Cuota (MB) - 0 MB de cuota",
- 'tidypics:settings:watermark' => "Introduce el texto que aparecerá en la marca de agua - ImageMagick Cmdline debe ser seleccionado para la libreria de imagenes",
'tidypics:settings:im_path' => "Ingresa la ruta de tu ImageMagick commands (incluye el slash)",
'tidypics:settings:img_river_view' => "¿Cuántas entradas deseas para cada grupo de imágenes cargadas?",
'tidypics:settings:album_river_view' => "Muestra la portada del álbum o el set de fotos para el álbum nuevo",
@@ -68,8 +66,8 @@ $spanish = array( //actions
'album:create' => "Crear nuevo álbum",
- 'album:add' => "Añadir Álbum de fotos",
- 'album:addpix' => "ñadir fotos al Álbum",
+ 'album:add' => "Añadir álbum de fotos",
+ 'album:addpix' => "Añadir fotos al álbum",
'album:edit' => "Editar álbum",
'album:delete' => "Borrar álbum",
'image:edit' => "Editar imagen",
@@ -92,22 +90,6 @@ $spanish = array( 'image:back' => "Anterior",
'image:next' => "Siguiente",
- // tagging
- 'tidypics:taginstruct' => 'Seleccciona el área que deseas etiquetar',
- 'tidypics:deltag_title' => 'Seleccionas las etiquetas a borrar',
- 'tidypics:finish_tagging' => 'Detener etiquetado',
- 'tidypics:tagthisphoto' => 'Etiquetar esta foto',
- 'tidypics:deletetag' => 'Borrar etiqueta de la foto',
- 'tidypics:actiontag' => 'Etiqueta',
- 'tidypics:actiondelete' => 'Borrar',
- 'tidypics:actioncancel' => 'Cancelar',
- 'tidypics:inthisphoto' => 'En esta foto',
- 'tidypics:usertag' => "Fotos etiquetadas con %s",
- 'tidypics:phototagging:success' => 'La etiqueta de la foto fue añadida exitosamente',
- 'tidypics:phototagging:error' => 'Ocurrió un error inesperado durante el etiquetado',
- 'tidypics:deletetag:success' => 'Las etiquetas seleccionadas fueron borradas exitosamente',
-
-
//rss
'tidypics:posted' => 'publicar una foto:',
@@ -124,7 +106,6 @@ $spanish = array( 'image:river:created' => "%s añadio la foto %s al álbum %s",
'image:river:item' => "una foto",
'image:river:annotate' => "un comentario en la foto",
- 'image:river:tagged' => "fue etiquetada en la foto",
'album:river:created' => "%s creo un nuevo álbum de fotos",
'album:river:group' => "en el grupo",
'album:river:item' => "un álbum",
diff --git a/languages/fr.php b/languages/fr.php index 1c653daa1..0b9ceac49 100644 --- a/languages/fr.php +++ b/languages/fr.php @@ -51,14 +51,12 @@ $french = array( 'tidypics:settings:image_lib' => "Librairie graphique" , 'tidypics:settings:thumbnail' => "Création des vignettes" , 'tidypics:settings:download_link' => "Voir le lien de download" , - 'tidypics:settings:tagging' => "Activer les tags sur les photos" , 'tidypics:settings:photo_ratings' => "Activer les notations des photos (nécessite le rate plugin de Miguel Montes ou compatible)" , 'tidypics:settings:exif' => "Voir les données EXIF" , 'tidypics:settings:view_count' => "Voir le compteur" , 'tidypics:settings:grp_perm_override' => "Autoriser l'acés total aux membres du groupe" , 'tidypics:settings:maxfilesize' => "Taille maximum des images en Mb:" , 'tidypics:settings:quota' => "Quota Utilisateur/Groupe (Mb) - O égal pas de quota" , - 'tidypics:settings:watermark' => "Entrez le texte qui doit figure sur le WaterMark - fonction non vraiment sure." , 'tidypics:settings:im_path' => "Chemin de l'exécutable ImageMagick, terminé par un slash" , 'tidypics:settings:img_river_view' => "Combien d'entrées dans le river pour chaque lot de traitement des fichiers chargés" , 'tidypics:settings:album_river_view' => "Montrer la couverture de l'album ou un ensemble de photos pour tout nouvel album" , @@ -86,22 +84,9 @@ $french = array( 'image:none' => "Aucune image n'a encore été ajoutée" , 'image:back' => "Précédent" , 'image:next' => "Suivant" , - 'tidypics:taginstruct' => "Sélectionnez la zone que vous souhaitez tagger" , - 'tidypics:deltag_title' => "Sélectionnez le tag à supprimer" , - 'tidypics:finish_tagging' => "Arrêter de tagger" , - 'tidypics:tagthisphoto' => "Tagger cette photo" , - 'tidypics:deletetag' => "Supprimer le tag d'une photo" , - 'tidypics:actiontag' => "Tag" , 'tidypics:actiondelete' => "Supprimer" , 'tidypics:actioncancel' => "Annuler" , 'tidypics:inthisphoto' => "Dans cette photo" , - 'tidypics:usertag' => "Photo taggée par %s" , - 'tidypics:phototagging:success' => "La photo a été correctement taggée." , - 'tidypics:phototagging:error' => "Erreur innatendue durant le taggage" , - 'tidypics:deletetag:success' => "Les tags sélectionnés ont correctement été supprimés" , - 'tidypics:tag:subject' => "Vous avez été taggé dans une photo !!!" , - 'tidypics:tag:body' => "Vous avez été taggé dans la photo %s par %s !!! -La photo peut être consultée ici: %s" , 'tidypics:posted' => "a posté une photo" , 'tidypics:widget:albums' => "Albums photo" , 'tidypics:widget:album_descr' => "Échantillon de vos albums photo" , @@ -113,7 +98,6 @@ La photo peut être consultée ici: %s" , 'image:river:created' => "%s a ajouté la photo %s à l'album %s" , 'image:river:item' => "une photo" , 'image:river:annotate' => "commentaire sur la photo" , - 'image:river:tagged' => "a été taggé sur la photo" , 'album:river:created' => "%s a créé un nouvel album photo" , 'album:river:group' => "dans le groupe" , 'album:river:item' => "un album" , diff --git a/languages/he.php b/languages/he.php index 5f232daf6..d2a2bb9ab 100644 --- a/languages/he.php +++ b/languages/he.php @@ -47,14 +47,12 @@ $hebrew = array( 'tidypics:admin:instructions' => "אלה הגדרות הליבה של Tidypics. שנה אותן לפי הצורך ולחץ על שמור" , 'tidypics:settings:image_lib' => "ספריית תמונות:" , 'tidypics:settings:download_link' => "הצג לינק להורדה" , - 'tidypics:settings:tagging' => "אפשר תיוג תמונות" , 'tidypics:settings:photo_ratings' => "אפשר דירוג תמונות, דורש תוסף דירוג של Miguel Montes או דומה" , 'tidypics:settings:exif' => "הצג נתוני EXIF" , 'tidypics:settings:view_count' => "מונה צפיה" , 'tidypics:settings:grp_perm_override' => "אפשר לחברי קבוצה גישה מלאה לאלבומים קבוצתיים" , 'tidypics:settings:maxfilesize' => "גודל תמונה מירבי בMB" , 'tidypics:settings:quota' => "מכסה בMB למשתמש/קבוצה - 0 שווה ללא מכסה" , - 'tidypics:settings:watermark' => "הזן טקסט אשר יופיע בסימן המים - יש לבחור ב ImageMagick Cmdline עבור ספריית התמונות" , 'tidypics:settings:im_path' => "הזן את הנטיב לפקודות ImageMagick ללא לוכסן בסוף" , 'tidypics:settings:img_river_view' => "כמה רשומות במה חדש עבור כל מקבץ תמונות אשר נוסף" , 'tidypics:settings:album_river_view' => "הצג תמונה אחת או מקבץ תמונות עבור אלבום חדש" , @@ -81,19 +79,9 @@ $hebrew = array( 'image:none' => "טרם נוספו תמונות" , 'image:back' => "הקודם" , 'image:next' => "הבא" , - 'tidypics:taginstruct' => "בחר אזור להוספת תג" , - 'tidypics:deltag_title' => "בחר תגים למחיקה" , - 'tidypics:finish_tagging' => "הפסק לתייג" , - 'tidypics:tagthisphoto' => "תייג תמונה זו" , - 'tidypics:deletetag' => "מחק תג תמונה" , - 'tidypics:actiontag' => "תג" , 'tidypics:actiondelete' => "מחיקה" , 'tidypics:actioncancel' => "ביטול" , 'tidypics:inthisphoto' => "בתמונה זו" , - 'tidypics:usertag' => "תמונות המתוייגות במשתמש %s" , - 'tidypics:phototagging:success' => "התג נוסף בהצלחה" , - 'tidypics:phototagging:error' => "אירע שגיאה בתהליך התיוג" , - 'tidypics:deletetag:success' => "התגים נמחקו בהצלחה" , 'tidypics:posted' => "הוסיף/ה תמונה" , 'tidypics:widget:albums' => "אלבומי תמונות" , 'tidypics:widget:album_descr' => "הצג את האלבומים החדשים שלך" , diff --git a/languages/it.php b/languages/it.php index 27a9654a6..6b42fe655 100644 --- a/languages/it.php +++ b/languages/it.php @@ -75,8 +75,6 @@ $italian = array( 'image:river:created:multiple' => "%s added %u photos to album %s",
'image:river:item' => "una immagine",
'image:river:annotate' => "a comment on the image",
- 'image:river:tagged' => "%s tagged %s in the photo %s",
- 'image:river:tagged:unknown' => "%s tagged %s in a photo",
'album:river:created' => "%s created a new photo album: ",
'album:river:item' => "an album",
'album:river:annotate' => "un commento nel foto album",
diff --git a/lib/resize.php b/lib/resize.php index b06f317ca..380e0c406 100644 --- a/lib/resize.php +++ b/lib/resize.php @@ -5,8 +5,6 @@ * @package TidypicsImageResize */ -include dirname(__FILE__) . "/watermark.php"; - /** * Create thumbnails using PHP GD Library @@ -37,7 +35,6 @@ function tp_create_gd_thumbnails($file, $prefix, $filestorename) { $thumbname = $thumb->getFilenameOnFilestore(); $rtn_code = tp_gd_resize( $file->getFilenameOnFilestore(), $thumbname, - FALSE, $image_sizes['tiny_image_width'], $image_sizes['tiny_image_height'], TRUE); @@ -53,7 +50,6 @@ function tp_create_gd_thumbnails($file, $prefix, $filestorename) { $thumbname = $thumb->getFilenameOnFilestore(); $rtn_code = tp_gd_resize( $file->getFilenameOnFilestore(), $thumbname, - FALSE, $image_sizes['small_image_width'], $image_sizes['small_image_height'], TRUE); @@ -68,7 +64,6 @@ function tp_create_gd_thumbnails($file, $prefix, $filestorename) { $thumbname = $thumb->getFilenameOnFilestore(); $rtn_code = tp_gd_resize( $file->getFilenameOnFilestore(), $thumbname, - TRUE, $image_sizes['large_image_width'], $image_sizes['large_image_height'], FALSE); @@ -89,13 +84,12 @@ function tp_create_gd_thumbnails($file, $prefix, $filestorename) { * * @param string $input_name The name of the file on the disk * @param string $output_name The name of the file to be written - * @param bool - watermark this image? * @param int $maxwidth The maximum width of the resized image * @param int $maxheight The maximum height of the resized image * @param TRUE|FALSE $square If set to TRUE, will take the smallest of maxwidth and maxheight and use it to set the dimensions on all size; the image will be cropped. * @return bool TRUE on success or FALSE on failure */ -function tp_gd_resize($input_name, $output_name, $watermark, $maxwidth, $maxheight, $square = FALSE, $x1 = 0, $y1 = 0, $x2 = 0, $y2 = 0) { +function tp_gd_resize($input_name, $output_name, $maxwidth, $maxheight, $square = FALSE, $x1 = 0, $y1 = 0, $x2 = 0, $y2 = 0) { // Get the size information from the image $imgsizearray = getimagesize($input_name); @@ -159,10 +153,6 @@ function tp_gd_resize($input_name, $output_name, $watermark, $maxwidth, $maxheig return $rtn_code; } - if ($watermark) { - tp_gd_watermark($newimage); - } - switch ($imgsizearray['mime']) { case 'image/jpeg': case 'image/pjpeg': @@ -243,8 +233,6 @@ function tp_create_imagick_thumbnails($file, $prefix, $filestorename) { } $file->largethumb = $prefix."largethumb".$filestorename; - tp_imagick_watermark($thumbname); - unset($thumb); return TRUE; @@ -370,9 +358,6 @@ function tp_create_im_cmdline_thumbnails($file, $prefix, $filestorename) { } $file->largethumb = $prefix."largethumb".$filestorename; - - tp_im_cmdline_watermark($thumbname); - unset($thumb); return TRUE; diff --git a/lib/tidypics.php b/lib/tidypics.php index 9439bed39..62c4c1c89 100644 --- a/lib/tidypics.php +++ b/lib/tidypics.php @@ -127,7 +127,7 @@ function tidypics_get_image_libraries() { */ function tidypics_is_upgrade_available() { // sets $version based on code - require_once elgg_get_plugins_path() . "tidypics/version.php"; + require_once elgg_get_plugins_path() . "lightpics/version.php"; $local_version = elgg_get_plugin_setting('version', 'tidypics'); if ($local_version === false) { @@ -352,51 +352,6 @@ function tp_is_person() { } /** - * get a list of people that can be tagged in an image - * - * @param $viewer entity - * @return array of guid->name for tagging - */ -function tp_get_tag_list($viewer) { - $friends = get_user_friends($viewer->getGUID(), '', 999, 0); - $friend_list = array(); - if ($friends) { - foreach($friends as $friend) { - //error_log("friend $friend->name"); - $friend_list[$friend->guid] = $friend->name; - } - } - - // is this a group - $is_group = tp_is_group_page(); - if ($is_group) { - $group_guid = page_owner(); - $viewer_guid = $viewer->guid; - $members = get_group_members($group_guid, 999); - if (is_array($members)) { - foreach ($members as $member) { - if ($viewer_guid != $member->guid) { - $group_list[$member->guid] = $member->name; - //error_log("group $member->name"); - } - } - - // combine group and friends list - $intersect = array_intersect_key($friend_list, $group_list); - $unique_friends = array_diff_key($friend_list, $group_list); - $unique_members = array_diff_key($group_list, $friend_list); - //$friend_list = array_merge($friend_list, $group_list); - //$friend_list = array_unique($friend_list); - $friend_list = $intersect + $unique_friends + $unique_members; - } - } - - asort($friend_list); - - return $friend_list; -} - -/** * Convenience function for listing recent images * * @param int $max diff --git a/lib/watermark.php b/lib/watermark.php deleted file mode 100644 index f7c228af1..000000000 --- a/lib/watermark.php +++ /dev/null @@ -1,193 +0,0 @@ -<?php -/** - * Watermarking functions - * - * @package TidypicsWatermark - */ - -/** - * Make replacements in watermark text - * - * @param string $text - * @param ElggUser $owner - * @return string - */ -function tp_process_watermark_text($text, $owner) { - global $CONFIG; - - $text = str_replace("%name%", $owner->name, $text); - $text = str_replace("%sitename%", $CONFIG->sitename, $text); - - return $text; -} - -/** - * Create the watermark image filename - * - * @param string $text - * @param ElggUser $owner - * @return string - */ -function tp_get_watermark_filename($text, $owner) { - - $base = elgg_strtolower($text); - $base = preg_replace("/[^\w-]+/", "-", $base); - $base = trim($base, '-'); - - $filename = tp_get_img_dir(); - $filename .= elgg_strtolower($owner->username . "_" . $base . "_stamp"); - - return $filename; -} - -/** - * Use GD to apply watermark to image - * - * @param resource $image GD image resource - */ -function tp_gd_watermark($image) { - global $CONFIG; - - $watermark_text = elgg_get_plugin_setting('watermark_text', 'tidypics'); - if (!$watermark_text) { - return; - } - - // plugins can do their own watermark and return false to prevent this function from running - if (elgg_trigger_plugin_hook('tp_watermark', 'gd', $image, true) === false) { - return; - } - - $owner = elgg_get_logged_in_user_entity(); - - $watermark_text = tp_process_watermark_text($watermark_text, $owner); - - // transparent gray - imagealphablending($image, true); - $textcolor = imagecolorallocatealpha($image, 50, 50, 50, 60); - - // font and location - $font = $CONFIG->pluginspath . "tidypics/fonts/LiberationSerif-Regular.ttf"; - $bbox = imagettfbbox(20, 0, $font, $watermark_text); - - $text_width = $bbox[2] - $bbox[0]; - $text_height = $bbox[1] - $bbox[7]; - - $image_width = imagesx($image); - $image_height = imagesy($image); - - $left = $image_width / 2 - $text_width / 2; - $top = $image_height - 20; - - // write the text on the image - imagettftext($image, 20, 0, $left, $top, $textcolor, $font, $watermark_text); -} - -/** - * imagick watermarking - * - * @param string $filename - * @return bool - */ -function tp_imagick_watermark($filename) { - - $watermark_text = elgg_get_plugin_setting('watermark_text', 'tidypics'); - if (!$watermark_text) { - return false; - } - - // plugins can do their own watermark and return false to prevent this function from running - if (elgg_trigger_plugin_hook('tp_watermark', 'imagick', $filename, true) === false) { - return true; - } - - $owner = elgg_get_logged_in_user_entity(); - - $watermark_text = tp_process_watermark_text($watermark_text, $owner); - - $img = new Imagick($filename); - - $img->readImage($image); - - $draw = new ImagickDraw(); - - //$draw->setFont(""); - - $draw->setFontSize(28); - - $draw->setFillOpacity(0.5); - - $draw->setGravity(Imagick::GRAVITY_SOUTH); - - $img->annotateImage($draw, 0, 0, 0, $watermark_text); - - if ($img->writeImage($filename) != true) { - $img->destroy(); - return false; - } - - $img->destroy(); - - return true; -} - -/** - * ImageMagick watermarking - * - * @param string $filename - */ -function tp_im_cmdline_watermark($filename) { - - $watermark_text = elgg_get_plugin_setting('watermark_text', 'tidypics'); - if (!$watermark_text) { - return; - } - - // plugins can do their own watermark and return false to prevent this function from running - if (elgg_trigger_plugin_hook('tp_watermark', 'imagemagick', $filename, true) === false) { - return; - } - - $im_path = elgg_get_plugin_setting('im_path', 'tidypics'); - if (!$im_path) { - $im_path = "/usr/bin/"; - } - - // make sure end of path is / - if (substr($im_path, strlen($im_path)-1, 1) != "/") { - $im_path .= "/"; - } - - - $owner = elgg_get_logged_in_user_entity(); - - $watermark_text = tp_process_watermark_text($watermark_text, $owner); - - $ext = ".png"; - - $user_stamp_base = tp_get_watermark_filename($watermark_text, $owner); - - - if ( !file_exists( $user_stamp_base . $ext )) { - //create the watermark image if it doesn't exist - $commands = array(); - $commands[] = $im_path . 'convert -size 300x50 xc:grey30 -pointsize 20 -gravity center -draw "fill grey70 text 0,0 \''. $watermark_text . '\'" "'. $user_stamp_base . '_fgnd' . $ext . '"'; - $commands[] = $im_path . 'convert -size 300x50 xc:black -pointsize 20 -gravity center -draw "fill white text 1,1 \''. $watermark_text . '\' text 0,0 \''. $watermark_text . '\' fill black text -1,-1 \''. $watermark_text . '\'" +matte ' . $user_stamp_base . '_mask' . $ext; - $commands[] = $im_path . 'composite -compose CopyOpacity "' . $user_stamp_base . "_mask" . $ext . '" "' . $user_stamp_base . '_fgnd' . $ext . '" "' . $user_stamp_base . $ext . '"'; - $commands[] = $im_path . 'mogrify -trim +repage "' . $user_stamp_base . $ext . '"'; - $commands[] = 'rm "' . $user_stamp_base . '_mask' . $ext . '"'; - $commands[] = 'rm "' . $user_stamp_base . '_fgnd' . $ext . '"'; - - foreach( $commands as $command ) { - exec( $command ); - } - } - - //apply the watermark - $commands = array(); - $commands[] = $im_path . 'composite -gravity south -geometry +0+10 "' . $user_stamp_base . $ext . '" "' . $filename . '" "' . $filename . '_watermarked"'; - $commands[] = "mv \"$filename" . "_watermarked\" \"$filename\""; - foreach( $commands as $command ) { - exec( $command ); - } -} diff --git a/manifest.xml b/manifest.xml index 3f4025988..3120d9f96 100644 --- a/manifest.xml +++ b/manifest.xml @@ -13,4 +13,18 @@ <type>elgg_release</type> <version>1.8</version> </requires> + <conflicts> + <type>plugin</type> + <name>tidypics</name> + </conflicts> + <suggests> + <type>plugin</type> + <name>colorbox</name> + <version>1.8</version> + </suggests> + <requires> + <type>priority</type> + <priority>after</priority> + <plugin>colorbox</plugin> + </requires> </plugin_manifest>
\ No newline at end of file diff --git a/pages/lists/mostrecentimages.php b/pages/lists/mostrecentimages.php index 0a2595c85..83ec3e988 100644 --- a/pages/lists/mostrecentimages.php +++ b/pages/lists/mostrecentimages.php @@ -32,14 +32,6 @@ if ($username) { } } -// allow other plugins to override the slideshow -$slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', array(), null); -if ($slideshow_link) { - add_submenu_item(elgg_echo('album:slideshow'), - $slideshow_link, - 'photos' ); -} - // how many do we display $max = 12; diff --git a/pages/lists/mostviewedimages.php b/pages/lists/mostviewedimages.php index eb87bc17c..c113c39e2 100644 --- a/pages/lists/mostviewedimages.php +++ b/pages/lists/mostviewedimages.php @@ -50,14 +50,6 @@ $photos = tp_get_entities_from_annotations_calculate_x( */ //error_log("custom query is " . (float)(microtime(true) - $start)); -// allow other plugins to override the slideshow -$slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', array(), null); -if ($slideshow_link) { - add_submenu_item(elgg_echo('album:slideshow'), - $slideshow_link, - 'photos' ); -} - if ($owner_guid) { if ($owner_guid == get_loggedin_userid()) { $title = elgg_echo("tidypics:yourmostviewed"); diff --git a/pages/lists/recentlycommented.php b/pages/lists/recentlycommented.php index f070e8563..08f69603a 100644 --- a/pages/lists/recentlycommented.php +++ b/pages/lists/recentlycommented.php @@ -13,14 +13,6 @@ if (isloggedin()) { set_page_owner(get_loggedin_userid()); } -// allow other plugins to override the slideshow -$slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', array(), null); -if ($slideshow_link) { - add_submenu_item(elgg_echo('album:slideshow'), - $slideshow_link, - 'photos' ); -} - global $CONFIG; $prefix = $CONFIG->dbprefix; diff --git a/pages/lists/recentlyviewed.php b/pages/lists/recentlyviewed.php index 419576d8e..851804e99 100644 --- a/pages/lists/recentlyviewed.php +++ b/pages/lists/recentlyviewed.php @@ -13,14 +13,6 @@ if (isloggedin()) { set_page_owner(get_loggedin_userid()); } -// allow other plugins to override the slideshow -$slideshow_link = trigger_plugin_hook('tp_slideshow', 'album', array(), null); -if ($slideshow_link) { - add_submenu_item(elgg_echo('album:slideshow'), - $slideshow_link, - 'photos' ); -} - global $CONFIG; $prefix = $CONFIG->dbprefix; diff --git a/pages/photos/album/view.php b/pages/photos/album/view.php index 100cc44c6..6e111ab98 100644 --- a/pages/photos/album/view.php +++ b/pages/photos/album/view.php @@ -42,6 +42,17 @@ if ($album->getContainerEntity()->canWriteToContainer()) { )); } +// only show sort button if there are images +if ($album->canEdit() && $album->getSize() > 0) { + elgg_register_menu_item('title', array( + 'name' => 'sort', + 'href' => "photos/sort/" . $album->getGUID(), + 'text' => elgg_echo('album:sort'), + 'link_class' => 'elgg-button elgg-button-action', + 'priority' => 200, + )); +} + $body = elgg_view_layout('content', array( 'filter' => false, 'content' => $content, diff --git a/pages/photos/image/view.php b/pages/photos/image/view.php index fc4a01320..e30bed70a 100644 --- a/pages/photos/image/view.php +++ b/pages/photos/image/view.php @@ -19,11 +19,6 @@ if (!$photo) { $photo->addView(); -if (elgg_get_plugin_setting('tagging', 'tidypics')) { - elgg_load_js('tidypics:tagging'); - elgg_load_js('jquery.imgareaselect'); -} - // set page owner based on owner of photo album $album = $photo->getContainerEntity(); if ($album) { diff --git a/pages/tagged.php b/pages/tagged.php deleted file mode 100644 index 34ea8a709..000000000 --- a/pages/tagged.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Tidypics Tagged Listing - * - * List all photos tagged with a user - */ - -include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; - - -// Get user guid -$guid = get_input('guid'); - -$user = get_entity($guid); - -if ($user) { - $title = sprintf(elgg_echo('tidypics:usertag'), $user->name); -} else { - $title = "User does not exist"; -} - - -// create main column -$body = elgg_view_title($title); - -set_context('search'); -set_input('search_viewtype', 'gallery'); // need to force gallery view -$body .= list_entities_from_relationship('phototag', $guid, false, 'object', 'image', 0, 10, false); - -// Set up submenus -if (isloggedin()) { - add_submenu_item( elgg_echo("album:yours"), - $CONFIG->wwwroot . "pg/photos/owned/" . $_SESSION['user']->username, - 'tidypics-b' ); -} -add_submenu_item( elgg_echo('album:all'), - $CONFIG->wwwroot . "pg/photos/world/", - 'tidypics-z'); -add_submenu_item( elgg_echo('tidypics:mostrecent'), - $CONFIG->wwwroot . 'pg/photos/mostrecent', - 'tidypics-z'); - - - -$body = elgg_view_layout('two_column_left_sidebar', '', $body); - - -page_draw($title, $body); @@ -13,7 +13,7 @@ elgg_register_event_handler('init', 'system', 'tidypics_init'); */ function tidypics_init() { // Register libraries - $base_dir = elgg_get_plugins_path() . 'tidypics/lib'; + $base_dir = elgg_get_plugins_path() . 'lightpics/lib'; elgg_register_library('tidypics:core', "$base_dir/tidypics.php"); elgg_register_library('tidypics:upload', "$base_dir/upload.php"); elgg_register_library('tidypics:resize', "$base_dir/resize.php"); @@ -38,16 +38,8 @@ function tidypics_init() { $js = elgg_get_simplecache_url('js', 'photos/tidypics'); elgg_register_simplecache_view('js/photos/tidypics'); elgg_register_js('tidypics', $js, 'footer'); - $js = elgg_get_simplecache_url('js', 'photos/upload'); - elgg_register_simplecache_view('js/photos/upload'); - elgg_register_js('tidypics:upload', $js, 'footer'); - $js = elgg_get_simplecache_url('js', 'photos/tagging'); - elgg_register_simplecache_view('js/photos/tagging'); - elgg_register_js('tidypics:tagging', $js, 'footer'); - - elgg_register_js('tidypics:slideshow', 'mod/tidypics/vendors/PicLensLite/piclens_optimized.js', 'footer'); - - $js_base = 'mod/tidypics/vendors/jquery-file-upload/js'; + + $js_base = 'mod/lightpics/vendors/jquery-file-upload/js'; elgg_register_js('jquery-tmpl', "http://blueimp.github.com/JavaScript-Templates/tmpl.js", 'footer'); elgg_register_js('jquery-load-image', "$js_base/vendor/load-image.min.js", 'footer'); @@ -93,7 +85,7 @@ function tidypics_init() { elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'tidypics_notify_message'); // Register actions - $base_dir = elgg_get_plugins_path() . 'tidypics/actions/photos'; + $base_dir = elgg_get_plugins_path() . 'lightpics/actions/photos'; elgg_register_action("photos/delete", "$base_dir/delete.php"); elgg_register_action("photos/album/save", "$base_dir/album/save.php"); @@ -104,8 +96,6 @@ function tidypics_init() { elgg_register_action("photos/image/save", "$base_dir/image/save.php"); elgg_register_action("photos/image/ajax_upload", "$base_dir/image/ajax_upload.php", 'logged_in'); elgg_register_action("photos/image/ajax_upload_complete", "$base_dir/image/ajax_upload_complete.php", 'logged_in'); - elgg_register_action("photos/image/tag", "$base_dir/image/tag.php"); - elgg_register_action("photos/image/untag", "$base_dir/image/untag.php"); elgg_register_action("photos/batch/edit", "$base_dir/batch/edit.php"); @@ -126,9 +116,11 @@ function tidypics_page_handler($page) { return false; } + elgg_load_js('lightbox'); + elgg_load_css('lightbox'); elgg_load_js('tidypics'); - $base = elgg_get_plugins_path() . 'tidypics/pages/photos'; + $base = elgg_get_plugins_path() . 'lightpics/pages/photos'; switch ($page[0]) { case "all": // all site albums case "world": @@ -150,7 +142,6 @@ function tidypics_page_handler($page) { case "album": // view an album individually set_input('guid', $page[1]); - elgg_load_js('tidypics:slideshow'); require "$base/album/view.php"; break; @@ -212,7 +203,7 @@ function tidypics_page_handler($page) { if (isset($page[1])) { set_input('batch', $page[1]); } - include($CONFIG->pluginspath . "tidypics/pages/edit_multiple.php"); + include($CONFIG->pluginspath . "lightpics/pages/edit_multiple.php"); break; case "download": // download an image @@ -221,41 +212,34 @@ function tidypics_page_handler($page) { include "$base/image/download.php"; break; - case "tagged": // all photos tagged with user - if (isset($page[1])) { - set_input('guid', $page[1]); - } - include($CONFIG->pluginspath . "tidypics/pages/tagged.php"); - break; - case "mostviewed": // images with the most views if (isset($page[1])) { set_input('username', $page[1]); } - include($CONFIG->pluginspath . "tidypics/pages/lists/mostviewedimages.php"); + include($CONFIG->pluginspath . "lightpics/pages/lists/mostviewedimages.php"); break; case "mostrecent": // images uploaded most recently if (isset($page[1])) { set_input('username', $page[1]); } - include($CONFIG->pluginspath . "tidypics/pages/lists/mostrecentimages.php"); + include($CONFIG->pluginspath . "lightpics/pages/lists/mostrecentimages.php"); break; case "recentlyviewed": // images most recently viewed - include($CONFIG->pluginspath . "tidypics/pages/lists/recentlyviewed.php"); + include($CONFIG->pluginspath . "lightpics/pages/lists/recentlyviewed.php"); break; case "recentlycommented": // images with the most recent comments - include($CONFIG->pluginspath . "tidypics/pages/lists/recentlycommented.php"); + include($CONFIG->pluginspath . "lightpics/pages/lists/recentlycommented.php"); break; case "highestrated": // images with the highest average rating - include($CONFIG->pluginspath . "tidypics/pages/lists/highestrated.php"); + include($CONFIG->pluginspath . "lightpics/pages/lists/highestrated.php"); break; case "admin": - include ($CONFIG->pluginspath . "tidypics/pages/admin.php"); + include ($CONFIG->pluginspath . "lightpics/pages/admin.php"); break; default: @@ -334,44 +318,7 @@ function tidypics_entity_menu_setup($hook, $type, $return, $params) { ); $return[] = ElggMenuItem::factory($options); } - - if (elgg_get_plugin_setting('tagging', 'tidypics')) { - $options = array( - 'name' => 'tagging', - 'text' => elgg_echo('tidypics:actiontag'), - 'href' => '#', - 'title' => elgg_echo('tidypics:tagthisphoto'), - 'rel' => 'photo-tagging', - 'priority' => 80, - ); - $return[] = ElggMenuItem::factory($options); - } - } - - // only show these options if there are images - if (elgg_instanceof($entity, 'object', 'album') && $entity->getSize() > 0) { - $url = $entity->getURL() . '?limit=50&view=rss'; - $url = elgg_format_url($url); - $slideshow_link = "javascript:PicLensLite.start({maxScale:0, feedUrl:'$url'})"; - $options = array( - 'name' => 'slideshow', - 'text' => elgg_echo('album:slideshow'), - 'href' => $slideshow_link, - 'priority' => 80, - ); - $return[] = ElggMenuItem::factory($options); - - if ($entity->canEdit()) { - $options = array( - 'name' => 'sort', - 'text' => elgg_echo('album:sort'), - 'href' => "photos/sort/" . $entity->getGUID(), - 'priority' => 90, - ); - $return[] = ElggMenuItem::factory($options); - } } - return $return; } diff --git a/vendors/PicLensLite/NoFlash.jpg b/vendors/PicLensLite/NoFlash.jpg Binary files differdeleted file mode 100644 index 94f643dc7..000000000 --- a/vendors/PicLensLite/NoFlash.jpg +++ /dev/null diff --git a/vendors/PicLensLite/PicLensLite.swf b/vendors/PicLensLite/PicLensLite.swf Binary files differdeleted file mode 100644 index 3bfd4ea49..000000000 --- a/vendors/PicLensLite/PicLensLite.swf +++ /dev/null diff --git a/vendors/PicLensLite/piclens_optimized.js b/vendors/PicLensLite/piclens_optimized.js deleted file mode 100644 index 48cea086b..000000000 --- a/vendors/PicLensLite/piclens_optimized.js +++ /dev/null @@ -1,20 +0,0 @@ -/* PicLens Lite: version 1.3.1 (14221)
- * Copyright (c) 2008 Cooliris, Inc. All Rights Reserved.
- *
- * The JavaScript part of PicLens Lite (i.e., this file) is BSD licensed (see: http://lite.piclens.com/bsdlicense)
- * This launcher includes and interacts with SWFObject (MIT), BrowserDetect (BSD Compatible), and Lytebox (CC Attribution 3.0).
- *
- * There are two versions of this JS:
- * http://lite.piclens.com/current/piclens.js full commented file (~39KB)
- * http://lite.piclens.com/current/piclens_optimized.js lighter deployment file (~21KB)
- */
-var PicLensLite={start:function(B){this.determineBrowserParams();clearTimeout(this.REMOVE_TIMER_ID);clearTimeout(this.AUTO_CLOSE_TIMER_ID);this.ARGS={};if(typeof B!=="undefined"&&B!==null){this.ARGS=B;if(B.feedUrl){this.THE_FEED_URL=B.feedUrl;if(this.checkForPluginAndLaunchIfPossible(B.feedUrl,B.guid)){return }if(B.loadFeedInFlash){this.showFlashUI("")}else{this.loadViaXHR(B.feedUrl)}}if(typeof B.feedData!=="undefined"){this.showFlashUI(B.feedData)}}else{var A=this.indexFeeds();if(A.length!==0){var C=A[0];this.THE_FEED_URL=C.url;if(this.checkForPluginAndLaunchIfPossible(C.url)){return }this.loadViaXHR(C.url)}}},isRunning:function(){return this.LITE_IS_RUNNING},hasClient:function(){return this.hasCooliris()},addCustomButton:function(C,B,A){this.CUSTOM_BUTTON={targetURL:C,labelText:B,iconImage:A}},setCallbacks:function(A){if(A.onNoPlugins){this.ON_NO_PLUGINS=A.onNoPlugins}if(A.onExit){this.ON_EXIT=A.onExit}},setLiteURLs:function(A){if(!this.LITE_URL){if(A.swf){this.LITE_URL=A.swf}else{if(A.lite){this.LITE_URL=A.lite+"PicLensLite.swf"}}}if(!this.BUTTON_URL){if(A.button){this.BUTTON_URL=A.button}else{if(A.lite){this.BUTTON_URL=A.lite+"NoFlash.jpg"}}}var B="";if(A.lbox){B=A.lbox}else{if(A.lite){B=A.lite+"../lytebox/"}}if(!this.LBOX_CSS_URL){if(A.lboxcss){this.LBOX_CSS_URL=A.lboxcss}else{if(B!=""){this.LBOX_CSS_URL=B+"lytebox.css"}}}if(!this.LBOX_JS_URL){if(A.lboxjs){this.LBOX_JS_URL=A.lboxjs}else{if(B!=""){this.LBOX_JS_URL=B+"lytebox.js"}}}},ARGS:{},DEBUG_NOCLIENT:false,DEBUG_NOFLASH:false,HPAD:60,VPAD:20,LITE_BG_DIV:null,LITE_FG_DIV:null,LITE_URL:null,BUTTON_URL:null,LBOX_CSS_URL:null,LBOX_JS_URL:null,LBOX_COUNT:0,SHOW_LBOX:false,OS_WIN:false,OS_MAC:false,BROWSER_FFX:false,BROWSER_SAF:false,BROWSER_IE:false,BROWSER_IE6:false,OLD_B_MARGIN:null,OLD_B_OVERFLOW:null,OLD_B_HEIGHT:null,OLD_H_OVERFLOW:null,OLD_H_HEIGHT:null,THE_FEED:"",THE_FEED_URL:"",LITE_IS_RUNNING:false,piclensIsRunning_:false,FLASH_ID_1:"pllflash1",FLASH_ID_2:"pllflash2",FLASH_VER:null,FLASH_URL:"http://www.adobe.com/go/getflashplayer",PL_URL:"http://download.piclens.com/partner/",PLC:null,LEARN_PL_URL:"http://affiliate.piclens.com/partner/",FONT:"font-family: Lucida Grande, Myriad Pro, Verdana, Helvetica, Arial, sans-serif;",KEY_HANDLERS:"",ON_NO_PLUGINS:null,ON_EXIT:null,AUTO_CLOSE_TIMER_ID:0,REMOVE_TIMER_ID:0,RESIZE_TIMER_IE6:null,RESIZE_HANDLER_EXISTS:false,CUSTOM_BUTTON:null,addKeyHandlers:function(){var A=this;if(typeof document.onkeydown!=="undefined"){this.KEY_HANDLERS=document.onkeydown}document.onkeydown=function(C){var B;if(typeof C==="undefined"||C===null){B=window.event.keyCode}else{B=C.which}var D=A.handleKeyPress(B);if(typeof C!="undefined"&&C!=null){C.returnValue=D}return D}},addMouseHandlers:function(){if(window.addEventListener){window.addEventListener("DOMMouseScroll",this.handleMouseWheel,false)}else{if(document.attachEvent){document.attachEvent("onmousewheel",this.handleMouseWheel)}}window.onmousewheel=document.onmousewheel=this.handleMouseWheel},appendElementsToDocument:function(){if(this.BROWSER_FFX&&this.OS_MAC){this.LITE_BG_DIV.style.display="none"}document.body.appendChild(this.LITE_BG_DIV);document.body.appendChild(this.LITE_FG_DIV)},autoResize:function(){if(!this.isRunning()){clearInterval(this.RESIZE_TIMER_IE6);return }var C=this.getPageSize();var B=this.LITE_BG_DIV;if(B){B.style.height=C.h+"px";B.style.width=C.w+"px"}if(this.LITE_FG_DIV){var A=this.LITE_FG_DIV.style;this.resizeToPaddedBox(A);this.resizeToFitPaddedBox(A,C);this.resizeFlashToFitPaddedBox()}},checkForPluginAndLaunchIfPossible:function(B,A){if(this.hasCooliris()){if(typeof (A)!="undefined"){this.PLC.launch(B,"uid",A)}else{this.PLC.launch(B,"","")}return true}return false},createBackgroundOverlay:function(){var D=document.createElement("div");this.LITE_BG_DIV=D;D.id="lite_bg_div";var E=D.style;E.position="fixed";E.width=E.height="100%";if(this.BROWSER_IE6){var A=document.body;var C=A.currentStyle;var H=document.documentElement;var G=H.currentStyle;this.OLD_B_MARGIN=C.margin;this.OLD_B_OVERFLOW=C.overflow;this.OLD_B_HEIGHT=C.height;this.OLD_H_OVERFLOW=G.overflow;this.OLD_H_HEIGHT=G.height;this.OLD_SCROLL_Y=H.scrollTop;A.style.margin="0";A.style.overflow="auto";A.style.height="100%";H.style.overflow="auto";H.style.height="100%";E.position="absolute";var F=this.getPageSize();E.height=F.h+"px";E.width=F.w+"px"}E.left=E.right=E.top=E.bottom="0";E.backgroundColor="#000";E.zIndex=1000;E.opacity="0.5";E.filter="alpha(opacity=50)";var B=this;D.onclick=function(){B.exitPicLensLite()}},createForegroundFlashComponent:function(){var B=document.createElement("div");this.LITE_FG_DIV=B;B.id="lite_fg_div";var A=B.style;A.backgroundColor="#000";A.position="fixed";A.border="2px solid #555";A.zIndex=1001;this.resizeToPaddedBox(A);if(this.BROWSER_IE6){A.position="absolute";this.resizeToFitPaddedBox(A)}},closeFlashUI:function(C){var B=document;B.onkeydown=this.KEY_HANDLERS;window.onmousewheel=B.onmousewheel="";if(window.removeEventListener){window.removeEventListener("DOMMouseScroll",this.handleMouseWheel,false)}if(B.detachEvent){B.detachEvent("onmousewheel",this.handleMouseWheel)}this.LITE_BG_DIV.style.display=this.LITE_FG_DIV.style.display="none";this.REMOVE_TIMER_ID=setTimeout(function(){PicLensLite.removeChildren()},150);if(this.BROWSER_IE6){var A=document.body;var D=document.documentElement;A.style.margin=this.OLD_B_MARGIN;A.style.overflow=this.OLD_B_OVERFLOW;A.style.height=this.OLD_B_HEIGHT;D.style.overflow=this.OLD_H_OVERFLOW;D.style.height=this.OLD_H_HEIGHT;window.scrollTo(0,this.OLD_SCROLL_Y)}if(this.ON_EXIT!==null){this.ON_EXIT(C)}this.setRunningFlag(false)},determineBrowserParams:function(){var B=BrowserDetect.OS;var A=BrowserDetect.browser;this.OS_MAC=(B=="Mac");this.OS_WIN=(B=="Windows");this.BROWSER_FFX=(A=="Firefox");this.BROWSER_SAF=(A=="Safari");this.BROWSER_IE=(A=="Explorer");this.BROWSER_IE6=(this.BROWSER_IE&&BrowserDetect.version=="6");this.FLASH_VER=swfobjlite.getFlashPlayerVersion()},exitPicLensLite:function(){var A=this.getFlash();if(A!==null&&A.fl_exitPicLensLite){A.fl_exitPicLensLite();this.AUTO_CLOSE_TIMER_ID=setTimeout(function(){if(PicLensLite.isRunning()){PicLensLite.closeFlashUI()}},500)}else{this.closeFlashUI()}},findScriptLocation:function(){var E=document.getElementsByTagName("script");for(var C=0;C!=E.length;++C){var A=E[C];var D=A.getAttribute("type");if(D=="text/javascript"){var F=A.getAttribute("src");if(F===null){continue}var B=F.indexOf("piclens.js");if(B!=-1){this.setLiteURLs({lite:F.substring(0,B)});return }else{B=F.indexOf("piclens_optimized.js");if(B!=-1){this.setLiteURLs({lite:F.substring(0,B)});return }}}}},getPageSize:function(){var J,F,G,C;var I=document;var E=I.body;var D;if(window.innerHeight&&window.scrollMaxY){J=I.scrollWidth;F=(this.isFrame?parent.innerHeight:self.innerHeight)+(this.isFrame?parent.scrollMaxY:self.scrollMaxY)}else{if(E.scrollHeight>E.offsetHeight){J=E.scrollWidth;F=E.scrollHeight}else{D=I.getElementsByTagName("html").item(0);J=D.offsetWidth;F=D.offsetHeight;J=(J<E.offsetWidth)?E.offsetWidth:J;F=(F<E.offsetHeight)?E.offsetHeight:F}}var A=I.documentElement;if(self.innerHeight){G=(this.isFrame)?parent.innerWidth:self.innerWidth;C=(this.isFrame)?parent.innerHeight:self.innerHeight}else{if(A&&A.clientHeight){G=A.clientWidth;C=A.clientHeight}else{if(E){D=I.getElementsByTagName("html").item(0);G=D.clientWidth;C=D.clientHeight;G=(G==0)?E.clientWidth:G;C=(C==0)?E.clientHeight:C}}}var B=(F<C)?C:F;var H=(J<G)?G:J;return{pw:H,ph:B,w:G,h:C}},getElementsFromXMLFeed:function(){var B;if(window.ActiveXObject){B=new ActiveXObject("Microsoft.XMLDOM");B.async=false;B.loadXML(PicLensLite.THE_FEED)}else{var C=new DOMParser();B=C.parseFromString(PicLensLite.THE_FEED,"text/xml")}var A=B.getElementsByTagName("*");return A},getBasicSlideShowHTML:function(){if(!this.LBOX_JS_URL||!this.LBOX_CSS_URL){return""}var D=document.getElementsByTagName("head").item(0);var A=document.createElement("script");A.src=this.LBOX_JS_URL;A.type="text/javascript";D.appendChild(A);var G=document.createElement("link");G.rel="stylesheet";G.href=this.LBOX_CSS_URL;G.type="text/css";G.media="screen";D.appendChild(G);var F=this.getElementsFromXMLFeed();var C;var H="";for(C=0;C<F.length;C++){if(F[C].nodeName=="media:content"){var B=F[C].getAttribute("url");if(B.indexOf(".flv")==-1){H+='<a id="lboxImage" href="'+B+'" rel="lytebox[lite]"></a> '}}}var E="<div id='lightbox_images' align='center' style='display: none; padding-top:10px; color:#FFFFFF; font-size:.8em; "+this.FONT+" color:#999999;'>";E+='( Alternatively, <a onclick="javascript:PicLensLite.invokeLytebox();return false;" href="#" style="color:#656588">click here for a basic slideshow</a>. )';E+=H;E+="</div><br/>";return E},generateAlternativeContent:function(){var J='<div id="altContent" style="text-align:center; margin: 0 0 0 0; padding: 0 0 0 0; background-color: #000; min-width:860px;">';J+='<div align="center" style="width: 100%; padding-top:60px; '+this.FONT+'">';var I=this.FLASH_VER;var G;if(I.major>0){G="update your Flash Player from version "+I.major+"."+I.minor+"."+I.release+" to version 9.0.28 or newer"}else{G="install the most recent Flash Player"}var D="";if(this.THE_FEED!==""){D=this.getBasicSlideShowHTML()}var A=this.PL_URL;var E=this.LEARN_PL_URL;var F=this.ARGS.pid;if(F){A+=F+"/";E+=F+"/"}else{var H="000000000001/";A+=H;E+=H}if(this.SHOW_LBOX){}else{var C="<span style='padding-left:25px; color:#C6C6C6; font-size:";J+="<div style='padding:10px;'>"+C+"1.5em; font-weight: bold; "+this.FONT+"'>You're clicks away from going full screen!</span><br/>"+C+".9em; padding-bottom: 15px; "+this.FONT+"'>You must get the <a href='"+A+"' style='color:#656588'>Cooliris</a> browser plugin, or "+G+".</span></div>";if(!this.BUTTON_URL){J+='<a href="'+A+'" style="color:#ACD">Get Cooliris Now!</a>'}else{var B='<area shape="rect" coords=';J+='<img src="'+this.BUTTON_URL+'" alt="" border="0" usemap="#Map"><map name="Map" id="Map">'+B+'"0,0,33,33" href="#" onclick="javascript:PicLensLite.closeFlashUI();" />'+B+'"35,35,325,325" href="'+A+'" />'+B+'"593,209,825,301" href="'+this.FLASH_URL+'" />'+B+'"327,148,448,178" href="'+E+'" /></map>'}}J+="</div>";J+=D;J+='<div align="center" style="color:#666666; font-size:11px; '+this.FONT+'">© 2008 Cooliris, Inc. All trademarks are property of their respective holders.<br/><br/><br/></div>';J+="</div>";return J},generateFlashVars:function(){var C="";var B=this.ARGS;if(typeof B.guid!=="undefined"){C+="&startItemGUID="+B.guid}if(B.loadFeedInFlash){C+="&feedURL="+encodeURIComponent(this.THE_FEED_URL)}if(B.paused){C+="&paused="+B.paused}if(B.loop){C+="&loop="+B.loop}if(B.delay){C+="&delay="+B.delay}if(B.pid){C+="&pid="+B.pid}if(typeof B.maxScale!="undefined"){C+="&maxScale="+B.maxScale}if(typeof B.overlayToolbars!="undefined"){C+="&overlayToolbars="+B.overlayToolbars}var A=this.CUSTOM_BUTTON;if(A!=null){C+="&cButtonURL="+encodeURIComponent(A.targetURL);if(A.labelText!=null){C+="&cButtonLabel="+encodeURIComponent(A.labelText)}if(A.iconImage!=null){C+="&cButtonIcon="+encodeURIComponent(A.iconImage)}}C+="&swfURL="+encodeURIComponent(this.LITE_URL);C=C.substring(1);return C},getFlash:function(){if(this.BROWSER_SAF||this.BROWSER_IE){return document.getElementById(this.FLASH_ID_1)}else{return document.getElementById(this.FLASH_ID_2)}},getWindowSize:function(){var B=document.documentElement;var D=document.body;var A=0,C=0;if(typeof (window.innerWidth)=="number"){A=window.innerWidth;C=window.innerHeight}else{if(B&&(B.clientWidth||B.clientHeight)){A=B.clientWidth;C=B.clientHeight}else{if(D&&(D.clientWidth||D.clientHeight)){A=D.clientWidth;C=D.clientHeight}}}return{w:A,h:C}},handleKeyPress:function(A){if(!this.isRunning()){return true}var B=this.getFlash();if(B!=null&&B.fl_keyPressed){B.fl_keyPressed(A)}else{if(A==27){this.closeFlashUI();return false}}if(A==9||A==13){return false}return true},handleMouseWheel:function(A){var C=0;if(!A){A=window.event}if(A.wheelDelta){C=A.wheelDelta/120;if(window.opera){C=-C}}else{if(A.detail){var B=A.detail;if(Math.abs(B)<3){C=-B}else{C=-B/3}}}if(C){PicLensLite.sendMouseScrollToFlash(C)}if(A.preventDefault){A.preventDefault()}A.returnValue=false;return false},hasPicLensClient:function(){return this.hasCooliris()},hasCooliris:function(){if(this.DEBUG_NOCLIENT){return false}var E=false;if(this.PLC){E=true}else{if(window.piclens&&window.piclens.launch){this.PLC=window.piclens;E=true}else{var B=null;if(typeof PicLensContext!="undefined"){B=new PicLensContext()}else{try{B=new ActiveXObject("PicLens.Context")}catch(D){if(navigator.mimeTypes["application/x-cooliris"]){B=document.createElement("object");B.style.height="0px";B.style.width="0px";B.type="application/x-cooliris";document.documentElement.appendChild(B)}else{B=null}}}this.PLC=B;if(this.PLC){E=true}}}if(E){if(this.BROWSER_SAF){return true}var A;try{A=this.PLC.version}catch(D){return false}var C=A.split(".");if(C[0]>1){return true}else{if(C[0]==1){if(C[1]>6){return true}else{if(C[1]==6){if(C[2]>0){return true}else{if(C[2]==0){if(C[3]>=824){return true}}}}}}}return false}else{return false}},invokeLytebox:function(){this.SHOW_LBOX=true;myLytebox.start(document.getElementById("lboxImage"),false,false);this.closeFlashUI()},showLyteboxLink:function(){myLytebox.updateLyteboxItems();myLytebox.doAnimations=false;var A=document.getElementById("lightbox_images");if(A!=null){A.style.display="block";if(this.SHOW_LBOX&&this.getFlash()==null){this.invokeLytebox()}}},startLytebox:function(){if(typeof myLytebox!="undefined"){this.showLyteboxLink()}else{if(typeof initLytebox!="undefined"){initLytebox();this.showLyteboxLink()}else{if(this.LBOX_COUNT>=4){return }setTimeout(function(){PicLensLite.startLytebox()},150);this.LBOX_COUNT++}}},injectFlashPlayer:function(){var A=this.LITE_FG_DIV;var D;var F;D=F="100%";if(this.BROWSER_IE6){D=F="0"}var E=this.generateFlashVars();var B=this.generateAlternativeContent();if(this.meetsReqs()){var C="<param name=";A.innerHTML='<object id="'+this.FLASH_ID_1+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%">'+C+'"movie" value="'+this.LITE_URL+'" />'+C+'"quality" value="high"/> '+C+'"bgcolor" value="#000000"/> '+C+'"allowScriptAccess" value="always"/> '+C+'"FlashVars" value="'+E+'"/> '+C+'"allowFullScreen" value="true"/> '+C+'"wmode" value="window"/> '+C+'"scale" value="noscale"/> <object type="application/x-shockwave-flash" data="'+this.LITE_URL+'" width="'+D+'" height="'+F+'" quality="high" bgcolor="#000000" id="'+this.FLASH_ID_2+'" quality="high" FlashVars="'+E+'" allowFullScreen="true" scale="noscale" wmode="window" allowScriptAccess="always">'+B+"</object></object>"}else{if(this.ON_NO_PLUGINS){this.ON_NO_PLUGINS()}else{A.innerHTML=B;A.style.minWidth="860px";A.style.minHeight="550px"}}if(this.BROWSER_SAF){this.resizeUI()}},indexFeeds:function(){var E=document.getElementsByTagName("link");var A=[];for(var B=0;B!=E.length;++B){var D=E[B],C=D.getAttribute("type");if(C=="application/rss+xml"||C=="text/xml"){A.push({title:D.getAttribute("title"),url:D.getAttribute("href")})}}return A},loadViaXHR:function(B){var A=this;var D=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("MSXML2.XMLHTTP.3.0");try{D.open("GET",B,true);D.onreadystatechange=function(){if(D.readyState==4){if((D.status==200||D.status==0)){if(D.responseText){A.showFlashUI(D.responseText)}}else{if(console){console.log("PicLens Lite could not load the RSS Feed: "+B)}}}};D.send("")}catch(C){this.ARGS.loadFeedInFlash=true;this.showFlashUI("")}},meetsReqs:function(){if(this.DEBUG_NOFLASH){return false}var B=(this.FLASH_VER.major==0)&&this.BROWSER_IE;var A=swfobjlite.hasFlashPlayerVersion("9.0.28");return A||B},removeChildren:function(){this.REMOVE_TIMER_ID=0;if(this.LITE_BG_DIV!==null){document.body.removeChild(this.LITE_BG_DIV);this.LITE_BG_DIV=null}if(this.LITE_FG_DIV!==null){document.body.removeChild(this.LITE_FG_DIV);this.LITE_FG_DIV=null}},resizeFlashToFitPaddedBox:function(){var B=this.getFlash();if(B){var C=this.getPageSize();var A=C.w-this.HPAD*2;var D=C.h-this.VPAD*2;B.style.width=A;B.style.height=D;B.width=A;B.height=D}},resizeToFitPaddedBox:function(B,A){if(typeof A=="undefined"){A=this.getPageSize()}B.width=(A.w-this.HPAD*2)+"px";B.height=(A.h-this.VPAD*2)+"px"},resizeToPaddedBox:function(A){A.left=A.right=this.HPAD+"px";A.top=A.bottom=this.VPAD+"px"},resizeUI:function(){if(this.LITE_FG_DIV){var A=this.LITE_FG_DIV.style;this.resizeToPaddedBox(A);this.resizeToFitPaddedBox(A);this.resizeFlashToFitPaddedBox()}},setRunningFlag:function(A){this.LITE_IS_RUNNING=A;this.piclensIsRunning_=A},setResizeHandler:function(){if(!this.RESIZE_HANDLER_EXISTS&&this.BROWSER_SAF){var A=this;window.addEventListener("resize",function(){A.resizeUI()},false);this.RESIZE_HANDLER_EXISTS=true}},setResizeTimer:function(){if(this.BROWSER_IE6){this.RESIZE_TIMER_IE6=setInterval(function(){PicLensLite.autoResize()},1000)}},showFlashUI:function(A){this.THE_FEED=A;this.findScriptLocation();this.createBackgroundOverlay();this.createForegroundFlashComponent();if(this.BROWSER_IE){this.appendElementsToDocument()}this.injectFlashPlayer();if(!this.BROWSER_IE){this.appendElementsToDocument()}this.addKeyHandlers();this.addMouseHandlers();this.setRunningFlag(true);this.setResizeTimer();this.setResizeHandler();this.startLytebox()},sendMouseScrollToFlash:function(B){if(!this.isRunning()){return }var A=this.getFlash();if(A!=null&&A.fl_mouseMoved){A.fl_mouseMoved(B)}}};var swfobjlite=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",win=window,doc=document,nav=navigator;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF&&typeof doc.appendChild!=UNDEF&&typeof doc.replaceChild!=UNDEF&&typeof doc.removeChild!=UNDEF&&typeof doc.cloneNode!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
-/*@cc_on
- ie = true;
- @if (@_win32)
- windows = true;
- @elif (@_mac)
- mac = true;
- @end
- @*/
-return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();return{hasFlashPlayerVersion:function(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10);v[2]=parseInt(v[2],10);return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}}}}();var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"Unknown Browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"Unknown Version";this.OS=this.searchString(this.dataOS)||"Unknown OS"},searchString:function(D){for(var A=0;A<D.length;A++){var B=D[A].string;var C=D[A].prop;this.versionSearchString=D[A].versionSearch||D[A].identity;if(B){if(B.indexOf(D[A].subString)!=-1){return D[A].identity}}else{if(C){return D[A].identity}}}},searchVersion:function(B){var A=B.indexOf(this.versionSearchString);if(A==-1){return }return parseFloat(B.substring(A+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();
\ No newline at end of file diff --git a/views/default/admin/settings/photos/help.php b/views/default/admin/settings/photos/help.php index c3ac2477e..1e5bdd254 100644 --- a/views/default/admin/settings/photos/help.php +++ b/views/default/admin/settings/photos/help.php @@ -6,7 +6,7 @@ elgg_load_library('elgg:markdown'); -$faq = elgg_get_plugins_path() . 'tidypics/FAQ.txt'; +$faq = elgg_get_plugins_path() . 'lightpics/FAQ.txt'; $text = Markdown(file_get_contents($faq)); $content = "<div class=\"elgg-markdown\">$text</div>"; diff --git a/views/default/admin/settings/photos/server_config.php b/views/default/admin/settings/photos/server_config.php index 8268b646a..b4fe552ec 100644 --- a/views/default/admin/settings/photos/server_config.php +++ b/views/default/admin/settings/photos/server_config.php @@ -6,7 +6,7 @@ elgg_load_library('elgg:markdown'); -$faq = elgg_get_plugins_path() . 'tidypics/CONFIG.txt'; +$faq = elgg_get_plugins_path() . 'lightpics/CONFIG.txt'; $text = Markdown(file_get_contents($faq)); $content = "<div class=\"elgg-markdown\">$text</div>"; diff --git a/views/default/forms/photos/admin/settings/main.php b/views/default/forms/photos/admin/settings/main.php index f7950a7ad..a35c9ab59 100644 --- a/views/default/forms/photos/admin/settings/main.php +++ b/views/default/forms/photos/admin/settings/main.php @@ -5,10 +5,9 @@ $plugin = $vars['plugin']; -$checkboxes = array('tagging', 'view_count', 'exif', 'download_link'); +$checkboxes = array('view_count', 'exif', 'download_link'); foreach ($checkboxes as $checkbox) { echo '<div>'; - $checked = $plugin->$checkbox ? 'checked' : false; echo elgg_view('input/checkbox', array( 'name' => "params[$checkbox]", 'value' => true, @@ -27,14 +26,6 @@ echo elgg_view('input/text', array( )); echo '</div>'; -// Watermark Text -echo '<div>' . elgg_echo('tidypics:settings:watermark'); -echo elgg_view("input/text", array( - 'name' => 'params[watermark_text]', - 'value' => $plugin->watermark_text, -)); -echo '</div>'; - // Quota Size $quota = $plugin->quota; if (!$quota) { diff --git a/views/default/forms/photos/image/tag.php b/views/default/forms/photos/image/tag.php deleted file mode 100644 index 31869be9e..000000000 --- a/views/default/forms/photos/image/tag.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * Tag select form body - * - * @uses $vars['entity'] - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -echo '<div class="elgg-col elgg-col-4of5">'; - -echo elgg_view('input/autocomplete', array( - 'name' => 'username', - 'match_on' => 'friends', -)); - -echo elgg_view('input/hidden', array( - 'name' => 'guid', - 'value' => $vars['entity']->getGUID(), -)); - -echo elgg_view('input/hidden', array( - 'name' => 'coordinates', -)); - -echo '</div>'; - -echo '<div class="elgg-col elgg-col-1of5 center">'; -echo elgg_view('input/submit', array( - 'value' => elgg_echo('tidypics:actiontag'), -)); -echo '</div>'; diff --git a/views/default/icon/object/album.php b/views/default/icon/object/album.php index 656b2e0df..55bb7451b 100644 --- a/views/default/icon/object/album.php +++ b/views/default/icon/object/album.php @@ -17,6 +17,7 @@ $album = $vars['entity']; $cover_guid = $album->getCoverImageGuid(); if ($cover_guid) { $vars['title'] = $album->getTitle(); + $vars['href'] = $album->getURL(); echo elgg_view_entity_icon(get_entity($cover_guid), $vars['size'], $vars); } else { $url = "mod/tidypics/graphics/empty_album.png"; diff --git a/views/default/icon/object/image.php b/views/default/icon/object/image.php index 3dbced8ab..9087fc3d8 100644 --- a/views/default/icon/object/image.php +++ b/views/default/icon/object/image.php @@ -27,7 +27,7 @@ if (!isset($vars['title'])) { $title = $vars['title']; } -$url = $entity->getURL(); +$url = isset($vars['href']) ? $vars['href'] : $entity->getURL(); if (isset($vars['href'])) { $url = $vars['href']; } diff --git a/views/default/js/photos/tagging.php b/views/default/js/photos/tagging.php deleted file mode 100644 index f444aa44c..000000000 --- a/views/default/js/photos/tagging.php +++ /dev/null @@ -1,159 +0,0 @@ -<?php -/** - * Photo tagging JavaScript - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -?> -//<script> -elgg.provide('elgg.tidypics.tagging'); - -elgg.tidypics.tagging.init = function() { - elgg.tidypics.tagging.active = false; - $('[rel=photo-tagging]').click(elgg.tidypics.tagging.start); - - $('#tidypics-tagging-quit').click(elgg.tidypics.tagging.stop); - - $('.tidypics-tag').each(elgg.tidypics.tagging.position); - - elgg.tidypics.tagging.tag_hover = false; - elgg.tidypics.tagging.toggleTagHover(); -}; - -/** - * Start a tagging session - */ -elgg.tidypics.tagging.start = function(event) { - - if (elgg.tidypics.tagging.active) { - elgg.tidypics.tagging.stop(event); - return; - } - - $('.tidypics-photo').imgAreaSelect({ - disable : false, - hide : false, - classPrefix : 'tidypics-tagging', - onSelectEnd : elgg.tidypics.tagging.startSelect, - onSelectStart: function() { - $('#tidypics-tagging-select').hide(); - } - }); - - elgg.tidypics.tagging.toggleTagHover(); - - $('.tidypics-photo').css({"cursor" : "crosshair"}); - - $('#tidypics-tagging-help').toggle(); - - elgg.tidypics.tagging.active = true; - - event.preventDefault(); -}; - -/** - * Stop tagging - * - * A tagging session could be completed or the user could have quit. - */ -elgg.tidypics.tagging.stop = function(event) { - $('#tidypics-tagging-help').toggle(); - $('#tidypics-tagging-select').hide(); - - $('.tidypics-photo').imgAreaSelect({hide: true, disable: true}); - $('.tidypics-photo').css({"cursor" : "pointer"}); - - elgg.tidypics.tagging.active = false; - elgg.tidypics.tagging.toggleTagHover(); - - event.preventDefault(); -}; - -/** - * Start the selection stage of tagging - */ -elgg.tidypics.tagging.startSelect = function(img, selection) { - - var coords = '"x1":"' + selection.x1 + '",'; - coords += '"y1":"' + selection.y1 + '",'; - coords += '"width":"' + selection.width + '",'; - coords += '"height":"' + selection.height + '"'; - $("input[name=coordinates]").val(coords); - - $('#tidypics-tagging-select').show() - .css({ - 'top' : selection.y2 + 10, - 'left' : selection.x2 - }) - .find('input[type=text]').focus(); - -}; - -/** - * Position the tags over the image - */ -elgg.tidypics.tagging.position = function() { - var tag_left = parseInt($(this).data('x1')); - var tag_top = parseInt($(this).data('y1')); - var tag_width = parseInt($(this).data('width')); - var tag_height = parseInt($(this).data('height')); - - // add image offset - var image_pos = $('.tidypics-photo').position(); - tag_left += image_pos.left; - tag_top += image_pos.top; - - $(this).parent().css({ - left: tag_left + 'px', - top: tag_top + 'px' /* - width: tag_width + 'px', - height: tag_height + 'px' */ - }); - - $(this).css({ - width: tag_width + 'px', - height: tag_height + 'px' - }); -}; - -/** - * Toggle whether tags are shown on hover over the image - */ -elgg.tidypics.tagging.toggleTagHover = function() { - if (elgg.tidypics.tagging.tag_hover == false) { - $('.tidypics-photo').hover( - function() { - $('.tidypics-tag-wrapper').show(); - }, - function(event) { - // this check handles the tags appearing over the image - var mouseX = event.pageX; - var mouseY = event.pageY; - var offset = $('.tidypics-photo').offset(); - var width = $('.tidypics-photo').outerWidth() - 1; - var height = $('.tidypics-photo').outerHeight() - 1; - - mouseX -= offset.left; - mouseY -= offset.top; - - if (mouseX < 0 || mouseX > width || mouseY < 0 || mouseY > height) { - $('.tidypics-tag-wrapper').hide(); - } - } - ); - } else { - $('.tidypics-photo').hover( - function() { - $('.tidypics-tag-wrapper').hide(); - }, - function() { - $('.tidypics-tag-wrapper').hide(); - } - ); - } - elgg.tidypics.tagging.tag_hover = !elgg.tidypics.tagging.tag_hover; -}; - -elgg.register_hook_handler('init', 'system', elgg.tidypics.tagging.init); diff --git a/views/default/js/photos/tidypics.php b/views/default/js/photos/tidypics.php index c97a1eadb..1ff7b2c40 100644 --- a/views/default/js/photos/tidypics.php +++ b/views/default/js/photos/tidypics.php @@ -9,8 +9,20 @@ elgg.provide('elgg.tidypics'); elgg.tidypics.init = function() { - if ($(".tidypics-lightbox").length) { - $(".tidypics-lightbox").fancybox({'type': 'image'}); + if (elgg.ui.lightbox) { + $('.elgg-lightbox, .elgg-lightbox-photo').colorbox({ + href: function() { + if ((new RegExp("photos/image/[0-9]+", 'i')).test($(this).attr('href'))) { + var guid = (new RegExp("photos/image/[0-9]+", 'i')).exec($(this).attr('href')).toString().substr("photos/image/".length); + return elgg.config.wwwroot + "photos/thumbnail/" + guid + "/large"; + } else { + return $(this).attr('href'); + } + }, + title: function() { + return '<h3 style="display: inline">'+ $(this).find('img').attr('title') +'</h3> - <a href="'+ $(this).attr('href') +'">'+ elgg.echo('comments') +'</a>'; + } + }); } $("#tidypics-sort").sortable({ diff --git a/views/default/object/image.php b/views/default/object/image.php index 2aa76d48f..fc8ea827e 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -175,26 +175,6 @@ if (get_context() == "search") { <div class="clearfloat"></div> </div> <?php - // image menu (start tagging, download, etc.) - - echo '<div id="tidypics_controls"><ul>'; - echo elgg_view('tidypics/image_menu', array( - 'image_guid' => $image_guid, - 'viewer' => $viewer, - 'owner' => $owner, - 'anytags' => $image->isPhotoTagged(), - 'album' => $album, ) ); - echo '</ul></div>'; - - // tagging code - photo tags on images, photo tag listing and hidden divs used in tagging - if (get_plugin_setting('tagging', 'tidypics') != "disabled") { - echo elgg_view('tidypics/tagging', array( - 'image' => $image, - 'viewer' => $viewer, - 'owner' => $owner, ) ); - } - - if (get_plugin_setting('exif', 'tidypics') == "enabled") { echo elgg_view('tidypics/exif', array('guid'=> $image_guid)); } diff --git a/views/default/object/image/full.php b/views/default/object/image/full.php index 175519c16..74436f500 100644 --- a/views/default/object/image/full.php +++ b/views/default/object/image/full.php @@ -13,10 +13,8 @@ $image = $photo = $vars['entity']; $img = elgg_view_entity_icon($image, 'large', array( 'href' => $image->getIconURL('master'), 'img_class' => 'tidypics-photo', - 'link_class' => 'tidypics-lightbox', + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', )); -elgg_load_js('lightbox'); -elgg_load_css('lightbox'); $owner_link = elgg_view('output/url', array( 'href' => "photos/owner/" . $photo->getOwnerEntity()->username, @@ -51,10 +49,7 @@ echo $summary; echo '<div class="tidypics-photo-wrapper center">'; echo elgg_view('object/image/navigation', $vars); -echo elgg_view('photos/tagging/help', $vars); -echo elgg_view('photos/tagging/select', $vars); echo $img; -echo elgg_view('photos/tagging/tags', $vars); echo '</div>'; if ($photo->description) { diff --git a/views/default/object/image/summary.php b/views/default/object/image/summary.php index ed8ceff38..0fa03cbe8 100644 --- a/views/default/object/image/summary.php +++ b/views/default/object/image/summary.php @@ -10,7 +10,6 @@ $image = elgg_extract('entity', $vars); -$img = elgg_view_entity_icon($image, 'small'); $header = elgg_view('output/url', array( 'text' => $image->getTitle(), @@ -19,11 +18,12 @@ $header = elgg_view('output/url', array( 'class' => 'tidypics-heading', )); -$body = elgg_view('output/url', array( - 'text' => $img, +$body = elgg_view_entity_icon($image, 'small', array( 'href' => $image->getURL(), + 'img_class' => 'tidypics-photo', 'encode_text' => false, 'is_trusted' => true, + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', )); /* diff --git a/views/default/photos/css.php b/views/default/photos/css.php index b031b825c..8fd64fd0f 100644 --- a/views/default/photos/css.php +++ b/views/default/photos/css.php @@ -18,6 +18,7 @@ } .elgg-module-tidypics-image { margin: 5px auto; + height: 80%; } .tidypics-gallery-widget > li { @@ -42,6 +43,7 @@ #tidypics-sort li { width:153px; height:153px; + cursor: move; } .tidypics-river-list > li { @@ -71,80 +73,6 @@ } /* *************************************** - Tagging -*************************************** */ -.tidypics-tagging-border1 { - border: solid 2px white; -} - -.tidypics-tagging-border1, .tidypics-tagging-border2, -.tidypics-tagging-border3, .tidypics-tagging-border4 { - filter: alpha(opacity=50); - opacity: 0.5; -} - -.tidypics-tagging-handle { - background-color: #fff; - border: solid 1px #000; - filter: alpha(opacity=50); - opacity: 0.5; -} - -.tidypics-tagging-outer { - background-color: #000; - filter: alpha(opacity=50); - opacity: 0.5; -} - -.tidypics-tagging-help { - position: absolute; - left: 50%; - top: -25px; - width: 250px; - margin-left: -125px; - text-align: center; -} - -.tidypics-tagging-select { - position: absolute; - max-width: 300px; -} - -.tidypics-tag-wrapper { - display: none; - position: absolute; -} - -.tidypics-tag { - border: 2px solid white; - clear: both; -} - -.tidypics-tag-label { - float: left; - margin-top: 5px; - color: #666; -} - -/* *************************************** - Tagging -*************************************** */ -#tidypics_uploader { - position:relative; - width:400px; - min-height:20px; -} - -#tidypics_choose_button { - position:absolute; - top:0; - left:0; - z-index:0; - display:block; - float:left; -} - -/* *************************************** UPLOADER *************************************** */ @@ -206,7 +134,6 @@ } } - <?php return true; ?> diff --git a/views/default/photos/tagging/help.php b/views/default/photos/tagging/help.php deleted file mode 100644 index a7f437e51..000000000 --- a/views/default/photos/tagging/help.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Instructions on how to peform photo tagging - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$button = elgg_view('output/url', array( - 'text' => elgg_echo('quit'), - 'href' => '#', - 'id' => 'tidypics-tagging-quit', -)); - -$instructions = elgg_echo('tidypics:taginstruct', array($button)); -?> -<div id="tidypics-tagging-help" class="elgg-module elgg-module-popup tidypics-tagging-help pam hidden"> - <?php echo $instructions; ?> -</div> diff --git a/views/default/photos/tagging/select.php b/views/default/photos/tagging/select.php deleted file mode 100644 index 8894af63a..000000000 --- a/views/default/photos/tagging/select.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Tag select view - * - * @uses $vars['entity'] - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$body = elgg_view_form('photos/image/tag', array(), $vars); - -echo elgg_view_module('popup', elgg_echo('tidypics:tagthisphoto'), $body, array( - 'class' => 'tidypics-tagging-select pam hidden', - 'id' => 'tidypics-tagging-select', -)); diff --git a/views/default/photos/tagging/tag.php b/views/default/photos/tagging/tag.php deleted file mode 100644 index 6bdc0db02..000000000 --- a/views/default/photos/tagging/tag.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -/** - * Photo tag view - * - * @uses $vars['tag'] Tag object - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$coords = json_decode('{' . $vars['tag']->coords . '}'); - -$attributes = elgg_format_attributes(array( - 'class' => 'tidypics-tag', - 'data-x1' => $coords->x1, - 'data-y1' => $coords->y1, - 'data-width' => $coords->width, - 'data-height' => $coords->height, -)); - -if ($vars['tag']->type == 'user') { - $user = get_entity($vars['tag']->value); - $label = elgg_view('output/url', array( - 'text' => $user->name, - 'href' => $user->getURL(), - )); -} else { - $label = $vars['tag']->value; -} - -$delete = ''; -$annotation = elgg_get_annotation_from_id($vars['tag']->annotation_id); - -if ($annotation->canEdit()) { - $url = elgg_http_add_url_query_elements('action/photos/image/untag', array( - 'annotation_id' => $vars['tag']->annotation_id - )); - $delete = elgg_view('output/confirmlink', array( - 'href' => $url, - 'text' => elgg_view_icon('delete', 'float mas'), - 'confirm' => elgg_echo('tidypics:phototagging:delete:confirm') - )); -} - -echo <<<HTML -<div class="tidypics-tag-wrapper"> - <div $attributes>$delete</div> - <div class="elgg-module-popup tidypics-tag-label">$label</div> -</div> -HTML; diff --git a/views/default/photos/tagging/tags.php b/views/default/photos/tagging/tags.php deleted file mode 100644 index 29c9d0efb..000000000 --- a/views/default/photos/tagging/tags.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php -/** - * View the tags for this image - * - * @uses $vars['entity'] - * - * @author Cash Costello - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 - */ - -$tags = $vars['entity']->getPhotoTags(); -foreach ($tags as $tag) { - echo elgg_view('photos/tagging/tag', array('tag' => $tag)); -} diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php index c8c79f406..29620041f 100644 --- a/views/default/river/object/album/create.php +++ b/views/default/river/object/album/create.php @@ -6,6 +6,10 @@ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 */ +elgg_load_css('lightbox'); +elgg_load_js('lightbox'); +elgg_load_js('tidypics'); + $album = $vars['item']->getObjectEntity(); $album_river_view = elgg_get_plugin_setting('album_river_view', 'tidypics'); @@ -18,10 +22,12 @@ if ($album_river_view == "cover") { $images = $album->getImages(7); if (count($images)) { - $attachments = '<ul class="tidypics-river-list">'; + $attachments = '<ul class="tidypics-river-list elgg-lightbox-gallery">'; foreach($images as $image) { $attachments .= '<li class="tidypics-photo-item">'; - $attachments .= elgg_view_entity_icon($image, 'tiny'); + $attachments .= elgg_view_entity_icon($image, 'tiny', array( + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', + )); $attachments .= '</li>'; } $attachments .= '</ul>'; diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php index 08cfdc550..6b68b4d68 100644 --- a/views/default/river/object/image/create.php +++ b/views/default/river/object/image/create.php @@ -6,6 +6,10 @@ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 */ +elgg_load_css('lightbox'); +elgg_load_js('lightbox'); +elgg_load_js('tidypics'); + $subject = $vars['item']->getSubjectEntity(); $subject_link = elgg_view('output/url', array( 'href' => $subject->getURL(), @@ -21,6 +25,7 @@ $image_link = elgg_view('output/url', array( 'href' => $image->getURL(), 'text' => $image->getTitle(), 'is_trusted' => true, + 'class' => 'elgg-lightbox-photo', )); $album_link = elgg_view('output/url', array( diff --git a/views/default/river/object/image/tag.php b/views/default/river/object/image/tag.php deleted file mode 100644 index 7e6f0313d..000000000 --- a/views/default/river/object/image/tag.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -$tagger = get_entity($vars['item']->subject_guid); -$tagged = get_entity($vars['item']->object_guid); -$annotation = get_annotation($vars['item']->annotation_id); -if ($annotation) { - $image = get_entity($annotation->entity_guid); - - // viewer may not have permission to view image - if (!$image) { - return; - } - - $image_title = $image->getTitle(); -} - -$tagger_link = "<a href=\"{$tagger->getURL()}\">$tagger->name</a>"; -$tagged_link = "<a href=\"{$tagged->getURL()}\">$tagged->name</a>"; -if (!empty($image_title)) { - $image_link = "<a href=\"{$image->getURL()}\">$image_title</a>"; - $string = sprintf(elgg_echo('image:river:tagged'), $tagger_link, $tagged_link, $image_link); -} else { - $string = sprintf(elgg_echo('image:river:tagged:unknown'), $tagger_link, $tagged_link); -} - -echo $string; diff --git a/views/default/river/object/tidypics_batch/create.php b/views/default/river/object/tidypics_batch/create.php index dc47284d2..b97c853a3 100644 --- a/views/default/river/object/tidypics_batch/create.php +++ b/views/default/river/object/tidypics_batch/create.php @@ -6,6 +6,10 @@ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 */ +elgg_load_css('lightbox'); +elgg_load_js('lightbox'); +elgg_load_js('tidypics'); + $batch = $vars['item']->getObjectEntity(); // Get images related to this batch @@ -38,10 +42,12 @@ $subject_link = elgg_view('output/url', array( )); if (count($images)) { - $attachments = '<ul class="tidypics-river-list">'; + $attachments = '<ul class="tidypics-river-list elgg-lightbox-gallery">'; foreach($images as $image) { $attachments .= '<li class="tidypics-photo-item">'; - $attachments .= elgg_view_entity_icon($image, 'tiny'); + $attachments .= elgg_view_entity_icon($image, 'tiny', array( + 'link_class' => 'tidypics-lightbox elgg-lightbox-photo', + )); $attachments .= '</li>'; } $attachments .= '</ul>'; |