diff --git a/lib/Query.php b/lib/Query.php
index 18b02bf..f311f99 100644
--- a/lib/Query.php
+++ b/lib/Query.php
@@ -135,6 +135,8 @@ class Query extends xmlTemplate {
$bases = get_request('base','REQUEST',false,null);
$query['filter'] = get_request('filter','REQUEST',false,'objectClass=*');
$query['scope'] = get_request('scope','REQUEST',false,'sub');
+ $query['size_limit'] = get_request('size_limit','REQUEST',false,$_SESSION[APPCONFIG]->getValue('search','size_limit'));
+ $query['format'] = get_request('format','REQUEST',false,$_SESSION[APPCONFIG]->getValue('search','display'));
$attrs = get_request('display_attrs','REQUEST');
$attrs = preg_replace('/\s+/','',$attrs);
diff --git a/lib/QueryRender.php b/lib/QueryRender.php
index aeeaf4c..70e951d 100644
--- a/lib/QueryRender.php
+++ b/lib/QueryRender.php
@@ -262,30 +262,29 @@ function hideall(key,except) {
$this->drawBaseTabs();
$ado = $this->template->getAttrDisplayOrder();
+ $counter = 0;
- switch(get_request('format','REQUEST',false,'table')) {
- case 'list':
+ foreach ($this->template->results as $base => $results) {
+ $counter++;
- $counter = 0;
+ if (! $show = get_request('show','REQUEST'))
+ $show = ($counter === 1 ? $this->getAjaxRef($base) : null);
- foreach ($this->template->results as $base => $results) {
- if (! $show = get_request('show','REQUEST'))
- $show = ($counter++ === 0 ? $this->getAjaxRef($base) : null);
+ printf('
',
+ $this->getAjaxRef($base), ($show == $this->getAjaxRef($base) ? '' : 'none'));
- printf('
',
- $this->getAjaxRef($base),
- ($show == $this->getAjaxRef($base) ? '' : 'none'));
+ echo '
';
+ echo '';
+ echo ' ';
+ echo ' ';
- echo '';
- echo '';
- echo ' ';
- echo ' ';
+ $this->drawResultsTable($base,count($results));
- $this->drawResultsTable($base,count($results));
-
- echo ' ';
- echo ' ';
+ echo ' ';
+ echo ' ';
+ switch(get_request('format','REQUEST',false,$_SESSION[APPCONFIG]->getValue('search','display'))) {
+ case 'list':
foreach ($results as $dn => $dndetails) {
$dndetails = array_change_key_case($dndetails);
@@ -338,45 +337,17 @@ function hideall(key,except) {
echo ' ';
}
- echo ' | ';
- echo ' ';
- echo '';
-
- echo "\n\n";
- }
-
- break;
-
- case 'table':
+ break;
# Display the results.
- $counter = 0;
- foreach ($this->template->results as $base => $results) {
- if (! $show = get_request('show','REQUEST'))
- $show = ($counter++ === 0 ? $this->getAjaxRef($base) : null);
-
- printf('',
- $this->getAjaxRef($base),
- ($show == $this->getAjaxRef($base) ? '' : 'none'));
-
- echo ' ';
- echo '';
- echo ' ';
- echo ' ';
-
- $this->drawResultsTable($base,count($results));
-
- echo ' ';
- echo ' ';
-
+ case 'table':
if (! $results) {
echo _('Search returned no results');
- echo ' | ';
- echo ' ';
+
continue;
}
- echo ' |
';
echo '';
- echo '';
- echo '';
- echo '
';
echo "\n\n";
- echo '';
- }
-
- break;
-
- default:
- printf('Have ID [%s], run this query for page [%s]',$this->template_id,$this->page);
- }
+ echo '';
+ }
}
public function drawSubTitle($subtitle=null) {
@@ -596,13 +574,17 @@ var deon=0;
foreach (array('list','table') as $f) {
echo ' ';
- if (get_request('format','REQUEST') == $f) {
+ if (get_request('format','REQUEST',false,$_SESSION[APPCONFIG]->getValue('search','display')) == $f) {
printf('
%s',_($f));
} else {
- $query_string = array_to_query_string($_GET,array('format','cmd'));
- $query_string .= sprintf('&format=%s&show=%s',$f,$this->getAjaxRef($base));
- printf('
%s',htmlspecialchars($query_string),_($f));
+ $query_string = htmlspecialchars(sprintf('%s&format=%s&show=%s&focusbase=%s',array_to_query_string($_GET,array('format','meth')),$f,$this->getAjaxRef($base),$base));
+
+ if (isAjaxEnabled())
+ printf('
%s',
+ $query_string,$query_string,_('Loading Search'),_($f));
+ else
+ printf('
%s',$query_string,_($f));
}
}
diff --git a/lib/TemplateRender.php b/lib/TemplateRender.php
index 65144f2..e780aad 100644
--- a/lib/TemplateRender.php
+++ b/lib/TemplateRender.php
@@ -1327,7 +1327,7 @@ class TemplateRender extends PageRender {
if (DEBUGTMP) printf('
%s',__METHOD__);
- $href = sprintf('cmd=query_engine&server_id=%s&filter=%s&base=%s&scope=one&query=none',
+ $href = sprintf('cmd=query_engine&server_id=%s&filter=%s&base=%s&scope=one&query=none&size_limit=0',
$this->getServerID(),rawurlencode('objectClass=*'),rawurlencode($this->template->getDN()));
if (isAjaxEnabled())