From d60e3e54760af445a00125eb23866b80c8871621 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Fri, 4 Feb 2011 01:28:55 -0500 Subject: [PATCH] documentation seems weird, trying to get content to be rerquested for playlist contents. --- application/controllers/LibraryController.php | 18 ++++++++---------- public/js/airtime/library/library.js | 13 ++++++++----- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/application/controllers/LibraryController.php b/application/controllers/LibraryController.php index 85945ff40..281b33385 100644 --- a/application/controllers/LibraryController.php +++ b/application/controllers/LibraryController.php @@ -149,19 +149,17 @@ class LibraryController extends Zend_Controller_Action public function getFileMetaDataAction() { - //id = type_id - $id = $this->_getParam('file'); + $id = $this->_getParam('id'); + $type = $this->_getParam('type'); - $info = explode("_", $id); - - if($info[0] == "au") { - $file = StoredFile::Recall($info[1]); - $this->view->type = $info[0]; + if($type == "au") { + $file = StoredFile::Recall($id); + $this->view->type = $type; $this->view->md = $file->md; } - else if($info[0] == "pl") { - $file = Playlist::Recall($info[1]); - $this->view->type = $info[0]; + else if($type == "pl") { + $file = Playlist::Recall($id); + $this->view->type = $type; $this->view->md = $file->getAllPLMetaData(); $this->view->contents = $file->getContents(); } diff --git a/public/js/airtime/library/library.js b/public/js/airtime/library/library.js index 09fa8c2e1..e1b674158 100644 --- a/public/js/airtime/library/library.js +++ b/public/js/airtime/library/library.js @@ -60,16 +60,19 @@ function addLibraryItemEvents() { } function dtRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { - var id = aData[6].substring(0,2) + "_" + aData[0]; + var id, type, once; - $(nRow).attr("id", id); + type = aData[6].substring(0,2); + id = aData[0]; + + $(nRow).attr("id", type+'_'+id); $(nRow).qtip({ content: { - // Set the text to an image HTML string with the correct src URL to the loading image you want to use - //text: 'Loading...', - url: '/Library/get-file-meta-data/format/html/file/'+id, // Use the rel attribute of each element for the url to load + url: '/Library/get-file-meta-data', + type: 'post', + data: ({format: "html", id : id, type: type}), title: { text: aData[1] + ' MetaData', button: 'Close' // Show a close link in the title