Merge pull request #892 from codenift/media_type

Track Types Feature
This commit is contained in:
Robb 2020-03-16 14:05:29 -04:00 committed by GitHub
commit 96f33f6250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 3719 additions and 169 deletions

View file

@ -26,6 +26,7 @@ foreach ($this->md as $key => &$value) {
<tr><td><?php echo _("Artwork:"); ?></td><td><?php echo ($this->md["MDATA_KEY_ARTWORK"]);?></td></tr>
<tr><td><?php echo _("Artwork Data:"); ?></td><td><?php echo ($this->md["MDATA_KEY_ARTWORK_DATA"]);?></td></tr>
<tr><td><?php echo _("Language:"); ?></td><td><?php echo ($this->md["MDATA_KEY_LANGUAGE"]);?></td></tr>
<tr><td><?php echo _("Track Type:"); ?></td><td><?php echo ($this->md["MDATA_KEY_TRACK_TYPE"]);?></td></tr>
<tr><td class='file-md-qtip-nowrap'><?php echo _("File Path:"); ?></td><td><?php echo ($this->md["MDATA_KEY_FILEPATH"]);?></td></tr>
</table>
<?php endif; ?>

View file

@ -13,9 +13,60 @@
$disk = $partitions[0];
$used = $disk->totalSpace-$disk->totalFreeSpace;
$total = $disk->totalSpace;
$tracktypes = Application_Model_Tracktype::getTracktypes();
if(count($tracktypes) == 0) {
$hasTracktypes = "disabled";
$showTracktypesDropdown = false;
} else {
$hasTracktypes = "";
$showTracktypesDropdown = true;
}
?>
<?php
if (isset($_COOKIE['tt_upload'])) {
$ttsaved = $_COOKIE['tt_upload'];
} else {
// Use default track type
$ttsaved = "MUS";
}
?>
<div id="upload_wrapper">
<H2>Upload Audio Files</H2>
<div id="track_type_selection">
<form>
<?php
if ($showTracktypesDropdown != false) { ?>
<select id="select_type" class="form-control" <?php echo $hasTracktypes; ?>>
<?php
echo "<option value=''>Select Track Type</option>";
foreach ($tracktypes as $key => $tt) {
$selected = "";
if ($ttsaved == $tt['code']) {
$selected = "selected";
}
$code = $tt['code'];
$typename = $tt['type_name'];
echo "<option value='$code' $selected>$typename</option>";
}
?>
</select>
<?php } ?>
</form>
</div>
<?php
if ($showTracktypesDropdown) {
$ttTitle = "";
foreach ($tracktypes as $key => $tt) {
if ($ttsaved == $tt['code']) {
$ttTitle = $tt['type_name'];
}
}
}
?>
<H2><?php echo _("Upload")?> <span id="upload_type" <?php echo ($showTracktypesDropdown && $ttTitle!="") ? 'style="color:#ff611f"' : "" ?>>
<?php echo ($showTracktypesDropdown && $ttTitle!="") ? $ttTitle : "Tracks"; ?></span></H2>
<form action="/rest/media" method="post" id="add-media-dropzone" class="dropzone dz-clickable">
<?php echo $this->form->getElement('csrf') ?>
<div class="dz-message">
@ -53,7 +104,7 @@
<input type="radio" name="upload_status" id="upload_status_all" checked /><label for="upload_status_all"><?php echo _("All")?></label>
<input type="radio" name="upload_status" id="upload_status_failed" /><label for="upload_status_failed"><?php echo _("Failed")?></label>
<input type="radio" name="upload_status" id="upload_status_pending" /><label for="upload_status_pending"><?php echo _("Pending")?></label>
</form>
</form>
</div>
<H2><?php echo _("Recent Uploads")?></H2>
<table id="recent_uploads_table" class="datatable lib-content ui-widget ui-widget-content block-shadow"

View file

@ -0,0 +1,36 @@
<div class="ui-widget prefpanel clearfix padded-strong tracktype-management">
<h2><?php echo _("Manage Track Types") ?></h2>
<div class="tracktype-list-wrapper">
<div id="tracktypes_wrapper" class="dataTables_wrapper">
<div class="button-holder">
<button type="button" id="add_tracktype_button" name="search_add_group" class="ui-button ui-widget ui-button-text-icon-primary btn">
<span class="ui-icon ui-icon-plusthick"></span>
<span class="ui-button-text"><?php echo _("New Track Type")?></span>
</button>
</div>
<table cellspacing="0" cellpadding="0" style="" id="tracktypes_datatable" class="datatable">
<thead>
<tr>
<th><?php echo _("id") ?></th>
<th><?php echo _("Code") ?></th>
<th><?php echo _("Label")?></th>
<th><?php echo _("Description")?></th>
<th><?php echo _("Visibility")?></th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="tracktype-data simple-formblock" id="tracktype_details">
<?php echo $this->successMessage ?>
<fieldset class="padded">
<?php echo $this->form ?>
</fieldset>
</div>
</div>

View file

@ -0,0 +1,3 @@
<?php
echo $this->entries;
?>

View file

@ -0,0 +1,3 @@
<?php
echo $this->entries;
?>