Moved functionality for uploading to RESTful ShowController class

This commit is contained in:
Duncan Sommerville 2014-09-16 18:18:26 -04:00
parent 3be8e10691
commit f3548ff893
1 changed files with 2 additions and 15 deletions

View File

@ -1,8 +1,5 @@
<?php
$filepath = realpath (dirname(__FILE__));
require_once($filepath."/../modules/rest/controllers/MediaController.php");
class ScheduleController extends Zend_Controller_Action
{
@ -594,7 +591,8 @@ class ScheduleController extends Zend_Controller_Action
$forms["style"]->removeElement("upload");
if ($service_showForm->validateShowForms($forms, $data)) {
$service_show->addUpdateShow($data);
// Get the show ID from the show service to pass as a parameter to the RESTful ShowController
$this->view->showId = $service_show->addUpdateShow($data);
//send new show forms to the user
$this->createShowFormAction(true);
@ -610,17 +608,6 @@ class ScheduleController extends Zend_Controller_Action
}
}
/**
* Since the form is being submitted via jQuery, this function accepts
* a second AJAX request and writes the file (sent as a FormData object)
*/
public function uploadImageAction()
{
Rest_MediaController::processUploadedImage(
$_FILES["show-image"]["tmp-name"],
$_FILES["show-image"]["name"]);
}
public function createShowFormAction($populateDefaults=false)
{
$service_showForm = new Application_Service_ShowFormService();