diff --git a/.zfproject.xml b/.zfproject.xml index c849f233f..1e30ef1c8 100644 --- a/.zfproject.xml +++ b/.zfproject.xml @@ -35,6 +35,7 @@ + @@ -282,6 +283,9 @@ + + + diff --git a/application/Bootstrap.php b/application/Bootstrap.php index 709a7ff29..c17fdc043 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -60,8 +60,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap $view->headScript()->appendFile('/js/libs/jquery.stickyPanel.js','text/javascript'); //scripts for now playing bar - $this->view->headScript()->appendFile('/js/playlist/helperfunctions.js','text/javascript'); - $this->view->headScript()->appendFile('/js/playlist/playlist.js','text/javascript'); + //$this->view->headScript()->appendFile('/js/playlist/helperfunctions.js','text/javascript'); + //$this->view->headScript()->appendFile('/js/playlist/playlist.js','text/javascript'); $view->headScript()->appendFile('/js/airtime/common/common.js','text/javascript'); } diff --git a/application/controllers/LibraryController.php b/application/controllers/LibraryController.php index 34bbb2778..85945ff40 100644 --- a/application/controllers/LibraryController.php +++ b/application/controllers/LibraryController.php @@ -16,6 +16,7 @@ class LibraryController extends Zend_Controller_Action $ajaxContext->addActionContext('contents', 'json') ->addActionContext('delete', 'json') ->addActionContext('context-menu', 'json') + ->addActionContext('get-file-meta-data', 'html') ->initContext(); $this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME); @@ -24,9 +25,10 @@ class LibraryController extends Zend_Controller_Action public function indexAction() { - $this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript'); + $this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript'); $this->view->headScript()->appendFile('/js/jplayer/jquery.jplayer.min.js'); $this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript'); + $this->view->headScript()->appendFile('/js/qtip/jquery.qtip-1.0.0.min.js','text/javascript'); $this->view->headScript()->appendFile('/js/airtime/library/library.js','text/javascript'); $this->view->headLink()->appendStylesheet('/css/media_library.css'); @@ -90,7 +92,7 @@ class LibraryController extends Zend_Controller_Action public function deleteAction() { $id = $this->_getParam('id'); - + if (!is_null($id)) { $file = StoredFile::Recall($id); @@ -116,7 +118,7 @@ class LibraryController extends Zend_Controller_Action public function contentsAction() { - $post = $this->getRequest()->getPost(); + $post = $this->getRequest()->getPost(); $datatables = StoredFile::searchFilesForPlaylistBuilder($post); die(json_encode($datatables)); @@ -144,6 +146,29 @@ class LibraryController extends Zend_Controller_Action $this->view->form = $form; } + + public function getFileMetaDataAction() + { + //id = type_id + $id = $this->_getParam('file'); + + $info = explode("_", $id); + + if($info[0] == "au") { + $file = StoredFile::Recall($info[1]); + $this->view->type = $info[0]; + $this->view->md = $file->md; + } + else if($info[0] == "pl") { + $file = Playlist::Recall($info[1]); + $this->view->type = $info[0]; + $this->view->md = $file->getAllPLMetaData(); + $this->view->contents = $file->getContents(); + } + + } + + } @@ -162,3 +187,5 @@ class LibraryController extends Zend_Controller_Action + + diff --git a/application/models/Playlist.php b/application/models/Playlist.php index dee382093..cfac55281 100644 --- a/application/models/Playlist.php +++ b/application/models/Playlist.php @@ -166,13 +166,13 @@ class Playlist { return FALSE; $storedPlaylist = new Playlist(); - $storedPlaylist->id = $pl->getDbId(); + $storedPlaylist->id = $id; $storedPlaylist->name = $pl->getDbName(); $storedPlaylist->state = $pl->getDbState(); $storedPlaylist->currentlyaccessing = $pl->getDbCurrentlyaccessing(); $storedPlaylist->editedby = $pl->getDbEditedby(); $storedPlaylist->mtime = $pl->getDbMtime(); - + return $storedPlaylist; } @@ -461,7 +461,7 @@ class Playlist { } $metadata = $media->getMetadata(); - $length = $metadata["length"]; + $length = $metadata["dcterms:extent"]; if (!is_null($p_clipLength)) { $length = $p_clipLength; @@ -777,6 +777,25 @@ class Playlist { } + public function getAllPLMetaData() + { + $categories = $this->categories; + $row = CcPlaylistQuery::create()->findPK($this->id); + $md = array(); + + foreach($categories as $key => $val) { + if($val === 'length') { + $md[$key] = $this->getLength(); + continue; + } + + $method = 'get' . $val; + $md[$key] = $row->$method(); + } + + return $md; + } + public function getPLMetaData($category) { $cat = $this->categories[$category]; diff --git a/application/models/StoredFile.php b/application/models/StoredFile.php index 2f54c0ce0..a5c730b88 100644 --- a/application/models/StoredFile.php +++ b/application/models/StoredFile.php @@ -492,9 +492,9 @@ class StoredFile { $escapedValue = pg_escape_string($this->gunid); $sql = "SELECT * FROM ".$CC_CONFIG["filesTable"] ." WHERE gunid='$escapedValue'"; - //var_dump($sql); + $this->md = $CC_DBC->getRow($sql); - //var_dump($this->md); + if (PEAR::isError($this->md)) { $error = $this->md; $this->md = null; @@ -511,10 +511,9 @@ class StoredFile { $compatibilityData[$xmlName] = $value; } } - //var_dump($compatibilityData); - $this->md = array_merge($this->md, $compatibilityData); - //var_dump($this->md); - //$_SESSION["debug"] = $this->md; + + //$this->md = array_merge($this->md, $compatibilityData); + $this->md = $compatibilityData; } public function setFormat($p_value) @@ -707,7 +706,7 @@ class StoredFile { $sql = "SELECT *" ." FROM ".$CC_CONFIG['filesTable'] ." WHERE $cond"; - //echo $sql; + $row = $CC_DBC->getRow($sql); if (PEAR::isError($row) || is_null($row)) { return $row; diff --git a/application/views/scripts/library/contents.ajax.phtml b/application/views/scripts/library/contents.ajax.phtml deleted file mode 100644 index 080b0a341..000000000 --- a/application/views/scripts/library/contents.ajax.phtml +++ /dev/null @@ -1 +0,0 @@ -partialLoop('library/libraryTablePartial.phtml', $this->files) ?> diff --git a/application/views/scripts/library/contextMenuPartial.phtml b/application/views/scripts/library/contextMenuPartial.phtml deleted file mode 100644 index 31b484496..000000000 --- a/application/views/scripts/library/contextMenuPartial.phtml +++ /dev/null @@ -1 +0,0 @@ -
  • text ?>
  • diff --git a/application/views/scripts/library/get-file-meta-data.ajax.phtml b/application/views/scripts/library/get-file-meta-data.ajax.phtml new file mode 100644 index 000000000..97aeba58a --- /dev/null +++ b/application/views/scripts/library/get-file-meta-data.ajax.phtml @@ -0,0 +1,47 @@ +type == "au") : ?> +
    Title:md["dc:title"]);?>
    +
    Artist:md["dc:creator"]);?>
    +
    Album:md["dc:source"]);?>
    +
    Track:md["ls:track_num"]);?>
    +
    Length:md["dcterms:extent"]);?>
    +
    Genre:md["dc:type"]);?>
    +
    Sample Rate:md["ls:samplerate"]);?>
    +
    Bit Rate:md["ls:bitrate"]);?>
    +
    Channels:md["ls:channels"]);?>
    + +
    Year:md["ls:year"]);?>
    +
    Label:md["dc:publisher"]);?>
    +
    BPM:md["ls:bpm"]);?>
    +
    Channels:md["ls:channels"]);?>
    +
    Orchestra:md["ls:orchestra"]);?>
    +
    Conductor:md["ls:conductor"]);?>
    +
    Copyright:md["dc:rights"]);?>
    +
    Catalog Number:md["ls:catalognumber"]);?>
    +
    Isrc Number:md["ls:isrcnumber"]);?>
    + +
    Report Datetime:md["dcterms:temporal"]);?>
    +
    Report Location:md["dcterms:spatial"]);?>
    +
    Report Organization:md["dcterms:entity"]);?>
    +
    Subject:md["dc:subject"]);?>
    +
    Contributor:md["dc:contributor"]);?>
    + +
    Language:md["dc:language"]);?>
    +
    Comments:md["dc:description"]);?>
    + + +type == "pl") : ?> +
    Name:md["dc:title"]);?>
    +
    Creator:md["dc:creator"]);?>
    +
    Length:md["dcterms:extent"]);?>
    +
    Description:md["dc:description"]);?>
    +
    Contents: + contents as $row) : ?> +
    + + + + +
    + +
    + diff --git a/application/views/scripts/library/quick-search.phtml b/application/views/scripts/library/quick-search.phtml deleted file mode 100644 index d8bbabb76..000000000 --- a/application/views/scripts/library/quick-search.phtml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/public/css/styles.css b/public/css/styles.css index 334bbdd5c..769789a02 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -702,7 +702,7 @@ dt.block-display, dd.block-display { .floated-panel { margin-top:0; width:99.99%; - z-index:9999; + z-index:999; } diff --git a/public/js/airtime/library/library.js b/public/js/airtime/library/library.js index 6537e8a35..09fa8c2e1 100644 --- a/public/js/airtime/library/library.js +++ b/public/js/airtime/library/library.js @@ -64,6 +64,41 @@ function dtRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { $(nRow).attr("id", 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 + title: { + text: aData[1] + ' MetaData', + button: 'Close' // Show a close link in the title + } + }, + position: { + corner: { + //target: 'leftMiddle' + tooltip: 'rightMiddle' + }, + adjust: { + screen: true // Keep the tooltip on-screen at all times + } + }, + show: { + when: 'click', + solo: true // Only show one tooltip at a time + }, + hide: 'click', + style: { + border: { + width: 0, + radius: 4 + }, + name: 'dark', // Use the default light style + width: 570 // Set the tooltip width + } + }); + return nRow; }