Commit d87621ad by Scott

Add theme-specific classes to body tag

Closes #193.
parent a453d36e
......@@ -51,6 +51,8 @@ class qa_html_theme_base
// whether to use new block layout in rankings (true) or fall back to tables (false)
protected $ranking_block_layout = false;
// theme 'slug' to use as CSS class
protected $theme;
public function __construct($template, $content, $rooturl, $request)
......@@ -406,6 +408,7 @@ class qa_html_theme_base
public function body_tags()
{
$class = 'qa-template-'.qa_html($this->template);
$class .= empty($this->theme) ? '' : ' qa-theme-' . qa_html($this->theme);
if (isset($this->content['categoryids'])) {
foreach ($this->content['categoryids'] as $categoryid)
......
......@@ -24,6 +24,7 @@ class qa_html_theme extends qa_html_theme_base
{
// use new ranking layout
protected $ranking_block_layout = true;
protected $theme = 'candy';
public function nav_user_search() // reverse the usual order
{
......
......@@ -24,4 +24,5 @@ class qa_html_theme extends qa_html_theme_base
{
// use new ranking layout
protected $ranking_block_layout = true;
protected $theme = 'classic';
}
......@@ -4,6 +4,7 @@ class qa_html_theme extends qa_html_theme_base
{
// use new ranking layout
protected $ranking_block_layout = true;
protected $theme = 'snow';
// outputs login form if user not logged in
public function nav_user_search()
......
......@@ -34,6 +34,8 @@
*/
class qa_html_theme extends qa_html_theme_base
{
protected $theme = 'snowflat';
// theme subdirectories
private $js_dir = 'js';
private $icon_url = 'images/icons';
......@@ -114,6 +116,7 @@ class qa_html_theme extends qa_html_theme_base
public function body_tags()
{
$class = 'qa-template-' . qa_html($this->template);
$class .= empty($this->theme) ? '' : ' qa-theme-' . qa_html($this->theme);
if (isset($this->content['categoryids'])) {
foreach ($this->content['categoryids'] as $categoryid)
......
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