Esempio n. 1
0
 /**
  * Render a move storage URI.
  *
  * @return string
  */
 public function render()
 {
     $urlParameters = array(VidiModule::getParameterPrefix() => array('controller' => 'Content', 'action' => 'move', 'fieldNameAndPath' => $this->templateVariableContainer->get('fieldNameAndPath'), 'matches' => $this->templateVariableContainer->get('matches')));
     $moduleUrl = BackendUtility::getModuleUrl(VidiModule::getSignature(), $urlParameters);
     // Work around a bug in BackendUtility::getModuleUrl if matches is empty getModuleUrl() will not return the parameter.
     $matches = $this->templateVariableContainer->get('matches');
     if (empty($matches)) {
         $moduleUrl .= '&' . urlencode(VidiModule::getParameterPrefix() . '[matches]=');
     }
     return $moduleUrl;
 }
Esempio n. 2
0
    public function JStop()
    {
        $result = parent::JStop();
        $result .= '
<script>
	var vidiModuleUrl = \'' . BackendUtility::getModuleUrl(VidiModule::getSignature()) . '\';
	var vidiModulePrefix = \'' . VidiModule::getParameterPrefix() . '\';
</script>
		';
        return $result;
    }
Esempio n. 3
0
 /**
  * Render a file upload field
  *
  * @param array $objects
  * @return string
  */
 public function render($objects = array())
 {
     // Check if a storages is selected
     $currentStorage = $this->getMediaModule()->getCurrentStorage();
     $template = '<select name="%s[target]">%s</select>';
     $options = array();
     foreach ($objects as $storage) {
         /** @var \TYPO3\CMS\Core\Resource\ResourceStorage $storage */
         $options[] = sprintf('<option value="%s" %s>%s %s</option>', $storage->getUid(), is_object($currentStorage) && $currentStorage->getUid() == $storage->getUid() ? 'selected="selected"' : '', $storage->getName(), !$storage->isOnline() ? '(offline)' : '');
     }
     return sprintf($template, VidiModule::getParameterPrefix(), implode("\n", $options));
 }
Esempio n. 4
0
 /**
  * @return bool
  */
 protected function isPermissionNecessary()
 {
     $isNecessary = TRUE;
     $parameters = GeneralUtility::_GET(VidiModule::getParameterPrefix());
     if ($parameters['controller'] === 'Clipboard' && ($parameters['action'] === 'show' || $parameters['action'] === 'flush')) {
         $isNecessary = FALSE;
     }
     if ($parameters['controller'] === 'Content' && ($parameters['action'] === 'copyClipboard' || $parameters['action'] === 'moveClipboard')) {
         $isNecessary = FALSE;
     }
     return $isNecessary;
 }
 /**
  * @return string
  */
 protected function getModuleUrl()
 {
     $additionalParameters = array(VidiModule::getParameterPrefix() => array('plugins' => array('imageEditor'), 'matches' => array('type' => 2)));
     $moduleUrl = BackendUtility::getModuleUrl(VidiModule::getSignature(), $additionalParameters);
     return GeneralUtility::quoteJSvalue($moduleUrl);
 }