本文整理汇总了PHP中t3lib_BEfunc::BEgetRootLine方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::BEgetRootLine方法的具体用法?PHP t3lib_BEfunc::BEgetRootLine怎么用?PHP t3lib_BEfunc::BEgetRootLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::BEgetRootLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calcPerms
/**
* Returns a combined binary representation of the current users permissions for the page-record, $row.
* The perms for user, group and everybody is OR'ed together (provided that the page-owner is the user and for the groups that the user is a member of the group
* If the user is admin, 31 is returned (full permissions for all five flags)
*
* @param array Input page row with all perms_* fields available.
* @param object BE User Object
* @return integer Bitwise representation of the users permissions in relation to input page row, $row
*/
public function calcPerms($params, $that)
{
$row = $params['row'];
$beAclConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_acl']);
if (!$beAclConfig['disableOldPermissionSystem']) {
$out = $params['outputPermissions'];
} else {
$out = 0;
}
$rootLine = t3lib_BEfunc::BEgetRootLine($row['uid']);
$i = 0;
$takeUserIntoAccount = 1;
$groupIdsAlreadyUsed = array();
foreach ($rootLine as $level => $values) {
if ($i != 0) {
$recursive = ' AND recursive=1';
} else {
$recursive = '';
}
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_beacl_acl', 'pid=' . intval($values['uid']) . $recursive, '', 'recursive ASC');
while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if ($result['type'] == 0 && $that->user['uid'] == $result['object_id'] && $takeUserIntoAccount) {
// user has to be taken into account
$out |= $result['permissions'];
$takeUserIntoAccount = 0;
} elseif ($result['type'] == 1 && $that->isMemberOfGroup($result['object_id']) && !in_array($result['object_id'], $groupIdsAlreadyUsed)) {
$out |= $result['permissions'];
$groupIdsAlreadyUsed[] = $result['object_id'];
}
}
$i++;
}
return $out;
}
示例2: getSiteUrl
/**
* Obtains site URL.
*
* @static
* @param int $pageId
* @return string
*/
protected static function getSiteUrl($pageId)
{
$domain = t3lib_BEfunc::firstDomainRecord(t3lib_BEfunc::BEgetRootLine($pageId));
$pageRecord = t3lib_BEfunc::getRecord('pages', $pageId);
$scheme = is_array($pageRecord) && isset($pageRecord['url_scheme']) && $pageRecord['url_scheme'] == t3lib_utility_Http::SCHEME_HTTPS ? 'https' : 'http';
return $domain ? $scheme . '://' . $domain . '/' : t3lib_div::getIndpEnv('TYPO3_SITE_URL');
}
示例3: main
/**
* The main function in the class
*
* @return string HTML content
*/
function main()
{
$output = 'Enter [table]:[uid]:[fieldlist (optional)] <input name="table_uid" value="' . htmlspecialchars(t3lib_div::_POST('table_uid')) . '" />';
$output .= '<input type="submit" name="_" value="REFRESH" /><br/>';
// Show record:
if (t3lib_div::_POST('table_uid')) {
list($table, $uid, $fieldName) = t3lib_div::trimExplode(':', t3lib_div::_POST('table_uid'), 1);
if ($GLOBALS['TCA'][$table]) {
$rec = t3lib_BEfunc::getRecordRaw($table, 'uid=' . intval($uid), $fieldName ? $fieldName : '*');
if (count($rec)) {
$pidOfRecord = $rec['pid'];
$output .= '<input type="checkbox" name="show_path" value="1"' . (t3lib_div::_POST('show_path') ? ' checked="checked"' : '') . '/> Show path and rootline of record<br/>';
if (t3lib_div::_POST('show_path')) {
$output .= '<br/>Path of PID ' . $pidOfRecord . ': <em>' . t3lib_BEfunc::getRecordPath($pidOfRecord, '', 30) . '</em><br/>';
$output .= 'RL:' . Tx_Extdeveval_Compatibility::viewArray(t3lib_BEfunc::BEgetRootLine($pidOfRecord)) . '<br/>';
$output .= 'FLAGS:' . ($rec['deleted'] ? ' <b>DELETED</b>' : '') . ($rec['pid'] == -1 ? ' <b>OFFLINE VERSION of ' . $rec['t3ver_oid'] . '</b>' : '') . '<br/><hr/>';
}
if (t3lib_div::_POST('_EDIT')) {
$output .= '<hr/>Edit:<br/><br/>';
$output .= '<input type="submit" name="_SAVE" value="SAVE" /><br/>';
foreach ($rec as $field => $value) {
$output .= '<b>' . htmlspecialchars($field) . ':</b><br/>';
if (count(explode(chr(10), $value)) > 1) {
$output .= '<textarea name="record[' . $table . '][' . $uid . '][' . $field . ']" cols="100" rows="10">' . t3lib_div::formatForTextarea($value) . '</textarea><br/>';
} else {
$output .= '<input name="record[' . $table . '][' . $uid . '][' . $field . ']" value="' . htmlspecialchars($value) . '" size="100" /><br/>';
}
}
} elseif (t3lib_div::_POST('_SAVE')) {
$incomingData = t3lib_div::_POST('record');
$GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . intval($uid), $incomingData[$table][$uid]);
$output .= '<br/>Updated ' . $table . ':' . $uid . '...';
$this->updateRefIndex($table, $uid);
} else {
if (t3lib_div::_POST('_DELETE')) {
$GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'uid=' . intval($uid));
$output .= '<br/>Deleted ' . $table . ':' . $uid . '...';
$this->updateRefIndex($table, $uid);
} else {
$output .= '<input type="submit" name="_EDIT" value="EDIT" />';
$output .= '<input type="submit" name="_DELETE" value="DELETE" onclick="return confirm(\'Are you sure you wish to delete?\');" />';
$output .= '<br/>' . md5(implode($rec));
$output .= Tx_Extdeveval_Compatibility::viewArray($rec);
}
}
} else {
$output .= 'No record existed!';
}
}
}
return $output;
}
示例4: init
/**
* Initialize the normal module operation
*
* @return void
*/
function init()
{
global $BE_USER, $LANG, $BACK_PATH;
// Setting more GPvars:
$this->popViewId = t3lib_div::_GP('popViewId');
$this->popViewId_addParams = t3lib_div::_GP('popViewId_addParams');
$this->viewUrl = t3lib_div::_GP('viewUrl');
$this->editRegularContentFromId = t3lib_div::_GP('editRegularContentFromId');
$this->recTitle = t3lib_div::_GP('recTitle');
$this->disHelp = t3lib_div::_GP('disHelp');
$this->noView = t3lib_div::_GP('noView');
$this->perms_clause = $BE_USER->getPagePermsClause(1);
// Set other internal variables:
$this->R_URL_getvars['returnUrl'] = $this->retUrl;
$this->R_URI = $this->R_URL_parts['path'] . '?' . t3lib_div::implodeArrayForUrl('', $this->R_URL_getvars);
// MENU-ITEMS:
// If array, then it's a selector box menu
// If empty string it's just a variable, that'll be saved.
// Values NOT in this array will not be saved in the settings-array for the module.
$this->MOD_MENU = array('showPalettes' => '');
// Setting virtual document name
$this->MCONF['name'] = 'xMOD_alt_doc.php';
// CLEANSE SETTINGS
$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
// Create an instance of the document template object
$this->doc = $GLOBALS['TBE_TEMPLATE'];
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('templates/alt_doc.html');
$this->doc->form = '<form action="' . htmlspecialchars($this->R_URI) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">';
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->JScode = $this->doc->wrapScriptTags('
function jumpToUrl(URL,formEl) { //
if (!TBE_EDITOR.isFormChanged()) {
window.location.href = URL;
} else if (formEl && formEl.type=="checkbox") {
formEl.checked = formEl.checked ? 0 : 1;
}
}
// Object: TS:
// passwordDummy and decimalSign are used by tbe_editor.js and have to be declared here as
// TS object overwrites the object declared in tbe_editor.js
function typoSetup () { //
this.uniqueID = "";
this.passwordDummy = "********";
this.decimalSign = ".";
}
var TS = new typoSetup();
// Info view:
function launchView(table,uid,bP) { //
var backPath= bP ? bP : "";
var thePreviewWindow="";
thePreviewWindow = window.open(backPath+"show_item.php?table="+encodeURIComponent(table)+"&uid="+encodeURIComponent(uid),"ShowItem"+TS.uniqueID,"height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
if (thePreviewWindow && thePreviewWindow.focus) {
thePreviewWindow.focus();
}
}
function deleteRecord(table,id,url) { //
if (
' . ($GLOBALS['BE_USER']->jsConfirmation(4) ? 'confirm(' . $LANG->JScharCode($LANG->getLL('deleteWarning')) . ')' : '1==1') . '
) {
window.location.href = "tce_db.php?cmd["+table+"]["+id+"][delete]=1' . t3lib_BEfunc::getUrlToken('tceAction') . '&redirect="+escape(url)+"&vC=' . $BE_USER->veriCode() . '&prErr=1&uPT=1";
}
return false;
}
' . (isset($_POST['_savedokview_x']) && $this->popViewId ? 'if (window.opener) { ' . t3lib_BEfunc::viewOnClick($this->popViewId, '', t3lib_BEfunc::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams, FALSE) . ' } else { ' . t3lib_BEfunc::viewOnClick($this->popViewId, '', t3lib_BEfunc::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams) . ' } ' : ''));
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
$this->doc->bodyTagAdditions = 'onload="window.scrollTo(0,' . t3lib_div::intInRange(t3lib_div::_GP('_scrollPosition'), 0, 10000) . ');"';
}
示例5: initializeHttpHost
/**
* Initializes the $_SERVER['HTTP_HOST'] environment variable in CLI
* environments dependent on the Index Queue item's root page.
*
* When the Index Queue Worker task is executed by a cron job there is no
* HTTP_HOST since we are in a CLI environment. RealURL needs the host
* information to generate a proper URL though. Using the Index Queue item's
* root page information we can determine the correct host although being
* in a CLI environment.
*
* @param Tx_Solr_IndexQueue_Item $item Index Queue item to use to determine the host.
*/
protected function initializeHttpHost(Tx_Solr_IndexQueue_Item $item)
{
static $hosts = array();
// relevant for realURL environments, only
if (t3lib_extMgm::isLoaded('realurl')) {
$rootpageId = $item->getRootPageUid();
$hostFound = !empty($hosts[$rootpageId]);
if (!$hostFound) {
$rootline = t3lib_BEfunc::BEgetRootLine($rootpageId);
$host = t3lib_BEfunc::firstDomainRecord($rootline);
$hosts[$rootpageId] = $host;
}
$_SERVER['HTTP_HOST'] = $hosts[$rootpageId];
}
}
示例6: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an associated array
*/
protected function getButtons()
{
$buttons = array('view' => '', 'record_list' => '', 'shortcut' => '');
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('tx_impexp', '', $this->MCONF['name']);
}
// Input data grabbed:
$inData = t3lib_div::_GP('tx_impexp');
if ((string) $inData['action'] == 'import') {
if ($this->id && is_array($this->pageinfo) || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
// View
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $this->doc->backPath, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>';
// Record list
if ($GLOBALS['BE_USER']->check('modules', 'web_list')) {
$href = $this->doc->backPath . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
$buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-system-list-open') . '</a>';
}
}
}
}
return $buttons;
}
示例7: buildACLtree
/**
* returns a datastructure: pageid - userId / groupId - permissions
*
* @param array user ID list
* @param array group ID list
*/
function buildACLtree($users, $groups)
{
// get permissions in the starting point for users and groups
$rootLine = t3lib_BEfunc::BEgetRootLine($this->id);
$userStartPermissions = array();
$groupStartPermissions = array();
array_shift($rootLine);
// needed as a starting point
foreach ($rootLine as $level => $values) {
$recursive = ' AND recursive=1';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('type, object_id, permissions', 'tx_beacl_acl', 'pid=' . intval($values['uid']) . $recursive);
while ($result = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if ($result['type'] == 0 && in_array($result['object_id'], $users) && !array_key_exists($result['object_id'], $userStartPermissions)) {
$userStartPermissions[$result['object_id']] = $result['permissions'];
} elseif ($result['type'] == 1 && in_array($result['object_id'], $groups) && !array_key_exists($result['object_id'], $groupStartPermissions)) {
$groupStartPermissions[$result['object_id']] = $result['permissions'];
}
}
}
foreach ($userStartPermissions as $oid => $perm) {
$startPerms[0][$oid]['permissions'] = $perm;
$startPerms[0][$oid]['recursive'] = 1;
}
foreach ($groupStartPermissions as $oid => $perm) {
$startPerms[1][$oid]['permissions'] = $perm;
$startPerms[1][$oid]['recursive'] = 1;
}
$this->traversePageTree_acl($startPerms, $rootLine[0]['uid']);
// check if there are any ACLs on these pages
// build a recursive function traversing through the pagetree
}
示例8: viewPageIcon
/**
* Makes link to page $id in frontend (view page)
* Returns an magnifier-glass icon which links to the frontend index.php document for viewing the page with id $id
* $id must be a page-uid
* If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url)
*
* @param integer The page id
* @param string The current "BACK_PATH" (the back relative to the typo3/ directory)
* @param string Additional parameters for the image tag(s)
* @return string HTML string with linked icon(s)
*/
function viewPageIcon($id, $backPath, $addParams = 'hspace="3"')
{
global $BE_USER;
$str = '';
// If access to Web>List for user, then link to that module.
if ($BE_USER->check('modules', 'web_list')) {
$href = $backPath . 'db_list.php?id=' . $id . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
$str .= '<a href="' . htmlspecialchars($href) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/list.gif', 'width="11" height="11"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '"' . ($addParams ? ' ' . trim($addParams) : '') . ' alt="" />' . '</a>';
}
// Make link to view page
$str .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($id, $backPath, t3lib_BEfunc::BEgetRootLine($id))) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '"' . ($addParams ? ' ' . trim($addParams) : "") . ' hspace="3" alt="" />' . '</a>';
return $str;
}
示例9: main
/**
* Main function
*
* @return void
*/
function main()
{
global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS;
// Access check...
// The page will show only if there is a valid page and if this page may be viewed by the user
$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
$access = is_array($this->pageinfo) ? 1 : 0;
$addCmd = '';
if ($this->id && $access) {
$addCmd = '&ADMCMD_view=1&ADMCMD_editIcons=1' . t3lib_BEfunc::ADMCMD_previewCmds($this->pageinfo);
}
$parts = parse_url(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
$dName = t3lib_BEfunc::getDomainStartPage($parts['host'], $parts['path']) ? t3lib_BEfunc::firstDomainRecord(t3lib_BEfunc::BEgetRootLine($this->id)) : '';
// preview of mount pages
$sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
$sys_page->init(FALSE);
$mountPointInfo = $sys_page->getMountPointInfo($this->id);
if ($mountPointInfo && $mountPointInfo['overlay']) {
$this->id = $mountPointInfo['mount_pid'];
$addCmd .= '&MP=' . $mountPointInfo['MPvar'];
}
$this->url .= ($dName ? (t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://') . $dName : $BACK_PATH . '..') . '/index.php?id=' . $this->id . ($this->type ? '&type=' . $this->type : '') . $addCmd;
}
示例10: processClearCacheCommand
/**
* Processes the CURL request and sends action to Varnish server
*
* @param string $url
* @param integer $pid
* @param string $host
* @param boolean $quote
*
* @return array
*/
protected function processClearCacheCommand($url, $pid, $host = '', $quote = TRUE)
{
$responseArray = array();
foreach ($this->serverArray as $server) {
$response = array('server' => $server);
// Build request
if ($this->stripSlash) {
$url = rtrim($url, '/');
}
$request = $server . '/' . ltrim($url, '/');
$response['request'] = $request;
// Check for curl functions
if (!function_exists('curl_init')) {
// TODO: Implement fallback to file_get_contents()
$response['status'] = t3lib_FlashMessage::ERROR;
$response['message'] = 'No curl_init available';
} else {
// If no host was given we need to loop over all
$hostArray = array();
if ($host !== '') {
$hostArray = t3lib_div::trimExplode(',', $host, 1);
} else {
// Get all (non-redirecting) domains from root
$rootLine = t3lib_BEfunc::BEgetRootLine($pid);
foreach ($rootLine as $row) {
$domainArray = t3lib_BEfunc::getRecordsByField('sys_domain', 'pid', $row['uid'], ' AND redirectTo="" AND hidden=0');
if (is_array($domainArray) && !empty($domainArray)) {
foreach ($domainArray as $domain) {
$hostArray[] = $domain['domainName'];
}
unset($domain);
}
}
unset($row);
}
// Fallback to current server
if (empty($hostArray)) {
$domain = rtrim(t3lib_div::getIndpEnv('TYPO3_SITE_URL'), '/');
$hostArray[] = substr($domain, strpos($domain, '://') + 3);
}
// Loop over hosts
foreach ($hostArray as $xHost) {
$response['host'] = $xHost;
// Curl initialization
$ch = curl_init();
// Disable direct output
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Only get header response
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
// Set url
curl_setopt($ch, CURLOPT_URL, $request);
// Set method and protocol
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpMethod);
curl_setopt($ch, CURLOPT_HTTP_VERSION, $this->httpProtocol === 'http_10' ? CURL_HTTP_VERSION_1_0 : CURL_HTTP_VERSION_1_1);
// Set X-Host and X-Url header
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Host: ' . ($quote ? preg_quote($xHost) : $xHost), 'X-Url: ' . ($quote ? preg_quote($url) : $url)));
// Store outgoing header
curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
// Include preProcess hook (e.g. to set some alternative curl options
foreach ($this->hookObjects as $hookObject) {
/** @var tx_vcc_hook_communicationServiceHookInterface $hookObject */
$hookObject->preProcess($ch, $request, $response, $this);
}
unset($hookObject);
$header = curl_exec($ch);
if (!curl_error($ch)) {
$response['status'] = curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200 ? t3lib_FlashMessage::OK : t3lib_FlashMessage::ERROR;
$response['message'] = preg_split('/(\\r|\\n)+/m', trim($header));
} else {
$response['status'] = t3lib_FlashMessage::ERROR;
$response['message'] = array(curl_error($ch));
}
$response['requestHeader'] = preg_split('/(\\r|\\n)+/m', trim(curl_getinfo($ch, CURLINFO_HEADER_OUT)));
// Include postProcess hook (e.g. to start some other jobs)
foreach ($this->hookObjects as $hookObject) {
/** @var tx_vcc_hook_communicationServiceHookInterface $hookObject */
$hookObject->postProcess($ch, $request, $response, $this);
}
unset($hookObject);
curl_close($ch);
// Log debug information
$logData = array('url' => $url, 'pid' => $pid, 'host' => $host, 'response' => $response);
$logType = $response['status'] == t3lib_FlashMessage::OK ? tx_vcc_service_loggingService::OK : tx_vcc_service_loggingService::ERROR;
$this->loggingService->log('CommunicationService::processClearCacheCommand', $logData, $logType, $pid, 3);
$responseArray[] = $response;
}
unset($xHost);
}
}
//.........这里部分代码省略.........
示例11: ext_prevPageWithTemplate
/**
* [Describe function...]
*
* @param [type] $id: ...
* @param [type] $perms_clause: ...
* @return [type] ...
*/
function ext_prevPageWithTemplate($id, $perms_clause)
{
$rootLine = t3lib_BEfunc::BEgetRootLine($id, $perms_clause ? ' AND ' . $perms_clause : '');
foreach ($rootLine as $p) {
if ($this->ext_getFirstTemplate($p['uid'])) {
return $p;
}
}
}
示例12: getHeaderButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an assoc. array
*/
function getHeaderButtons()
{
global $LANG;
$buttons = array('csh' => '', 'view' => '', 'edit' => '', 'record_list' => '', 'level_up' => '', 'reload' => '', 'shortcut' => '', 'back' => '', 'csv' => '', 'export' => '');
$backPath = $GLOBALS['BACK_PATH'];
// CSH
// if (!strlen($this->id)) {
// $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txttnewsM1', 'list_module_noId', $backPath);
// } elseif(!$this->id) {
// $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txttnewsM1', 'list_module_root', $backPath);
// } else {
// $buttons['csh'] = t3lib_BEfunc::cshItem('_MOD_web_txttnewsM1', 'list_module', $backPath);
// }
if (isset($this->id)) {
if ($GLOBALS['BE_USER']->check('modules', 'web_list')) {
$href = t3lib_BEfunc::getModuleUrl('web_list', array('id' => $this->pageinfo['uid'], 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI')));
$buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/list.gif', 'width="11" height="11"') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' . '</a>';
}
// View
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id, $backPath, t3lib_BEfunc::BEgetRootLine($this->id))) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/zoom.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" alt="" />' . '</a>';
// If edit permissions are set (see class.t3lib_userauthgroup.php)
if ($this->localCalcPerms & 2 && !empty($this->id)) {
// Edit
$params = '&edit[pages][' . $this->pageinfo['uid'] . ']=edit';
$buttons['edit'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $backPath, -1)) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/edit2.gif') . ' title="' . $LANG->getLL('editPage', 1) . '" alt="" />' . '</a>';
}
// if ($this->table) {
// Export
if (t3lib_extMgm::isLoaded('impexp')) {
$modUrl = t3lib_extMgm::extRelPath('impexp') . 'app/index.php';
$params = $modUrl . '?tx_impexp[action]=export&tx_impexp[list][]=';
$params .= rawurlencode('tt_news:' . $this->id) . '&tx_impexp[list][]=';
$params .= rawurlencode('tt_news_cat:' . $this->id);
$buttons['export'] = '<a href="' . htmlspecialchars($backPath . $params) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, t3lib_extMgm::extRelPath('impexp') . 'export.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.export', 1) . '" alt="" />' . '</a>';
}
// }
// Reload
$buttons['reload'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisScript()) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/refresh_n.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.reload', 1) . '" alt="" />' . '</a>';
// Shortcut
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('id, showThumbs, pointer, table, search_field, searchLevels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_txttnewsM1');
}
// Back
if ($this->returnUrl) {
$buttons['back'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/goback.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1) . '" alt="" />' . '</a>';
}
}
return $buttons;
}
示例13: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an assoc. array
*/
protected function getButtons()
{
global $LANG, $BACK_PATH;
$buttons = array('csh' => '', 'back' => '', 'view' => '', 'new_page' => '', 'record_list' => '');
if (!$this->pagesOnly) {
// Regular new element:
// New page
if ($this->showNewRecLink('pages')) {
$buttons['new_page'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('pagesOnly' => '1'))) . '" title="' . $LANG->sL('LLL:EXT:cms/layout/locallang.xml:newPage', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-page-new') . '</a>';
}
// CSH
$buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_regular', $GLOBALS['BACK_PATH'], '', TRUE);
} elseif ($this->showNewRecLink('pages')) {
// Pages only wizard
// CSH
$buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_pages', $GLOBALS['BACK_PATH'], '', TRUE);
}
// Back
if ($this->R_URI) {
$buttons['back'] = '<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-view-go-back') . '</a>';
}
if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
// View
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $this->backPath, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '">' . t3lib_iconWorks::getSpriteIcon('actions-document-view') . '</a>';
// Record list
// If access to Web>List for user, then link to that module.
$buttons['record_list'] = t3lib_BEfunc::getListViewLink(array('id' => $this->pageinfo['uid'], 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI')), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList'));
}
return $buttons;
}
示例14: viewPageIcon
/**
* Makes link to page $id in frontend (view page)
* Returns an magnifier-glass icon which links to the frontend index.php document for viewing the page with id $id
* $id must be a page-uid
* If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url)
*
* @param integer The page id
* @param string The current "BACK_PATH" (the back relative to the typo3/ directory)
* @param string Additional parameters for the image tag(s)
* @return string HTML string with linked icon(s)
*/
function viewPageIcon($id, $backPath, $addParams = 'hspace="3"')
{
global $BE_USER;
// If access to Web>List for user, then link to that module.
$str = t3lib_BEfunc::getListViewLink(array('id' => $id, 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI')), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList'));
// Make link to view page
$str .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($id, $backPath, t3lib_BEfunc::BEgetRootLine($id))) . '">' . '<img' . t3lib_iconWorks::skinImg($backPath, 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '"' . ($addParams ? ' ' . trim($addParams) : "") . ' hspace="3" alt="" />' . '</a>';
return $str;
}
示例15: isInWebMount
/**
* Checks if the page id, $id, is found within the webmounts set up for the user.
* This should ALWAYS be checked for any page id a user works with, whether it's about reading, writing or whatever.
* The point is that this will add the security that a user can NEVER touch parts outside his mounted pages in the page tree. This is otherwise possible if the raw page permissions allows for it. So this security check just makes it easier to make safe user configurations.
* If the user is admin OR if this feature is disabled (fx. by setting TYPO3_CONF_VARS['BE']['lockBeUserToDBmounts']=0) then it returns "1" right away
* Otherwise the function will return the uid of the webmount which was first found in the rootline of the input page $id
*
* @param integer Page ID to check
* @param string Content of "->getPagePermsClause(1)" (read-permissions). If not set, they will be internally calculated (but if you have the correct value right away you can save that database lookup!)
* @param boolean If set, then the function will exit with an error message.
* @return integer The page UID of a page in the rootline that matched a mount point
*/
function isInWebMount($id, $readPerms = '', $exitOnError = 0)
{
if (!$GLOBALS['TYPO3_CONF_VARS']['BE']['lockBeUserToDBmounts'] || $this->isAdmin()) {
return 1;
}
$id = intval($id);
// Check if input id is an offline version page in which case we will map id to the online version:
$checkRec = t3lib_beFUnc::getRecord('pages', $id, 'pid,t3ver_oid');
if ($checkRec['pid'] == -1) {
$id = intval($checkRec['t3ver_oid']);
}
if (!$readPerms) {
$readPerms = $this->getPagePermsClause(1);
}
if ($id > 0) {
$wM = $this->returnWebmounts();
$rL = t3lib_BEfunc::BEgetRootLine($id, ' AND ' . $readPerms);
foreach ($rL as $v) {
if ($v['uid'] && in_array($v['uid'], $wM)) {
return $v['uid'];
}
}
}
if ($exitOnError) {
t3lib_BEfunc::typo3PrintError('Access Error', 'This page is not within your DB-mounts', 0);
exit;
}
}