summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-01 00:16:08 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-01 00:16:08 +0000
commit7c82691e0057188e07601c30069385c3f17cbff1 (patch)
treea1bc9b21b62314bc34784625b0f1b0e8dfdddb47
parent11d2788af8111a036d2279563fe6a21f374b5b9c (diff)
Move debug CSS into core/css/debug.css, and enable it for admin themes also
-rw-r--r--core/css/debug.css29
-rw-r--r--core/helpers/core_block.php14
-rw-r--r--core/libraries/Admin_View.php10
-rw-r--r--core/libraries/Theme_View.php5
-rw-r--r--themes/default/css/screen.css44
5 files changed, 60 insertions, 42 deletions
diff --git a/core/css/debug.css b/core/css/debug.css
new file mode 100644
index 00000000..82d365aa
--- /dev/null
+++ b/core/css/debug.css
@@ -0,0 +1,29 @@
+.gAnnotatedThemeBlock {
+ position: relative;
+ padding: 1em;
+ margin: 1em;
+ border: 1px solid #C00;
+ clear: both;
+}
+
+.gAnnotatedThemeBlock_album_top {
+ float: right;
+}
+
+.gAnnotatedThemeBlock_header_bottom {
+ float: right;
+}
+
+.gAnnotatedThemeBlock div.title {
+ position: absolute;
+ top: -1em;
+ right: -1em;
+ border: 1px solid black;
+ background: #C00;
+ color: white;
+ text-align: left;
+ padding: 4px;
+ font-size: 110%;
+ -moz-border-radius: 5% 5% 5% 5%;
+}
+
diff --git a/core/helpers/core_block.php b/core/helpers/core_block.php
index 1bc70a13..c82ca53d 100644
--- a/core/helpers/core_block.php
+++ b/core/helpers/core_block.php
@@ -19,6 +19,20 @@
*/
class core_block_Core {
+ public static function head($theme) {
+ if (Session::instance()->get("debug")) {
+ return "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
+ url::file("core/css/debug.css") . "\" />";
+ }
+ }
+
+ public static function admin_head($theme) {
+ if (Session::instance()->get("debug")) {
+ return "<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
+ url::file("core/css/debug.css") . "\" />";
+ }
+ }
+
public static function page_bottom($theme) {
if (Session::instance()->get("profiler", false)) {
$profiler = new Profiler();
diff --git a/core/libraries/Admin_View.php b/core/libraries/Admin_View.php
index 332be596..267d06e8 100644
--- a/core/libraries/Admin_View.php
+++ b/core/libraries/Admin_View.php
@@ -98,6 +98,16 @@ class Admin_View_Core extends View {
array_merge(array($this), $args));
}
}
+
+ if (Session::instance()->get("debug")) {
+ if ($function != "admin_head") {
+ array_unshift(
+ $blocks, "<div class=\"gAnnotatedThemeBlock gAnnotatedThemeBlock_$function\">" .
+ "<div class=\"title\">$function</div>");
+ $blocks[] = "</div>";
+ }
+ }
+
return implode("\n", $blocks);
default:
diff --git a/core/libraries/Theme_View.php b/core/libraries/Theme_View.php
index d4e7019e..794cb2fb 100644
--- a/core/libraries/Theme_View.php
+++ b/core/libraries/Theme_View.php
@@ -125,9 +125,6 @@ class Theme_View_Core extends View {
case "thumb_info":
case "thumb_top":
case "photo_bottom":
- // @todo: restrict access to this option
- $debug = Session::instance()->get("debug", false);
-
$blocks = array();
foreach (module::installed() as $module) {
$helper_class = "{$module->name}_block";
@@ -137,7 +134,7 @@ class Theme_View_Core extends View {
array_merge(array($this), $args));
}
}
- if ($debug) {
+ if (Session::instance()->get("debug")) {
if ($function != "head") {
array_unshift(
$blocks, "<div class=\"gAnnotatedThemeBlock gAnnotatedThemeBlock_$function gClearFix\">" .
diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css
index ffb7a8b0..ee1c8472 100644
--- a/themes/default/css/screen.css
+++ b/themes/default/css/screen.css
@@ -15,9 +15,8 @@
*
* @todo Group Credits and gLoginMenu seperator styles
* @todo Apply :hover bg image to #gViewMenu (will clear fix correct this?)
- * @todo Refactor form layout styles to reserve room for validation messages in default state. This
+ * @todo Refactor form layout styles to reserve room for validation messages in default state. This
* will eliminate layout shifts when validation messages are displayed.
- * @todo Move debugging information styles into a core stylesheet.
*/
/** *******************************************************************
@@ -303,37 +302,6 @@ li.gError select {
width: 10em;
}
-/* Debugging information ~~~~~~~~~~~~~~~~~ */
-
-.gAnnotatedThemeBlock {
- position: relative;
- padding: 1em;
- margin: 1em;
- border: 1px solid #C00;
- clear: both;
-}
-
-.gAnnotatedThemeBlock_album_top {
- float: right;
-}
-
-.gAnnotatedThemeBlock_header_bottom {
- float: right;
-}
-
-.gAnnotatedThemeBlock div.title {
- position: absolute;
- top: -1em;
- right: -1em;
- border: 1px solid black;
- background: #C00;
- color: white;
- text-align: left;
- padding: 4px;
- font-size: 110%;
- -moz-border-radius: 5% 5% 5% 5%;
-}
-
/*** ******************************************************************
* 4) Page layout containers
*********************************************************************/
@@ -478,8 +446,8 @@ li.gError select {
* 5) Navigation and menus
*********************************************************************/
-#gSiteMenu,
-#gBreadcrumbs,
+#gSiteMenu,
+#gBreadcrumbs,
#gTagCloud ul {
font-size: 1.3em;
}
@@ -784,7 +752,7 @@ li.gError select {
display: block;
}
body .ui-resizable-disabled .ui-resizable-handle,
-body .ui-resizable-autohide .ui-resizable-handle {
+body .ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
@@ -863,7 +831,7 @@ body .ui-resizable-autohide .ui-resizable-handle {
height: 11px;
z-index: 100;
}
-.ui-dialog-titlebar-close-hover,
+.ui-dialog-titlebar-close-hover,
.ui-dialog-titlebar-close:hover {
background-position: 0 47%;
}
@@ -908,4 +876,4 @@ body .ui-resizable-autohide .ui-resizable-handle {
.ui-dialog.ui-draggable .ui-dialog-titlebar,
.ui-dialog.ui-draggable .ui-dialog-titlebar {
cursor: move;
-} \ No newline at end of file
+}