diff --git a/airtime_mvc/application/common/FileDataHelper.php b/airtime_mvc/application/common/FileDataHelper.php index 3c576f685..865f5eec1 100644 --- a/airtime_mvc/application/common/FileDataHelper.php +++ b/airtime_mvc/application/common/FileDataHelper.php @@ -349,4 +349,20 @@ class FileDataHelper { } } + /** + * Media Type + * + * @return string Media type key value + */ + public static function saveMediaType() + { + if (isset($_COOKIE['mt_upload'])) { + $mt = $_COOKIE['mt_upload']; + } else { + // Use default media type + $mt = "MUS"; + } + return $mt; + } + } diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index fcc390a46..5c9d4c5be 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -150,12 +150,14 @@ class CcFiles extends BaseCcFiles { $importedStorageDir = $storDir->getDirectory() . "imported/" . self::getOwnerId() . "/"; $importedDbPath = "imported/" . self::getOwnerId() . "/"; $artwork = FileDataHelper::saveArtworkData($filePath, $originalFilename, $importedStorageDir, $importedDbPath); + $mediaType = FileDataHelper::saveMediaType(); $file->fromArray($fileArray); $file->setDbOwnerId(self::getOwnerId()); $now = new DateTime("now", new DateTimeZone("UTC")); $file->setDbTrackTitle($originalFilename); $file->setDbArtwork($artwork); + $file->setDbMediaType($mediaType); $file->setDbUtime($now); $file->setDbHidden(true); $file->save(); diff --git a/airtime_mvc/application/views/scripts/plupload/index.phtml b/airtime_mvc/application/views/scripts/plupload/index.phtml index bdf6a485e..e02b5283e 100644 --- a/airtime_mvc/application/views/scripts/plupload/index.phtml +++ b/airtime_mvc/application/views/scripts/plupload/index.phtml @@ -14,8 +14,59 @@ $used = $disk->totalSpace-$disk->totalFreeSpace; $total = $disk->totalSpace; ?> + + 'Music', + 'SID' => 'Station IDs', + 'INT' => 'Intros', + 'OUT' => 'Outros', + 'SWP' => 'Sweepers', + 'JIN' => 'Jingles', + 'PRO' => 'Promos', + 'SHO' => 'Shout Outs', + 'NWS' => 'News', + 'COM' => 'Commercials', + 'ITV' => 'Interviews', + 'VTR' => 'Voice Trackings', + ); + ?> + +
-

Upload Audio Files

+ +
+
+ +
+
+ + $mt) { + if ($mtsaved == $key) { + $mtTitle = $mt; + } + } + ?> +

form->getElement('csrf') ?>
@@ -53,7 +104,7 @@ - +

Custom tool bar! Text/images etc.'); + + $("#select_type").on("change",function(){ + var mtValue = $("#select_type").val(); + var mtText = $('#select_type option[value="'+mtValue+'"]').text(); + $("#upload_type").text(" " + mtText); + Cookies.set('mt_upload', mtValue); + }); });