Commit d87621ad by Scott

Add theme-specific classes to body tag

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