***************************************************************/
-if(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
+if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
}
* @return void
*/
public function setBackPath($backPath) {
- if(!is_string($backPath)) {
+ if (!is_string($backPath)) {
throw new InvalidArgumentException('parameter $backPath must be of type string', 1193315266);
}
protected function getCollapsedStates() {
$collapsedStates = array();
- if($GLOBALS['BE_USER']->uc['moduleData']['moduleMenu']) {
+ if ($GLOBALS['BE_USER']->uc['moduleData']['moduleMenu']) {
$collapsedStates = $GLOBALS['BE_USER']->uc['moduleData']['moduleMenu'];
}
foreach($rawModuleData as $moduleKey => $moduleData) {
$key = substr($moduleKey, 8);
$num = count($data['root']);
- if($moduleData['link'] != 'dummy.php' || ($moduleData['link'] == 'dummy.php' && is_array($moduleData['subitems'])) ) {
+ if ($moduleData['link'] != 'dummy.php' || ($moduleData['link'] == 'dummy.php' && is_array($moduleData['subitems'])) ) {
$data['root'][$num]['key'] = $key;
$data['root'][$num]['menuState'] = $GLOBALS['BE_USER']->uc['moduleData']['menuState'][$moduleKey];
$data['root'][$num]['label'] = $moduleData['title'];
$data['root'][$num]['subitems'] = is_array($moduleData['subitems']) ? count($moduleData['subitems']) : 0;
- if($moduleData['link'] && $this->linkModules) {
+ if ($moduleData['link'] && $this->linkModules) {
$data['root'][$num]['link'] = 'top.goToModule(\'' . $moduleData['name'] . '\')';
}
$modules = array();
// Remove the 'doc' module?
- if($GLOBALS['BE_USER']->getTSConfigVal('options.disableDocModuleInAB')) {
+ if ($GLOBALS['BE_USER']->getTSConfigVal('options.disableDocModuleInAB')) {
unset($this->loadedModules['doc']);
}
foreach($this->loadedModules as $moduleName => $moduleData) {
$moduleLink = '';
- if(!is_array($moduleData['sub'])) {
+ if (!is_array($moduleData['sub'])) {
$moduleLink = $moduleData['script'];
}
$moduleLink = t3lib_div::resolveBackPath($moduleLink);
'navigationComponentId' => $submoduleData['navigationComponentId'],
);
- if($moduleData['navFrameScript']) {
+ if ($moduleData['navFrameScript']) {
$modules[$moduleKey]['subitems'][$submoduleKey]['parentNavigationFrameScript'] = $moduleData['navFrameScript'];
}
}
$iconSizes = @getimagesize($iconFileAbsolute);
$iconTitle = $GLOBALS['LANG']->moduleLabels['tabs'][$moduleKey];
- if(!empty($iconFileRelative)) {
+ if (!empty($iconFileRelative)) {
$icon['filename'] = $iconFileRelative;
$icon['size'] = $iconSizes[3];
$icon['title'] = htmlspecialchars($iconTitle);
*/
protected function getModuleIconAbsolute($iconFilename) {
- if(!t3lib_div::isAbsPath($iconFilename)) {
+ if (!t3lib_div::isAbsPath($iconFilename)) {
$iconFilename = $this->backPath . $iconFilename;
}
* @return string link URl appended with ? if there wasn't one
*/
protected function appendQuestionmarkToLink($link) {
- if(!strstr($link, '?')) {
+ if (!strstr($link, '?')) {
$link .= '?';
}
* @param boolean status for linking modules with a-tags, set to FALSE to turn lining off
*/
public function setLinkModules($linkModules) {
- if(!is_bool($linkModules)) {
+ if (!is_bool($linkModules)) {
throw new InvalidArgumentException('parameter $linkModules must be of type bool', 1193326558);
}
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
-if(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
+if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) {
require_once(PATH_typo3 . 'interfaces/interface.backend_toolbaritem.php');
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
$groups = $this->getGroupsFromShortcuts();
krsort($groups, SORT_NUMERIC);
foreach($groups as $groupId => $groupLabel) {
- if($groupId != 0 ) {
+ if ($groupId != 0 ) {
$shortcutGroup = '
<tr class="shortcut-group" id="shortcut-group-'.$groupId.'">
<td class="shortcut-group-icon">'.$groupIcon.'</td>
$i++;
$firstRow = '';
- if($i == 1) {
+ if ($i == 1) {
$firstRow = ' first-row';
}
}
}
- if(count($shortcutMenu) == 1) {
+ if (count($shortcutMenu) == 1) {
//no shortcuts added yet, show a small help message how to add shortcuts
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:toolbarItems.bookmarks', TRUE);
$icon = t3lib_iconWorks::getSpriteIcon('actions-system-shortcut-new', array(
$queryParts = parse_url($row['url']);
$queryParameters = t3lib_div::explodeUrl2Array($queryParts['query'], 1);
- if($row['module_name'] == 'xMOD_alt_doc.php' && is_array($queryParameters['edit'])) {
+ if ($row['module_name'] == 'xMOD_alt_doc.php' && is_array($queryParameters['edit'])) {
$shortcut['table'] = key($queryParameters['edit']);
$shortcut['recordid'] = key($queryParameters['edit'][$shortcut['table']]);
- if($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'edit') {
+ if ($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'edit') {
$shortcut['type'] = 'edit';
- } elseif($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'new') {
+ } elseif ($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'new') {
$shortcut['type'] = 'new';
}
- if(substr($shortcut['recordid'], -1) == ',') {
+ if (substr($shortcut['recordid'], -1) == ',') {
$shortcut['recordid'] = substr($shortcut['recordid'], 0, -1);
}
} else {
// check for module access
$pageId = $this->getLinkedPageId($row['url']);
- if(!$GLOBALS['BE_USER']->isAdmin()) {
- if(!isset($GLOBALS['LANG']->moduleLabels['tabs_images'][implode('_', $moduleParts).'_tab'])) {
+ if (!$GLOBALS['BE_USER']->isAdmin()) {
+ if (!isset($GLOBALS['LANG']->moduleLabels['tabs_images'][implode('_', $moduleParts).'_tab'])) {
// nice hack to check if the user has access to this module
// - otherwise the translation label would not have been loaded :-)
continue;
}
- if(t3lib_utility_Math::canBeInterpretedAsInteger($pageId)) {
+ if (t3lib_utility_Math::canBeInterpretedAsInteger($pageId)) {
// check for webmount access
- if(!$GLOBALS['BE_USER']->isInWebMount($pageId)) {
+ if (!$GLOBALS['BE_USER']->isInWebMount($pageId)) {
continue;
}
// check for record access
$pageRow = t3lib_BEfunc::getRecord('pages', $pageId);
- if(!$GLOBALS['BE_USER']->doesUserHaveAccess($pageRow, $perms = 1)) {
+ if (!$GLOBALS['BE_USER']->doesUserHaveAccess($pageRow, $perms = 1)) {
continue;
}
}
}
$shortcutGroup = $row['sc_group'];
- if($shortcutGroup && strcmp($lastGroup, $shortcutGroup) && ($shortcutGroup != -100)) {
+ if ($shortcutGroup && strcmp($lastGroup, $shortcutGroup) && ($shortcutGroup != -100)) {
$shortcut['groupLabel'] = $this->getShortcutGroupLabel($shortcutGroup);
}
- if($row['description']) {
+ if ($row['description']) {
$shortcut['label'] = $row['description'];
} else {
$shortcut['label'] = t3lib_div::fixed_lgd_cs(rawurldecode($queryParts['query']), 150);
$shortcuts = array();
foreach($this->shortcuts as $shortcut) {
- if($shortcut['group'] == $groupId) {
+ if ($shortcut['group'] == $groupId) {
$shortcuts[] = $shortcut;
}
}
$returnShortcut = FALSE;
foreach($this->shortcuts as $shortcut) {
- if($shortcut['raw']['uid'] == (int) $shortcutId) {
+ if ($shortcut['raw']['uid'] == (int) $shortcutId) {
$returnShortcut = $shortcut;
continue;
}
// groups from TSConfig
$bookmarkGroups = $GLOBALS['BE_USER']->getTSConfigProp('options.bookmarkGroups');
- if(is_array($bookmarkGroups) && count($bookmarkGroups)) {
+ if (is_array($bookmarkGroups) && count($bookmarkGroups)) {
foreach($bookmarkGroups as $groupId => $label) {
- if(strcmp('', $label) && strcmp('0', $label)) {
+ if (strcmp('', $label) && strcmp('0', $label)) {
$this->shortcutGroups[$groupId] = (string) $label;
- } elseif($GLOBALS['BE_USER']->isAdmin()) {
+ } elseif ($GLOBALS['BE_USER']->isAdmin()) {
unset($this->shortcutGroups[$groupId]);
}
}
}
// generate global groups, all global groups have negative IDs.
- if(count($this->shortcutGroups)) {
+ if (count($this->shortcutGroups)) {
$groups = $this->shortcutGroups;
foreach($groups as $groupId => $groupLabel) {
$this->shortcutGroups[($groupId * -1)] = $groupLabel;
foreach($this->shortcutGroups as $groupId => $groupLabel) {
$label = $groupLabel;
- if($groupLabel == '1') {
+ if ($groupLabel == '1') {
$label = $GLOBALS['LANG']->getLL('bookmark_group_'.abs($groupId), 1);
- if(empty($label)) {
+ if (empty($label)) {
// fallback label
$label = $GLOBALS['LANG']->getLL('bookmark_group', 1).' '.abs($groupId);
}
}
- if($groupId < 0) {
+ if ($groupId < 0) {
// global group
$label = $GLOBALS['LANG']->getLL('bookmark_global', 1).': '.
(!empty($label) ?
abs($groupId)
);
- if($groupId == -100) {
+ if ($groupId == -100) {
$label = $GLOBALS['LANG']->getLL('bookmark_global', 1).': '.$GLOBALS['LANG']->getLL('bookmark_all', 1);
}
}
public function getAjaxShortcutGroups($params = array(), TYPO3AJAX &$ajaxObj = NULL) {
$shortcutGroups = $this->shortcutGroups;
- if(!$GLOBALS['BE_USER']->isAdmin()) {
+ if (!$GLOBALS['BE_USER']->isAdmin()) {
foreach($shortcutGroups as $groupId => $groupName) {
- if(intval($groupId) < 0) {
+ if (intval($groupId) < 0) {
unset($shortcutGroups[$groupId]);
}
}
$fullShortcut = $this->getShortcutById($shortcutId);
$ajaxReturn = 'failed';
- if($fullShortcut['raw']['userid'] == $GLOBALS['BE_USER']->user['uid']) {
+ if ($fullShortcut['raw']['userid'] == $GLOBALS['BE_USER']->user['uid']) {
$GLOBALS['TYPO3_DB']->exec_DELETEquery(
'sys_be_shortcuts',
'uid = '.$shortcutId
);
- if($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
+ if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
$ajaxReturn = 'deleted';
}
}
$shortcut['table'] = key($queryParameters['edit']);
$shortcut['recordid'] = key($queryParameters['edit'][$shortcut['table']]);
- if($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'edit') {
+ if ($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'edit') {
$shortcut['type'] = 'edit';
$shortcutNamePrepend = $GLOBALS['LANG']->getLL('shortcut_edit', 1);
- } elseif($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'new') {
+ } elseif ($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'new') {
$shortcut['type'] = 'new';
$shortcutNamePrepend = $GLOBALS['LANG']->getLL('shortcut_create', 1);
}
// Lookup the title of this page and use it as default description
$pageId = $shortcut['recordid'] ? $shortcut['recordid'] : $this->getLinkedPageId($url);
- if(t3lib_utility_Math::canBeInterpretedAsInteger($pageId)) {
+ if (t3lib_utility_Math::canBeInterpretedAsInteger($pageId)) {
$page = t3lib_BEfunc::getRecord('pages', $pageId);
- if(count($page)) {
+ if (count($page)) {
// set the name to the title of the page
- if($shortcut['type'] == 'other') {
+ if ($shortcut['type'] == 'other') {
$shortcutName = $page['title'];
} else {
$shortcutName = $shortcutNamePrepend.' '.$GLOBALS['LANG']->sL($GLOBALS['TCA'][$shortcut['table']]['ctrl']['title']).' ('.$page['title'].')';
}
// adding the shortcut
- if($module && $url) {
+ if ($module && $url) {
$fieldValues = array(
'userid' => $GLOBALS['BE_USER']->user['uid'],
'module_name' => $module.'|'.$motherModule,
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_be_shortcuts', $fieldValues);
- if($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
+ if ($GLOBALS['TYPO3_DB']->sql_affected_rows() == 1) {
$shortcutCreated = 'success';
}
}
$shortcutName = strip_tags(t3lib_div::_POST('value'));
$shortcutGroupId = (int) t3lib_div::_POST('shortcut-group');
- if($shortcutGroupId > 0 || $GLOBALS['BE_USER']->isAdmin()) {
+ if ($shortcutGroupId > 0 || $GLOBALS['BE_USER']->isAdmin()) {
// users can delete only their own shortcuts (except admins)
$addUserWhere = (!$GLOBALS['BE_USER']->isAdmin() ?
' AND userid='.intval($GLOBALS['BE_USER']->user['uid'])
'sc_group' => $shortcutGroupId
);
- if($fieldValues['sc_group'] < 0 && !$GLOBALS['BE_USER']->isAdmin()) {
+ if ($fieldValues['sc_group'] < 0 && !$GLOBALS['BE_USER']->isAdmin()) {
$fieldValues['sc_group'] = 0;
}
);
$affectedRows = $GLOBALS['TYPO3_DB']->sql_affected_rows();
- if($affectedRows == 1) {
+ if ($affectedRows == 1) {
$ajaxObj->addContent('shortcut', $shortcutName);
} else {
$ajaxObj->addContent('shortcut', 'failed');
protected function getShortcutGroupLabel($groupId) {
$label = '';
- if($this->shortcutGroups[$groupId]) {
+ if ($this->shortcutGroups[$groupId]) {
$label = $this->shortcutGroups[$groupId];
}
$globalGroups = array();
foreach($this->shortcutGroups as $groupId => $groupLabel) {
- if($groupId < 0) {
+ if ($groupId < 0) {
$globalGroups[$groupId] = $groupLabel;
}
}
$table = $shortcut['table'];
$recordid = $shortcut['recordid'];
- if($shortcut['type'] == 'edit') {
+ if ($shortcut['type'] == 'edit') {
// Creating the list of fields to include in the SQL query:
$selectFields = $this->fieldArray;
$selectFields[] = 'uid';
$selectFields[] = 'pid';
- if($table=='pages') {
- if(t3lib_extMgm::isLoaded('cms')) {
+ if ($table=='pages') {
+ if (t3lib_extMgm::isLoaded('cms')) {
$selectFields[] = 'module';
$selectFields[] = 'extendToSubpages';
}
$selectFields[] = 'doktype';
}
- if(is_array($GLOBALS['TCA'][$table]['ctrl']['enablecolumns'])) {
+ if (is_array($GLOBALS['TCA'][$table]['ctrl']['enablecolumns'])) {
$selectFields = array_merge($selectFields, $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']);
}
- if($GLOBALS['TCA'][$table]['ctrl']['type']) {
+ if ($GLOBALS['TCA'][$table]['ctrl']['type']) {
$selectFields[] = $GLOBALS['TCA'][$table]['ctrl']['type'];
}
- if($GLOBALS['TCA'][$table]['ctrl']['typeicon_column']) {
+ if ($GLOBALS['TCA'][$table]['ctrl']['typeicon_column']) {
$selectFields[] = $GLOBALS['TCA'][$table]['ctrl']['typeicon_column'];
}
- if($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
+ if ($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
$selectFields[] = 't3ver_state';
}
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
$icon = t3lib_iconWorks::getIcon($table, $row, $this->backPath);
- } elseif($shortcut['type'] == 'new') {
+ } elseif ($shortcut['type'] == 'new') {
$icon = t3lib_iconWorks::getIcon($table, '', $this->backPath);
}
$icon = 'gfx/edit_rtewiz.gif';
break;
default:
- if($GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'].'_tab']) {
+ if ($GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'].'_tab']) {
$icon = $GLOBALS['LANG']->moduleLabels['tabs_images'][$row['module_name'].'_tab'];
// change icon of fileadmin references - otherwise it doesn't differ with Web->List
$icon = str_replace('mod/file/list/list.gif', 'mod/file/file.gif', $icon);
- if(t3lib_div::isAbsPath($icon)) {
+ if (t3lib_div::isAbsPath($icon)) {
$icon = '../'.substr($icon, strlen(PATH_site));
}
} else {
protected function getShortcutIconTitle($shortcutLabel, $moduleName, $parentModuleName = '') {
$title = '';
- if(substr($moduleName, 0, 5) == 'xMOD_') {
+ if (substr($moduleName, 0, 5) == 'xMOD_') {
$title = substr($moduleName, 5);
} else {
$splitModuleName = explode('_', $moduleName);
$title = $GLOBALS['LANG']->moduleLabels['tabs'][$splitModuleName[0].'_tab'];
- if(count($splitModuleName) > 1) {
+ if (count($splitModuleName) > 1) {
$title .= '>'.$GLOBALS['LANG']->moduleLabels['tabs'][$moduleName.'_tab'];
}
}
- if($parentModuleName) {
+ if ($parentModuleName) {
$title .= ' ('.$parentModuleName.')';
}