mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix add combinedFiles to clear logic
This commit is contained in:
parent
9d2503c3da
commit
7b200a2a64
@ -744,25 +744,24 @@ class Requirements_Backend {
|
|||||||
* @param string|int $fileOrID
|
* @param string|int $fileOrID
|
||||||
*/
|
*/
|
||||||
public function clear($fileOrID = null) {
|
public function clear($fileOrID = null) {
|
||||||
if($fileOrID) {
|
$types = array(
|
||||||
foreach(array('javascript','css', 'customScript', 'customCSS', 'customHeadTags') as $type) {
|
'javascript',
|
||||||
if(isset($this->{$type}[$fileOrID])) {
|
'css',
|
||||||
|
'customScript',
|
||||||
|
'customCSS',
|
||||||
|
'customHeadTags',
|
||||||
|
'combine_files',
|
||||||
|
);
|
||||||
|
foreach ($types as $type) {
|
||||||
|
if ($fileOrID) {
|
||||||
|
if (isset($this->{$type}[$fileOrID])) {
|
||||||
$this->disabled[$type][$fileOrID] = $this->{$type}[$fileOrID];
|
$this->disabled[$type][$fileOrID] = $this->{$type}[$fileOrID];
|
||||||
unset($this->{$type}[$fileOrID]);
|
unset($this->{$type}[$fileOrID]);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$this->disabled[$type] = $this->{$type};
|
||||||
|
$this->{$type} = array();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$this->disabled['javascript'] = $this->javascript;
|
|
||||||
$this->disabled['css'] = $this->css;
|
|
||||||
$this->disabled['customScript'] = $this->customScript;
|
|
||||||
$this->disabled['customCSS'] = $this->customCSS;
|
|
||||||
$this->disabled['customHeadTags'] = $this->customHeadTags;
|
|
||||||
|
|
||||||
$this->javascript = array();
|
|
||||||
$this->css = array();
|
|
||||||
$this->customScript = array();
|
|
||||||
$this->customCSS = array();
|
|
||||||
$this->customHeadTags = array();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -770,11 +769,17 @@ class Requirements_Backend {
|
|||||||
* Restore requirements cleared by call to Requirements::clear
|
* Restore requirements cleared by call to Requirements::clear
|
||||||
*/
|
*/
|
||||||
public function restore() {
|
public function restore() {
|
||||||
$this->javascript = $this->disabled['javascript'];
|
$types = array(
|
||||||
$this->css = $this->disabled['css'];
|
'javascript',
|
||||||
$this->customScript = $this->disabled['customScript'];
|
'css',
|
||||||
$this->customCSS = $this->disabled['customCSS'];
|
'customScript',
|
||||||
$this->customHeadTags = $this->disabled['customHeadTags'];
|
'customCSS',
|
||||||
|
'customHeadTags',
|
||||||
|
'combine_files',
|
||||||
|
);
|
||||||
|
foreach ($types as $type) {
|
||||||
|
$this->{$type} = $this->disabled[$type];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Block inclusion of a specific file
|
* Block inclusion of a specific file
|
||||||
|
Loading…
Reference in New Issue
Block a user