function doctype() { global $widgets; $widgets = get_all_widgets(); $this->widgets = $widgets; if (isset($_REQUEST['cs_ajax_html'])) { $action = 'cs_ajax_' . $_REQUEST['action']; if (method_exists($this, $action)) { $this->{$action}(); } } else { $this->output('<!DOCTYPE html>'); $this->content['navigation']['main']['questions']['icon'] = 'icon-question-sign'; $this->content['navigation']['main']['unanswered']['icon'] = 'icon-sad'; $this->content['navigation']['main']['hot']['icon'] = 'icon-fire'; $this->content['navigation']['main']['tag']['icon'] = 'icon-tags2'; $this->content['navigation']['main']['categories']['icon'] = 'icon-folder-close'; $this->content['navigation']['main']['user']['icon'] = 'icon-users'; $this->content['navigation']['main']['widgets']['icon'] = 'icon-puzzle'; $this->content['navigation']['main']['admin']['icon'] = 'icon-wrench'; $this->content['navigation']['main']['themeoptions']['icon'] = 'icon-wrench'; unset($this->content['navigation']['main']['ask']); unset($this->content['navigation']['main']['admin']); if ((bool) qa_opt('cs_enable_category_nav')) { unset($this->content['navigation']['main']['categories']); } } }
function doctype() { $this->widgets = get_all_widgets(); // Setup Navigation global $qa_request; //var_dump($qa_request); $this->content['navigation']['user']['widgets'] = array('label' => 'Theme Widgets', 'url' => qa_path_html('widgets'), 'icon' => 'icon-puzzle'); if ($qa_request == 'widgets') { $this->content['navigation']['user']['widgets']['selected'] = true; $this->content['navigation']['user']['selected'] = true; $this->template = "widgets"; $this->content['site_title'] = "Theme Widgets"; $this->content['error'] = ""; $this->content['suggest_next'] = ""; $this->content['title'] = "Theme Widgets"; //$this->content['custom']=''; $saved = false; if (qa_clicked('cs_remove_all_button')) { qa_db_query_sub('TRUNCATE TABLE ^cs_widgets'); $saved = true; } if (qa_clicked('cs_reset_widgets_button')) { $handle = fopen(Q_THEME_DIR . '/demo_content/widget_builder.sql', 'r'); $sql = ''; if ($handle) { while (($line = fgets($handle, 4096)) !== false) { $sql .= trim(' ' . trim($line)); if (substr($sql, -strlen(';')) == ';') { qa_db_query_sub($sql); $sql = ''; } } fclose($handle); } $saved = true; } $cs_page = ' <div id="ra-widgets"> <div class="widget-list col-sm-5"> ' . $this->cs_get_widgets() . ' </div> <div class="widget-postions col-sm-7"> ' . $this->cs_get_widgets_positions() . ' </div> </div> <div class="form-widget-button-holder"> <form class="form-horizontal" method="post"> <input class="qa-form-tall-button btn-primary" type="submit" name="cs_remove_all_button" value="Remove All Widgets" title=""> <input class="qa-form-tall-button btn-primary" type="submit" name="cs_reset_widgets_button" value="Reset All Widgets To Theme Default" title=""> </form> </div> '; $this->content['custom'] = $cs_page; } qa_html_theme_base::doctype(); }