Moved all file-related functions from BasicStor into StoredFile class.

Got rid of all the stuff related to GUNID hex-to-int conversion.
Commented out lots of functions that are either not in use or will
no longer work.

Pypo: made things more generic and pluggable, added documentation.
Added the PHP scripts to serve the right info back to pypo.
This commit is contained in:
paul.baranowski 2010-11-12 17:07:01 -05:00
parent 35dc3fd01f
commit 8a58df3093
32 changed files with 2233 additions and 2000 deletions

View file

@ -77,12 +77,12 @@ class uiScratchPad
// get the scratchpad list
$arr = explode(' ', $spData);
$maxLength = $this->Base->STATIONPREFS[UI_SCRATCHPAD_MAXLENGTH_KEY];
$arr = array_slice($arr, 0, $maxLength);
$arr = array_slice($arr, 0, $maxLength);
foreach ($arr as $item) {
//for audiofiles.
list($type, $savedId) = explode(":", $item);
if($type === 'pl') {
if($type === 'pl') {
$id = $savedId;
if ($i = $this->Base->getPLMetaInfo($id)) {
$this->items[] = $i;
@ -91,9 +91,10 @@ class uiScratchPad
else {
$gunid = $savedId;
if (preg_match('/[0-9]{1,20}/', $gunid)) {
$id = BasicStor::IdFromGunid($this->Base->toHex($gunid));
if ($id != FALSE) {
if ($i = $this->Base->getMetaInfo($id)) {
$f = StoredFile::RecallByGunid($gunid);
//$id = BasicStor::IdFromGunid($this->Base->toHex($gunid));
if (!PEAR::isError($f)) {
if ($i = $this->Base->getMetaInfo($f->getId())) {
$this->items[] = $i;
}
}
@ -115,7 +116,7 @@ class uiScratchPad
$str .= 'pl:'.$val['id'].' ';
}
else {
$str .= 'ac:'.$this->Base->toInt8($val['gunid']).' ';
$str .= 'ac:'.$val['gunid'].' ';
}
}
$this->Base->gb->savePref($this->Base->sessid, UI_SCRATCHPAD_KEY, $str);
@ -264,7 +265,7 @@ class uiScratchPad
$this->items[$key] = $this->Base->getMetaInfo($val['id']);
}
}
public function reloadActivePLMetadata($id)
{
foreach ($this->items as $key => $val) {
@ -274,6 +275,6 @@ class uiScratchPad
}
}
}
} // class uiScratchPad
?>