public function getXHtml() { global $_CORELANG; \JS::registerCSS('core_modules/Upload/css/uploaders/exposedCombo/exposedCombo.css'); \JS::registerJS('core_modules/Upload/js/uploaders/exposedCombo/exposedCombo.js'); //back up instance name, we're going to set a temporary name for the combo uploader $instanceNameBak = $this->jsInstanceName; $this->jsInstanceName = 'exposedCombo_comboUploader_' . $this->uploadId; $comboXHtml = parent::getXHtml(); $this->jsInstanceName = $instanceNameBak; $tpl = new \Cx\Core\Html\Sigma(ASCMS_CORE_MODULE_PATH . '/Upload/template/uploaders'); $tpl->setErrorHandling(PEAR_ERROR_DIE); $tpl->loadTemplateFile('exposedCombo.html'); $tpl->setVariable(array('COMBO_CODE' => $comboXHtml, 'DIALOG_TITLE' => $_CORELANG['UPLOAD_EXPOSED_DIALOG_TITLE'])); //see Uploader::handleInstanceBusiness $this->handleInstanceBusiness($tpl, 'exposedCombo'); return $tpl->get(); }
/** * Creates an Uploader instance from the type given * * @param string $type 'pl' | 'jump' | 'form' | 'combo' ... */ protected function uploaderFromType($type) { $theUploader = null; switch ($type) { case 'pl': //pluploader $theUploader = new PlUploader($this->isBackendRequest); break; case 'jump': //jumploader $theUploader = new JumpUploader($this->isBackendRequest); break; case 'form': //html file input $theUploader = new FormUploader($this->isBackendRequest); break; case 'combo': //combined version of all uploaders $theUploader = new ComboUploader($this->isBackendRequest); $theUploader->setEnabledUploaders($this->uploaders); break; case 'exposedCombo': //combined version of all uploaders, features modal dialog $theUploader = new ExposedComboUploader($this->isBackendRequest); $theUploader->setEnabledUploaders($this->uploaders); break; } return $theUploader; }