예제 #1
0
 function getAVAreaObject()
 {
     if ($this->av_area_id > 0) {
         $ma = MediaArea::get($this->av_area_id);
         return $ma;
     } else {
         $e = new Error();
         $e->add("An administrator has not yet registered this track for audio or videos.");
         return $e;
     }
 }
예제 #2
0
 function getPhotoAreaObject()
 {
     if ($this->photo_area_id > 0) {
         $ma = MediaArea::get($this->photo_area_id);
         return $ma;
     } else {
         $e = new Error();
         $e->add("An administrator has not yet registered this show for photos.");
         return $e;
     }
 }
예제 #3
0
include_class('tours');
include_class('m2');
// type is only used on initial entry, not on an actual submit
$to = Tour::get($_GET['id']);
if (!db::isError($to)) {
    $doSubmit = false;
    if (!$_POST['area']) {
        $type = $_REQUEST['type'] == 'av' ? 'av' : 'photos';
        $ma = $type == 'av' ? $to->getAVAreaObject() : $to->getPhotoAreaObject();
    } else {
        if ($_POST['area'] == $to->getAVAreaID() || $_POST['area'] == $to->getPhotoAreaID()) {
            $doSubmit = true;
        }
    }
    if ($doSubmit) {
        $ma = MediaArea::get($_POST['area']);
        if (!db::isError($ma)) {
            if ($_POST['localfile']) {
                $res = $ma->addMediaUpload('mediafile', $to);
            } else {
                if ($_POST['url']) {
                    $res = $ma->addMediaRemote($_POST['url'], $to);
                } else {
                    if ($_POST['toAdd'] == 'all') {
                        $keepCopy = $_POST['copyFromIncoming'] ? 1 : 0;
                        $res = $ma->addAllMediaIncoming($keepCopy, $to);
                    } else {
                        if ($_POST['incoming_file']) {
                            $keepCopy = $_POST['copyFromIncoming'] ? 1 : 0;
                            $res = $ma->addMediaIncoming($_POST['incoming_file'], $keepCopy, $to);
                        }
<?php

include 'base.php';
User::protect();
include_class('general_media');
include_class('m2');
$media = new Media();
$ma = MediaArea::get($_REQUEST['id']);
if ($_GET['task'] == 'update' && !db::isError($ma)) {
    $res = $ma->updatePreferences($_POST);
    if (!db::isError($res)) {
        header('Location: media_preferences.php?id=' . $_GET['id']);
    }
}
$page_title = 'Media Preferences';
$stylesheet = 'popup.css';
include 'layout/header_popup.php';
if (!db::isError($ma)) {
    if (User::isAdmin()) {
        if ($_GET['task'] == 'edit') {
            ?>
	
		<h1>edit media area</h1>
		<div class="inset">
			<form id="edit_entry" action="<?php 
            echo $PHP_SELF;
            ?>
?task=update&amp;id=<?php 
            echo $_GET['id'];
            ?>
" method="post">
예제 #5
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;
$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)) {
        ?>
예제 #6
0
include_class('m2');
$ma = MediaArea::get($_REQUEST['id']);
if ($_GET['task'] == 'add_alias' && !db::isError($ma)) {
    $res = $ma->addMediaAlias($_POST['media']);
    if (!db::isError($res)) {
        ?>
			<script type="text/javascript">self.close(); opener.location.reload()</script>
		<?php 
    }
}
$page_title = 'Alias Media';
$stylesheet = 'popup.css';
include 'layout/header_popup.php';
$areaIDAdd = $_GET['area'] ? $_GET['area'] : '0';
if ($areaIDAdd) {
    $maAdd = MediaArea::get($areaIDAdd);
}
if (isset($maAdd) && !db::isError($maAdd)) {
    ?>
	
	<div id="breadcrumb">
		<a href="<?php 
    echo $PHP_SELF;
    ?>
?id=<?php 
    echo $_GET['id'];
    ?>
">Media&nbsp;&#62;</a>
		<?php 
    $breadcrumb = $maAdd->getAreaTrail();
    if ($breadcrumb) {
예제 #7
0
 function moveDown($filterObj = null)
 {
     if ($filterObj) {
         $proceed = $filterObj->validateMediaOperation("MOVEDOWN");
         if (db::isError($proceed)) {
             return $proceed;
         }
     }
     $a = MediaArea::get($this->area_id);
     if (!db::isError($a)) {
         $a->updateDisplayOrder();
     }
     $q = "select display_order from DarkRoom_Media_to_Areas where ID = {$this->ID}";
     $r = mysql_query($q);
     if (!$r) {
         return Error::MySQL();
     }
     $row = mysql_fetch_assoc($r);
     if ($row['display_order']) {
         $this->display_order = $row['display_order'];
     }
     $newDO = $this->display_order + 1;
     $r1 = mysql_query("update DarkRoom_Media_to_Areas set display_order = {$this->display_order} where display_order = {$newDO} and area_id = {$this->area_id}");
     $r2 = mysql_query("\tupdate DarkRoom_Media_to_Areas set display_order = {$newDO} where ID = {$this->ID}");
     if ($r1 && $r2) {
         return true;
     } else {
         $e = new Error();
         $e->add(mysql_error());
         return $e;
     }
 }