public function theme_editor()
{
global $aidlink, $locale;
if (isset($_GET['e_action']) && $_GET['e_action'] == "edit" && isset($_GET['preset']) && isnum($_GET['preset'])) {
$result = dbquery("SELECT * FROM " . DB_THEME . " WHERE theme_name='" . $this->theme_name . "' AND theme_id='" . intval($_GET['preset']) . "'");
if (dbrows($result) > 0) {
$this->data = dbarray($result);
if ($this->data['theme_config']) {
$this->data += unserialize(stripslashes($this->data['theme_config']));
}
}
}
self::save_theme();
$this->font_decoration_options = array($locale['theme_5000'], $locale['theme_5001'], $locale['theme_5002'], $locale['theme_5003'], $locale['theme_5004'], $locale['theme_5005'], $locale['theme_5006'], $locale['theme_5007']);
$this->fills = array($locale['theme_5008'], $locale['theme_5009'], $locale['theme_5010'], $locale['theme_5011'], $locale['theme_5012']);
$tab_title['title'][] = $locale['theme_2001'];
$tab_title['id'][] = 'font';
$tab_title['icon'][] = 'fa fa-text-width m-r-10';
$tab_title['title'][] = $locale['theme_2002'];
$tab_title['id'][] = 'grid';
$tab_title['icon'][] = 'fa fa-magic m-r-10';
$tab_title['title'][] = $locale['theme_2003'];
$tab_title['id'][] = 'nav';
$tab_title['icon'][] = 'fa fa-navicon m-r-10';
$tab_active = tab_active($tab_title, 0);
if ($this->debug) {
print_p($_POST);
}
// Use a modal to block user to avoid double clicking the save button.
echo openmodal('dbi', sprintf($locale['theme_2005'], ucwords($this->theme_name)), array('class' => 'zindex-boost modal-center', 'button_id' => 'save_theme', 'static' => 1));
echo "<div class='pull-left m-r-20'><i class='icon_notify n-magic'></i></div>\n";
echo "<div class='overflow-hide text-smaller'>" . $locale['theme_2006'] . "</div>\n";
echo closemodal();
// how come my multiple preset missing now?
echo openform('theme_edit', 'post', FUSION_REQUEST, array("class" => "m-t-20"));
echo "<div class='list-group-item m-b-20 clearfix'>\n";
echo "<div class='pull-right m-l-10'>\n";
echo form_button('save_theme', $locale['theme_5013'], 'save_theme', array('class' => 'btn-primary m-r-10'));
echo form_button('close_theme', $locale['close'], 'close_theme', array('class' => 'btn-default'));
echo "</div>\n";
echo "<div class='overflow-hide'>\n";
echo form_hidden('theme_id', '', $this->data['theme_id']);
echo form_hidden("theme_datestamp", '', time());
echo form_text('theme_title', $locale['theme_2007'], $this->data['theme_title'], array('inline' => 1, 'required' => TRUE));
echo form_hidden('theme_name', $locale['theme_2008'], $this->theme_name, array('inline' => 1, 'deactivate' => 1));
echo "</div>\n";
echo "</div>\n";
echo opentab($tab_title, $tab_active, 'atom');
echo opentabbody($tab_title['title'][0], $tab_title['id'][0], $tab_active);
echo "<div class='m-t-20'>\n";
$this->font_admin();
echo "</div>\n";
echo closetabbody();
echo opentabbody($tab_title['title'][1], $tab_title['id'][1], $tab_active);
echo "<div class='m-t-20'>\n";
$this->layout_admin();
echo "</div>\n";
echo closetabbody();
echo opentabbody($tab_title['title'][2], $tab_title['id'][2], $tab_active);
echo "<div class='m-t-20'>\n";
$this->nav_admin();
echo "</div>\n";
echo closetabbody();
echo closetab();
echo closeform();
}