From: friendica Date: Fri, 27 Jan 2012 00:50:35 +0000 (-0800) Subject: add viewsrc addon X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bf28efb4feb3d8815f9a55964d9669aafba55d6c;p=friendica-addons.git add viewsrc addon --- diff --git a/nsfw.tgz b/nsfw.tgz index f90d2d1c..187ef015 100755 Binary files a/nsfw.tgz and b/nsfw.tgz differ diff --git a/viewsrc.tgz b/viewsrc.tgz new file mode 100644 index 00000000..2aa7d0fe Binary files /dev/null and b/viewsrc.tgz differ diff --git a/viewsrc/viewsrc.php b/viewsrc/viewsrc.php new file mode 100644 index 00000000..e39fe8a6 --- /dev/null +++ b/viewsrc/viewsrc.php @@ -0,0 +1,27 @@ + + * + */ + +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']); + +}