-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathqa-book-widget.php
More file actions
33 lines (24 loc) · 873 Bytes
/
qa-book-widget.php
File metadata and controls
33 lines (24 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
class qa_book_widget {
function allow_template($template)
{
return true;
}
function allow_region($region)
{
return true;
}
function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
if(!qa_opt('book_plugin_active'))
return;
$themeobject->output('<h2>'.qa_lang('book/widget_title').'</h2>');
$out = '<p><a href="'.qa_path_html(qa_opt('book_plugin_request')).'"></> '.qa_lang('book/widget_html').'</a></p>';
if(qa_opt('book_plugin_pdf'))
$out .= '<p><a href="'.qa_path_html(qa_opt('book_plugin_request_pdf')).'"><img src="http://www.adobe.com/images/pdficon_small.png"> '.qa_lang('book/widget_pdf').'</a></p>';
$themeobject->output('<div class="book-widget" style="padding-top:0px">',$out,'</div>');
}
};
/*
Omit PHP closing tag to help avoid accidental output
*/