<?php

include 'base.php';
User::protect();
include_class('general_media');
include_class('m2');
$id = $_GET['id'] > 0 && is_numeric($_GET['id']) ? $_GET['id'] : 0;
$gm = new GeneralMedia();
if ($id != 0) {
    $ma = MediaArea::get($id);
    if (!db::isError($ma)) {
        $gm->setAreaObject($ma);
        $isNotGeneralMedia = !$ma->isGeneralMedia();
    }
}
if ($_POST['submit'] && !db::isError($ma)) {
    $res = $ma->updateInformation($_POST, $gm);
    if (!db::isError($res)) {
        header('Location: media.php?id=' . $ma->getID());
        exit;
    }
}
$editors = array('description');
$section = 'media';
$page_title = 'Edit Media Area';
include 'layout/header.php';
if ($isNotGeneralMedia) {
    Error::outputDialog('Return to Media', 'media.php', 'You may only edit general media here. Any media that has been added to a specific band member, show or release must be edited in its appropriate section.');
} else {
    if (!db::isError($ma)) {
        ?>
示例#2
0
<?php

include 'base.php';
User::protect();
include_class('general_media');
include_class('m2');
$id = $_GET['id'] > 0 && is_numeric($_GET['id']) ? $_GET['id'] : 0;
$section = 'media';
$ma = MediaArea::get($id);
$gm = new GeneralMedia();
$gm->setAreaObject($ma);
if (!db::isError($ma)) {
    switch ($_GET['task']) {
        case 'rescan':
            if ($ma) {
                $res = $ma->rescan($gm);
                if (!db::isError($res)) {
                    header('Location: media.php?id=' . $_GET['id']);
                    exit;
                }
            }
            break;
        case 'move_up':
            if ($ma) {
                $mi = MediaInstance::get($_GET['media_instance_id']);
                if (!db::isError($mi)) {
                    $res = $mi->moveUp($gm);
                    if (!db::isError($res)) {
                        header('Location: media.php?id=' . $_GET['id']);
                        exit;
                    }
示例#3
0
<?php

include 'base.php';
User::protect();
include_class('general_media');
include_class('m2');
$editors = array('description');
$id = $_GET['id'] > 0 && is_numeric($_GET['id']) ? $_GET['id'] : 0;
$gm = new GeneralMedia();
if ($id != 0) {
    $ma = MediaArea::get($id);
    if (!db::isError($ma)) {
        $gm->setAreaObject($ma);
        $isNotGeneralMedia = !$ma->isGeneralMedia();
    }
    $mi = MediaInstance::get($_GET['media_instance_id']);
    if (!db::isError($mi)) {
        switch ($_GET['task']) {
            case 'update':
                $res = $mi->update($_POST, $gm);
                if (!db::isError($res)) {
                    header('Location: media_edit.php?id=' . $_GET['id'] . '&media_instance_id=' . $_GET['media_instance_id']);
                }
                break;
            case 'deactivate':
                $res = $mi->deactivate($gm);
                if (!db::isError($res)) {
                    header('Location: media_edit.php?id=' . $_GET['id'] . '&media_instance_id=' . $_GET['media_instance_id']);
                }
                break;
            case 'activate':
示例#4
0
<?php

include 'base.php';
User::protect();
$section = 'media';
include_class('general_media');
include_class('m2');
$id = $_GET['id'] > 0 && is_numeric($_GET['id']) ? $_GET['id'] : 0;
if ($id == 0) {
    $id = $_REQUEST['area'] > 0 ? $_REQUEST['area'] : 0;
}
$gm = new GeneralMedia();
if ($id != 0) {
    $ma = MediaArea::get($id);
    $gm = new GeneralMedia();
    if (is_object($ma)) {
        $isNotGeneralMedia = !$ma->isGeneralMedia();
        $gm->setAreaObject($ma);
    }
}
if ($_POST['localfile']) {
    if ($ma) {
        $doSubmit = true;
        $res = $ma->addMediaUpload('mediafile', $gm);
    }
} else {
    if ($_POST['url']) {
        if ($ma) {
            $doSubmit = true;
            $res = $ma->addMediaRemote($_POST['url'], $gm);
        }