/** * @access private * @return string */ function _infoPage() { $pageID = GetPostOrGet('pageID'); $action = GetPostOrGet('action2'); $pageData = $this->_PageStructure->GetPageDataArray($pageID); if ($pageData === false) { return $this->_homePage(); } // get some config-values $dateDayFormat = $this->_Config->Get('date_day_format', ''); $dateTimeFormat = $this->_Config->Get('date_time_format', ''); $dateFormat = $dateDayFormat . ' ' . $dateTimeFormat; $this->_ComaLate->SetCondition('pageaccess_default'); $this->_ComaLate->SetCondition('pagepath_default'); $this->_ComaLate->SetCondition('pagename_default'); $this->_ComaLate->SetReplacement('LANG_PATH', $this->_Translation->GetTranslation('path')); switch ($action) { case 'changeAccess': $this->_ComaLate->SetCondition('pageaccess_edit'); $this->_ComaLate->SetCondition('pageaccess_default', false); $this->_ComaLate->SetReplacement('LANG_PUBLIC', $this->_Translation->GetTranslation('public')); $this->_ComaLate->SetReplacement('LANG_PRIVATE', $this->_Translation->GetTranslation('private')); $this->_ComaLate->SetReplacement('LANG_HIDDEN', $this->_Translation->GetTranslation('hidden')); $this->_ComaLate->SetReplacement('LANG_DELETED', $this->_Translation->GetTranslation('deleted')); $this->_ComaLate->SetReplacement('PAGEACCESS_PUBLIC_SELECTED', 'public' == $pageData['access'] ? 'selected="selected"' : ''); $this->_ComaLate->SetReplacement('PAGEACCESS_PRIVATE_SELECTED', 'private' == $pageData['access'] ? 'selected="selected"' : ''); $this->_ComaLate->SetReplacement('PAGEACCESS_HIDDEN_SELECTED', 'hidden' == $pageData['access'] ? 'selected="selected"' : ''); $this->_ComaLate->SetReplacement('PAGEACCESS_DELETED_SELECTED', 'deleted' == $pageData['access'] ? 'selected="selected"' : ''); $this->_ComaLate->SetReplacement('LANG_SAVE', $this->_Translation->GetTranslation('save')); break; case 'saveAccess': $newPageAccess = GetPostOrGet('pageAccess'); if ($newPageAccess == $pageData['access']) { break; } $logMessage = 'Changed Page-Access from ' . $pageData['access'] . ' to ' . $newPageAccess; $this->_PageStructure->LogPage($pageID, $logMessage); $this->_PageStructure->ChangePageAccess($pageID, $newPageAccess); $pageData['date'] = mktime(); $pageData['creator'] = $this->_User->ID; $pageData['access'] = $newPageAccess; $pageData['comment'] = $logMessage; break; case 'changePath': $this->_ComaLate->SetReplacement('LANG_SAVE', $this->_Translation->GetTranslation('save')); $this->_ComaLate->SetReplacement('LANG_NONE', $this->_Translation->GetTranslation('none')); $this->_ComaLate->SetReplacement('LANG_PATH', $this->_Translation->GetTranslation('subpage_of')); $this->_ComaLate->SetCondition('pagepath_default', false); $this->_ComaLate->SetCondition('pagepath_edit'); break; case 'savePath': $newPatentID = GetPostOrGet('pageParentID'); if ($newPatentID == $pageData['parentID']) { break; } $logMessage = 'Changed ParentID form ' . $pageData['parentID'] . ' to ' . $newPatentID; $this->_PageStructure->LogPage($pageID, $logMessage); $this->_PageStructure->ChangePageParentID($pageID, $newPatentID); $pageData['date'] = mktime(); $pageData['creator'] = $this->_User->ID; $pageData['parentID'] = $newPatentID; $pageData['comment'] = $logMessage; break; case 'changeName': $this->_ComaLate->SetReplacement('LANG_SAVE', $this->_Translation->GetTranslation('save')); $this->_ComaLate->SetCondition('pagename_default', false); $this->_ComaLate->SetCondition('pagename_edit'); break; case 'saveName': $newName = GetPostOrGet('pageName'); $newName = str_replace(' ', '_', $newName); $newNameRawUrl = rawurlencode($newName); if ($newNameRawUrl == $pageData['name']) { break; } $logMessage = 'Changed Name form ' . rawurldecode($pageData['name']) . ' to ' . $newName; $this->_PageStructure->LogPage($pageID, $logMessage); $this->_PageStructure->ChangePageName($pageID, $newNameRawUrl); $pageData['date'] = mktime(); $pageData['creator'] = $this->_User->ID; $pageData['comment'] = $logMessage; $pageData['name'] = $newNameRawUrl; break; } $this->_ComaLate->SetReplacement('LANG_TITLE', $this->_Translation->GetTranslation('title')); $this->_ComaLate->SetReplacement('LANG_EDIT', $this->_Translation->GetTranslation('edit')); $this->_ComaLate->SetReplacement('LANG_NAME', $this->_Translation->GetTranslation('name')); $this->_ComaLate->SetReplacement('LANG_TYPE', $this->_Translation->GetTranslation('type')); $this->_ComaLate->SetReplacement('LANG_ACCESS', $this->_Translation->GetTranslation('access')); $this->_ComaLate->SetReplacement('LANG_LANGUAGE', $this->_Translation->GetTranslation('language')); $this->_ComaLate->SetReplacement('LANG_EDITED_BY', $this->_Translation->GetTranslation('edited_by')); $this->_ComaLate->SetReplacement('LANG_LAST_CHANGE', $this->_Translation->GetTranslation('last_change')); $this->_ComaLate->SetReplacement('LANG_INLINEMENU', $this->_Translation->GetTranslation('inlinemenu')); $this->_ComaLate->SetReplacement('LANG_SUBPAGES', $this->_Translation->GetTranslation('subpages')); $this->_ComaLate->SetReplacement('LANG_HISTORY', $this->_Translation->GetTranslation('history')); $this->_ComaLate->SetReplacement('LANG_DATE', $this->_Translation->GetTranslation('date')); $this->_ComaLate->SetReplacement('LANG_USER', $this->_Translation->GetTranslation('user')); $this->_ComaLate->SetReplacement('LANG_COMMENT', $this->_Translation->GetTranslation('comment')); $this->_ComaLate->SetReplacement('LANG_ACTIONS', $this->_Translation->GetTranslation('actions')); $this->_ComaLate->SetReplacement('LANG_ENTRIES', $this->_Translation->GetTranslation('entries')); $this->_ComaLate->SetReplacement('LANG_VIEW', $this->_Translation->GetTranslation('view')); $this->_ComaLate->SetReplacement('LANG_RESTORE', $this->_Translation->GetTranslation('restore')); $this->_ComaLate->SetReplacement('PAGE_ID', $pageID); $this->_ComaLate->SetReplacement('TITLE_VALUE', $pageData['title']); $this->_ComaLate->SetReplacement('NAME_VALUE', rawurldecode($pageData['name'])); $this->_ComaLate->SetReplacement('TYPE_VALUE', $this->_Translation->GetTranslation($pageData['type'])); $this->_ComaLate->SetReplacement('ACCESS_VALUE', $this->_Translation->GetTranslation($pageData['access'])); $this->_ComaLate->SetReplacement('LANGUAGE_VALUE', $this->_Translation->GetTranslation($pageData['lang'])); $this->_ComaLate->SetReplacement('EDITED_BY_VALUE', $this->_ComaLib->GetUserByID($pageData['creator'])); $this->_ComaLate->SetReplacement('LAST_CHANGE_VALUE', date($dateFormat, $pageData['date'])); $history = array(); $history = $this->_PageStructure->GetPageHistory($pageID); $inlineMenuEntriesCount = $this->_PageStructure->GetInlineMenuEntriesCount($pageID); $historyCount = count($history); for ($i = 0; $i < $historyCount; $i++) { $history[$i]['HISTORY_PAGE_DATE'] = date($dateFormat, $history[$i]['HISTORY_PAGE_DATE']); $history[$i]['HISTORY_PAGE_USER'] = $this->_ComaLib->GetUserByID($history[$i]['HISTORY_PAGE_USER']); } $this->_ComaLate->SetReplacement('INLINEMENU_ENTRIES_COUNT', $inlineMenuEntriesCount); $this->_ComaLate->SetReplacement('HISTORY_COUNT', $historyCount + 1); $this->_ComaLate->SetReplacement('PAGE_HISTORY', $history); $this->_ComaLate->SetReplacement('PAGE_COMMENT', $pageData['comment']); $template = '<form action="' . $this->FormUrl . '" method="post"> <input type="hidden" name="' . $this->FormPage . '" value="pagestructure" /> <input type="hidden" name="action" value="pageInfo" /> <input type="hidden" name="pageID" value="{PAGE_ID}" /> <table> <tr> <th>{LANG_TITLE}</th> <td>{TITLE_VALUE} <a href="' . $this->LinkUrl . 'page=pagestructure&action=editPage&pageID={PAGE_ID}"><img src="./img/edit.png" height="16" width="16" alt="{LANG_EDIT}" title="{LANG_EDIT}"/></a></td> </tr> <tr> <th>{LANG_NAME}</th> <td> <pagename_default:condition> {NAME_VALUE} <a href="' . $this->LinkUrl . 'page=pagestructure&action=pageInfo&pageID={PAGE_ID}&action2=changeName"><img src="./img/edit.png" height="16" width="16" alt="{LANG_EDIT}" title="{LANG_EDIT}"/></a> </pagename_default> <pagename_edit:condition> <input type="hidden" name="action2" value="saveName" /> <input type="text" maxlength="28" name="pageName" value="{NAME_VALUE}" /><input type="submit" value="{LANG_SAVE}" class="button" /> </pagename_edit> </td> </tr> <tr> <th>{LANG_TYPE}</th> <td>{TYPE_VALUE}</td> </tr> <tr> <th>{LANG_ACCESS}</th> <td> <pageaccess_default:condition> {ACCESS_VALUE} <a href="' . $this->LinkUrl . 'page=pagestructure&action=pageInfo&pageID={PAGE_ID}&action2=changeAccess"><img src="./img/edit.png" height="16" width="16" alt="{LANG_EDIT}" title="{LANG_EDIT}"/></a> </pageaccess_default> <pageaccess_edit:condition> <input type="hidden" name="action2" value="saveAccess" /> <select name="pageAccess"> <option value="public" {PAGEACCESS_PUBLIC_SELECTED}>{LANG_PUBLIC}</option> <option value="private" {PAGEACCESS_PRIVATE_SELECTED}>{LANG_PRIVATE}</option> <option value="hidden" {PAGEACCESS_HIDDEN_SELECTED}>{LANG_HIDDEN}</option> <option value="deleted" {PAGEACCESS_DELETED_SELECTED}>{LANG_DELETED}</option> </select> <input type="submit" value="{LANG_SAVE}" class="button" /> </pageaccess_edit> </td> </tr> <tr> <th>{LANG_LANGUAGE}</th> <td>{LANGUAGE_VALUE}</td> </tr> <tr> <th>{LANG_PATH}</th> <td> <pagepath_default:condition> <a href="' . $this->LinkUrl . 'page=pagestructure">root</a><strong>/</strong> ' . $this->_pagePath($pageID) . ' <a href="' . $this->LinkUrl . 'page=pagestructure&action=pageInfo&pageID={PAGE_ID}&action2=changePath"><img src="./img/edit.png" height="16" width="16" alt="{LANG_EDIT}" title="{LANG_EDIT}"/></a> </pagepath_default> <pagepath_edit:condition> <input type="hidden" name="action2" value="savePath" /> <select name="pageParentID"> <option value="0">{LANG_NONE}</option>'; if ($action == 'changePath') { $this->_PageStructure->LoadParentIDs(); $template .= $this->_PageStructure->PageStructurePulldown(0, 0, '', $pageID, $pageData['parentID']); } $template .= '</select><input type="submit" value="{LANG_SAVE}" class="button" /></pagepath_edit> </td> </tr> <tr> <th>{LANG_EDITED_BY}</th> <td>{EDITED_BY_VALUE}</td> </tr> <tr> <th>{LANG_LAST_CHANGE}</th> <td>{LAST_CHANGE_VALUE}</td> </tr> <tr> <th>{LANG_INLINEMENU}</th> <td>{INLINEMENU_ENTRIES_COUNT} {LANG_ENTRIES} <a href="' . $this->LinkUrl . 'page=pagestructure&action=pageInlineMenu&pageID={PAGE_ID}"><img src="./img/inlinemenu.png" height="16" width="16" alt="{LANG_INLINEMENU}" title="{LANG_ILNINEMENU}"/></a></td> </tr> </table> </form> <h2>{LANG_SUBPAGES}</h2> <script type="text/javascript" language="JavaScript" src="system/functions.js"></script> ' . $this->_showStructure($pageID) . ' <script type="text/javascript" language="JavaScript"> SetHover(\'span\', \'structure_row\', \'structure_row_hover\', function additional() {document.getElementById(\'menu\').className = \'\';}); </script> <h2>{LANG_HISTORY} ({HISTORY_COUNT})</h2> <table class="full_width"> <thead> <tr> <th>{LANG_DATE}</th> <th>{LANG_USER}</th> <th>{LANG_TITLE}</th> <th>{LANG_COMMENT}</th> <th>{LANG_ACTIONS}</th> </tr> </thead> <tbody> <tr> <td>{LAST_CHANGE_VALUE}</td> <td>{EDITED_BY_VALUE}</td> <td>{TITLE_VALUE}</td> <td>{PAGE_COMMENT}</td> <td> <a href="index.php?page={PAGE_ID}"><img src="./img/view.png" height="16" width="16" alt="{LANG_VIEW}" title="{LANG_VIEW}"/></a> <a href="' . $this->LinkUrl . 'page=pagestructure&action=editPage&pageID={PAGE_ID}"><img src="./img/edit.png" height="16" width="16" alt="{LANG_EDIT}" title="{LANG_EDIT}"/></a> </td> </tr> <PAGE_HISTORY:loop> <tr> <td>{HISTORY_PAGE_DATE}</td> <td>{HISTORY_PAGE_USER}</td> <td>{HISTORY_PAGE_TITLE}</td> <td>{HISTORY_PAGE_COMMENT}</td> <td> <a href="index.php?page={PAGE_ID}&change={HISTORY_PAGE_REVISION}"><img src="./img/view.png" height="16" width="16" alt="{LANG_VIEW}" title="{LANG_VIEW}"/></a> <a href="' . $this->LinkUrl . 'page=pagestructure&action=editOldPage&pageID={PAGE_ID}&revision={HISTORY_PAGE_REVISION}"><img src="./img/edit.png" height="16" width="16" alt="{LANG_EDIT}" title="{LANG_EDIT}"/></a> <a href="' . $this->LinkUrl . 'page=pagestructure&action=restorePage&pageID={PAGE_ID}&revision={HISTORY_PAGE_REVISION}"><img src="./img/restore.png" height="16" width="16" alt="{LANG_RESTORE}" title="{LANG_RESTORE}"/></a> </td> </tr> </PAGE_HISTORY> </tbody> </table>'; return $template; }