mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Renamed UploadField::$config to UploadField::$ufConfig to avoid conflicts with the config API.
This commit is contained in:
parent
317756d92a
commit
d04fe07fa6
@ -73,7 +73,7 @@ class UploadField extends FileField {
|
|||||||
* Config for this field used in both, php and javascript (will be merged into the config of the javascript file upload plugin)
|
* Config for this field used in both, php and javascript (will be merged into the config of the javascript file upload plugin)
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $config = array(
|
protected $ufConfig = array(
|
||||||
/**
|
/**
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
@ -265,7 +265,7 @@ class UploadField extends FileField {
|
|||||||
* @param mixed $val
|
* @param mixed $val
|
||||||
*/
|
*/
|
||||||
public function setConfig($key, $val) {
|
public function setConfig($key, $val) {
|
||||||
$this->config[$key] = $val;
|
$this->ufConfig[$key] = $val;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +274,14 @@ class UploadField extends FileField {
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getConfig($key) {
|
public function getConfig($key) {
|
||||||
return $this->config[$key];
|
return $this->ufConfig[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to get config in the template
|
||||||
|
*/
|
||||||
|
public function getAutoUpload() {
|
||||||
|
return $this->getConfig('autoUpload');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -368,7 +375,7 @@ class UploadField extends FileField {
|
|||||||
if (is_numeric($config['maxNumberOfFiles']) && $this->getItems()->count()) {
|
if (is_numeric($config['maxNumberOfFiles']) && $this->getItems()->count()) {
|
||||||
$configOverwrite['maxNumberOfFiles'] = $config['maxNumberOfFiles'] - $this->getItems()->count();
|
$configOverwrite['maxNumberOfFiles'] = $config['maxNumberOfFiles'] - $this->getItems()->count();
|
||||||
}
|
}
|
||||||
$config = array_merge($config, $this->config, $configOverwrite);
|
$config = array_merge($config, $this->ufConfig, $configOverwrite);
|
||||||
return $this->customise(array(
|
return $this->customise(array(
|
||||||
'configString' => str_replace('"', "'", Convert::raw2json($config)),
|
'configString' => str_replace('"', "'", Convert::raw2json($config)),
|
||||||
'config' => new ArrayData($config),
|
'config' => new ArrayData($config),
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<input id="$id" name="$getName" class="$extraClass ss-uploadfield-fromcomputer-fileinput" data-config="$configString" type="file"<% if $multiple %> multiple="multiple"<% end_if %> />
|
<input id="$id" name="$getName" class="$extraClass ss-uploadfield-fromcomputer-fileinput" data-config="$configString" type="file"<% if $multiple %> multiple="multiple"<% end_if %> />
|
||||||
</label>
|
</label>
|
||||||
<button class="ss-uploadfield-fromfiles ss-ui-button ui-corner-all" title="<% _t('UploadField.FROMCOMPUTERINFO', 'Select from from files') %>" data-icon="network-cloud"><% _t('UploadField.FROMCOMPUTER', 'From files') %></button>
|
<button class="ss-uploadfield-fromfiles ss-ui-button ui-corner-all" title="<% _t('UploadField.FROMCOMPUTERINFO', 'Select from from files') %>" data-icon="network-cloud"><% _t('UploadField.FROMCOMPUTER', 'From files') %></button>
|
||||||
<% if not $config.autoUpload %>
|
<% if not $autoUpload %>
|
||||||
<button class="ss-uploadfield-startall ss-ui-button ui-corner-all" title="<% _t('UploadField.STARTALLINFO', 'Start all uploads') %>" data-icon="navigation"><% _t('UploadField.STARTALL', 'Start all') %></button>
|
<button class="ss-uploadfield-startall ss-ui-button ui-corner-all" title="<% _t('UploadField.STARTALLINFO', 'Start all uploads') %>" data-icon="navigation"><% _t('UploadField.STARTALL', 'Start all') %></button>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
<div class="clear"><!-- --></div>
|
<div class="clear"><!-- --></div>
|
||||||
|
Loading…
Reference in New Issue
Block a user