BUGFIX: Renamed UploadField::$config to UploadField::$ufConfig to avoid conflicts with the config API.

This commit is contained in:
Sam Minnee 2012-03-09 19:32:09 +13:00
parent 317756d92a
commit d04fe07fa6
2 changed files with 12 additions and 5 deletions

View File

@ -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)
* @var array
*/
protected $config = array(
protected $ufConfig = array(
/**
* @var boolean
*/
@ -265,7 +265,7 @@ class UploadField extends FileField {
* @param mixed $val
*/
public function setConfig($key, $val) {
$this->config[$key] = $val;
$this->ufConfig[$key] = $val;
return $this;
}
@ -274,7 +274,14 @@ class UploadField extends FileField {
* @return mixed
*/
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()) {
$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(
'configString' => str_replace('"', "'", Convert::raw2json($config)),
'config' => new ArrayData($config),

View File

@ -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 %> />
</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>
<% 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>
<% end_if %>
<div class="clear"><!-- --></div>