Beispiel #1
0
    /**
     * @return string
     */
    protected function renderStorageMenu()
    {
        $currentStorage = $this->getMediaModule()->getCurrentStorage();
        /** @var $storage \TYPO3\CMS\Core\Resource\ResourceStorage */
        $options = '';
        foreach ($this->getMediaModule()->getAllowedStorages() as $storage) {
            $selected = '';
            if ($currentStorage->getUid() == $storage->getUid()) {
                $selected = 'selected';
            }
            $options .= sprintf('<option value="%s" %s>%s %s</option>', $storage->getUid(), $selected, $storage->getName(), $storage->isOnline() ? '' : '(' . LocalizationUtility::translate('offline', 'media') . ')');
        }
        $parameters = GeneralUtility::_GET();
        $inputs = '';
        foreach ($parameters as $parameter => $value) {
            list($parameter, $value) = $this->computeParameterAndValue($parameter, $value);
            if ($parameter !== $this->moduleLoader->getParameterPrefix() . '[storage]') {
                $inputs .= sprintf('<input type="hidden" name="%s" value="%s" />', $parameter, $value);
            }
        }
        $template = '<form action="mod.php" id="form-menu-storage" method="get">
						%s
						<select name="%s[storage]" class="btn btn-min" id="menu-storage" onchange="$(\'#form-menu-storage\').submit()">%s</select>
					</form>';
        return sprintf($template, $inputs, $this->moduleLoader->getParameterPrefix(), $options);
    }
Beispiel #2
0
    /**
     * @return string
     */
    protected function renderRecursiveCheckbox()
    {
        $template = '<form action="mod.php" id="form-checkbox-hasRecursiveSelection" method="get">
						<label>
							<input type="checkbox"
									name="%s[hasRecursiveSelection]"
									class="btn btn-min"
									id="checkbox-hasRecursiveSelection"/>
							<span style="position: relative; top: 3px">%s</span>
						</label>
					</form>';
        return sprintf($template, $this->moduleLoader->getParameterPrefix(), LocalizationUtility::translate('browse_sub_folders', 'media'));
    }
 public function setUp()
 {
     parent::setUp();
     $this->fixture = new \Fab\Vidi\Module\ModuleLoader($this->dataType);
     $this->fixture->register();
 }