public static function getAddLocalizationLinks(tx_rnbase_model_base $item, tx_rnbase_mod_BaseModule $mod = NULL) { if ($item->getUid() != $item->getProperty('uid') || $item->getSysLanguageUid() !== 0) { return ''; } $out = ''; foreach (self::getLangRecords($item->getPid()) as $lang) { // skip, if the be user hase no access to for the language! if (!$GLOBALS['BE_USER']->checkLanguageAccess($lang['uid'])) { continue; } // skip, if a overlay for this language allready exists tx_rnbase::load('tx_rnbase_util_TCA'); $parentField = tx_rnbase_util_TCA::getTransOrigPointerFieldForTable($item->getTableName()); $sysLanguageUidField = tx_rnbase_util_TCA::getLanguageFieldForTable($item->getTableName()); $overlays = tx_rnbase_util_DB::doSelect('uid', $item->getTableName(), array('where' => implode(' AND ', array($parentField . '=' . $item->getUid(), $sysLanguageUidField . '=' . (int) $lang['uid'])), 'limit' => 1)); if (!empty($overlays)) { continue; } /* @var $mod tx_rnbase_mod_BaseModule */ if (!$mod instanceof tx_rnbase_mod_BaseModule) { $mod = $GLOBALS['SOBE']; } $onclick = $mod->getDoc()->issueCommand('&cmd[' . $item->getTableName() . '][' . $item->getUid() . '][localize]=' . $lang['uid']); $onclick = 'window.location.href=\'' . $onclick . '\'; return false;'; $out .= sprintf('<a href="#" onclick="%1$s">%2$s</a>', htmlspecialchars($onclick), self::getLangSpriteIcon($lang, array('show_title' => FALSE))); } return $out; }
/** * @TODO: weitere links integrieren! * $options = array('hide'=>'ausblenden,'edit'=>'bearbeiten,'remove'=>'löschen','history'='history','info'=>'info','move'=>'verschieben'); * * @param tx_rnbase_model_base $item * @param array $options * @return string */ protected function getActions(tx_rnbase_model_base $item, array $options) { $ret = ''; $tableName = $item->getTableName(); // we use the real uid, not the uid of the parent! $uid = $item->getProperty('uid'); foreach ($options as $sLinkId => $bTitle) { switch ($sLinkId) { case 'edit': $ret .= $this->getFormTool()->createEditLink($tableName, $uid, $bTitle); break; case 'hide': $sHiddenColumn = tx_mklib_util_TCA::getEnableColumn($tableName, 'disabled', 'hidden'); $ret .= $this->getFormTool()->createHideLink($tableName, $uid, $item->record[$sHiddenColumn]); break; case 'remove': //Es wird immer ein Bestätigungsdialog ausgegeben!!! Dieser steht //in der BE-Modul locallang.xml der jeweiligen Extension im Schlüssel //'confirmation_deletion'. (z.B. mkkvbb/mod1/locallang.xml) Soll kein //Bestätigungsdialog ausgegeben werden, dann einfach 'confirmation_deletion' leer lassen $ret .= $this->getFormTool()->createDeleteLink($tableName, $uid, $bTitle, array('confirm' => $GLOBALS['LANG']->getLL('confirmation_deletion'))); break; default: break; } } return $ret; }