📄 class.tx_tstemplateobjbrowser.php
字号:
} } } $tsbr = t3lib_div::_GET('tsbr'); $update=0; if (is_array($tsbr)) { // If any plus-signs were clicked, it's registred. $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType]); $update=1; } if ($POST["Submit"]) { // If any POST-vars are send, update the condition array $this->pObj->MOD_SETTINGS["tsbrowser_conditions"] = $POST["conditions"]; $update=1; } if ($update) { $GLOBALS["BE_USER"]->pushModuleData($this->pObj->MCONF["name"],$this->pObj->MOD_SETTINGS); } $tmpl->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions']; $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. $tmpl->constantMode = $this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"] ? "" : $this->pObj->MOD_SETTINGS["ts_browser_const"]; if ($this->pObj->sObj && $tmpl->constantMode) {$tmpl->constantMode = "untouched";} $tmpl->regexMode = $this->pObj->MOD_SETTINGS["ts_browser_regexsearch"]; $tmpl->fixedLgd=$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"];# $tmpl->linkObjects=$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"]; $tmpl->linkObjects = TRUE; $tmpl->ext_regLinenumbers = TRUE; $tmpl->bType=$bType; $tmpl->resourceCheck=1; $tmpl->uplPath = PATH_site.$tmpl->uplPath; $tmpl->removeFromGetFilePath = PATH_site; //debug($tmpl->uplPath); if ($this->pObj->MOD_SETTINGS["ts_browser_type"]=="const") { $tmpl->ext_constants_BRP=intval(t3lib_div::_GP("breakPointLN")); } else { $tmpl->ext_config_BRP=intval(t3lib_div::_GP("breakPointLN")); } $tmpl->generateConfig(); if ($bType=="setup") { $theSetup = $tmpl->setup; } else { $theSetup = $tmpl->setup_constants; } // EDIT A VALUE: if ($this->pObj->sObj) { list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->sObj?$this->pObj->sObj:"")); $theOutput.=$this->pObj->doc->divider(5); if ($existTemplate) { // Value $out = ''; $out.= $this->pObj->sObj.' =<br />'; $out.='<input type="Text" name="data['.$this->pObj->sObj.'][value]" value="'.htmlspecialchars($theSetupValue).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>'; $out.='<input type="Submit" name="update_value" value="Update">'; $theOutput.=$this->pObj->doc->section("Edit object/property value:",$out,0,0); // Property if (t3lib_extMgm::isLoaded("tsconfig_help")) { $url=$BACK_PATH."wizard_tsconfig.php?mode=tsref&onlyProperty=1"; $params=array(); $params["formName"]="editForm"; $params["itemName"]="data[".$this->pObj->sObj."][name]"; $params["itemValue"]="data[".$this->pObj->sObj."][propertyValue]"; $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>'; } else $TSicon=""; $out=""; $out="<nobr>".$this->pObj->sObj."."; $out.='<input type="Text" name="data['.$this->pObj->sObj.'][name]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'>'.$TSicon.' = </nobr><BR>'; $out.='<input type="Text" name="data['.$this->pObj->sObj.'][propertyValue]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>'; $out.='<input type="Submit" name="add_property" value="Add">'; $theOutput.=$this->pObj->doc->spacer(20); $theOutput.=$this->pObj->doc->section("Add object property:",$out,0,0); // clear $out=""; $out=$this->pObj->sObj." <b>CLEAR?</b> "; $out.='<input type="Checkbox" name="data['.$this->pObj->sObj.'][clearValue]" value="1">'; $out.='<input type="Submit" name="clear_object" value="Clear">'; $theOutput.=$this->pObj->doc->spacer(20); $theOutput.=$this->pObj->doc->section("Clear object:",$out,0,0); $theOutput.=$this->pObj->doc->spacer(10); } else { $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); } // Links: $out=''; if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][$this->pObj->sObj]) { if (count($theSetup)) { $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)'; } } else { $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)'; } if ($out) { $theOutput.=$this->pObj->doc->divider(5); $theOutput.=$this->pObj->doc->section("",$out); } // back $out = "< Back"; $out = '<a href="index.php?id='.$this->pObj->id.'"><b>'.$out.'</b></a>'; $theOutput.=$this->pObj->doc->divider(5); $theOutput.=$this->pObj->doc->section("",$out); } else { $tmpl->tsbrowser_depthKeys=$this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType]; // debug($tmpl->tsbrowser_depthKeys); if (t3lib_div::_POST('search') && t3lib_div::_POST('search_field')) { // If any POST-vars are send, update the condition array $tmpl->tsbrowser_depthKeys = $tmpl->ext_getSearchKeys($theSetup, '', t3lib_div::_POST('search_field'), array()); // debug($tmpl->tsbrowser_depthKeys); // debug($tmpl->tsbrowser_searchKeys); } // Expanding menu /* if (is_array($theSetup)) { reset($theSetup); while(list($tkey,$tval)=each($theSetup)) { if (substr($tkey,-1)==".") { $tkey=substr($tkey,0,-1); } if ($theSetup[$tkey."."] && $tkey!="types" && $tkey!="TSConstantEditor") { $this->pObj->MOD_MENU["ts_browser_toplevel_".$bType][$tkey]=$tkey; } } }*/ $theOutput.=$this->pObj->doc->spacer(5); $theOutput.=$this->pObj->doc->section('Object tree:','',0,1); $menu = 'Browse: '.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[ts_browser_type]',$bType,$this->pObj->MOD_MENU['ts_browser_type']); $menu.= ' 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]); $theOutput.=$this->pObj->doc->section('','<NOBR>'.$menu.'</NOBR>'); $theKey=$this->pObj->MOD_SETTINGS["ts_browser_toplevel_".$bType]; if (!$theKey || !str_replace("-","",$theKey)) {$theKey="";} list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType]?$this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType]:'')); $tree = $tmpl->ext_getObjTree($theSetup, $theKey, '', '', $theSetupValue, $this->pObj->MOD_SETTINGS['ts_browser_alphaSort']); $tree = $tmpl->substituteCMarkers($tree); // Parser Errors: $pEkey = ($bType=="setup"?"config":"constants"); if (count($tmpl->parserErrors[$pEkey])) { reset($tmpl->parserErrors[$pEkey]); $errMsg=array(); while(list(,$inf)=each($tmpl->parserErrors[$pEkey])) { $errMsg[]=($inf[1]).": ".$inf[0]; } $theOutput.=$this->pObj->doc->spacer(10); $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Errors and warnings"),implode($errMsg,"<br>"),0,1,0,1); } if (isset($this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType][$theKey])) { $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>'; } else { $remove=''; } $label = $theKey ? $theKey : ($bType=="setup"?"SETUP ROOT":"CONSTANTS ROOT"); $theOutput.=$this->pObj->doc->spacer(15); $theOutput.=$this->pObj->doc->sectionEnd(); $theOutput.='<table border=0 cellpadding=1 cellspacing=0 id="typo3-objectBrowser"> <tr> <td><img src=clear.gif width=4 height=1></td> <td class="bgColor2"> <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr><td nowrap width="99%"><b>'.$label.'</b></td>'.$remove.'</tr></table> </td> </tr> <tr> <td><img src=clear.gif width=4 height=1></td> <td class="bgColor2"> <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> </tr> </table> '; // Conditions: if (is_array($tmpl->sections)) { $theOutput.=$this->pObj->doc->divider(15); $out=""; reset($tmpl->sections); while(list($key,$val)=each($tmpl->sections)) { $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> </td></tr>'; } $theOutput.=' <table border=0 cellpadding=1 cellspacing=0> <tr> <td><img src=clear.gif width=4 height=1></td> <td class="bgColor2"> <table border=0 cellpadding=0 cellspacing=0 class="bgColor4">'.$out.' <tr> <td> </td> <td><img src=clear.gif height=10 width=240><BR><input type="Submit" name="Submit" value="Set conditions"><BR></td> </tr> </table> </td> </tr> </table> '; } // Search: $theOutput.='<br> <table border=0 cellpadding=1 cellspacing=0> <tr> <td><img src=clear.gif width=4 height=1></td> <td class="bgColor2"> <table border=0 cellpadding=0 cellspacing=0 class="bgColor4"> <tr> <td> Enter search phrase: <input type="Text" name="search_field" value="'.htmlspecialchars($POST["search_field"]).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'></td> <td><input type="Submit" name="search" value="Search"></td> </tr> <tr> <td> <label for="checkTs_browser_regexsearch">Use ereg(), not stristr():</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_regexsearch]",$this->pObj->MOD_SETTINGS["ts_browser_regexsearch"],'','','id="checkTs_browser_regexsearch"').'</td> <td> </td> </tr> </table> </td> </tr> </table> <br> '; // Menu in the bottom: $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"'); #$menu.= " Enable object links".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_linkObjects]",$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"]); $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"'); if ($bType=="setup" && !$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"]) { $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"]); } $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(); } return $theOutput; }}if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"]) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"]);}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -