summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-05-23 22:44:01 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-05-23 22:44:01 -0400
commitd92a018cd2b199213cbd66f27dbabb460d3d55c9 (patch)
tree16f344902566fb514788d7d6fd23c7a57fabb25e
parent78564c21d46d56a2cf413b9ba804d5a60430f06e (diff)
get a design for each page
-rw-r--r--lib/action.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/action.php b/lib/action.php
index 6a69d2651..e8aba5b89 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -224,6 +224,16 @@ class Action extends HTMLOutputter // lawsuit
'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]');
Event::handle('EndShowUAStyles', array($this));
}
+ if (Event::handle('StartShowDesign', array($this))) {
+ $design = $this->getDesign();
+ if (!empty($design)) {
+ $cur = common_current_user();
+ if (empty($cur) || $cur->viewdesigns) {
+ $design->showCSS($this);
+ }
+ }
+ Event::handle('EndShowDesign', array($this, $design));
+ }
Event::handle('EndShowStyles', array($this));
}
}
@@ -248,7 +258,6 @@ class Action extends HTMLOutputter // lawsuit
'src' => common_path('js/jquery.joverlay.min.js')),
' ');
-
Event::handle('EndShowJQueryScripts', array($this));
}
if (Event::handle('StartShowLaconicaScripts', array($this))) {
@@ -1095,4 +1104,19 @@ class Action extends HTMLOutputter // lawsuit
'title' => _('Previous')));
}
}
+
+ /**
+ * A design for this action
+ *
+ * A design (colors and background) for the current page. May be
+ * the user's design, or a group's design, or a site design.
+ *
+ * @return array Feed object to show in head and links
+ */
+
+ function getDesign()
+ {
+ // XXX: return site design by default
+ return null;
+ }
}