[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_plugins/banner_menu/config.php,v $ 14 | $Revision: 1.9 $ 15 | $Date: 2006/10/24 13:41:21 $ 16 | $Author: mrpete $ 17 +----------------------------------------------------------------------------+ 18 */ 19 $eplug_admin = TRUE; 20 require_once ("../../class2.php"); 21 if (!getperms("1")) { 22 header("location:".e_BASE."index.php"); 23 exit ; 24 } 25 require_once(e_ADMIN."auth.php"); 26 require_once(e_HANDLER."form_handler.php"); 27 $rs = new form; 28 29 @include_once(e_PLUGIN."banner_menu/languages/".e_LANGUAGE.".php"); 30 @include_once(e_PLUGIN."banner_menu/languages/English.php"); 31 32 $lan_file = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php"; 33 include(file_exists($lan_file) ? $lan_file : e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php"); 34 35 if (e_QUERY) { 36 $tmp = explode(".", e_QUERY); 37 $action = $tmp[0]; 38 $sub_action = $tmp[1]; 39 $id = $tmp[2]; 40 unset($tmp); 41 } 42 43 if (isset($_POST['update_menu'])) { 44 foreach($_POST as $k => $v) { 45 if (strpos($k, "banner_") === 0) { 46 $menu_pref[$k] = $v; 47 } 48 } 49 50 if (isset($_POST['catid'])) { 51 $array_cat = explode("-", $_POST['catid']); 52 for($i = 0; $i < count($array_cat); $i++) { 53 $cat .= $array_cat[$i]."|"; 54 } 55 $cat = substr($cat, 0, -1); 56 $menu_pref['banner_campaign'] = $cat; 57 } 58 59 $sysprefs->setArray('menu_pref'); 60 $ns->tablerender("", "<div style='text-align:center'><b>".BANNER_MENU_L2."</b></div>"); 61 } 62 63 if (!$menu_pref['banner_caption']) { 64 $menu_pref['banner2_caption'] = BANNER_MENU_L1; 65 } 66 67 $text = "<div style='text-align:center'> 68 <form method='post' action='".e_SELF."' name='menu_conf_form'> 69 <table style='width:85%' class='fborder' > 70 71 <tr> 72 <td style='width:40%' class='forumheader3'>".BANNER_MENU_L3.": </td> 73 <td style='width:60%' class='forumheader3'> 74 <input class='tbox' type='text' name='banner_caption' size='20' value='".$menu_pref['banner_caption']."' maxlength='100' /> 75 </td> 76 </tr>"; 77 78 $array_cat_in = explode("|", $menu_pref['banner_campaign']); 79 80 $c = 0; 81 $d = 0; 82 $sql2 = new db; 83 $category_total = $sql2->db_Select("banner", "DISTINCT(SUBSTRING_INDEX(banner_campaign, '^', 1)) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where"); 84 while ($row = $sql2->db_Fetch()) { 85 extract($row); 86 if (in_array($banner_campaign, $array_cat_in)) { 87 $in_catname[$c] = $banner_campaign; 88 $c++; 89 } else { 90 $out_catname[$d] = $banner_campaign; 91 $d++; 92 } 93 } 94 95 $text .= " 96 <tr> 97 <td style='width:40%' class='forumheader3'>".BANNER_MENU_L6."</td> 98 <td style='width:60%' class='forumheader3'> 99 100 <table style='width:90%'> 101 <tr> 102 <td style='width:45%; vertical-align:top'>".BANNER_MENU_L7."<br /> 103 <select class='tbox' id='catout' name='catout' size='10' style='width:180px' multiple='multiple' onchange='moveOver();'>"; 104 for($a = 0; $a <= ($d-1); $a++) { 105 $text .= "<option value='".$out_catname[$a]."'>".$out_catname[$a]."</option>"; 106 } 107 $text .= "</select> 108 </td> 109 <td style='width:45%; vertical-align:top'>".BANNER_MENU_L8."<br /> 110 <select class='tbox' id='catin' name='catin' size='10' style='width:180px' multiple='multiple'>"; 111 for($a = 0; $a <= ($c-1); $a++) { 112 $catidvalues .= $in_catname[$a]."-"; 113 $text .= "<option value='".$in_catname[$a]."'>".$in_catname[$a]."</option>"; 114 } 115 $catidvalues = substr($catidvalues, 0, -1); 116 $text .= "</select><br /><br /> 117 <input class='button' type='button' value='".BANNER_MENU_L9."' onclick='removeMe();' /> 118 <input type='hidden' name='catid' id='catid' value='".$catidvalues."' /> 119 </td> 120 </tr> 121 </table> 122 123 </td> 124 </tr> 125 126 <tr> 127 <td style='width:40%' class='forumheader3'>".BANNER_MENU_L10."</td> 128 <td style='width:60%' class='forumheader3'> 129 <select class='tbox' id='banner_rendertype' name='banner_rendertype' size='1' > 130 ".$rs->form_option(BANNER_MENU_L11, (!$menu_pref['banner_rendertype'] || $menu_pref['banner_rendertype'] == "0" ? "1" : "0"), 0)." 131 ".$rs->form_option("1 - ".BANNER_MENU_L12."", ($menu_pref['banner_rendertype'] == "1" ? "1" : "0"), 1)." 132 ".$rs->form_option("2 - ".BANNER_MENU_L13."", ($menu_pref['banner_rendertype'] == "2" ? "1" : "0"), 2)." 133 ".$rs->form_option("3 - ".BANNER_MENU_L14."", ($menu_pref['banner_rendertype'] == "3" ? "1" : "0"), 3)." 134 ".$rs->form_select_close()." 135 </td> 136 </tr> 137 138 <tr> 139 <td style='width:40%' class='forumheader3'>".BANNER_MENU_L15."<br /><span class='smalltext' style='font-style:italic;'>".BANNER_MENU_L16."</span></td> 140 <td style='width:60%' class='forumheader3'> 141 <select class='tbox' id='banner_amount' name='banner_amount' size='1' > 142 ".$rs->form_option(BANNER_MENU_L17, (!$menu_pref['banner_amount'] ? "1" : "0"), 0); 143 for($b = 1; $b < 6; $b++) { 144 $text .= $rs->form_option($b, ($menu_pref['banner_amount'] == $b ? "1" : "0"), $b); 145 } 146 $text .= $rs->form_select_close()." 147 </td> 148 </tr> 149 150 <tr> 151 <td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".BANNER_MENU_L18."' /></td> 152 </tr> 153 154 </table> 155 </form> 156 </div>"; 157 158 $ns->tablerender(BANNER_MENU_L5, $text); 159 160 161 require_once(e_ADMIN."footer.php"); 162 163 function headerjs() { 164 165 $script_js = "<script type=\"text/javascript\"> 166 //<!-- 167 //<!-- Adapted from original: Kathi O'Shea (Kathi.O'Shea@internet.com) --> 168 169 function moveOver(){ 170 var boxLength = document.getElementById('catin').length; 171 var selectedItem = document.getElementById('catout').selectedIndex; 172 var selectedText = document.getElementById('catout').options[selectedItem].text; 173 var selectedValue = document.getElementById('catout').options[selectedItem].value; 174 175 var i; 176 var isNew = true; 177 if (boxLength != 0) { 178 for (i = 0; i < boxLength; i++) { 179 thisitem = document.getElementById('catin').options[i].text; 180 if (thisitem == selectedText) { 181 isNew = false; 182 break; 183 } 184 } 185 } 186 if (isNew) { 187 newoption = new Option(selectedText, selectedValue, false, false); 188 document.getElementById('catin').options[boxLength] = newoption; 189 document.getElementById('catout').options[selectedItem].text = ''; 190 } 191 document.getElementById('catout').selectedIndex=-1; 192 193 saveMe(); 194 } 195 196 function removeMe() { 197 var boxLength = document.getElementById('catin').length; 198 var boxLength2 = document.getElementById('catout').length; 199 arrSelected = new Array(); 200 var count = 0; 201 for (i = 0; i < boxLength; i++) { 202 if (document.getElementById('catin').options[i].selected) { 203 arrSelected[count] = document.getElementById('catin').options[i].value; 204 var valname = document.getElementById('catin').options[i].text; 205 for (j = 0; j < boxLength2; j++) { 206 if (document.getElementById('catout').options[j].value == arrSelected[count]){ 207 document.getElementById('catout').options[j].text = valname; 208 } 209 } 210 } 211 count++; 212 } 213 var x; 214 for (i = 0; i < boxLength; i++) { 215 for (x = 0; x < arrSelected.length; x++) { 216 if (document.getElementById('catin').options[i].value == arrSelected[x]) { 217 document.getElementById('catin').options[i] = null; 218 } 219 } 220 boxLength = document.getElementById('catin').length; 221 } 222 223 saveMe(); 224 } 225 226 //function clearMe(clid){ 227 // location.href = document.location + \"?clear.\" + clid; 228 //} 229 230 function saveMe(clid) { 231 var strValues = \"\"; 232 var boxLength = document.getElementById('catin').length; 233 var count = 0; 234 if (boxLength != 0) { 235 for (i = 0; i < boxLength; i++) { 236 if (count == 0) { 237 strValues = document.getElementById('catin').options[i].value; 238 } 239 else { 240 strValues = strValues + \"-\" + document.getElementById('catin').options[i].value; 241 } 242 count++; 243 } 244 } 245 if (strValues.length == 0) { 246 //alert(\"You have not made any selections\"); 247 document.getElementById('catid').value = \"\"; 248 } 249 else { 250 document.getElementById('catid').value = strValues; 251 } 252 } 253 254 // --> 255 </script>\n"; 256 return $script_js; 257 } 258 259 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |