Ejemplo n.º 1
0
 /**
  * This method renders the user friendly upload widget.
  *
  * @param array $propertyArray : information related to the field
  * @param Object $tceForms : reference to calling TCEforms object
  * @throws \Exception
  * @return string
  */
 public function renderFileUpload($propertyArray, $tceForms)
 {
     $fileMetadataRecord = $propertyArray['row'];
     if ($fileMetadataRecord['file'] <= 0) {
         throw new \Exception('I could not find a valid file identifier', 1392926871);
     }
     /** @var $fileUpload \Fab\Media\Form\FileUploadTceForms */
     $fileUpload = GeneralUtility::makeInstance('Fab\\Media\\Form\\FileUploadTceForms');
     $fileUpload->setValue($fileMetadataRecord['file'][0])->setPrefix(MediaModule::getParameterPrefix());
     return $fileUpload->render();
 }
Ejemplo n.º 2
0
 /**
  * @param string $controllerName
  * @return string
  */
 protected function getPluginUri($controllerName)
 {
     $urlParameters = array(MediaModule::getParameterPrefix() => array('controller' => $controllerName, 'action' => 'show', 'file' => $this->object->getUid()));
     return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
 }
Ejemplo n.º 3
0
 /**
  * Renders a button for uploading assets.
  *
  * @return string
  */
 public function render()
 {
     /** @var $fileUpload \Fab\Media\Form\FileUpload */
     $fileUpload = GeneralUtility::makeInstance('Fab\\Media\\Form\\FileUpload');
     return $fileUpload->setPrefix(MediaModule::getParameterPrefix())->render();
 }
Ejemplo n.º 4
0
 /**
  * @return string
  */
 protected function getLinkCreatorUri()
 {
     $urlParameters = array(MediaModule::getParameterPrefix() => array('controller' => 'LinkCreator', 'action' => 'show'));
     return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
 }
Ejemplo n.º 5
0
 /**
  * @return string
  */
 protected function getModuleUrl()
 {
     $moduleSignature = MediaModule::getSignature();
     return BackendUtility::getModuleUrl($moduleSignature);
 }
Ejemplo n.º 6
0
 /**
  * @param Content $object
  * @return string
  */
 protected function getImageEditorUri(Content $object)
 {
     $urlParameters = array(MediaModule::getParameterPrefix() => array('controller' => 'ImageEditor', 'action' => 'show', 'file' => $object->getUid()));
     return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
 }
Ejemplo n.º 7
0
 /**
  * Render a mass delete URI.
  *
  * @return string
  */
 protected function getMassDeleteUri()
 {
     $urlParameters = array(MediaModule::getParameterPrefix() => array('controller' => 'Asset', 'action' => '', 'format' => 'json'));
     return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
 }
Ejemplo n.º 8
0
 /**
  * Renders a button for uploading assets.
  *
  * @return string
  */
 public function render()
 {
     $parameterPrefix = MediaModule::getParameterPrefix();
     $output = "\n<script>\n\nMedia.parameterPrefix = '{$parameterPrefix}';\n\n</script>";
     return $output;
 }
Ejemplo n.º 9
0
 /**
  * @return string
  */
 protected function getUri()
 {
     $urlParameters = array(MediaModule::getParameterPrefix() => array('controller' => 'Asset', 'action' => 'download', 'file' => $this->getFile()->getUid()));
     return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
 }
Ejemplo n.º 10
0
 /**
  * @return string
  */
 protected function getChangeStorageUri()
 {
     $urlParameters = array(MediaModule::getParameterPrefix() => array('controller' => 'Asset', 'action' => 'editStorage'));
     return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
 }
Ejemplo n.º 11
0
 /**
  * Handle GUI for inserting an image in the RTE.
  *
  * @param File $file
  * @return void
  */
 public function showAction(File $file)
 {
     $this->view->assign('file', $file);
     $moduleSignature = MediaModule::getSignature();
     $this->view->assign('moduleUrl', BackendUtility::getModuleUrl($moduleSignature));
 }
Ejemplo n.º 12
0
 /**
  * @param Content $object
  * @return string
  */
 protected function getDownloadUri(Content $object)
 {
     $urlParameters = array(MediaModule::getParameterPrefix() => array('controller' => 'Asset', 'action' => 'download', 'forceDownload' => TRUE, 'file' => $object->getUid()));
     return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
 }