Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

class.tx_cms_webinfo.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2004 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 ***************************************************************/
00052 require_once(PATH_t3lib.'class.t3lib_pagetree.php');
00053 require_once(PATH_t3lib.'class.t3lib_recordlist.php');
00054 require_once(PATH_typo3.'class.db_list.inc');
00055 require_once(t3lib_extMgm::extPath('cms').'layout/class.tx_cms_layout.php');
00056 require_once(PATH_t3lib.'class.t3lib_extobjbase.php');
00057 
00058 
00066 class tx_cms_webinfo_page extends t3lib_extobjbase {
00067 
00073    function modMenu()   {
00074       global $LANG;
00075       return array (
00076          'pages' => array (
00077             0 => $LANG->getLL('pages_0'),
00078             2 => $LANG->getLL('pages_2'),
00079             1 => $LANG->getLL('pages_1')
00080          ),
00081          'stat_type' => array(
00082             0 => $LANG->getLL('stat_type_0'),
00083             1 => $LANG->getLL('stat_type_1'),
00084             2 => $LANG->getLL('stat_type_2'),
00085          ),
00086          'depth' => array(
00087             0 => $LANG->getLL('depth_0'),
00088             1 => $LANG->getLL('depth_1'),
00089             2 => $LANG->getLL('depth_2'),
00090             3 => $LANG->getLL('depth_3')
00091          )
00092       );
00093    }
00094 
00100    function main()   {
00101       global $BACK_PATH,$LANG,$SOBE;
00102 
00103       $dblist = t3lib_div::makeInstance('tx_cms_layout');
00104       $dblist->descrTable = '_MOD_'.$GLOBALS['MCONF']['name'];
00105       $dblist->backPath = $BACK_PATH;
00106       $dblist->thumbs = 0;
00107       $dblist->script = 'index.php';
00108       $dblist->showIcon = 0;
00109       $dblist->setLMargin=0;
00110       $dblist->agePrefixes=$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears');
00111 
00112       $dblist->pI_showUser=1;
00113       $dblist->pI_showStat=0;
00114 
00115 
00116          // PAGES:
00117       $this->pObj->MOD_SETTINGS['pages_levels']=$this->pObj->MOD_SETTINGS['depth'];    // ONLY for the sake of dblist module which uses this value.
00118 
00119       $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[depth]',$this->pObj->MOD_SETTINGS['depth'],$this->pObj->MOD_MENU['depth'],'index.php');
00120       if ($this->pObj->MOD_SETTINGS['function']=='tx_cms_webinfo_hits') {
00121          $h_func.= t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[stat_type]',$this->pObj->MOD_SETTINGS['stat_type'],$this->pObj->MOD_MENU['stat_type'],'index.php');
00122 
00123          if ($this->pObj->MOD_SETTINGS['stat_type']==1)  $dblist->stat_select_field='rl0';
00124          if ($this->pObj->MOD_SETTINGS['stat_type']==2)  $dblist->stat_select_field='rl1';
00125 
00126             // Timespan
00127          for ($a=0;$a<30;$a++)   {
00128             $dblist->stat_codes[]='HITS_days:'.(-$a);
00129          }
00130          $timespan_b = mktime (0,0,0);
00131          $timespan_e = mktime (0,0,0)-(30-1)*3600*24+1;
00132          $header='<br />'.sprintf($LANG->getLL('stat_period'),t3lib_BEfunc::date($timespan_b),t3lib_BEfunc::date($timespan_e)).'<br />';
00133 
00134             //
00135          $dblist->start($this->pObj->id,'pages',0);
00136          $dblist->pages_noEditColumns=1;
00137          $dblist->generateList();
00138 
00139 
00140          $theOutput.= $this->pObj->doc->section($LANG->getLL('hits_title'),
00141             t3lib_BEfunc::cshItem($dblist->descrTable,'stat',$GLOBALS['BACK_PATH'],'|<br/>').   // CSH
00142                $h_func.
00143                $header.
00144                $dblist->HTMLcode,
00145             0,
00146             1
00147          );
00148       } else {
00149          $h_func.= t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[pages]',$this->pObj->MOD_SETTINGS['pages'],$this->pObj->MOD_MENU['pages'],'index.php');
00150 
00151          $dblist->start($this->pObj->id,'pages',0);
00152          $dblist->generateList();
00153 
00154             // CSH
00155          $theOutput.=$this->pObj->doc->section($LANG->getLL('page_title'),
00156             t3lib_BEfunc::cshItem($dblist->descrTable,'pagetree_overview',$GLOBALS['BACK_PATH'],'|<br/>').  // CSH
00157                $h_func.
00158                $dblist->HTMLcode,
00159             0,
00160             1
00161          );
00162 
00163             // SYS_NOTES:
00164          if (t3lib_extMgm::isLoaded('sys_note'))   {
00165             $dblist->start($this->pObj->id,'sys_note',0);
00166             $dblist->generateList();
00167             if ($dblist->HTMLcode)  {
00168                $theOutput.=$this->pObj->doc->spacer(10);
00169                $theOutput.=$this->pObj->doc->section($LANG->getLL('page_sysnote'),
00170                   $dblist->HTMLcode,
00171                   0,
00172                   1
00173                );
00174             }
00175          }
00176 
00177             // PAGE INFORMATION
00178          if ($this->pObj->pageinfo['uid'])   {
00179             $theOutput.=$this->pObj->doc->spacer(10);
00180             $theOutput.=$this->pObj->doc->section($LANG->getLL('pageInformation'),$dblist->getPageInfoBox($this->pObj->pageinfo,$this->pObj->CALC_PERMS&2),0,1);
00181          }
00182       }
00183 
00184       return $theOutput;
00185    }
00186 }
00187 
00199 class tx_cms_webinfo_hits extends tx_cms_webinfo_page {
00200 }
00201 
00202 
00203 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/web_info/class.tx_cms_webinfo.php']) {
00204    include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/web_info/class.tx_cms_webinfo.php']);
00205 }
00206 ?>

Generated on Sun Oct 3 01:06:00 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913