viewsrc: show message source in a fancybox via ajax
parent
c92861618b
commit
5adb4ef803
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue