[ Index ] |
PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09) |
[Summary view] [Print] [Text view]
1 function login(fval) { 2 if(fval.json.value == 2 && fval.form_password.value=='' && fval.form_loginname.value=='') { 3 fval.submit(); 4 return true; 5 } else { 6 fval.json.value == 0; 7 } 8 if(fval.form_password.value && fval.form_loginname.value) { 9 fval.md5pass.value = hex_md5(fval.form_password.value); 10 fval.form_password.value = ''; 11 fval.json.value = 1; 12 return true; 13 } else { 14 showLayer('jserr'); 15 return false; 16 } 17 } 18 19 function MM_swapImgRestore() { //v3.0 20 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; 21 } 22 23 function MM_findObj(n, d) { //v4.01 24 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { 25 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 26 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; 27 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); 28 if(!x && d.getElementById) x=d.getElementById(n); return x; 29 } 30 31 function MM_swapImage() { //v3.0 32 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) 33 if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} 34 } 35 36 function clearText(thefield){ 37 if (thefield.defaultValue==thefield.value) 38 thefield.value = "" 39 } 40 41 function confirmGoUrl(confirmtext, jumpurl) { 42 if(confirm(confirmtext)) {location.href=jumpurl;} 43 } 44 45 function wordcount(s) { 46 var formcontent=Trim(s); 47 if(formcontent == "") { 48 return 0; 49 } else { 50 formcontent=formcontent.split(" "); 51 return formcontent.length; 52 } 53 } 54 55 function LTrim(str) { 56 var whitespace = new String(" \t\n\r"); 57 var s = new String(str); 58 if (whitespace.indexOf(s.charAt(0)) != -1) { 59 var j=0, i = s.length; 60 while (j < i && whitespace.indexOf(s.charAt(j)) != -1) { 61 j++; s = s.substring(j, i); 62 } 63 } 64 return s; 65 } 66 67 function RTrim(str) { 68 var whitespace = new String(" \t\n\r"); 69 var s = new String(str); 70 if (whitespace.indexOf(s.charAt(s.length-1)) != -1) { 71 var i = s.length - 1; 72 while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) { 73 i--; s = s.substring(0, i+1); 74 } 75 } 76 return s; 77 } 78 79 function Trim(str) { 80 return RTrim(LTrim(str)); 81 } 82 83 function set_chatlist(lines) { 84 document.sendchatmessage.chatlist.value = lines; 85 document.sendchatmessage.submit(); 86 } 87 88 function flevPopupLink(){// v1.2 89 var v1=arguments,v2=window.open(v1[0],v1[1],v1[2]), v3=(v1.length>3)?v1[3]:false;if (v3){v2.focus();}document.MM_returnValue=false; 90 } 91 92 function MM_showHideLayers() { //v6.0 93 var i,p,v,obj,args=MM_showHideLayers.arguments; 94 for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; 95 if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } 96 obj.visibility=v; } 97 } 98 99 function tmt_winOpen(u,id,f,df){ 100 if(eval(id)==null||eval(id+".closed")){ 101 eval(id+"=window.open('"+u+"','"+id+"','"+f+"')");eval(id+".focus()");} 102 else if(df){eval(id+".focus()");} 103 else{eval(id+"=window.open('"+u+"','"+id+"','"+f+"')");eval(id+".focus()");} 104 } 105 106 function tmt_winControl(id,c){ 107 var d=eval(id)==null||eval(id+".closed"); if(!d){eval(id+"."+c);} 108 } 109 110 function get_cookie(Name) { 111 var search = Name + "="; 112 var returnvalue = ""; 113 if (document.cookie.length > 0) { 114 offset = document.cookie.indexOf(search); 115 // if cookie exists 116 if (offset != -1) { 117 offset += search.length; // set index of beginning of value 118 end = document.cookie.indexOf(";", offset); // set index of end of cookie value 119 if (end == -1) end = document.cookie.length; 120 returnvalue=unescape(document.cookie.substring(offset, end)); 121 } 122 } 123 return returnvalue; 124 } 125 126 function write_cookie(wert) { 127 if(wert) { 128 window.document.cookie="chatstring="+window.document.sendchatmessage.chatmsg.value; 129 } else { 130 window.document.cookie="chatstring="; 131 } 132 } 133 134 function cut(objekt, laenge) { 135 if(objekt.value.length > laenge) objekt.value=objekt.value.substr(0,laenge); 136 } 137 138 function changeImagePos(x,f) { 139 if(!f) { 140 document.articlecontent.cimage_pos.selectedIndex = x; 141 } else { 142 document.article.cimage_pos.selectedIndex = x; 143 } 144 for(i=0; i<=9; i++) { 145 if(i==x) { 146 MM_swapImage('imgpos'+i,'','img/symbole/content_selected.gif',0); 147 } else { 148 MM_swapImage('imgpos'+i,'','img/leer.gif',0); 149 } 150 } 151 } 152 153 function changeImagePosMenu(f) { 154 if(!f) { 155 var x = document.articlecontent.cimage_pos.selectedIndex; 156 } else { 157 var x = document.article.cimage_pos.selectedIndex; 158 } 159 for(i=0; i<=9; i++) { 160 if(i==x) { 161 MM_swapImage('imgpos'+i,'','img/symbole/content_selected.gif',0); 162 } else { 163 MM_swapImage('imgpos'+i,'','img/leer.gif',0); 164 } 165 } 166 if(!f) { 167 document.articlecontent.cimage_pos.focus(); 168 } else { 169 document.article.cimage_pos.focus(); 170 } 171 } 172 173 function switchToggleFTP(field) { 174 if(field.value=='0') { 175 field.value='1'; 176 } else { 177 field.value='0'; 178 } 179 return parseInt(field.value); 180 } 181 182 function toggleAllFTP(field, proof) { 183 for (i = 0; i < field.length; i++) { 184 if(proof) { 185 field[i].checked = true; 186 } else { 187 field[i].checked = false ; 188 } 189 } 190 } 191 192 function int_only(value) { 193 value = parseInt(value); 194 if(value<0) value = value * -1; 195 return (value) ? value+"" : ""; 196 } 197 198 function hideLayer(whichLayer) { 199 toggleDisplayById(whichLayer, 'none'); 200 } 201 202 function showLayer(whichLayer) { 203 toggleDisplayById(whichLayer, ''); 204 } 205 206 function toggleDisplayById(whichLayer, status) { 207 if (document.getElementById) { 208 document.getElementById(whichLayer).style.display = status; 209 } else if (document.all) { 210 document.all[whichLayer].style.display = status; 211 } else if (document.layers) { 212 document.layers[whichLayer].display = status; 213 } 214 } 215 216 function doMapChange() { 217 document.articlecontent.cmap_location_edited.value='1'; 218 } 219 220 function subrstr(str,nbr) { 221 return str.substr(str.length-nbr); 222 } 223 224 // for placing text at position 225 function setCursorPos (textObj) { 226 if (textObj.createTextRange) { 227 textObj.cursorPos = document.selection.createRange().duplicate(); 228 } 229 } 230 function insertAtCursorPos (textObj, textFieldValue) { 231 textObj.focus(); 232 if(document.all){ 233 if (textObj.createTextRange && textObj.cursorPos) { 234 var cursorPos = textObj.cursorPos; 235 cursorPos.text = cursorPos.text.charAt(cursorPos.text.length - 1) == ' ' ? textFieldValue + ' ' : textFieldValue; 236 } else { 237 textObj.value = textObj.value+textFieldValue; 238 } 239 } else { 240 if(textObj.setSelectionRange){ 241 var rangeStart = textObj.selectionStart; 242 var rangeEnd = textObj.selectionEnd; 243 var tempStr1 = textObj.value.substring(0,rangeStart); 244 var tempStr2 = textObj.value.substring(rangeEnd); 245 textObj.value = tempStr1 + textFieldValue + tempStr2; 246 } else { 247 alert("This version of Mozilla based browser does not support setSelectionRange"); 248 } 249 } 250 } 251 252 //tmtC_winOpen 253 var imageBrowser; 254 var uploadWin; 255 256 // code copied from Solmetra 257 function growField (id, dir) { 258 fld = getFieldById(id); 259 if (dir == 'H') { 260 fld.cols = fld.cols + 3; 261 } 262 else if (dir == 'V') { 263 fld.rows = fld.rows + 3; 264 } 265 else if (dir == 'HV' || dir == 'VH') { 266 fld.cols = fld.cols + 3; 267 fld.rows = fld.rows + 3; 268 } 269 updateDimensions(fld); 270 return true; 271 } 272 273 function contractField (id, dir) { 274 fld = getFieldById(id); 275 if (dir == 'H') { 276 if (fld.cols > 3) { 277 fld.cols = fld.cols - 3; 278 } 279 } 280 else if (dir == 'V') { 281 if (fld.rows > 3) { 282 fld.rows = fld.rows - 3; 283 } 284 } 285 else if (dir == 'HV' || dir == 'VH') { 286 if (fld.cols > 3) { 287 fld.cols = fld.cols - 3; 288 } 289 if (fld.rows > 3) { 290 fld.rows = fld.rows - 3; 291 } 292 } 293 updateDimensions(fld); 294 return true; 295 } 296 297 function getFieldById (fld) { 298 var thisdetail; 299 if (document.getElementById && document.getElementById(fld) != null) { 300 return document.getElementById(fld); 301 } 302 else if (document.layers && document.layers[fld] != null) { 303 return document.layers[fld]; 304 } 305 else if (document.all) { 306 return document.all(fld); 307 } 308 else { 309 return true; 310 } 311 } 312 313 function getObjectById(fld) { 314 if (document.getElementById && document.getElementById(fld) != null) { 315 return document.getElementById(fld); 316 } else if (document.layers && document.layers[fld] != null) { 317 return document.layers[fld]; 318 } else if (document.all) { 319 return document.all(fld); 320 } else { 321 return false; 322 } 323 } 324 325 function updateDimensions (fld) { 326 frm = fld.form; 327 if(frm.elements[fld.name+'_cols']) { 328 frm.elements[fld.name+'_cols'].value = fld.cols; 329 } 330 if(frm.elements[fld.name+'_rows']) { 331 frm.elements[fld.name+'_rows'].value = fld.rows; 332 } 333 return true; 334 } 335 336 // -- end solmetra -- 337 338 function switchDisabled(fld) { 339 if(fld.disabled) { 340 fld.disabled = false; 341 } else { 342 fld.disabled = true; 343 } 344 return false; 345 } 346 347 function enableStatusMessage(fld, showHide, text) { 348 if (document.getElementById && document.getElementById(fld) != null) { 349 obj = document.getElementById(fld); 350 } else if (document.layers && document.layers[fld] != null) { 351 obj = document.layers[fld]; 352 } else { 353 return true; 354 } 355 if(text) { 356 obj.innerHTML = text; 357 } 358 obj.style.display = (showHide == true) ? 'block' : 'none'; 359 return true; 360 } 361 362 function create_alias(str,encoding,ucfirst) 363 { 364 str = str.toUpperCase(); 365 str = str.toLowerCase(); 366 367 str = str.replace(/[\u00E0\u00E1\u00E2\u00E3\u00E5]/g,'a'); 368 str = str.replace(/[\u00E7]/g,'c'); 369 str = str.replace(/[\u00E8\u00E9\u00EA\u00EB]/g,'e'); 370 str = str.replace(/[\u00EC\u00ED\u00EE\u00EF]/g,'i'); 371 str = str.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F8]/g,'o'); 372 str = str.replace(/[\u00F9\u00FA\u00FB]/g,'u'); 373 str = str.replace(/[\u00FD\u00FF]/g,'y'); 374 str = str.replace(/[\u00F1]/g,'n'); 375 str = str.replace(/[\u0153\u00F6]/g,'oe'); 376 str = str.replace(/[\u00E6\u00E4]/g,'ae'); 377 str = str.replace(/[\u00DF]/g,'ss'); 378 379 // additional German "Umlaute" 380 str = str.replace(/[\u00FC]/g,'ue'); 381 382 str = str.replace(/[ ]/g,'-'); 383 str = str.replace(/[^a-z0-9_\-]/g,''); 384 str = Trim(str); 385 386 if (ucfirst == 1) { 387 c = str.charAt(0); 388 str = c.toUpperCase()+str.slice(1); 389 } 390 391 return str; 392 } 393 var temp_url = ''; 394 function openFileBrowser(url) { 395 if(url != null && url != '') { 396 if(window.imageBrowser && temp_url != url) { 397 tmt_winControl('imageBrowser','close()'); 398 } 399 tmt_winOpen(url,'imageBrowser','width=450,height=450,scrollbars=yes,resizable=yes',1); 400 temp_url = url; 401 } 402 } 403 404 function set_article_alias(onempty_only, alias_type) { 405 if(alias_type == 'struct') { 406 var alias_basis = 'acat_name'; 407 var alias_target = 'acat_alias'; 408 } else { 409 var alias_basis = 'article_title'; 410 var alias_target = 'article_alias'; 411 } 412 var aalias = getObjectById(alias_target); 413 if(onempty_only && aalias.value != '') return false; 414 var atitle = getObjectById(alias_basis) 415 aalias.value = create_alias(atitle.value); 416 return false; 417 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Dec 30 05:55:15 2009 | Cross-referenced by PHPXref 0.7 |