Fix all the head() and admin_head() theme callbacks to return the

results of the $theme->css() and $theme->script() calls.  This handles
the case where combining scripts/css returns HTML instead of putting
it in the queue for combination.  Fixes #1611.
This commit is contained in:
Bharat Mediratta
2011-01-15 13:14:43 -08:00
parent 38b7493287
commit ee13b934f4
7 changed files with 38 additions and 39 deletions
@@ -20,24 +20,24 @@
class server_add_theme_Core {
static function head($theme) {
if (identity::active_user()->admin) {
$theme->css("server_add.css");
$theme->script("server_add.js");
return $theme->css("server_add.css")
. $theme->script("server_add.js");
}
}
static function admin_head($theme) {
$head = array();
$buf = "";
if (strpos(Router::$current_uri, "admin/server_add") !== false) {
$theme->css("server_add.css");
$theme->css("jquery.autocomplete.css");
$buf .= $theme->css("server_add.css")
. $theme->css("jquery.autocomplete.css");
$base = url::site("__ARGS__");
$csrf = access::csrf_token();
$head[] = "<script type=\"text/javascript\"> var base_url = \"$base\"; var csrf = \"$csrf\";</script>";
$buf .= "<script type=\"text/javascript\"> var base_url = \"$base\"; var csrf = \"$csrf\";</script>";
$theme->script("jquery.autocomplete.js");
$theme->script("admin.js");
$buf .= $theme->script("jquery.autocomplete.js")
. $theme->script("admin.js");
}
return implode("\n", $head);
return $buf;
}
}