Project

General

Profile

Bug #18047 » 20080205_rfc7262_template.diff

Administrator Admin, 2008-02-05 10:01

View differences:

typo3/sysext/tstemplate/ts/index.php (working copy)
require ("conf.php");
require ($BACK_PATH."init.php");
require ($BACK_PATH."template.php");
$LANG->includeLLFile('EXT:tstemplate/ts/locallang.xml');
require_once (PATH_t3lib."class.t3lib_page.php");
require_once (PATH_t3lib."class.t3lib_tstemplate.php");
require_once (PATH_t3lib."class.t3lib_tsparser_ext.php");
require_once (PATH_t3lib.'class.t3lib_parsehtml.php');
require_once (PATH_t3lib."class.t3lib_scbase.php");
$BE_USER->modAccess($MCONF,1);
......
// Access check...
// The page will show only if there is a valid page and if this page may be viewed by the user
$pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
$access = is_array($pageinfo) ? 1 : 0;
$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
$access = is_array($this->pageinfo) ? 1 : 0;
if ($this->id && $access) {
$this->doc = t3lib_div::makeInstance("template");
$this->doc->backPath = $BACK_PATH;
$this->doc->setModuleTemplate('templates/tstemplate.html');
$this->doc->docType = 'xhtml_trans';
$this->doc->form = '<form action="index.php?id='.$this->id.'" method="post" enctype="'.$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["form_enctype"].'" name="editForm">';
// JavaScript
$this->doc->JScode = '
<script language="javascript" type="text/javascript">
......
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
$headerSection = $this->doc->getHeader("pages",$pageinfo,$pageinfo["_thePath"]).'<br>'.
$LANG->sL("LLL:EXT:lang/locallang_core.php:labels.path").': '.
'<span title="'.htmlspecialchars($pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($pageinfo['_thePath'],-50)).'</span>';
// Draw the header.
$this->doc->form='<form action="index.php?id='.$this->id.'" method="post" enctype="'.$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["form_enctype"].'" name="editForm">';
$this->content.=$this->doc->startPage("Template Tools");
$this->content.=$this->doc->header("Template Tools");
$this->content.=$this->doc->spacer(5);
$this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,"SET[function]",$this->MOD_SETTINGS["function"],$this->MOD_MENU["function"])));
// Build the modulle content
$this->content = $this->doc->header("Template Tools");
$this->extObjContent();
// ShortCut
if ($BE_USER->mayMakeShortcut()) {
$this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon("id,e,sObj,template","function,ts_browser_type,constant_editor_cat",$this->MCONF["name"]));
}
$this->content.=$this->doc->spacer(10);
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markerArray = array(
'CSH' => $docHeaderButtons['csh'],
'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']),
'CONTENT' => $this->content
);
// Build the <body> for the module
$this->content = $this->doc->startPage('Template Tools');
$this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markerArray);
$this->content.= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
} else {
// If no access or if ID == zero
......
$this->doc->backPath = $BACK_PATH;
$this->content.=$this->doc->startPage("Template Tools");
$this->content.=$this->doc->header("Template Tools");
$this->content.=$this->doc->header($LANG->getLL('moduleTitle', 1));
$this->content.=$this->doc->spacer(5);
......
This is an overview of the pages in the database containing one or more template records. Click a page title to go to the page.
<BR><BR>
'.$table);
// debug($pArray);
// ********************************************
// RENDER LIST of pages with templates, END
// ********************************************
......
}
$this->content.=$this->doc->spacer(10);
$this->content.=$this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
}
function printContent() {
$this->content.=$this->doc->endPage();
function printContent() {
echo $this->content;
}
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an assoc. array
*/
function getButtons() {
global $TCA, $LANG, $BACK_PATH, $BE_USER;
$buttons = array(
'back' => '',
'close' => '',
'save' => '',
'view' => '',
'record_list' => '',
'shortcut' => '',
);
// View page
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $BACK_PATH, t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '">' .
'<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/zoom.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" hspace="3" alt="" />' .
'</a>';
// Shortcut
if ($BE_USER->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
}
// If access to Web>List for user, then link to that module.
if ($BE_USER->check('modules','web_list')) {
$href = $BACK_PATH . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
$buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' .
'<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/list.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' .
'</a>';
}
if($this->extClassConf['name'] == 'tx_tstemplateinfo') {
if(!empty($this->e) && !t3lib_div::_POST('abort')) {
// SAVE button
$buttons['save'] = '<input type="image" class="c-inputButton" name="submit" value="Update"' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/savedok.gif','') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';
// CLOSE button
$buttons['close'] = '<input type="image" class="c-inputButton" name="abort" value="Abort"' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/closedok.gif','') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '" />';
}
} elseif($this->extClassConf['name'] == 'tx_tstemplateceditor' && count($this->MOD_MENU["constant_editor_cat"])) {
// SAVE button
$buttons['save'] = '<input type="image" class="c-inputButton" name="submit" value="Update"' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/savedok.gif','') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';
} elseif($this->extClassConf['name'] == 'tx_tstemplateobjbrowser') {
if(!empty($this->sObj)) {
// BACK
$buttons['back'] = '<a href="index.php?id=' . $this->id . '" class="typo3-goBack">' .
'<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/goback.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1) . '" alt="" />' .
'</a>';
}
}
return $buttons;
}
// ***************************
// OTHER FUNCTIONS:
// ***************************
typo3/sysext/tstemplate/ts/locallang.xml (revision 0)
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<description>Labels for the Web&gt;Template module</description>
<type>module</type>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="moduleTitle">Template tools</label>
<label index="viewTemplates">Viewing templates of</label>moduleTitle
</languageKey>
</data>
</T3locallang>
typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php (working copy)
* localconf-variables:
* $TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"] = "fileadmin/fonts/"; // This is the path (must be in "fileadmin/" !!) where the web_ts/constant-editor submodule fetches online resources. Put fonts (ttf) and standard images here!
*
* @author Kasper Sk?rh?j <kasperYYYY@typo3.com>
* @author Kasper Sk�rh�j <kasperYYYY@typo3.com>
*/
require_once(PATH_t3lib."class.t3lib_extobjbase.php");
......
$printFields = trim($tmpl->ext_printFields($theConstants,$category));
if ($printFields) {
$theOutput.=$this->pObj->doc->spacer(20);
$theOutput.=$this->pObj->doc->section("",'<input type="Submit" name="submit" value="Update">');
$theOutput.=$this->pObj->doc->spacer(15);
$theOutput.=$this->pObj->doc->section("",$printFields);
$theOutput.=$this->pObj->doc->spacer(10);
$theOutput.=$this->pObj->doc->section("",'<input type="Submit" name="submit" value="Update">');
}
if ($BE_USER_modOptions["properties"]["constantEditor."]["example"]!="top") {
$theOutput=$this->displayExample($theOutput);
}
$theOutput.=$this->pObj->doc->spacer(10);
$theOutput.=$this->pObj->doc->section("Cache",'Click here to <a href="index.php?id='.$this->pObj->id.'&clear_all_cache=1"><strong>clear all cache</strong></a>',0,1);
} else {
$theOutput.=$this->pObj->noTemplate(1);
}
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php (working copy)
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* @author Kasper Sk?rh?j <kasperYYYY@typo3.com>
* @author Kasper Sk�rh�j <kasperYYYY@typo3.com>
*/
/**
* [CLASS/FUNCTION INDEX of SCRIPT]
......
unset($e);
}
if (is_array($e)) {
$theOutput.= $this->pObj->doc->section('', '<BR><input type="Submit" name="submit" value="Update"> <input type="Submit" name="abort" value="Cancel">');
}
if ($e['title']) {
$outCode = '<input type="Text" name="data[title]" value="'.htmlspecialchars($tplRow['title']).'"'.$this->pObj->doc->formWidth().'>';
$outCode.= '<input type="Hidden" name="e[title]" value="1">';
......
$theOutput.= $this->pObj->doc->section('Setup:', '');
$theOutput.= $this->pObj->doc->sectionEnd().$outCode;
}
if (is_array($e)) {
$theOutput.=$this->pObj->doc->section('', '<BR><input type="Submit" name="submit" value="Update"> <input type="Submit" name="abort" value="Cancel">');
}
// Processing:
$outCode = '';
......
$theOutput.= $this->pObj->doc->spacer(25);
$theOutput.= $this->pObj->doc->section('', $outCode);
$theOutput.= $this->pObj->doc->spacer(10);
$theOutput.= $this->pObj->doc->section(
'Cache',
'Click here to <a href="index.php?id='.$this->pObj->id.'&clear_all_cache=1"><strong>clear all cache</strong></a>.<BR><br>Status: '.$this->pObj->getCountCacheTables(1),
0, 1
);
} else {
$theOutput.= $this->pObj->noTemplate(1);
}
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php (working copy)
}
$theOutput.=$this->pObj->doc->section("",'<NOBR>'.$menu.'</NOBR>');
$theOutput.=$this->pObj->doc->spacer(10);
$theOutput.=$this->pObj->doc->section("Cache",'Click here to <a href="index.php?id='.$this->pObj->id.'&clear_all_cache=1"><strong>clear all cache</strong></a>',0,1);
// Ending section:
$theOutput.=$this->pObj->doc->sectionEnd();
}
typo3/templates/tstemplate.html (revision 0)
<!-- ###FULLDOC### begin -->
<div class="typo3-fullDoc">
<!-- Page header with buttons, path details and csh -->
<div id="typo3-docheader">
<div id="typo3-docheader-row1">
<div class="buttonsleft">###BUTTONLIST_LEFT###</div>
<div class="buttonsright">###BUTTONLIST_RIGHT######FUNC_MENU###</div>
</div>
<div id="typo3-docheader-row2">
<div class="pagepath">###CSH######PAGEPATH###</div>
<div class="infooptions">###PAGEINFO###</div>
</div>
</div>
<!-- Content of module, for instance listing, info or editing -->
<div id="typo3-docbody">
###CONTENT###
</div>
</div>
<!-- ###FULLDOC### end -->
<!-- Grouping the icons on top -->
<!-- ###BUTTON_GROUP_WRAP### -->
<div class="buttongroup">###BUTTONS###</div>
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUP1### -->###BACK###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUP2### -->###CLOSE###<!-- ###BUTTON_GROUP2### -->
<!-- ###BUTTON_GROUP3### -->###SAVE###<!-- ###BUTTON_GROUP3### -->
<!-- ###BUTTON_GROUP4### -->###VIEW###<!-- ###BUTTON_GROUP4### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
<!-- ###BUTTON_GROUP1### -->###RECORD_LIST######SHORTCUT###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
typo3/templates/tstemplate.html (revision 0)
<!-- ###FULLDOC### begin -->
<div class="typo3-fullDoc">
<!-- Page header with buttons, path details and csh -->
<div id="typo3-docheader">
<div id="typo3-docheader-row1">
<div class="buttonsleft">###BUTTONLIST_LEFT###</div>
<div class="buttonsright">###BUTTONLIST_RIGHT######FUNC_MENU###</div>
</div>
<div id="typo3-docheader-row2">
<div class="pagepath">###CSH######PAGEPATH###</div>
<div class="infooptions">###PAGEINFO###</div>
</div>
</div>
<!-- Content of module, for instance listing, info or editing -->
<div id="typo3-docbody">
###CONTENT###
</div>
</div>
<!-- ###FULLDOC### end -->
<!-- Grouping the icons on top -->
<!-- ###BUTTON_GROUP_WRAP### -->
<div class="buttongroup">###BUTTONS###</div>
<!-- ###BUTTON_GROUP_WRAP### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUP1### -->###BACK###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUP2### -->###CLOSE###<!-- ###BUTTON_GROUP2### -->
<!-- ###BUTTON_GROUP3### -->###SAVE###<!-- ###BUTTON_GROUP3### -->
<!-- ###BUTTON_GROUP4### -->###VIEW###<!-- ###BUTTON_GROUP4### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
<!-- ###BUTTON_GROUP1### -->###RECORD_LIST######SHORTCUT###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
(18-18/19)