| 1 |
<?php |
| 2 |
// this is the javascript code for the ckeck/uncheck all forecast boxes |
| 3 |
?> |
| 4 |
<script type="text/javascript"> |
| 5 |
function check(fname) |
| 6 |
{ |
| 7 |
if (fname=="day") { |
| 8 |
sammelvalue=document.woptions.alldays.checked; |
| 9 |
document.woptions.day1.checked=sammelvalue; |
| 10 |
document.woptions.day2.checked=sammelvalue; |
| 11 |
document.woptions.day3.checked=sammelvalue; |
| 12 |
document.woptions.day4.checked=sammelvalue; |
| 13 |
document.woptions.day5.checked=sammelvalue; |
| 14 |
document.woptions.day6.checked=sammelvalue; |
| 15 |
document.woptions.day7.checked=sammelvalue; |
| 16 |
document.woptions.day8.checked=sammelvalue; |
| 17 |
document.woptions.day9.checked=sammelvalue; |
| 18 |
} else { |
| 19 |
sammelvalue=document.woptions.allnight.checked; |
| 20 |
document.woptions.night1.checked=sammelvalue; |
| 21 |
document.woptions.night2.checked=sammelvalue; |
| 22 |
document.woptions.night3.checked=sammelvalue; |
| 23 |
document.woptions.night4.checked=sammelvalue; |
| 24 |
document.woptions.night5.checked=sammelvalue; |
| 25 |
document.woptions.night6.checked=sammelvalue; |
| 26 |
document.woptions.night7.checked=sammelvalue; |
| 27 |
document.woptions.night8.checked=sammelvalue; |
| 28 |
document.woptions.night9.checked=sammelvalue; |
| 29 |
} |
| 30 |
return !sammelvalue; |
| 31 |
} |
| 32 |
<?php |
| 33 |
// this is the javascript code for switchgin between weather providers |
| 34 |
?> |
| 35 |
function apifields(service) |
| 36 |
{ |
| 37 |
if (service=="accu") { |
| 38 |
document.woptions.apikey1.disabled=true; |
| 39 |
// document.woptions.apikey2.disabled=true; |
| 40 |
if (typeof(document.woptions.allnight) != "undefined"){ |
| 41 |
document.woptions.allnight.disabled=false; |
| 42 |
document.woptions.night1.disabled=false; |
| 43 |
document.woptions.night2.disabled=false; |
| 44 |
document.woptions.night3.disabled=false; |
| 45 |
document.woptions.night4.disabled=false; |
| 46 |
document.woptions.night5.disabled=false; |
| 47 |
document.woptions.night6.disabled=false; |
| 48 |
document.woptions.night7.disabled=false; |
| 49 |
document.woptions.night8.disabled=false; |
| 50 |
document.woptions.night9.disabled=false; |
| 51 |
document.woptions.day8.disabled=false; |
| 52 |
document.woptions.day9.disabled=false; |
| 53 |
document.woptions.d_d_wind.disabled=false; |
| 54 |
document.woptions.d_n_wind.disabled=false; |
| 55 |
document.woptions.d_d_wgusts.disabled=false; |
| 56 |
document.woptions.d_n_wgusts.disabled=false; |
| 57 |
|
| 58 |
document.woptions.searchloc.disabled=false; |
| 59 |
document.woptions.search_loc.disabled=false; |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
if (service=="google") { |
| 64 |
document.woptions.apikey1.disabled=false; |
| 65 |
//document.woptions.apikey2.disabled=false; |
| 66 |
if (typeof(document.woptions.allnight) != "undefined"){ |
| 67 |
document.woptions.allnight.disabled=true; |
| 68 |
document.woptions.night1.disabled=true; |
| 69 |
document.woptions.night2.disabled=true; |
| 70 |
document.woptions.night3.disabled=true; |
| 71 |
document.woptions.night4.disabled=true; |
| 72 |
document.woptions.night5.disabled=true; |
| 73 |
document.woptions.night6.disabled=true; |
| 74 |
document.woptions.night7.disabled=true; |
| 75 |
document.woptions.night8.disabled=true; |
| 76 |
document.woptions.night9.disabled=true; |
| 77 |
document.woptions.day6.disabled=true; |
| 78 |
document.woptions.day7.disabled=true; |
| 79 |
document.woptions.day8.disabled=true; |
| 80 |
document.woptions.day9.disabled=true; |
| 81 |
document.woptions.d_c_sunrise.checked=false; |
| 82 |
document.woptions.d_c_sunset.checked=false; |
| 83 |
document.woptions.d_d_wind.checked=false; |
| 84 |
document.woptions.d_n_wind.checked=false; |
| 85 |
document.woptions.d_c_wgusts.checked=false; |
| 86 |
document.woptions.d_d_wgusts.checked=false; |
| 87 |
document.woptions.d_n_wgusts.checked=false; |
| 88 |
document.woptions.d_c_humid.checked=false; |
| 89 |
document.woptions.d_c_press.checked=false; |
| 90 |
document.woptions.d_c_real.checked=false; |
| 91 |
document.woptions.d_c_sunrise.disabled=true; |
| 92 |
document.woptions.d_c_sunset.disabled=true; |
| 93 |
document.woptions.d_d_wind.disabled=true; |
| 94 |
document.woptions.d_n_wind.disabled=true; |
| 95 |
document.woptions.d_c_humid.disabled=true; |
| 96 |
document.woptions.d_c_press.disabled=true; |
| 97 |
document.woptions.d_c_real.disabled=true; |
| 98 |
document.woptions.d_c_wgusts.disabled=true; |
| 99 |
document.woptions.d_d_wgusts.disabled=true; |
| 100 |
document.woptions.d_n_wgusts.disabled=true; |
| 101 |
|
| 102 |
document.woptions.searchloc.disabled=true; |
| 103 |
document.woptions.search_loc.disabled=true; |
| 104 |
} |
| 105 |
} |
| 106 |
|
| 107 |
if (service=="bug") { |
| 108 |
document.woptions.apikey1.disabled=false; |
| 109 |
//document.woptions.apikey2.disabled=true; |
| 110 |
if (typeof(document.woptions.allnight) != "undefined"){ |
| 111 |
document.woptions.allnight.disabled=true; |
| 112 |
document.woptions.night1.disabled=true; |
| 113 |
document.woptions.night2.disabled=true; |
| 114 |
document.woptions.night3.disabled=true; |
| 115 |
document.woptions.night4.disabled=true; |
| 116 |
document.woptions.night5.disabled=true; |
| 117 |
document.woptions.night6.disabled=true; |
| 118 |
document.woptions.night7.disabled=true; |
| 119 |
document.woptions.night8.disabled=true; |
| 120 |
document.woptions.night9.disabled=true; |
| 121 |
document.woptions.day8.disabled=true; |
| 122 |
document.woptions.day9.disabled=true; |
| 123 |
document.woptions.d_d_wind.checked=false; |
| 124 |
document.woptions.d_n_wind.checked=false; |
| 125 |
document.woptions.d_d_wgusts.checked=false; |
| 126 |
document.woptions.d_n_wgusts.checked=false; |
| 127 |
document.woptions.d_d_wind.disabled=true; |
| 128 |
document.woptions.d_n_wind.disabled=true; |
| 129 |
document.woptions.d_d_wgusts.disabled=true; |
| 130 |
document.woptions.d_n_wgusts.disabled=true; |
| 131 |
|
| 132 |
document.woptions.searchloc.disabled=false; |
| 133 |
document.woptions.search_loc.disabled=false; |
| 134 |
|
| 135 |
|
| 136 |
} |
| 137 |
} |
| 138 |
return 0; |
| 139 |
} |
| 140 |
<?php |
| 141 |
// this toggles the pulldown fields |
| 142 |
?> |
| 143 |
|
| 144 |
function pdfields_update() |
| 145 |
{ |
| 146 |
obja=document.getElementById('pdforecast'); |
| 147 |
objb=document.getElementById('pdfirstday'); |
| 148 |
objb.disabled = (obja.checked == false); |
| 149 |
} |
| 150 |
<?php |
| 151 |
// this toggles the new window field |
| 152 |
?> |
| 153 |
|
| 154 |
function nwfields_update() |
| 155 |
{ |
| 156 |
obja=document.getElementById('d_c_accuweather'); |
| 157 |
objb=document.getElementById('d_c_aw_newwindow'); |
| 158 |
objb.disabled = (obja.checked == false); |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
<?php |
| 163 |
// the part for wpmu disabled fields by admin |
| 164 |
global $blog_id; |
| 165 |
if ( function_exists("is_multisite") && is_multisite() && $blog_id!=1) |
| 166 |
{ |
| 167 |
echo "function wpf_wpmu_disable_fields()\n{\n"; |
| 168 |
// read defaults and allowed fields |
| 169 |
$allowed = maybe_unserialize(wpf_get_option("wpf_sa_allowed")); |
| 170 |
|
| 171 |
foreach($allowed as $f => $fswitch) |
| 172 |
{ |
| 173 |
$fname = substr($f,3); // strip ue_ prefix |
| 174 |
|
| 175 |
if ( $fswitch != "1" ) |
| 176 |
{ |
| 177 |
if ($fname != "dispconfig" and $fname != "forecast") { |
| 178 |
// replace value in av with forced default |
| 179 |
echo "document.getElementById('$fname').disabled=true;\n"; |
| 180 |
} |
| 181 |
else if ($fname == "dispconfig") { |
| 182 |
$do = array('d_c_icon','d_c_time','d_c_short','d_c_temp','d_c_real','d_c_press', |
| 183 |
'd_c_humid','d_c_wind','d_c_sunrise','d_c_sunset','d_d_icon','d_d_short', |
| 184 |
'd_d_temp','d_d_wind','d_n_icon','d_n_short','d_n_temp','d_n_wind','d_c_date', |
| 185 |
'd_c_copyright','d_c_wgusts','d_d_wgusts','d_n_wgusts', |
| 186 |
'd_c_accuweather','d_c_aw_newwindow','d_c_copyright','d_c_accuweather'); |
| 187 |
|
| 188 |
foreach ($do as $i) { |
| 189 |
echo "document.getElementById('$i').disabled=true;\n"; |
| 190 |
} |
| 191 |
} else { |
| 192 |
// for forecast options |
| 193 |
$nd = array('day1','day2','day3','day4','day5','day6','day7','day8','day9', |
| 194 |
'night1','night2','night3','night4','night5','night6','night7','night8','night9'); |
| 195 |
foreach ($nd as $i) { |
| 196 |
echo "document.getElementById('$i').disabled=true;\n"; |
| 197 |
} |
| 198 |
} |
| 199 |
} |
| 200 |
} |
| 201 |
echo "}\n"; |
| 202 |
} |
| 203 |
?> |
| 204 |
</script> |