Documentation TYPO3 par Ameos

class.mailselect.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *  
00005 *  (c) 1999-2004 Kasper Skaarhoj (kasper@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 ***************************************************************/
00035 class mailSelect extends t3lib_queryGenerator   {
00036 
00037         var $langExt = array(
00038                 "comparison" => array(
00039                  // Type = userdef,     offset = 64
00040                                 "64_" =>        "modtager html",
00041                                 "65_" =>        "ikke modtager html",
00042                 
00043                                 "68_" =>        "er medlem af en af grupperne",
00044                                 "69_" =>        "ikke er medlem af en af grupperne",
00045                                 "70_" =>        "er medlem af alle grupperne",
00046                                 "71_" =>        "ikke er medlem af alle grupperne",
00047                                 "72_" =>        "har modtaget en af disse mails",               
00048                                 "73_" =>        "ikke har modtaget en af disse mails",
00049                                 "74_" =>        "har modtaget alle disse mails",                
00050                                 "75_" =>        "ikke har modtaget alle disse mails",           
00051                                 "76_" =>        "er medlem af en af disse kategorier",
00052                                 "77_" =>        "ikke er medlem af en af disse kategorier",
00053                                 "78_" =>        "er medlem af alle disse kategorier",
00054                                 "79_" =>        "ikke er medlem af alle disse kategorier",
00055                                 "80_" =>        "har responderet på en af", 
00056                                 "81_" =>        "ikke har responderet på en af", 
00057                                 "82_" =>        "har responderet på alle", 
00058                                 "83_" =>        "ikke har responderet på alle" /*, 
00059                                 "84_" =>        " har responderet på [mailliste] via en af disse",
00060                                 "85_" =>        "ikke har responderet på [mailliste] via en af disse",
00061                                 "86_" =>        "har responderet på [mailliste] via alle disse",
00062                                 "87_" =>        "ikke har responderet på [mailliste] via alle disse" */
00063                 )
00064         );
00065         
00066         var $comp_offsetsExt = array(
00067                 "userdef" => 2
00068         );
00069 
00070         var $fieldsExt =array(
00071                 "maillist" => array(
00072                         "label" => "mail liste",
00073                         "type" => "userdef"
00074                 )
00075         );
00076         var $allowedTables=array("tt_address","fe_users");
00077         
00078         function initUserDef()  {
00079                 $this->lang = t3lib_div::array_merge_recursive_overrule($this->lang, $this->langExt);
00080                 $this->comp_offsets = t3lib_div::array_merge_recursive_overrule($this->comp_offsets, $this->comp_offsetsExt);
00081                 $this->fields = t3lib_div::array_merge_recursive_overrule($this->fields, $this->fieldsExt);             
00082         }
00083         function userDef($name,$conf,$fName,$fType) {                                           
00084                 $out.=$this->mkTypeSelect($name.'[type]',$fName);
00085                 $out.=$this->mkMailSelect($name.'[comparison]',$conf["comparison"],$conf["negate"]?1:0,$conf["and_entries"]?1:0);
00086                 $out.='<input type="checkbox" '.($conf["negate"]?"checked":"").' name="'.$this->name.'['.$key.'][negate]'.'" onClick="submit();">';
00087                 if($conf["comparison"]!=64&&$conf["comparison"]!=65) {
00088                         $out.='<input type="checkbox" '.($conf["and_entries"]?"checked":"").' name="'.$name.'[and_entries]'.'" onClick="submit();">';
00089                 }
00090                 $out.='<input type="text" value="'.$conf["inputValue"].'" name="'.$name.'[inputValue]'.'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'>';
00091                 return $out;
00092         }
00093         function mkMailSelect($name,$comparison,$neg,$andEnt) {
00094                 $compOffSet = $comparison >> 5;
00095                 $out='<select name="'.$name.'" onChange="submit();">';
00096                 for($i=32*$compOffSet+$neg+$andEnt*2;$i<32*($compOffSet+1);$i+=4) {
00097                         if($this->lang["comparison"][$i."_"]) {
00098                                 $out.='<option value="'.$i.'"'.(($i >> 2)==($comparison >> 2) ? ' selected':'').'>'.$this->lang["comparison"][$i."_"].'</option>';
00099                         }
00100                 }
00101                 $out.='</select>';
00102                 return $out;
00103         }
00104         function mkTableSelect($name,$cur)      {
00105                 global $TCA;
00106                 $out='<select name="'.$name.'" onChange="submit();">';
00107                 $out.='<option value=""></option>';
00108                 reset($TCA);
00109                 while(list($tN)=each($TCA)) {
00110                         if ($GLOBALS["BE_USER"]->check("tables_select",$tN) && in_array($tN,$this->allowedTables))      {
00111                                 $out.='<option value="'.$tN.'"'.($tN==$cur ? ' selected':'').'>'.$GLOBALS["LANG"]->sl($TCA[$tN]["ctrl"]["title"]).'</option>';  
00112                         }
00113                 }
00114                 $out.='</select>';
00115                 return $out;
00116         }
00117 }
00118 
00119 
00120 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/direct_mail/mod/class.mailselect.php"])        {
00121         include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/direct_mail/mod/class.mailselect.php"]);
00122 }
00123 
00124 ?>


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