whitespace consistency

This commit is contained in:
Shish 2010-02-18 14:12:52 +00:00
parent d3c921e8f3
commit 7e303dc73d
2 changed files with 135 additions and 135 deletions

View File

@ -25,11 +25,11 @@ class Blotter extends SimpleExtension {
* Installer * Installer
*/ */
global $database, $config; global $database, $config;
$database->create_table("blotter", $database->create_table("blotter", "
"id SCORE_AIPK id SCORE_AIPK,
, entry_date SCORE_DATETIME DEFAULT SCORE_NOW entry_date SCORE_DATETIME DEFAULT SCORE_NOW,
, entry_text TEXT NOT NULL entry_text TEXT NOT NULL,
, important SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N important SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N
"); ");
// Insert sample data: // Insert sample data:
$database->execute("INSERT INTO blotter (id, entry_date, entry_text, important) VALUES (?, now(), ?, ?)", $database->execute("INSERT INTO blotter (id, entry_date, entry_text, important) VALUES (?, now(), ?, ?)",
@ -99,7 +99,7 @@ class Blotter extends SimpleExtension {
if(!$user->is_admin()) { if(!$user->is_admin()) {
$this->theme->display_permission_denied($page); $this->theme->display_permission_denied($page);
} else { } else {
$id = $_POST['id']; $id = int_escape($_POST['id']);
if(!isset($id)) { die("No ID!"); } if(!isset($id)) { die("No ID!"); }
$database->Execute("DELETE FROM blotter WHERE id=$id"); $database->Execute("DELETE FROM blotter WHERE id=$id");
log_info("blotter", "Removed Entry #$id"); log_info("blotter", "Removed Entry #$id");
@ -122,6 +122,7 @@ class Blotter extends SimpleExtension {
*/ */
$this->display_blotter(); $this->display_blotter();
} }
private function display_blotter() { private function display_blotter() {
global $database, $config; global $database, $config;
$limit = $config->get_int("blotter_recent", 5); $limit = $config->get_int("blotter_recent", 5);
@ -129,3 +130,4 @@ class Blotter extends SimpleExtension {
$this->theme->display_blotter($entries); $this->theme->display_blotter($entries);
} }
} }
?>

View File

@ -1,4 +1,4 @@
<? <?php
class BlotterTheme extends Themelet { class BlotterTheme extends Themelet {
public function display_editor($entries) { public function display_editor($entries) {
global $page; global $page;
@ -132,13 +132,11 @@ class BlotterTheme extends Themelet {
$i_color = $config->get_string("blotter_color","#FF0000"); $i_color = $config->get_string("blotter_color","#FF0000");
$position = $config->get_string("blotter_position", "subheading"); $position = $config->get_string("blotter_position", "subheading");
$html = "<style type='text/css'> $html = "<style type='text/css'>
#blotter1 {font-size: 80%; #blotter1 {font-size: 80%; position: relative;}
position: relative;} #blotter2 {font-size: 80%;}
#blotter2 {font-size: 80%; </style>";
}
</style>";
$html .= "<script><!-- $html .= "<script><!--
$(document).ready(function() { $(document).ready(function() {
$(\"#blotter2-toggle\").click(function() { $(\"#blotter2-toggle\").click(function() {
$(\"#blotter2\").slideToggle(\"slow\", function() { $(\"#blotter2\").slideToggle(\"slow\", function() {
if($(\"#blotter2\").is(\":hidden\")) { if($(\"#blotter2\").is(\":hidden\")) {
@ -152,8 +150,8 @@ class BlotterTheme extends Themelet {
if($.cookie(\"blotter2-hidden\") == 'true') { if($.cookie(\"blotter2-hidden\") == 'true') {
$(\"#blotter2\").hide(); $(\"#blotter2\").hide();
} }
}); });
//--></script>"; //--></script>";
$entries_list = ""; $entries_list = "";
for ($i = 0 ; $i < count($entries) ; $i++) for ($i = 0 ; $i < count($entries) ; $i++)
{ {
@ -175,7 +173,7 @@ class BlotterTheme extends Themelet {
$pos_break = ""; $pos_break = "";
$pos_align = "text-align: right; position: absolute; right: 0px;"; $pos_align = "text-align: right; position: absolute; right: 0px;";
if($position == "left") { $pos_break = "<br />"; $pos_align = ""; } if($position == "left") { $pos_break = "<br />"; $pos_align = ""; }
if (count($entries) == 0) { $out_text = "No blotter entries yet."; $in_text = "Empty.";} if(count($entries) == 0) { $out_text = "No blotter entries yet."; $in_text = "Empty.";}
else { $clean_date = date("m/d/y",strtotime($entries[0]['entry_date'])); else { $clean_date = date("m/d/y",strtotime($entries[0]['entry_date']));
$out_text = "Blotter updated: {$clean_date}"; $out_text = "Blotter updated: {$clean_date}";
$in_text = "<ul>$entries_list</ul>"; $in_text = "<ul>$entries_list</ul>";