|
|
@@ -13,6 +13,7 @@ class BxBaseFormView extends BxDolForm
|
|
|
|
|
|
protected static $_isCssJsAdded = false;
|
|
|
protected static $_isCssJsUiAdded = false;
|
|
|
+ protected static $_isCssJsUiSortableAdded = false;
|
|
|
protected static $_isCssJsMinicolorsAdded = false;
|
|
|
protected static $_isCssJsLabelsAdded = false;
|
|
|
protected static $_isCssJsTimepickerAdded = false;
|
|
|
@@ -1386,6 +1387,9 @@ BLAH;
|
|
|
*/
|
|
|
function genInputFiles(&$aInput, $sInfo = '', $sError = '')
|
|
|
{
|
|
|
+ if(empty($aInput['uploaders']) || !is_array($aInput['uploaders']))
|
|
|
+ return '';
|
|
|
+
|
|
|
$sUniqId = !empty($aInput['uploaders_id']) ? $aInput['uploaders_id'] : genRndPwd (8, false);
|
|
|
|
|
|
$sUploaders = '';
|
|
|
@@ -1413,15 +1417,15 @@ BLAH;
|
|
|
|
|
|
$sUploaders .= $oUploader->getUploaderButton($sGhostTemplate, isset($aInput['multiple']) ? $aInput['multiple'] : true, $aParams, $this->_bDynamicMode);
|
|
|
}
|
|
|
+
|
|
|
+ if(!$oUploader)
|
|
|
+ return '';
|
|
|
|
|
|
- $bInitReordering = $oUploader && !empty($aInput['init_reordering']);
|
|
|
- if($bInitReordering)
|
|
|
- $this->oTemplate->addJs(array(
|
|
|
- 'jquery-ui/jquery.ui.core.min.js',
|
|
|
- 'jquery-ui/jquery.ui.widget.min.js',
|
|
|
- 'jquery-ui/jquery.ui.mouse.min.js',
|
|
|
- 'jquery-ui/jquery.ui.sortable.min.js',
|
|
|
- ));
|
|
|
+ $bInitReordering = !empty($aInput['init_reordering']);
|
|
|
+ if($bInitReordering) {
|
|
|
+ $this->addCssJsUi();
|
|
|
+ $this->addCssJsUiSortable();
|
|
|
+ }
|
|
|
|
|
|
return $this->oTemplate->parseHtmlByName('form_field_uploader.html', array(
|
|
|
'uploaders_buttons' => $sUploaders,
|
|
|
@@ -2083,6 +2087,18 @@ BLAH;
|
|
|
|
|
|
self::$_isCssJsUiAdded = true;
|
|
|
}
|
|
|
+
|
|
|
+ function addCssJsUiSortable ()
|
|
|
+ {
|
|
|
+ if (self::$_isCssJsUiSortableAdded)
|
|
|
+ return;
|
|
|
+
|
|
|
+ $this->_addJs(array(
|
|
|
+ 'jquery-ui/jquery.ui.sortable.min.js'
|
|
|
+ ), "'undefined' === typeof($.sortable)");
|
|
|
+
|
|
|
+ self::$_isCssJsUiSortableAdded = true;
|
|
|
+ }
|
|
|
|
|
|
function addCssJsTimepicker ()
|
|
|
{
|