

Public Member Functions | |
| AjaxFilter ($url, $divid="container", $params=array(), $formid="") | |
| AjaxFilterLog ($url, $type, $module="all", $divid="container") | |
| display () | |
| displayDivToUpdate () | |
| hasBeenPopped () | |
| HtmlElement () | |
| setOptions ($options) | |
| setRefresh ($refresh) | |
| Allow the list to refresh. | |
| setsearchbar ($url) | |
Data Fields | |
| $options | |
Definition at line 321 of file AjaxFilterLog.inc.php.
| AjaxFilter::AjaxFilter | ( | $ | url, | |
| $ | divid = "container", |
|||
| $ | params = array(), |
|||
| $ | formid = "" | |||
| ) | [inherited] |
| $url,: | URL called by the javascript updated. The URL gets the filter in $_GET["filter"] | |
| $divid,: | div ID which is updated by the URL output |
Definition at line 845 of file PageGenerator.php.
00845 { 00846 if (strpos($url, "?") === False) 00847 /* Add extra ? needed to build the URL */ 00848 $this->url = $url . "?"; 00849 else 00850 /* Add extra & needed to build the URL */ 00851 $this->url = $url . "&"; 00852 $this->divid = $divid; 00853 $this->formid = $formid; 00854 $this->refresh= 0; 00855 $this->params = ''; 00856 foreach ($params as $k => $v) { 00857 $this->params .= "&".$k."=".$v; 00858 } 00859 00860 // get the current module pages 00861 if (isset($_GET["module"])) 00862 $__module = $_GET["module"]; 00863 else 00864 $__module = "default"; 00865 if (isset($_GET["submod"])) 00866 $__submod = $_GET["submod"]; 00867 else 00868 $__submod = "default"; 00869 if (isset($_GET["action"])) 00870 $__action = $_GET["action"]; 00871 else 00872 $__action = "default"; 00873 if (isset($_GET['tab'])) 00874 $__tab = $_GET['tab']; 00875 else 00876 $__tab = "default"; 00877 // then get our filter info 00878 if(isset($_SESSION[$__module."_".$__submod."_".$__action."_".$__tab."_filter"])) { 00879 $this->storedfilter = $_SESSION[$__module."_".$__submod."_".$__action."_".$__tab."_filter"]; 00880 } 00881 }
| AjaxFilterLog::AjaxFilterLog | ( | $ | url, | |
| $ | type, | |||
| $ | module = "all", |
|||
| $ | divid = "container" | |||
| ) |
Definition at line 322 of file AjaxFilterLog.inc.php.
00322 { 00323 $this->AjaxFilter($url, $divid); 00324 $this->begindate = new LogDynamicDateTpl("begindate",_("Begin date")); 00325 $this->enddate = new LogDynamicDateTpl("enddate",_("End date")); 00326 $this->filtertype = new SelectItem("filtertype"); 00327 $this->types = $type; 00328 $this->filtertype->setElements(array_values($type)); 00329 $this->filtertype->setElementsVal(array_keys($type)); 00330 $this->page= $module; 00331 //$this->filter = new SelectItem("filter"); 00332 }
| AjaxFilterLog::display | ( | ) |
update div with user
provide navigation in ajax for user
wait 500ms and update search
Reimplemented from AjaxFilter.
Definition at line 337 of file AjaxFilterLog.inc.php.
References print.
00337 { 00338 00339 00340 ?> 00341 <form name="Form" id="Form" class="ajaxfilterlog" action="#"> 00342 <div id="loader"><img id="loadimg" src="img/common/loader.gif" alt="loader" class="loader"/></div> 00343 <div id="searchSpan" class="searchboxlog"> 00344 <span class="searchfieldfilter"> 00345 <?php 00346 $this->enddate->setSize(15); 00347 $this->begindate->setSize(15); 00348 $this->begindate->display(array("update_search"=>True)); 00349 $this->enddate->display(array("update_search"=>True)); 00350 //$this->filtertype->display(); 00351 ?> 00352 <span class="searchtools"> 00353 <select name="filtertype" onChange="searchbar()"> 00354 00355 <?php 00356 00357 foreach ($this->types as $key => $item){ 00358 print "\t<option value=\"".$key."\">"._($item)."</option>\n"; 00359 } 00360 00361 ?> 00362 </select> 00363 <span id="searchfilter"> 00364 </span> 00365 <img src="img/common/reload.png" style="vertical-align: middle; margin-left: 10px; margin-right: 10px;" onclick="pushSearch(); return false;" title="<?php echo _("Refresh")?>" /> 00366 </span> 00367 </span> 00368 </div> 00369 <script type="text/javascript"> 00370 00371 Event.observe(window, 'load', function() { 00372 searchbar(); 00373 }); 00374 00378 function searchbar() { 00379 new Ajax.Updater('searchfilter','<?php echo $this->urlsearch ?>&filtertype='+document.Form.filtertype.value, { onSuccess: pushSearch }); 00380 } 00381 00382 function updateSearch() { 00383 launch--; 00384 if (launch==0) { 00385 if (document.getElementById('param') == null) 00386 new Ajax.Updater('<?= $this->divid; ?>','<?= $this->url; ?>filter=&filtertype='+document.Form.filtertype.value+'&begindate='+document.Form.begindate.value+'&enddate='+document.Form.enddate.value+'&page=<?= $this->page; ?>', { asynchronous:true, evalScripts: true}); 00387 else 00388 new Ajax.Updater('<?= $this->divid; ?>','<?= $this->url; ?>filter='+document.Form.param.value+'&filtertype='+document.Form.filtertype.value+'&begindate='+document.Form.begindate.value+'&enddate='+document.Form.enddate.value+'&page=<?= $this->page; ?>', { asynchronous:true, evalScripts: true}); 00389 } 00390 } 00391 00396 function updateSearchParam(filter, start, end) { 00397 var reg = new RegExp("##", "g"); 00398 var tableau = filter.split(reg); 00399 filter = tableau[0]; 00400 var location = tableau[1]; 00401 new Ajax.Updater('<?= $this->divid; ?>','<?= $this->url; ?>filter='+document.Form.param.value+'&filtertype='+document.Form.filtertype.value+'&begindate='+document.Form.begindate.value+'&enddate='+document.Form.enddate.value+'&page=<?= $this->page; ?>&start='+start+'&end='+end, { asynchronous:true, evalScripts: true}); 00402 } 00403 00408 function pushSearch() { 00409 launch++; 00410 setTimeout("updateSearch()",500); 00411 } 00412 00413 pushSearch(); 00414 00415 </script> 00416 00417 </form> 00418 <? 00419 }
| AjaxFilter::displayDivToUpdate | ( | ) | [inherited] |
Definition at line 989 of file PageGenerator.php.
00989 { 00990 print '<div id="' . $this->divid . '"></div>' . "\n"; 00991 }
| HtmlElement::hasBeenPopped | ( | ) | [inherited] |
| HtmlElement::HtmlElement | ( | ) | [inherited] |
| HtmlElement::setOptions | ( | $ | options | ) | [inherited] |
| AjaxFilter::setRefresh | ( | $ | refresh | ) | [inherited] |
Allow the list to refresh.
| $refresh,: | time in ms |
Definition at line 887 of file PageGenerator.php.
| AjaxFilterLog::setsearchbar | ( | $ | url | ) |
Definition at line 333 of file AjaxFilterLog.inc.php.
References $url.
00333 { 00334 $this->urlsearch=$url; 00335 }
HtmlElement::$options [inherited] |
1.5.8