Public Member Functions | |
| init () | |
| Initializing the module. | |
| menuConfig () | |
| Initialize function menu array. | |
| clearCache () | |
| Clears page cache for the current id, $this->id. | |
| main () | |
| Main function, starting the rendering of the list. | |
| printContent () | |
| Outputting the accumulated content to screen. | |
Public Attributes | |
| $id | |
| $pointer | |
| $imagemode | |
| $table | |
| $search_field | |
| $search_levels | |
| $showLimit | |
| $returnUrl | |
| $clear_cache | |
| $cmd | |
| $cmd_table | |
| $perms_clause | |
| $modTSconfig | |
| $pageinfo | |
| $doc | |
| $MCONF = array() | |
| $MOD_MENU = array() | |
| $MOD_SETTINGS = array() | |
| $include_once = array() | |
| $content | |
|
|
Clears page cache for the current id, $this->id.
Definition at line 181 of file db_list.php. 00181 {
00182 if ($this->clear_cache) {
00183 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
00184 $tce->stripslashes_values=0;
00185 $tce->start(Array(),Array());
00186 $tce->clear_cacheCmd($this->id);
00187 }
00188 }
|
|
|
Initializing the module.
Definition at line 125 of file db_list.php. References menuConfig(), PATH_t3lib, and table(). 00125 {
00126 global $BE_USER;
00127
00128 // Setting module configuration / page select clause
00129 $this->MCONF = $GLOBALS['MCONF'];
00130 $this->perms_clause = $BE_USER->getPagePermsClause(1);
00131
00132 // GPvars:
00133 $this->id = t3lib_div::_GP('id');
00134 $this->pointer = t3lib_div::_GP('pointer');
00135 $this->imagemode = t3lib_div::_GP('imagemode');
00136 $this->table = t3lib_div::_GP('table');
00137 $this->search_field = t3lib_div::_GP('search_field');
00138 $this->search_levels = t3lib_div::_GP('search_levels');
00139 $this->showLimit = t3lib_div::_GP('showLimit');
00140 $this->returnUrl = t3lib_div::_GP('returnUrl');
00141
00142 $this->clear_cache = t3lib_div::_GP('clear_cache');
00143 $this->cmd = t3lib_div::_GP('cmd');
00144 $this->cmd_table = t3lib_div::_GP('cmd_table');
00145
00146 // Initialize menu
00147 $this->menuConfig();
00148
00149 // Inclusions?
00150 if ($this->clear_cache || $this->cmd=='delete') {
00151 $this->include_once[]=PATH_t3lib.'class.t3lib_tcemain.php';
00152 }
00153 }
|
|
|
Main function, starting the rendering of the list.
Definition at line 195 of file db_list.php. References $CLIENT, $cmd, t3lib_BEfunc::getSetUpdateSignal(), t3lib_BEfunc::readPageAccess(), and table(). 00195 {
00196 global $BE_USER,$LANG,$BACK_PATH,$CLIENT;
00197
00198 // Start document template object:
00199 $this->doc = t3lib_div::makeInstance('template');
00200 $this->doc->backPath = $BACK_PATH;
00201 $this->doc->docType='xhtml_trans';
00202
00203 // Loading current page record and checking access:
00204 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
00205 $access = is_array($this->pageinfo) ? 1 : 0;
00206
00207 // Initialize the dblist object:
00208 $dblist = t3lib_div::makeInstance('localRecordList');
00209 $dblist->backPath = $BACK_PATH;
00210 $dblist->calcPerms = $BE_USER->calcPerms($this->pageinfo);
00211 $dblist->thumbs = $BE_USER->uc['thumbnailsByDefault'];
00212 $dblist->returnUrl=$this->returnUrl;
00213 $dblist->allFields = ($this->MOD_SETTINGS['bigControlPanel'] || $this->table) ? 1 : 0;
00214 $dblist->localizationView = $this->MOD_SETTINGS['localization'];
00215 $dblist->showClipboard = 1;
00216 $dblist->disableSingleTableView = $this->modTSconfig['properties']['disableSingleTableView'];
00217 $dblist->listOnlyInSingleTableMode = $this->modTSconfig['properties']['listOnlyInSingleTableView'];
00218 $dblist->clickTitleMode = $this->modTSconfig['properties']['clickTitleMode'];
00219 $dblist->alternateBgColors=$this->modTSconfig['properties']['alternateBgColors']?1:0;
00220 $dblist->allowedNewTables = t3lib_div::trimExplode(',',$this->modTSconfig['properties']['allowedNewTables'],1);
00221 $dblist->newWizards=$this->modTSconfig['properties']['newWizards']?1:0;
00222
00223
00224
00225 // Clipboard is initialized:
00226 $dblist->clipObj = t3lib_div::makeInstance('t3lib_clipboard'); // Start clipboard
00227 $dblist->clipObj->initializeClipboard(); // Initialize - reads the clipboard content from the user session
00228
00229 // Clipboard actions are handled:
00230 $CB = t3lib_div::_GET('CB'); // CB is the clipboard command array
00231 if ($this->cmd=='setCB') {
00232 // CBH is all the fields selected for the clipboard, CBC is the checkbox fields which were checked. By merging we get a full array of checked/unchecked elements
00233 // This is set to the 'el' array of the CB after being parsed so only the table in question is registered.
00234 $CB['el'] = $dblist->clipObj->cleanUpCBC(array_merge(t3lib_div::_POST('CBH'),t3lib_div::_POST('CBC')),$this->cmd_table);
00235 }
00236 if (!$this->MOD_SETTINGS['clipBoard']) $CB['setP']='normal'; // If the clipboard is NOT shown, set the pad to 'normal'.
00237 $dblist->clipObj->setCmd($CB); // Execute commands.
00238 $dblist->clipObj->cleanCurrent(); // Clean up pad
00239 $dblist->clipObj->endClipboard(); // Save the clipboard content
00240
00241 // This flag will prevent the clipboard panel in being shown.
00242 // It is set, if the clickmenu-layer is active AND the extended view is not enabled.
00243 $dblist->dontShowClipControlPanels = $CLIENT['FORMSTYLE'] && !$this->MOD_SETTINGS['bigControlPanel'] && $dblist->clipObj->current=='normal' && !$BE_USER->uc['disableCMlayers'] && !$this->modTSconfig['properties']['showClipControlPanelsDespiteOfCMlayers'];
00244
00245
00246
00247 // If there is access to the page, then render the list contents and set up the document template object:
00248 if ($access) {
00249
00250 // Deleting records...:
00251 // Has not to do with the clipboard but is simply the delete action. The clipboard object is used to clean up the submitted entries to only the selected table.
00252 if ($this->cmd=='delete') {
00253 $items = $dblist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'),$this->cmd_table,1);
00254 if (count($items)) {
00255 $cmd=array();
00256 reset($items);
00257 while(list($iK)=each($items)) {
00258 $iKParts = explode('|',$iK);
00259 $cmd[$iKParts[0]][$iKParts[1]]['delete']=1;
00260 }
00261 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
00262 $tce->stripslashes_values=0;
00263 $tce->start(array(),$cmd);
00264 $tce->process_cmdmap();
00265
00266 if (isset($cmd['pages'])) {
00267 t3lib_BEfunc::getSetUpdateSignal('updatePageTree');
00268 }
00269
00270 $tce->printLogErrorMessages(t3lib_div::getIndpEnv('REQUEST_URI'));
00271 }
00272 }
00273
00274 // Initialize the listing object, dblist, for rendering the list:
00275 $this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
00276 $dblist->start($this->id,$this->table,$this->pointer,$this->search_field,$this->search_levels,$this->showLimit);
00277 $dblist->setDispFields();
00278
00279 // Render the page header:
00280 $dblist->writeTop($this->pageinfo);
00281
00282 // Render versioning selector:
00283 $dblist->HTMLcode.= $this->doc->getVersionSelector($this->id);
00284
00285 // Render the list of tables:
00286 $dblist->generateList($this->id,$this->table);
00287
00288 // Write the bottom of the page:
00289 $dblist->writeBottom();
00290
00291 // Add JavaScript functions to the page:
00292 $this->doc->JScode=$this->doc->wrapScriptTags('
00293 function jumpToUrl(URL) { //
00294 document.location = URL;
00295 return false;
00296 }
00297 function jumpExt(URL,anchor) { //
00298 var anc = anchor?anchor:"";
00299 document.location = URL+(T3_THIS_LOCATION?"&returnUrl="+T3_THIS_LOCATION:"")+anc;
00300 return false;
00301 }
00302 function jumpSelf(URL) { //
00303 document.location = URL+(T3_RETURN_URL?"&returnUrl="+T3_RETURN_URL:"");
00304 return false;
00305 }
00306 '.$this->doc->redirectUrls($dblist->listURL()).'
00307 '.$dblist->CBfunctions().'
00308 function editRecords(table,idList,addParams,CBflag) { //
00309 document.location="'.$backPath.'alt_doc.php?returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')).
00310 '&edit["+table+"]["+idList+"]=edit"+addParams;
00311 }
00312 function editList(table,idList) { //
00313 var list="";
00314
00315 // Checking how many is checked, how many is not
00316 var pointer=0;
00317 var pos = idList.indexOf(",");
00318 while (pos!=-1) {
00319 if (cbValue(table+"|"+idList.substr(pointer,pos-pointer))) {
00320 list+=idList.substr(pointer,pos-pointer)+",";
00321 }
00322 pointer=pos+1;
00323 pos = idList.indexOf(",",pointer);
00324 }
00325 if (cbValue(table+"|"+idList.substr(pointer))) {
00326 list+=idList.substr(pointer)+",";
00327 }
00328
00329 return list ? list : idList;
00330 }
00331
00332 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
00333 ');
00334
00335 // Setting up the context sensitive menu:
00336 $CMparts=$this->doc->getContextMenuCode();
00337 $this->doc->bodyTagAdditions = $CMparts[1];
00338 $this->doc->JScode.=$CMparts[0];
00339 $this->doc->postCode.= $CMparts[2];
00340 } // access
00341
00342
00343
00344 // Begin to compile the whole page, starting out with page header:
00345 $this->content='';
00346 $this->content.=$this->doc->startPage('DB list');
00347 $this->content.= '<form action="'.htmlspecialchars($dblist->listURL()).'" method="post" name="dblistForm">';
00348
00349 // List Module CSH:
00350 if (!strlen($this->id)) {
00351 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_noId', $GLOBALS['BACK_PATH'],'<br/>|');
00352 } elseif (!$this->id) { // zero...:
00353 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_root', $GLOBALS['BACK_PATH'],'<br/>|');
00354 }
00355
00356 // Add listing HTML code:
00357 $this->content.= $dblist->HTMLcode;
00358 $this->content.= '<input type="hidden" name="cmd_table" /><input type="hidden" name="cmd" /></form>';
00359
00360 // List Module CSH:
00361 if ($this->id) {
00362 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH'],'<br/>|');
00363 }
00364
00365
00366 // If a listing was produced, create the page footer with search form etc:
00367 if ($dblist->HTMLcode) {
00368
00369 // Making field select box (when extended view for a single table is enabled):
00370 if ($dblist->table) {
00371 $this->content.=$dblist->fieldSelectBox($dblist->table);
00372 }
00373
00374 // Adding checkbox options for extended listing and clipboard display:
00375 $this->content.='
00376
00377 <!--
00378 Listing options for clipboard and thumbnails
00379 -->
00380 <div id="typo3-listOptions">
00381 <form action="" method="post">';
00382
00383 $this->content.=t3lib_BEfunc::getFuncCheck($this->id,'SET[bigControlPanel]',$this->MOD_SETTINGS['bigControlPanel'],'db_list.php','').' '.$LANG->getLL('largeControl',1).'<br />';
00384 if ($dblist->showClipboard) {
00385 $this->content.=t3lib_BEfunc::getFuncCheck($this->id,'SET[clipBoard]',$this->MOD_SETTINGS['clipBoard'],'db_list.php','').' '.$LANG->getLL('showClipBoard',1).'<br />';
00386 }
00387 $this->content.=t3lib_BEfunc::getFuncCheck($this->id,'SET[localization]',$this->MOD_SETTINGS['localization'],'db_list.php','').' '.$LANG->getLL('localization',1).'<br />';
00388 $this->content.='
00389 </form>
00390 </div>';
00391 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_options', $GLOBALS['BACK_PATH']);
00392
00393 // Printing clipboard if enabled:
00394 if ($this->MOD_SETTINGS['clipBoard'] && $dblist->showClipboard) {
00395 $this->content.= $dblist->clipObj->printClipboard();
00396 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_clipboard', $GLOBALS['BACK_PATH']);
00397 }
00398
00399 // Link for creating new records:
00400 if (!$this->modTSconfig['properties']['noCreateRecordsLink']) {
00401 $this->content.='
00402
00403 <!--
00404 Link for creating a new record:
00405 -->
00406 <div id="typo3-newRecordLink">
00407 <a href="'.htmlspecialchars('db_new.php?id='.$this->id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
00408 '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/new_el.gif','width="11" height="12"').' alt="" />'.
00409 $LANG->getLL('newRecordGeneral',1).
00410 '</a>
00411 </div>';
00412 }
00413
00414 // Search box:
00415 $this->content.=$dblist->getSearchBox();
00416
00417 // Display sys-notes, if any are found:
00418 $this->content.=$dblist->showSysNotesForPage();
00419
00420 // ShortCut:
00421 if ($BE_USER->mayMakeShortcut()) {
00422 $this->content.='<br/>'.$this->doc->makeShortcutIcon('id,imagemode,pointer,table,search_field,search_levels,showLimit,sortField,sortRev',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']);
00423 }
00424 }
00425
00426 // Finally, close off the page:
00427 $this->content.= $this->doc->endPage();
00428 }
|
|
|
Initialize function menu array.
Definition at line 160 of file db_list.php. References t3lib_BEfunc::getModTSconfig(), and t3lib_BEfunc::getModuleData(). Referenced by init(). 00160 {
00161
00162 // MENU-ITEMS:
00163 $this->MOD_MENU = array(
00164 'bigControlPanel' => '',
00165 'clipBoard' => '',
00166 'localization' => ''
00167 );
00168
00169 // Loading module configuration:
00170 $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']);
00171
00172 // Clean up settings:
00173 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
00174 }
|
|
|
Outputting the accumulated content to screen.
Definition at line 435 of file db_list.php. 00435 {
00436 echo $this->content;
00437 }
|
|
|
Definition at line 101 of file db_list.php. |
|
|
Definition at line 102 of file db_list.php. Referenced by main(). |
|
|
Definition at line 103 of file db_list.php. |
|
|
Definition at line 117 of file db_list.php. |
|
|
Definition at line 109 of file db_list.php. |
|
|
Definition at line 92 of file db_list.php. |
|
|
Definition at line 94 of file db_list.php. |
|
|
Definition at line 114 of file db_list.php. |
|
|
Definition at line 111 of file db_list.php. |
|
|
Definition at line 112 of file db_list.php. |
|
|
Definition at line 113 of file db_list.php. |
|
|
Definition at line 107 of file db_list.php. |
|
|
Definition at line 108 of file db_list.php. |
|
|
Definition at line 106 of file db_list.php. |
|
|
Definition at line 93 of file db_list.php. |
|
|
Definition at line 99 of file db_list.php. |
|
|
Definition at line 96 of file db_list.php. |
|
|
Definition at line 97 of file db_list.php. |
|
|
Definition at line 98 of file db_list.php. |
|
|
Definition at line 95 of file db_list.php. |
1.3.8-20040913