Commit e331e164 by Scott

Add new category widget plugin

parent d3a376bf
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
'MB' => qa_lang_html('options/place_main_bottom'), 'MB' => qa_lang_html('options/place_main_bottom'),
'ST' => qa_lang_html('options/place_side_top'), 'ST' => qa_lang_html('options/place_side_top'),
'SH' => qa_lang_html('options/place_side_below_sidebar'), 'SH' => qa_lang_html('options/place_side_below_sidebar'),
'SL' => qa_lang_html('options/place_side_below_categories'), 'SL' => qa_lang_html('options/place_side_low'),
'SB' => qa_lang_html('options/place_side_last'), 'SB' => qa_lang_html('options/place_side_last'),
); );
} }
......
...@@ -198,8 +198,9 @@ ...@@ -198,8 +198,9 @@
'place_main_below_title' => 'Main area - Below title', 'place_main_below_title' => 'Main area - Below title',
'place_main_bottom' => 'Main area - Bottom', 'place_main_bottom' => 'Main area - Bottom',
'place_main_top' => 'Main area - Top', 'place_main_top' => 'Main area - Top',
'place_side_below_categories' => 'Side panel - Below categories', 'place_side_below_categories' => 'Side panel - Below categories', // @deprecated
'place_side_below_sidebar' => 'Side panel - Below sidebar box', 'place_side_below_sidebar' => 'Side panel - Below sidebar box',
'place_side_low' => 'Side panel - Low',
'place_side_last' => 'Side panel - Last', 'place_side_last' => 'Side panel - Last',
'place_side_top' => 'Side panel - Top', 'place_side_top' => 'Side panel - Top',
'points_a_selected' => 'Having your answer selected as the best:', 'points_a_selected' => 'Having your answer selected as the best:',
......
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-include/qa-widget-activity-count.php
Description: Widget module class for activity count plugin
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
More about this license: http://www.question2answer.org/license.php
*/
class qa_category_list
{
private $themeobject;
public function allow_template($template)
{
return true;
}
public function allow_region($region)
{
return $region == 'side';
}
public function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
$this->themeobject = $themeobject;
if (isset($qa_content['navigation']['cat'])) {
$nav = $qa_content['navigation']['cat'];
}
else {
$navcategories = qa_db_single_select(qa_db_category_nav_selectspec(null, true, false, true));
$nav = qa_category_navigation($navcategories);
}
$this->themeobject->output('<h2>'.qa_lang_html('main/nav_categories').'</h2>');
$this->themeobject->set_context('nav_type', 'cat');
$this->themeobject->nav_list($nav, 'nav-cat', 1);
$this->themeobject->nav_clear('cat');
$this->themeobject->clear_context('nav_type');
}
}
...@@ -304,6 +304,7 @@ ...@@ -304,6 +304,7 @@
qa_register_module('widget', 'plugins/qa-widget-activity-count.php', 'qa_activity_count', 'Activity Count'); qa_register_module('widget', 'plugins/qa-widget-activity-count.php', 'qa_activity_count', 'Activity Count');
qa_register_module('widget', 'plugins/qa-widget-ask-box.php', 'qa_ask_box', 'Ask Box'); qa_register_module('widget', 'plugins/qa-widget-ask-box.php', 'qa_ask_box', 'Ask Box');
qa_register_module('widget', 'plugins/qa-widget-related-qs.php', 'qa_related_qs', 'Related Questions'); qa_register_module('widget', 'plugins/qa-widget-related-qs.php', 'qa_related_qs', 'Related Questions');
qa_register_module('widget', 'plugins/qa-widget-category-list.php', 'qa_category_list', 'Categories');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment