00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00035 class mailSelect extends t3lib_queryGenerator {
00036
00037 var $langExt = array(
00038 "comparison" => array(
00039
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
00060
00061
00062
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 ?>