Documentation TYPO3 par Ameos

class.tx_tstemplateobjbrowser.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00031 require_once(PATH_t3lib."class.t3lib_extobjbase.php");
00032 
00033 class tx_tstemplateobjbrowser extends t3lib_extobjbase {
00034         function modMenu()      {
00035                 global $LANG;
00036 
00037                 $modMenu = array (
00038                         "ts_browser_type" => array(
00039                                 "setup" => "Setup",
00040                                 "const" => "Constants"
00041                         ),
00042                         "ts_browser_toplevel_setup" => array(
00043                                 "0" => "ALL"
00044                         ),
00045                         "ts_browser_toplevel_const" => array(
00046                                 "0" => "ALL"
00047                         ),
00048                         "ts_browser_const" => array(
00049                                 "0" => "Plain substitution (default)",
00050                                 "subst" => "Substituted constants in green",
00051                                 "const" => "UN-substituted constants in green"
00052                         ),
00053                         "ts_browser_regexsearch" => "",
00054                         "ts_browser_fixedLgd" => "1",
00055                         "ts_browser_linkObjects" => "1",
00056                         'ts_browser_alphaSort' => '1',
00057                 );
00058 
00059                 foreach(array('setup','const') as $bType)       {
00060                         $addKey = t3lib_div::_GET('addKey');
00061                         if (is_array($addKey))  {               // If any plus-signs were clicked, it's registred.
00062                                 reset($addKey);
00063                                 if (current($addKey))   {
00064                                         $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][key($addKey)] = key($addKey);
00065                                 } else {
00066                                         unset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][key($addKey)]);
00067                                 }
00068                                 $GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'],$this->pObj->MOD_SETTINGS);
00069                         }
00070 
00071                         if (count($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType]))      {
00072                                 $modMenu['ts_browser_toplevel_'.$bType]['-']='---';
00073                                 $modMenu['ts_browser_toplevel_'.$bType] = $modMenu['ts_browser_toplevel_'.$bType] + $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType];
00074                         }
00075                 }
00076 
00077                 return $modMenu;
00078         }
00079 
00088         function verify_TSobjects($propertyArray,$parentType,$parentValue)      {
00089                 $TSobjTable = array(
00090                         "PAGE" => array(
00091                                 "prop" => array (
00092                                         "typeNum" => "int",
00093                                         "1,2,3" => "COBJ",
00094                                         "bodyTag" => "string"
00095                                 )
00096                         ),
00097                         "TEXT" => array(
00098                                 "prop" => array (
00099                                         "value" => "string"
00100                                 )
00101                         ),
00102                         "HTML" => array(
00103                                 "prop" => array (
00104                                         "value" => "stdWrap"
00105                                 )
00106                         ),
00107                         "stdWrap" => array(
00108                                 "prop" => array (
00109                                         "field" => "string",
00110                                         "current" => "boolean"
00111                                 )
00112                         ),
00113                 );
00114                 $TSobjDataTypes = array(
00115                         "COBJ" => "TEXT,CONTENT",
00116                         "PAGE" => "PAGE",
00117                         "stdWrap" => ""
00118                 );
00119 
00120                 if ($parentType)        {
00121                         if (isset($TSobjDataTypes[$parentType]) && (!$TSobjDataTypes[$parentType] || t3lib_div::inlist($TSobjDataTypes[$parentType],$parentValue)))     {
00122                                 $ObjectKind = $parentValue;
00123                         } else {
00124                                 $ObjectKind = "";       // Object kind is "" if it should be known.
00125                         }
00126                 } else {
00127                         $ObjectKind = $parentValue;     // If parentType is not given, then it can be anything. Free.
00128                 }
00129 
00130                 if ($ObjectKind && is_array($TSobjTable[$ObjectKind]))  {
00131                         $result=array();
00132                         if (is_array($propertyArray))           {
00133                                 reset($propertyArray);
00134                                 while(list($key,$val)=each($propertyArray))     {
00135                                         if (t3lib_div::testInt($key))   {       // If num-arrays
00136                                                 $result[$key]=$TSobjTable[$ObjectKind]["prop"]["1,2,3"];
00137                                         } else {        // standard
00138                                                 $result[$key]=$TSobjTable[$ObjectKind]["prop"][$key];
00139                                         }
00140                                 }
00141                         }
00142                         return $result;
00143                 }
00144         }
00145 
00153         function initialize_editor($pageId,$template_uid=0)     {
00154                         // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
00155                 global $tmpl,$tplRow,$theConstants;
00156 
00157                 $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
00158                 $tmpl->tt_track = 0;    // Do not log time-performance information
00159                 $tmpl->init();
00160 
00161                                 // Gets the rootLine
00162                 $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
00163                 $rootLine = $sys_page->getRootLine($pageId);
00164                 $tmpl->runThroughTemplates($rootLine,$template_uid);    // This generates the constants/config + hierarchy info for the template.
00165 
00166                 $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid);   // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
00167                 if (is_array($tplRow))  {       // IF there was a template...
00168                         return 1;
00169                 }
00170         }
00171 
00177         function main() {
00178                 global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00179                 global $tmpl,$tplRow,$theConstants;
00180 
00181                 $POST = t3lib_div::_POST();
00182 
00183                 // **************************
00184                 // Checking for more than one template an if, set a menu...
00185                 // **************************
00186                 $manyTemplatesMenu = $this->pObj->templateMenu();
00187                 $template_uid = 0;
00188                 if ($manyTemplatesMenu) {
00189                         $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
00190                 }
00191 
00192 
00193 
00194 
00195 
00196                 // **************************
00197                 // Main
00198                 // **************************
00199 
00200                 // BUGBUG: Should we check if the uset may at all read and write template-records???
00201                 $bType= $this->pObj->MOD_SETTINGS["ts_browser_type"];
00202                 $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid);               // initialize
00203                 if ($existTemplate)     {
00204                         $theOutput.=$this->pObj->doc->divider(5);
00205                         $theOutput.=$this->pObj->doc->section("Current template:",'<img src="'.$BACK_PATH.t3lib_iconWorks::getIcon("sys_template",$tplRow).'" width=18 height=16 align=top><b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"], ($bType=="setup"?"config":"constants")).'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''),0,0);
00206                         if ($manyTemplatesMenu) {
00207                                 $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
00208                                 $theOutput.=$this->pObj->doc->divider(5);
00209                         }
00210 
00211                         if ($POST["add_property"] || $POST["update_value"] || $POST["clear_object"])    {
00212                                         // add property
00213                                 $line="";
00214                 //              debug($POST);
00215                                 if (is_array($POST["data"]))    {
00216                                         if ($POST["add_property"])      {
00217                                                 reset($POST["data"]);
00218                                                 $name = key($POST["data"]);
00219                                                 $property = trim($POST["data"][$name]["name"]);
00220                                                 if (ereg_replace("[^a-zA-Z0-9_\.]*","",$property)!=$property)   {
00221                                                         $theOutput.=$this->pObj->doc->spacer(10);
00222                                                         $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("BAD PROPERTY!"),'You must enter a property with characters a-z, A-Z and 0-9, no spaces!<BR>Nothing was updated!',0,0,0,1);
00223                                                 } else {
00224                                                         $pline= $name.".".$property." = ".trim($POST["data"][$name]["propertyValue"]);
00225                                                         $theOutput.=$this->pObj->doc->spacer(10);
00226                                                         $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("PROPERTY ADDED"),htmlspecialchars($pline),0,0,0,1);
00227                                                         $line.=chr(10).$pline;
00228                                                 }
00229                                         }
00230                                         if ($POST["update_value"])      {
00231                                                 reset($POST["data"]);
00232                                                 $name = key($POST["data"]);
00233                                                 $pline= $name." = ".trim($POST["data"][$name]["value"]);
00234                                                 $theOutput.=$this->pObj->doc->spacer(10);
00235                                                 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("VALUE UPDATED"),htmlspecialchars($pline),0,0,0,1);
00236                                                 $line.=chr(10).$pline;
00237                                         }
00238                                         if ($POST["clear_object"])      {
00239                                                 reset($POST["data"]);
00240                                                 $name = key($POST["data"]);
00241                                                 if ($POST["data"][$name]["clearValue"]) {
00242                                                         $pline= $name." >";
00243                                                         $theOutput.=$this->pObj->doc->spacer(10);
00244                                                         $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Object cleared"),htmlspecialchars($pline),0,0,0,1);
00245                                                         $line.=chr(10).$pline;
00246                                                 }
00247                                         }
00248                                 }
00249                                 if ($line)      {
00250                                         require_once (PATH_t3lib."class.t3lib_tcemain.php");
00251                                         $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
00252                                                 // Set the data to be saved
00253                                         $recData=array();
00254                                         $field =$bType=="setup"?"config":"constants";
00255                                         $recData["sys_template"][$saveId][$field] = $tplRow[$field].$line;
00256                                                 // Create new  tce-object
00257                                         $tce = t3lib_div::makeInstance("t3lib_TCEmain");
00258                                         $tce->stripslashes_values=0;
00259                                                 // Initialize
00260                                         $tce->start($recData,Array());
00261                                                 // Saved the stuff
00262                                         $tce->process_datamap();
00263                                                 // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
00264                                         $tce->clear_cacheCmd("all");
00265 
00266                                                 // re-read the template ...
00267                                         $this->initialize_editor($this->pObj->id,$template_uid);
00268                                 }
00269                         }
00270                 }
00271 
00272                 $tsbr = t3lib_div::_GET('tsbr');
00273                 $update=0;
00274                 if (is_array($tsbr))    {               // If any plus-signs were clicked, it's registred.
00275                         $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType]);
00276                         $update=1;
00277                 }
00278 
00279                 if ($POST["Submit"])    {               // If any POST-vars are send, update the condition array
00280                         $this->pObj->MOD_SETTINGS["tsbrowser_conditions"] = $POST["conditions"];
00281                         $update=1;
00282                 }
00283                 if ($update)    { $GLOBALS["BE_USER"]->pushModuleData($this->pObj->MCONF["name"],$this->pObj->MOD_SETTINGS); }
00284 
00285 
00286                 $tmpl->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions'];
00287                 $tmpl->matchAlternative[] = 'dummydummydummydummydummydummydummydummydummydummydummy';  // This is just here to make sure that at least one element is in the array so that the tsparser actually uses this array to match.
00288 
00289                 $tmpl->constantMode = $this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"] ? "" : $this->pObj->MOD_SETTINGS["ts_browser_const"];
00290                 if ($this->pObj->sObj && $tmpl->constantMode)   {$tmpl->constantMode = "untouched";}
00291 
00292                 $tmpl->regexMode = $this->pObj->MOD_SETTINGS["ts_browser_regexsearch"];
00293                 $tmpl->fixedLgd=$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"];
00294 #               $tmpl->linkObjects=$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"];
00295                 $tmpl->linkObjects = TRUE;
00296                 $tmpl->ext_regLinenumbers = TRUE;
00297                 $tmpl->bType=$bType;
00298                 $tmpl->resourceCheck=1;
00299                 $tmpl->uplPath = PATH_site.$tmpl->uplPath;
00300                 $tmpl->removeFromGetFilePath = PATH_site;
00301                 //debug($tmpl->uplPath);
00302 
00303                 if ($this->pObj->MOD_SETTINGS["ts_browser_type"]=="const")      {
00304                         $tmpl->ext_constants_BRP=intval(t3lib_div::_GP("breakPointLN"));
00305                 } else {
00306                         $tmpl->ext_config_BRP=intval(t3lib_div::_GP("breakPointLN"));
00307                 }
00308                 $tmpl->generateConfig();
00309 
00310                 if ($bType=="setup")    {
00311                         $theSetup = $tmpl->setup;
00312                 } else {
00313                         $theSetup = $tmpl->setup_constants;
00314                 }
00315 
00316                         // EDIT A VALUE:
00317                 if ($this->pObj->sObj)  {
00318                         list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->sObj?$this->pObj->sObj:""));
00319                         $theOutput.=$this->pObj->doc->divider(5);
00320                         if ($existTemplate)     {
00321                                         // Value
00322                                 $out="";
00323                                 $out=$this->pObj->sObj." =<BR>";
00324                                 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][value]" value="'.htmlspecialchars($theSetupValue).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>';
00325                                 $out.='<input type="Submit" name="update_value" value="Update">';
00326                                 $theOutput.=$this->pObj->doc->section("Edit object/property value:",$out,0,0);
00327 
00328                                         // Property
00329                                 if (t3lib_extMgm::isLoaded("tsconfig_help"))    {
00330                                         $url=$BACK_PATH."wizard_tsconfig.php?mode=tsref&onlyProperty=1";
00331                                         $params=array();
00332                                         $params["formName"]="editForm";
00333                                         $params["itemName"]="data[".$this->pObj->sObj."][name]";
00334                                         $params["itemValue"]="data[".$this->pObj->sObj."][propertyValue]";
00335                                         $TSicon='<a href="#" onClick="vHWin=window.open(\''.$url.t3lib_div::implodeArrayForUrl("",array("P"=>$params)).'\',\'popUp'.$md5ID.'\',\'height=500,width=780,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;"><img src="'.$BACK_PATH.'gfx/wizard_tsconfig_s.gif" width="22" height="16" border="0" class="absmiddle" hspace=2 title="TSref reference"></a>';
00336                                 } else $TSicon="";
00337                                 $out="";
00338                                 $out="<nobr>".$this->pObj->sObj.".";
00339                                 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][name]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'>'.$TSicon.' = </nobr><BR>';
00340                                 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][propertyValue]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>';
00341                                 $out.='<input type="Submit" name="add_property" value="Add">';
00342 
00343 
00344 
00345                                 $theOutput.=$this->pObj->doc->spacer(20);
00346                                 $theOutput.=$this->pObj->doc->section("Add object property:",$out,0,0);
00347 
00348                                         // clear
00349                                 $out="";
00350                                 $out=$this->pObj->sObj." <b>CLEAR?</b> &nbsp;&nbsp;";
00351                                 $out.='<input type="Checkbox" name="data['.$this->pObj->sObj.'][clearValue]" value="1">';
00352                                 $out.='<input type="Submit" name="clear_object" value="Clear">';
00353                                 $theOutput.=$this->pObj->doc->spacer(20);
00354                                 $theOutput.=$this->pObj->doc->section("Clear object:",$out,0,0);
00355 
00356                                 $theOutput.=$this->pObj->doc->spacer(10);
00357                         } else {
00358                                 $theOutput.=$this->pObj->doc->section("EDIT:",$GLOBALS["TBE_TEMPLATE"]->rfw("You cannot edit properties and values, if there's no current template."),0,0,0,1);
00359                         }
00360                                 // Links:
00361                         $out='';
00362                         if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][$this->pObj->sObj]) {
00363                                 if (count($theSetup))   {
00364                                         $out = '<a href="index.php?id='.$this->pObj->id.'&addKey['.$this->pObj->sObj.']=1&SET[ts_browser_toplevel_'.$bType.']='.rawurlencode($this->pObj->sObj).'"><b>Add key</b></a> "'.$this->pObj->sObj.'" to Object List (OL)';
00365                                 }
00366                         } else {
00367                                 $out = '<a href="index.php?id='.$this->pObj->id.'&addKey['.$this->pObj->sObj.']=0&SET[ts_browser_toplevel_'.$bType.']=0"><b>Remove key</b></a> "'.$this->pObj->sObj.'" from Object List (OL)';
00368                         }
00369                         if ($out)       {
00370                                 $theOutput.=$this->pObj->doc->divider(5);
00371                                 $theOutput.=$this->pObj->doc->section("",$out);
00372                         }
00373 
00374                                 // back
00375                         $out = "< Back";
00376                         $out = '<a href="index.php?id='.$this->pObj->id.'"><b>'.$out.'</b></a>';
00377                         $theOutput.=$this->pObj->doc->divider(5);
00378                         $theOutput.=$this->pObj->doc->section("",$out);
00379 
00380                 } else {
00381                         $tmpl->tsbrowser_depthKeys=$this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType];
00382                 //      debug($tmpl->tsbrowser_depthKeys);
00383 
00384                         if (t3lib_div::_POST('search') && t3lib_div::_POST('search_field'))     {               // If any POST-vars are send, update the condition array
00385                                 $tmpl->tsbrowser_depthKeys = $tmpl->ext_getSearchKeys($theSetup, '', t3lib_div::_POST('search_field'), array());
00386                 //              debug($tmpl->tsbrowser_depthKeys);
00387                 //              debug($tmpl->tsbrowser_searchKeys);
00388                         }
00389 
00390 
00391 
00392                         // Expanding menu
00393                 /*      if (is_array($theSetup))        {
00394                                 reset($theSetup);
00395                                 while(list($tkey,$tval)=each($theSetup))        {
00396                                         if (substr($tkey,-1)==".")      {
00397                                                 $tkey=substr($tkey,0,-1);
00398                                         }
00399                                         if ($theSetup[$tkey."."] && $tkey!="types" && $tkey!="TSConstantEditor")        {
00400                                                 $this->pObj->MOD_MENU["ts_browser_toplevel_".$bType][$tkey]=$tkey;
00401                                         }
00402                                 }
00403                         }*/
00404 
00405                         $theOutput.=$this->pObj->doc->spacer(5);
00406                         $theOutput.=$this->pObj->doc->section('Object tree:','',0,1);
00407 
00408                         $menu = 'Browse: '.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[ts_browser_type]',$bType,$this->pObj->MOD_MENU['ts_browser_type']);
00409                         $menu.= '&nbsp;&nbsp;OL: '.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[ts_browser_toplevel_'.$bType.']',$this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType],$this->pObj->MOD_MENU['ts_browser_toplevel_'.$bType]);
00410                         $theOutput.=$this->pObj->doc->section('','<NOBR>'.$menu.'</NOBR>');
00411 
00412 
00413                         $theKey=$this->pObj->MOD_SETTINGS["ts_browser_toplevel_".$bType];
00414                         if (!$theKey || !str_replace("-","",$theKey))   {$theKey="";}
00415                         list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType]?$this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType]:''));
00416                         $tree = $tmpl->ext_getObjTree($theSetup, $theKey, '', '', $theSetupValue, $this->pObj->MOD_SETTINGS['ts_browser_alphaSort']);
00417                         $tree = $tmpl->substituteCMarkers($tree);
00418 
00419 
00420 
00421                                 // Parser Errors:
00422                         $pEkey = ($bType=="setup"?"config":"constants");
00423                         if (count($tmpl->parserErrors[$pEkey])) {
00424                                 reset($tmpl->parserErrors[$pEkey]);
00425                                 $errMsg=array();
00426                                 while(list(,$inf)=each($tmpl->parserErrors[$pEkey]))    {
00427                                         $errMsg[]=($inf[1]).": &nbsp; &nbsp;".$inf[0];
00428                                 }
00429                                 $theOutput.=$this->pObj->doc->spacer(10);
00430                                 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Errors and warnings"),implode($errMsg,"<br>"),0,1,0,1);
00431                         }
00432 
00433 
00434 
00435                         if (isset($this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType][$theKey]))     {
00436                                 $remove='<td width="1%" nowrap><a href="index.php?id='.$this->pObj->id.'&addKey['.$theKey.']=0&SET[ts_browser_toplevel_'.$bType.']=0"><b>Remove key from OL</b></a></td>';
00437                         } else {
00438                                 $remove='';
00439                         }
00440                         $label = $theKey ? $theKey : ($bType=="setup"?"SETUP ROOT":"CONSTANTS ROOT");
00441                         $theOutput.=$this->pObj->doc->spacer(15);
00442                         $theOutput.=$this->pObj->doc->sectionEnd();
00443                         $theOutput.='<table border=0 cellpadding=1 cellspacing=0 id="typo3-objectBrowser">
00444                                         <tr>
00445                                                 <td><img src=clear.gif width=4 height=1></td>
00446                                                 <td class="bgColor2">
00447                                                         <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr><td nowrap width="99%"><b>'.$label.'</b></td>'.$remove.'</tr></table>
00448                                                 </td>
00449                                         </tr>
00450                                         <tr>
00451                                                 <td><img src=clear.gif width=4 height=1></td>
00452                                                 <td class="bgColor2">
00453                                                         <table border=0 cellpadding=0 cellspacing=0 class="bgColor4" width="100%"><tr><td nowrap>'.$tree.'</td></tr></table><img src=clear.gif width=465 height=1></td>
00454                                         </tr>
00455                                 </table>
00456                         ';
00457 
00458 
00459                                 // Conditions:
00460                         if (is_array($tmpl->sections))  {
00461                                 $theOutput.=$this->pObj->doc->divider(15);
00462 
00463                                 $out="";
00464                                 reset($tmpl->sections);
00465                                 while(list($key,$val)=each($tmpl->sections))    {
00466                                         $out.='<tr><td><input type="Checkbox" name="conditions['.$key.']" id="check'.$key.'" value="'.htmlspecialchars($val).'"'.($this->pObj->MOD_SETTINGS["tsbrowser_conditions"][$key]?" checked":"").'></td><td nowrap><label for="check'.$key.'">'.$tmpl->substituteCMarkers(htmlspecialchars($val)).'</label>&nbsp;&nbsp;</td></tr>';
00467                                 }
00468                                 $theOutput.='
00469                                         <table border=0 cellpadding=1 cellspacing=0>
00470                                                 <tr>
00471                                                         <td><img src=clear.gif width=4 height=1></td>
00472                                                         <td class="bgColor2">
00473                                                                 <table border=0 cellpadding=0 cellspacing=0 class="bgColor4">'.$out.'
00474                                                                 <tr>
00475                                                                         <td>&nbsp;</td>
00476                                                                         <td><img src=clear.gif height=10 width=240><BR><input type="Submit" name="Submit" value="Set conditions"><BR></td>
00477                                                                 </tr>
00478                                                                 </table>
00479                                                         </td>
00480                                                 </tr>
00481                                         </table>
00482 
00483                                 ';
00484                         }
00485 
00486                                 // Search:
00487                         $theOutput.='<br>
00488 
00489                                 <table border=0 cellpadding=1 cellspacing=0>
00490                                         <tr>
00491                                                 <td><img src=clear.gif width=4 height=1></td>
00492                                                 <td class="bgColor2">
00493                                                         <table border=0 cellpadding=0 cellspacing=0 class="bgColor4">
00494                                                         <tr>
00495                                                                 <td>&nbsp;Enter search phrase:&nbsp;&nbsp;<input type="Text" name="search_field" value="'.htmlspecialchars($POST["search_field"]).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'></td>
00496                                                                 <td><input type="Submit" name="search" value="Search"></td>
00497                                                         </tr>
00498                                                         <tr>
00499                                                                 <td>&nbsp;<label for="checkTs_browser_regexsearch">Use ereg(), not stristr():</label>&nbsp;&nbsp;'.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_regexsearch]",$this->pObj->MOD_SETTINGS["ts_browser_regexsearch"],'','','id="checkTs_browser_regexsearch"').'</td>
00500                                                                 <td>&nbsp;</td>
00501                                                         </tr>
00502                                                         </table>
00503                                                 </td>
00504                                         </tr>
00505                                 </table>
00506                         <br>
00507                         ';
00508 
00509                                 // Menu in the bottom:
00510                         $menu = '<label for="checkTs_browser_fixedLgd">Crop lines:</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_fixedLgd]",$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"],'','','id="checkTs_browser_fixedLgd"');
00511                         #$menu.= "&nbsp;&nbsp;Enable object links".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_linkObjects]",$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"]);
00512                         $menu .= '<br /><label for="checkTs_browser_alphaSort">Sort alphabetically:</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,'SET[ts_browser_alphaSort]',$this->pObj->MOD_SETTINGS['ts_browser_alphaSort'],'','','id="checkTs_browser_alphaSort"');
00513                         if ($bType=="setup" && !$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"])       {
00514                                 $menu.= "<br />Constants display: ".t3lib_BEfunc::getFuncMenu($this->pObj->id,"SET[ts_browser_const]",$this->pObj->MOD_SETTINGS["ts_browser_const"],$this->pObj->MOD_MENU["ts_browser_const"]);
00515                         }
00516                         $theOutput.=$this->pObj->doc->section("",'<NOBR>'.$menu.'</NOBR>');
00517 
00518                         $theOutput.=$this->pObj->doc->spacer(10);
00519                         $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);
00520 
00521                                 // Ending section:
00522                         $theOutput.=$this->pObj->doc->sectionEnd();
00523                 }
00524                 return $theOutput;
00525         }
00526 }
00527 
00528 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"])     {
00529         include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"]);
00530 }
00531 
00532 ?>


Généré par Les spécialistes TYPO3 avec  doxygen 1.4.6