Ejemplo n.º 1
0
function get_license_name($license_name)
{
    return get_object_by_id('licenses', $license_name, 'name');
}
Ejemplo n.º 2
0
<?php

require_once 'download_file.php';
require_once 'dbo.php';
if (GET('download') == 'resource' && !GET_EMPTY('id')) {
    $hash = GET('id');
    $file_id = get_object_by_id('files', $hash, 'id', 'hash');
    $file_name = get_object_by_id('files', $hash, 'filename', 'hash');
    download_file($file_id, $file_name);
} else {
    header('Content-Type: text/xml');
    header('Content-Description: LMMS WebResources Index');
    echo '<?xml version="1.0"?>';
    echo '<!DOCTYPE lmms-webresources-index>';
    if (GET('download') == 'index') {
        echo '<webresources>';
        get_web_resources();
        echo '</webresources>';
    } else {
        echo '<error>Please contact the LMMS development team for API access</error>';
    }
    flush();
}
Ejemplo n.º 3
0
<?php

require_once 'utils.php';
require_once 'dbo.php';
require_once 'xhtml.php';
global $LSP_URL;
if (get_user_id(SESSION()) == get_object_by_id("files", GET('file'), 'user_id') || is_admin(get_user_id(SESSION()))) {
    if (!POST('updateok', false)) {
        $file_name = get_file_name(GET('file'));
        $file_extension = parse_extension($file_name);
        $categories = get_categories_for_ext($file_extension, get_file_category(GET('file')) . ' - ' . get_file_subcategory(GET('file')));
        echo '<div class="col-md-9">';
        create_title(array('Edit', get_file_url()));
        $form = new form($LSP_URL . '?content=update&file=' . GET('file'), $title = 'Edit File', 'fa-pencil');
        ?>
		<div class="form-group">
			<label for="category">Category</label>
			<select name="category" class="form-control">
			<?php 
        echo $categories;
        ?>
	
			</select>
		</div>
		<div class="form-group">
			<label for="license">License</label>
			<select name="license" class="form-control">
			<?php 
        echo get_licenses(get_license_name(get_file_license(GET('file'))));
        ?>
			</select>