Project

General

Profile

Feature #17037 » ttcontent_shortcut-4.1.0RC2.patch

Administrator Admin, 2007-02-24 22:08

View differences:

typo3_src-4.1.0RC2/t3lib/class.t3lib_page.php 2007-02-24 21:43:54.000000000 +0100
// if shortcut, look up if the target exists and is currently visible
if ($row['doktype'] == 4 && ($row['shortcut'] || $row['shortcut_mode']) && $checkShortcuts) {
$shortcut_parts = explode('_', $row['shortcut']);
$shortcut_uid = intval(array_pop($shortcut_parts));
$shortcut_table = implode('_', $shortcut_parts);
if ($shortcut_table == 'tt_content' && is_array($shortcut_ttcontent = t3lib_BEfunc::getRecord('tt_content', $shortcut_uid, 'pid'))) {
// if shortcutted to a tt_content element, we don't check for visibility of this element but fall back to the page
$shortcut_uid = $row['pid'];
}
if ($row['shortcut_mode'] == 0) {
$searchField = 'uid';
$searchUid = intval($row['shortcut']);
$searchUid = $shortcut_uid;
} else { // check subpages - first subpage or random subpage
$searchField = 'pid';
// If a shortcut mode is set and no valid page is given to select subpags from use the actual page.
$searchUid = intval($row['shortcut'])?intval($row['shortcut']):$row['uid'];
$searchUid = ($shortcut_uid>0)?$shortcut_uid:$row['uid'];
}
$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', $searchField.'='.$searchUid.$this->where_hid_del.$this->where_groupAccess.' '.$addWhere, '', $sortField);
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res2)) {
typo3_src-4.1.0RC2/typo3/sysext/cms/tslib/class.tslib_fe.php 2007-02-24 21:47:57.000000000 +0100
// Is the ID a link to another page??
if ($this->page['doktype']==4) {
$this->MP = ''; // We need to clear MP if the page is a shortcut. Reason is if the short cut goes to another page, then we LEAVE the rootline which the MP expects.
$this->page = $this->getPageShortcut($this->page['shortcut'],$this->page['shortcut_mode'],$this->page['uid']);
// Handle type of shortcut: Either of type pages or anything else (e.g. tt_content)
$shortcut_parts = explode('_', $this->page['shortcut']);
$shortcut_uid = array_pop($shortcut_parts);
$shortcut_table = implode('_', $shortcut_parts);
if (strlen($shortcut_table)==0 || $shortcut_table=='pages') {
$this->page = $this->getPageShortcut($this->page['shortcut'],$this->page['shortcut_mode'],$this->page['uid']);
} else {
$shortcut_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('pid', $shortcut_table, 'uid='.$shortcut_uid);
if ($shortcut_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($shortcut_res)) {
$GLOBALS['TYPO3_DB']->sql_free_result($shortcut_res);
$this->page = $this->getPageShortcut($shortcut_row['pid'],$this->page['shortcut_mode'],$this->page['uid']);
}
}
$this->id = $this->page['uid'];
}
typo3_src-4.1.0RC2/typo3/sysext/cms/tslib/class.tslib_menu.php 2007-02-24 21:47:10.000000000 +0100
$thePage = $this->sys_page->getPage($this->menuArr[$key]['pid']);
$LD = $this->tmpl->linkData($thePage,$mainTarget,'','',$overrideArray, $this->mconf['addParams'].$MP_params.$this->menuArr[$key]['_ADD_GETVARS'], $typeOverride);
} else {
$LD = $this->tmpl->linkData($this->menuArr[$key],$mainTarget,'','',$overrideArray, $this->mconf['addParams'].$MP_params.$this->I['val']['additionalParams'].$this->menuArr[$key]['_ADD_GETVARS'], $typeOverride);
if ($this->menuArr[$key]['doktype'] == 4) {
// Handle shortcut item (may be an anchorlink to a tt_content element as well)
$shortcut_page = $this->menuArr[$key];
if (strlen($shortcut_page['shortcut'])>0 && $shortcut_page['shortcut'] != '0') {
$shortcut_parts = explode('_', $shortcut_page['shortcut']);
$shortcut_uid = intval(array_pop($shortcut_parts));
$shortcut_table = implode('_', $shortcut_parts);
if ($shortcut_table == 'tt_content' && is_array($shortcut_ttcontent = t3lib_BEfunc::getRecord('tt_content', $shortcut_uid, 'pid'))) {
$shortcut_page = $this->sys_page->getPage($shortcut_ttcontent['pid']);
$shortcut_page['sectionIndex_uid'] = $shortcut_uid;
} elseif ($shortcut_table == 'pages') {
$shortcut_page = $this->sys_page->getPage($shortcut_uid);
}
}
$LD = $this->tmpl->linkData($shortcut_page,$mainTarget,'','',$overrideArray, $this->mconf['addParams'].$MP_params.$this->I['val']['additionalParams'].$this->menuArr[$key]['_ADD_GETVARS'], $typeOverride);
} else {
$LD = $this->tmpl->linkData($this->menuArr[$key],$mainTarget,'','',$overrideArray, $this->mconf['addParams'].$MP_params.$this->I['val']['additionalParams'].$this->menuArr[$key]['_ADD_GETVARS'], $typeOverride);
}
}
// Override URL if using "External URL" as doktype with a valid e-mail address:
(1-1/7)