| 90 | | $output = "\t<style type=\"text/css\">\n"; |
| 91 | | $output .= "\t\t.altarchive_month_noitems {\n"; |
| 92 | | $output .= "\t\t\ttext-align: center;\n"; |
| 93 | | $output .= "\t\t\tbackground-color: ".$this->_settings["altarchive_noitems_bg"].";\n"; |
| 94 | | $output .= "\t\t\tcolor: ".$this->_settings["altarchive_noitems_text"].";\n"; |
| 95 | | $output .= "\t\t\tborder: 1px solid #b0b0b0;\n"; |
| 96 | | $output .= "\t\t}\n"; |
| 97 | | $output .= "\t\t.altarchive_month_items {\n"; |
| 98 | | $output .= "\t\t\ttext-align: center;\n"; |
| 99 | | $output .= "\t\t\tbackground-color: ".$this->_settings["altarchive_items_bg"].";\n"; |
| 100 | | $output .= "\t\t\tborder: 1px solid #b0b0b0;\n"; |
| 101 | | $output .= "\t\t}\n"; |
| 102 | | $output .= "\t\t.altarchive_month_items a {\n"; |
| 103 | | $output .= "\t\t\tcolor: ".$this->_settings["altarchive_items_text"].";\n"; |
| 104 | | $output .= "\t\t}\n"; |
| 105 | | $output .= "\t</style>\n"; |
| | 95 | if ($this->_settings["altarchive_showdefaultcss"]) { |
| | 96 | $output = "\t<style type=\"text/css\">\n"; |
| | 97 | $output .= "\t\t.altarchive_month_noitems {\n"; |
| | 98 | $output .= "\t\t\ttext-align: center;\n"; |
| | 99 | $output .= "\t\t\tbackground-color: ".$this->_settings["altarchive_noitems_bg"].";\n"; |
| | 100 | $output .= "\t\t\tcolor: ".$this->_settings["altarchive_noitems_text"].";\n"; |
| | 101 | $output .= "\t\t\tborder: 1px solid #b0b0b0;\n"; |
| | 102 | $output .= "\t\t}\n"; |
| | 103 | $output .= "\t\t.altarchive_month_items {\n"; |
| | 104 | $output .= "\t\t\ttext-align: center;\n"; |
| | 105 | $output .= "\t\t\tbackground-color: ".$this->_settings["altarchive_items_bg"].";\n"; |
| | 106 | $output .= "\t\t\tborder: 1px solid #b0b0b0;\n"; |
| | 107 | $output .= "\t\t}\n"; |
| | 108 | $output .= "\t\t.altarchive_month_items a {\n"; |
| | 109 | $output .= "\t\t\tcolor: ".$this->_settings["altarchive_items_text"].";\n"; |
| | 110 | $output .= "\t\t}\n"; |
| | 111 | $output .= "\t</style>\n"; |
| | 112 | } else { |
| | 113 | $output = ""; |
| | 114 | } |
| | 117 | /* }}} */ |
| | 118 | /* show_settings {{{ */ |
| | 119 | public function show_settings() { |
| | 120 | $output = "<form name=\"acronym\" method=\"post\" action=\"index.php\">"; |
| | 121 | $output .= "<input type=\"hidden\" name=\"action\" value=\"save_plugin_setting\" />"; |
| | 122 | $output .= "<input type=\"hidden\" name=\"plugin\" value=\"altarchive\" />"; |
| | 123 | $output .= "<table style=\"width: 220px;\"><tr>"; |
| | 124 | $output .= "<td>".gettext("use default stylesheet?")."</td>"; |
| | 125 | $output .= "<td><select name=\"altarchive_showdefaultcss\">"; |
| | 126 | $output .= "<option value=\"1\""; |
| | 127 | if ($this->_settings["altarchive_showdefaultcss"]) |
| | 128 | $output .= " selected=\"selected\""; |
| | 129 | $output .= ">".gettext("yes")."</option>"; |
| | 130 | $output .= "<option value=\"0\""; |
| | 131 | if (!$this->_settings["altarchive_showdefaultcss"]) |
| | 132 | $output .= " selected=\"selected\""; |
| | 133 | $output .= ">".gettext("no")."</option>"; |
| | 134 | $output .= "</select></td>\n"; |
| | 135 | $output .= "</tr><tr>"; |
| | 136 | $output .= "<td colspan=\"2\"><input type=\"submit\" value=\"".gettext("Save")."\" /></td>"; |
| | 137 | $output .= "</tr></table>"; |
| | 142 | /* }}} */ |
| | 143 | /* save_setting {{{ */ |
| | 144 | public function save_setting($requestdata) { |
| | 145 | /* first look if the setting is already there */ |
| | 146 | $sql = "SELECT COUNT(*) FROM settings WHERE settingname = 'altarchive_showdefaultcss'"; |
| | 147 | $res = $this->_mvblog->db->query($sql); |
| | 148 | $res->fetchInto($row); |
| | 149 | if ($row[0]) { |
| | 150 | /* yes, so update */ |
| | 151 | $sql = sprintf("UPDATE settings SET settingvalue='%d' WHERE settingname='altarchive_showdefaultcss'", $requestdata["altarchive_showdefaultcss"]); |
| | 152 | } else { |
| | 153 | /* no, so insert */ |
| | 154 | $sql = sprintf("INSERT INTO settings (settingname, settingvalue) VALUES ('altarchive_showdefaultcss', '%d')", $requestdata["altarchive_showdefaultcss"]); |
| | 155 | } |
| | 156 | $res = $this->_mvblog->db->query($sql); |
| | 157 | $this->_settings["altarchive_showdefaultcss"] = sprintf("%d", $requestdata["altarchive_showdefaultcss"]); |
| | 158 | $this->show_settings(); |
| | 159 | } |
| | 160 | /* }}} */ |