Documentation TYPO3 par Ameos

index.php

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 ***************************************************************/
00036 unset($MCONF);
00037 require ("conf.php");
00038 require ($BACK_PATH."init.php");
00039 require ($BACK_PATH."template.php");
00040 $LANG->includeLLFile("EXT:plugin_mgm/modules/locallang.php");
00041 require_once (PATH_t3lib."class.t3lib_page.php");
00042 $BE_USER->modAccess($MCONF,1);
00043 
00044 
00045 
00046 // ***************************
00047 // Script Classes
00048 // ***************************
00049 class SC_mod_web_modules_index {
00050         var $MCONF=array();
00051         var $MOD_MENU=array();
00052         var $MOD_SETTINGS=array();
00053         var $doc;       
00054 
00055         var $include_once=array();
00056         var $content;
00057         
00058         var $perms_clause;
00059         var $modTSconfig;
00060         var $pageinfo;
00061         var $access;
00062         var $CMD;
00063         var $module;
00064         var $sys_dmail_uid;
00065         var $pages_uid;
00066         var $id;
00067 
00068         function init() {
00069                 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00070                 global $LOCAL_LANG;
00071                 $this->MCONF = $GLOBALS["MCONF"];
00072                 $this->id = intval(t3lib_div::_GP("id"));
00073 
00074                 $this->CMD = t3lib_div::_GP("CMD");
00075                 $this->sys_dmail_uid = t3lib_div::_GP("sys_dmail_uid");
00076                 $this->pages_uid = t3lib_div::_GP("pages_uid");
00077 
00078                 $this->perms_clause = $BE_USER->getPagePermsClause(1);
00079 
00080                 $this->menuConfig();
00081 
00082                 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
00083                 $this->access = is_array($this->pageinfo) ? 1 : 0;
00084 
00085                 if (!$this->id) {
00086                         $this->pageinfo=array();
00087                         $this->CMD="";
00088                         $this->access=1;
00089                 }
00090                 if ($this->access)      {
00091                         $this->module = $this->pageinfo["module"];
00092                         if (!$this->module)     {
00093                                 $pidrec=t3lib_BEfunc::getRecord("pages",intval($this->pageinfo["pid"]));
00094                                 $this->module=$pidrec["module"];
00095                         }
00096                 }
00097 
00098                 switch((string)$this->module)   {
00099                         case "dmail":
00100                                 if (t3lib_extMgm::isLoaded("direct_mail"))      {
00101                                         $this->include_once[]=PATH_t3lib."class.t3lib_tcemain.php";
00102                                         $this->include_once[]=PATH_t3lib."class.t3lib_pagetree.php";
00103                                         $this->include_once[]=PATH_t3lib."class.t3lib_htmlmail.php";
00104                                         $this->include_once[]=PATH_t3lib."class.t3lib_dmailer.php";
00105                                         $this->include_once[]=PATH_t3lib."class.t3lib_tcemain.php";
00106                                         $this->include_once[]=PATH_t3lib."class.t3lib_readmail.php";
00107                                         $this->include_once[]=PATH_t3lib."class.t3lib_querygenerator.php";
00108                                         $this->include_once[]=t3lib_extMgm::extPath("direct_mail")."mod/class.mod_web_dmail.php";
00109                                         $this->include_once[]=t3lib_extMgm::extPath("direct_mail")."mod/class.mailselect.php";
00110                                 }
00111                         break;
00112                 }
00113         }
00114         function menuConfig()   {
00115                 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00116 
00117                         // MENU-ITEMS:
00118                         // If array, then it's a selector box menu
00119                         // If empty string it's just a variable, that'll be saved. 
00120                         // Values NOT in this array will not be saved in the settings-array for the module.
00121                 $this->MOD_MENU = array(
00122                         "dmail_mode" => array(
00123                                 "news" => $GLOBALS["LANG"]->getLL("dmail_newsletters"),
00124                                 "direct" => "Direct Mails",
00125                                 "quick" => "QuickMail",
00126                                 "recip" => "Recipient list",
00127                                 "conf" => "Module configuration",
00128                                 "mailerengine" => "Mailer Engine Status",
00129                                 "help" => "Instructions"
00130                         ),
00131         
00132                         "dmail_test_email"=>""
00133                 );
00134         
00135         
00136                         // page/be_user TSconfig settings and blinding of menu-items
00137                 $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,"mod.".$this->MCONF["name"]);
00138                 $this->MOD_MENU["function"] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig["properties"],$this->MOD_MENU["function"],"menu.function");
00139                 
00140                         // CLEANSE SETTINGS
00141                 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP("SET"), $this->MCONF["name"]);
00142         }
00143         function main() {
00144                 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
00145 
00146                 // Access check...
00147                 // The page will show only if there is a valid page and if this page may be viewed by the user
00148                 
00149                 if ($this->access)      {
00150                         $this->doc = t3lib_div::makeInstance("mediumDoc");
00151                         $this->doc->backPath = $BACK_PATH;
00152                         $this->doc->JScode = '
00153 <script language="javascript" type="text/javascript">
00154         script_ended = 0;
00155         function jumpToUrl(URL) {
00156                 document.location = URL;
00157         }
00158         function jumpToUrlD(URL)        {
00159                 document.location = URL+"&sys_dmail_uid='.$this->sys_dmail_uid.'";
00160         }
00161 </script>
00162                                 ';
00163                         $this->doc->postCode='
00164 <script language="javascript" type="text/javascript">
00165         script_ended = 1;
00166         if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
00167 </script>
00168                 ';
00169                         $this->doc->form = '<form action="index.php?id='.$this->id.'" method="POST">';
00170                 
00171                         $headerSection = $this->doc->getHeader("pages",$this->pageinfo,$this->pageinfo["_thePath"]).'<br>'.$LANG->sL("LLL:EXT:lang/locallang_core.php:labels.path").': '.t3lib_div::fixed_lgd_pre($this->pageinfo["_thePath"],50);
00172                 
00173                                 // *******************
00174                                 // Draw the header.
00175                                 // *******************
00176                         $this->content.=$this->doc->startPage($LANG->getLL(($this->module?$this->module."_":"")."title"));
00177                         $this->content.=$this->doc->header($LANG->getLL(($this->module?$this->module."_":"")."title"));
00178                         $this->content.=$this->doc->spacer(5);
00179                         $this->content.=$this->doc->section('',$headerSection);
00180                 
00181                         switch((string)$this->module)   {
00182                                 case "shop":
00183                                         $this->content.=$this->doc->section("TODO: FE_USERS-module",nl2br('
00184                                         Here you can:
00185                                         - See the list of orders and modify order-status
00186                                         - Create/edit products on the page and subpages
00187                                         - Setup simple shop-parameters (eg. email/name of ...)
00188                                         '));
00189                                 break;
00190                                 case "board":
00191                                         $this->content.=$this->doc->section("TODO: FE_USERS-module",nl2br('
00192                                         Here you can:
00193                                         - Browse the forums on the page/subpage
00194                                         - Hide/unhide topics
00195                                         - List a thread
00196                                         - Manage forums/categories
00197                                         - Setup simple parameters (eg. admin email/name)
00198                                         '));
00199                                 break;
00200                                 case "dmail":
00201                                                         // Module configuration.
00202                                         $modTSconfig_submod = t3lib_BEfunc::getModTSconfig($this->id,"mod.".$this->MCONF["name"].".dmail");
00203 
00204                                         $SET = t3lib_div::_GP("SET");
00205                                         if (isset($SET["test_email"]))  {
00206                                                 $email = $SET["test_email"];
00207                                         }
00208                                         
00209                                                 // Create module object for the web_dmail module
00210                                         $className=t3lib_div::makeInstanceClassName("mod_web_dmail");
00211                                         $modObj = new $className($this->id,$this->pageinfo,$this->perms_clause,$this->CMD,$this->sys_dmail_uid,$this->pages_uid,$modTSconfig_submod);
00212                                         $modObj->createDMail();
00213                                         $modObj->updatePageTS();
00214                                         $this->content.=$modObj->main();        
00215                                 break;
00216                                 case "news":
00217                                         $this->content.=$this->doc->section("TODO: NEWS-module",nl2br('
00218                                         Here you can:
00219                                         - Create new news items on the page or subpages
00220                                         - See list of / search the news items
00221                                         '));
00222                                 break;
00223                                 case "fe_users":
00224                                         $this->content.=$this->doc->section("TODO: FE_USERS-module",nl2br('
00225                                         Here you can:
00226                                         - Create new front-end users in a snap
00227                                         - Create new front-end usergroups easily
00228                                         - See the list of users, when they logged in last time.
00229                                         '));
00230                                 break;
00231                                 case "approve":
00232                                         $this->content.=$this->doc->section("TODO: APPROVAL-module",'This module is basically just meant to list records like users signing up for something and being hidden initially. Then there will be a little button to press if you want to unhide/hide the record. Not too complicated.');
00233                                 break;
00234                                 default:
00235                                         $modList = t3lib_BEfunc::getListOfBackendModules(explode(",","dmail,board,fe_users,approve,news,shop"),$this->perms_clause,$BACK_PATH);         
00236                                         $this->content.=$this->doc->section($LANG->getLL("modules"),$modList["list"],0,1);
00237                                 break;
00238                         }
00239                 } else {
00240                                 // If no access or if ID == zero
00241                 
00242                         $this->doc = t3lib_div::makeInstance("smallDoc");
00243                         $this->doc->backPath = $BACK_PATH;
00244                 
00245                         $this->content.=$this->doc->startPage($LANG->getLL("title"));
00246                         $this->content.=$this->doc->header($LANG->getLL("title"));
00247                         $this->content.=$this->doc->spacer(5);
00248                         $this->content.=$this->doc->spacer(10);
00249                 }
00250         }
00251         function printContent() {
00252 
00253                 $this->content.=$this->doc->endPage();
00254                 echo $this->content;
00255         }
00256         
00257         // ***************************
00258         // OTHER FUNCTIONS:     
00259         // ***************************
00260         function getRecursiveSelect($id,$perms_clause)  {
00261                 // Finding tree and offer setting of values recursively.
00262                 $tree = t3lib_div::makeInstance("t3lib_pageTree");
00263                 $tree->init("AND ".$perms_clause);
00264                 $tree->makeHTML=0;
00265                 $tree->setRecs = 0;
00266                 $getLevels=10000;
00267                 $tree->getTree($id,$getLevels,"");
00268                 return $tree->ids;
00269         }
00270 }
00271 
00272 // Include extension?
00273 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/plugin_mgm/modules/index.php"])        {
00274         include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/plugin_mgm/modules/index.php"]);
00275 }
00276 
00277 
00278 
00279 
00280 
00281 
00282 
00283 
00284 
00285 
00286 
00287 
00288 // Make instance:
00289 $SOBE = t3lib_div::makeInstance("SC_mod_web_modules_index");
00290 $SOBE->init();
00291 
00292 // Include files?
00293 foreach($SOBE->include_once as $INC_FILE)       include_once($INC_FILE);
00294 
00295 $SOBE->main();
00296 $SOBE->printContent();
00297 ?>


Généré par TYPO3 Ameos avec  doxygen 1.4.6