Took out the sting (i.e. slowness) of creating the HUBBROWSE object on every page load - everytime it was created it did a search on the local database. Added some docs.
This commit is contained in:
parent
ded597dba6
commit
79f4c4266b
campcaster/src/modules/htmlUI/var
|
@ -1,8 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
|
* @author Sebastian Gobel <sebastian.goebel@web.de>
|
||||||
|
* @author Paul Baranowski <paul@paulbaranowski.org>
|
||||||
* @package Campcaster
|
* @package Campcaster
|
||||||
* @subpackage htmlUI
|
* @subpackage htmlUI
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
|
* @copyright 2006 MDLF, Inc.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl.txt
|
||||||
|
* @link http://www.campware.org
|
||||||
*/
|
*/
|
||||||
class uiHubBrowse extends uiBrowse
|
class uiHubBrowse extends uiBrowse
|
||||||
{
|
{
|
||||||
|
@ -13,7 +18,7 @@ class uiHubBrowse extends uiBrowse
|
||||||
$this->prefix = 'HUBBROWSE';
|
$this->prefix = 'HUBBROWSE';
|
||||||
$this->col =& $_SESSION[UI_HUBBROWSE_SESSNAME]['col'];
|
$this->col =& $_SESSION[UI_HUBBROWSE_SESSNAME]['col'];
|
||||||
$this->criteria =& $_SESSION[UI_HUBBROWSE_SESSNAME]['criteria'];
|
$this->criteria =& $_SESSION[UI_HUBBROWSE_SESSNAME]['criteria'];
|
||||||
#$this->results =& $_SESSION[UI_HUBBROWSE_SESSNAME]['results'];
|
//$this->results =& $_SESSION[UI_HUBBROWSE_SESSNAME]['results'];
|
||||||
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
$this->reloadUrl = UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close';
|
||||||
|
|
||||||
if (empty($this->criteria['limit'])) {
|
if (empty($this->criteria['limit'])) {
|
||||||
|
@ -24,8 +29,10 @@ class uiHubBrowse extends uiBrowse
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($this->col)) {
|
if (!is_array($this->col)) {
|
||||||
## init Categorys
|
// init Categorys
|
||||||
$this->setDefaults();
|
// This is broken - it initializes the columns from the local
|
||||||
|
// storage instead of the remote storage. -- Paul
|
||||||
|
//$this->setDefaults();
|
||||||
}
|
}
|
||||||
} // constructor
|
} // constructor
|
||||||
|
|
||||||
|
@ -45,6 +52,12 @@ class uiHubBrowse extends uiBrowse
|
||||||
} // fn searchDB
|
} // fn searchDB
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo this function is broken
|
||||||
|
*
|
||||||
|
* @param string $trtokid
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
function getSearchResults($trtokid) {
|
function getSearchResults($trtokid) {
|
||||||
$this->results = array('page' => $this->criteria['offset']/$this->criteria['limit']);
|
$this->results = array('page' => $this->criteria['offset']/$this->criteria['limit']);
|
||||||
$results = $this->Base->gb->getSearchResults($trtokid);
|
$results = $this->Base->gb->getSearchResults($trtokid);
|
||||||
|
@ -57,8 +70,6 @@ class uiHubBrowse extends uiBrowse
|
||||||
$this->results['items'][] = $this->Base->getMetaInfo($this->Base->gb->idFromGunid($rec));
|
$this->results['items'][] = $this->Base->getMetaInfo($this->Base->gb->idFromGunid($rec));
|
||||||
}
|
}
|
||||||
$this->pagination($results);
|
$this->pagination($results);
|
||||||
// echo '<XMP>this->results:'; print_r($this->results); echo "</XMP>\n";
|
|
||||||
// echo '<XMP>results:'; print_r($results); echo "</XMP>\n";
|
|
||||||
return is_array($results);
|
return is_array($results);
|
||||||
} // fn getSearchResults
|
} // fn getSearchResults
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue