]> git.mxchange.org Git - friendica-addons.git/commitdiff
add viewsrc addon
authorfriendica <info@friendica.com>
Fri, 27 Jan 2012 00:50:35 +0000 (16:50 -0800)
committerfriendica <info@friendica.com>
Fri, 27 Jan 2012 00:50:35 +0000 (16:50 -0800)
nsfw.tgz
viewsrc.tgz [new file with mode: 0644]
viewsrc/viewsrc.php [new file with mode: 0644]

index f90d2d1cd2ee5414ccb736619282d13bd15c887b..187ef0150cdca3fd8db6f96d465ecb91c77239db 100755 (executable)
Binary files a/nsfw.tgz and b/nsfw.tgz differ
diff --git a/viewsrc.tgz b/viewsrc.tgz
new file mode 100644 (file)
index 0000000..2aa7d0f
Binary files /dev/null and b/viewsrc.tgz differ
diff --git a/viewsrc/viewsrc.php b/viewsrc/viewsrc.php
new file mode 100644 (file)
index 0000000..e39fe8a
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+
+/**
+ * Name: viewsrc
+ * Description: Add "View Source" link to item context
+ * Version: 1.0
+ * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
+ * 
+ */
+
+function viewsrc_install() {
+       register_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
+}
+
+
+function viewsrc_uninstall() {
+       unregister_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
+}
+
+
+function viewsrc_item_photo_menu(&$a,&$b) {
+       if(! local_user())
+               return;
+       $b['menu'] = array_merge( array( t('View Source') => $a->get_baseurl() . '/viewsrc/'. $b['item']['id']), $b['menu']);
+
+}