]> git.mxchange.org Git - friendica-addons.git/blob - viewsrc/viewsrc.php
xmlify the login credentials - just in case
[friendica-addons.git] / viewsrc / viewsrc.php
1 <?php
2
3
4 /**
5  * Name: viewsrc
6  * Description: Add "View Source" link to item context
7  * Version: 1.0
8  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
9  * 
10  */
11
12 function viewsrc_install() {
13         register_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
14 }
15
16
17 function viewsrc_uninstall() {
18         unregister_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
19 }
20
21
22 function viewsrc_item_photo_menu(&$a,&$b) {
23         if(! local_user())
24                 return;
25         $b['menu'] = array_merge( array( t('View Source') => $a->get_baseurl() . '/viewsrc/'. $b['item']['id']), $b['menu']);
26
27 }