viewsrc: show message source in a fancybox via ajax

pull/30/head
Fabio Comuni 2012-03-28 11:44:04 +02:00
parent c92861618b
commit 5adb4ef803
1 changed files with 12 additions and 0 deletions

View File

@ -11,13 +11,25 @@
function viewsrc_install() {
register_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
register_hook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end');
}
function viewsrc_uninstall() {
unregister_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
unregister_hook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end');
}
function viewsrc_page_end(&$a, &$o){
$a->page['htmlhead'] .= <<< EOS
<script>
$(function(){
$('a[href*="/viewsrc/"]').fancybox();
});
</script>
EOS;
}
function viewsrc_item_photo_menu(&$a,&$b) {
if(! local_user())