/** * Gibt einen selector mit den elementen im gegebenen array zurück * * @TODO: move to an selector! * * @param array $aItems Array mit den werten der Auswahlbox * @param mixed $selectedItem * @param string $sDefId ID-String des Elements * @param array $aData enthält die Formularelement für die Ausgabe im Screen. Keys: selector, label * @param array $aOptions zusätzliche Optionen: label, id * @return string selected item */ public static function showSelectorByArray($aItems, $selectedItem, $sDefId, &$aData, $aOptions = array()) { $id = isset($aOptions['id']) && $aOptions['id'] ? $aOptions['id'] : $sDefId; $pid = isset($aOptions['pid']) && $aOptions['pid'] ? $aOptions['pid'] : 0; // Build select box items $aData['selector'] = Tx_Rnbase_Backend_Utility::getFuncMenu($pid, 'SET[' . $id . ']', $selectedItem, $aItems); //label $aData['label'] = $aOptions['label']; // as the deleted fe users have always to be hidden the function returns always FALSE //@todo wozu die alte abfrage? return $defId==$id ? FALSE : $selectedItem; return $selectedItem; }
static function createThumbnails10($damFiles, $size, $addAttr) { require_once tx_rnbase_util_Extensions::extPath('dam') . 'lib/class.tx_dam.php'; $files = $damFiles['rows']; $ret = array(); foreach ($files as $key => $info) { $thumbScript = $GLOBALS['BACK_PATH'] . 'thumbs.php'; $filepath = tx_dam::path_makeAbsolute($info['file_path']); $ret[] = Tx_Rnbase_Backend_Utility::getThumbNail($thumbScript, $filepath . $info['file_name'], $addAttr, $size); } return $ret; }
/** * Submit-Button like this: name="mykey[123]" value="label" * You will get 123 as long as no other submit changes this value. * @param string $key * @param string $modName * @return mixed */ public function getStoredRequestData($key, $changed = array(), $modName = 'DEFRNBASEMOD') { $data = tx_rnbase_parameters::getPostOrGetParameter($key); if (is_array($data)) { list($itemid, ) = each($data); $changed[$key] = $itemid; } $ret = Tx_Rnbase_Backend_Utility::getModuleData(array($key => ''), $changed, $modName); return $ret[$key]; }
/** * Create the panel of buttons for submitting the form or otherwise perform operations. * * @return array all available buttons as an assoc. array */ function getButtons() { global $BACK_PATH, $BE_USER; $buttons = array('csh' => '', 'view' => '', 'record_list' => '', 'shortcut' => ''); // TODO: CSH $buttons['csh'] = Tx_Rnbase_Backend_Utility::cshItem('_MOD_' . $this->MCONF['name'], '', $GLOBALS['BACK_PATH'], '', TRUE); if ($this->id && is_array($this->pageinfo)) { // View page $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(Tx_Rnbase_Backend_Utility::viewOnClick($this->pageinfo['uid'], $BACK_PATH, Tx_Rnbase_Backend_Utility::BEgetRootLine($this->pageinfo['uid']))) . '">' . '<img' . Tx_Rnbase_Backend_Utility_Icons::skinImg($BACK_PATH, 'gfx/zoom.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" hspace="3" alt="" />' . '</a>'; // Shortcut if ($BE_USER->mayMakeShortcut()) { $buttons['shortcut'] = $this->getDoc()->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']); } // If access to Web>List for user, then link to that module. if ($BE_USER->check('modules', 'web_list')) { $href = $BACK_PATH . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(tx_rnbase_util_Misc::getIndpEnv('REQUEST_URI')); $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' . '<img' . Tx_Rnbase_Backend_Utility_Icons::skinImg($BACK_PATH, 'gfx/list.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' . '</a>'; } } return $buttons; }
/** * Returns the complete search form * * @return string */ public function getSearchFormData() { $data = parent::getSearchFormData(); $button = $data['updatebutton']; unset($data['updatebutton']); $filter = $this->getFilter(); $data['runid'] = array('field' => \Tx_Rnbase_Backend_Utility::getFuncMenu($this->getOptions()->getPid(), 'SET[' . $this->getListerId() . 'Runid]', $filter->getRunid(), $this->getLatestRuns()), 'label' => '###LABEL_FILTER_RUNID###'); $data['severity'] = array('field' => \Tx_Rnbase_Backend_Utility::getFuncMenu($this->getOptions()->getPid(), 'SET[' . $this->getListerId() . 'Severity]', $filter->getSeverity(), $this->getSeverityLevels()), 'label' => '###LABEL_FILTER_SEVERITY###'); $data['extkeys'] = array('field' => \Tx_Rnbase_Backend_Utility::getFuncMenu($this->getOptions()->getPid(), 'SET[' . $this->getListerId() . 'ExtKey]', $filter->getExtKey(), $this->getLoggedExtensions()), 'label' => '###LABEL_FILTER_EXTKEYS###'); $data['updatebutton'] = $button; return $data; }
/** * Returns the first reference of a file. Usage by typoscript: * * lib.logo = IMAGE * lib.logo { * file.maxH = 30 * file.maxW = 30 * file.treatIdAsReference = 1 * file.import.cObject = USER * file.import.cObject { * userFunc=tx_rnbase_util_TSFAL->fetchFirstReference * refField=t3logo * refTable=tx_cfcleague_teams * } * } * * @param array $conf * @return array */ public function fetchFirstReference($content, $conf) { $cObj = $this->cObj; $uid = $cObj->data['_LOCALIZED_UID'] ? $cObj->data['_LOCALIZED_UID'] : $cObj->data['uid']; $refTable = $conf['refTable'] && is_array($GLOBALS['TCA'][$conf['refTable']]) ? $conf['refTable'] : 'tt_content'; $refField = trim($cObj->stdWrap($conf['refField'], $conf['refField.'])); if (isset($GLOBALS['BE_USER']->workspace) && $GLOBALS['BE_USER']->workspace !== 0) { $workspaceRecord = Tx_Rnbase_Backend_Utility::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, 'tt_content', $uid, 'uid'); if ($workspaceRecord) { $uid = $workspaceRecord['uid']; } } $fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); $files = $fileRepository->findByRelation($refTable, $refField, $uid); if (!empty($files)) { // Die erste Referenz zurück return $files[0]->getUid(); } return ''; }