Modified:
trunk/library/Framework/Control/Head.php
Log:
Sync with Vanilla 1.1.3
Modified: trunk/library/Framework/Control/Head.php
==============================================================================
--- trunk/library/Framework/Control/Head.php (original)
+++ trunk/library/Framework/Control/Head.php Sun Sep 30 13:37:55 2007
@@ -44,17 +44,22 @@
if (!is_array($this->Scripts)) {
$this->Scripts = array();
}
+
if ($ScriptRoot == '~') {
$ScriptRoot = $this->Context->Configuration['WEB_ROOT'];
}
+
$ScriptPath = $ScriptLocation;
if ($ScriptRoot != '') {
$ScriptPath = ConcatenatePath($ScriptRoot, $ScriptLocation);
}
- $this->Scripts[] = $ScriptPath;
+
+ if (!in_array($ScriptPath, $this->Scripts)) {
+ $this->Scripts[] = $ScriptPath;
+ }
}
-
- function AddStyleSheet($StyleSheetLocation, $Media = '', $Position = '100', $StyleRoot = '~')
+
+ function AddStyleSheet($StyleSheetLocation, $Media = '', $Position = '100', $StyleRoot = '~')
{
if ($StyleRoot == '~') {
$StyleRoot = $this->Context->Configuration['WEB_ROOT'];
@@ -72,7 +77,7 @@
$Position
);
}
-
+
function AddString($String)
{
if (!is_array($this->Strings)) {
@@ -80,19 +85,19 @@
}
$this->Strings[] = $String;
}
-
+
function Clear()
{
$this->ClearStrings();
$this->ClearStyleSheets();
- $this->ClearScripts();
+ $this->ClearScripts();
}
-
+
function ClearStrings()
{
$this->Strings = array();
}
-
+
function ClearStyleSheets()
{
$this->StyleSheets = array();
@@ -102,7 +107,7 @@
{
$this->Scripts = array();
}
-
+
function Render()
{
// First sort the stylesheets by key