added some useful models and controllers

This commit is contained in:
Logsol 2013-07-08 21:02:22 +02:00
parent 9bb724147e
commit 1d4b2a3314
44 changed files with 6424 additions and 0 deletions

View file

@ -0,0 +1,33 @@
<?php
class AdminUploadController extends Katharsis_Controller_Abstract
{
public function indexAction()
{
}
public function productAction()
{
$shop = new Product();
$this->_view->item = $shop->getProduct($this->_getParam('productId'));
}
public function processAction()
{
$upload = new Upload();
if($this->_getParam('productId'))
{
if($_FILES['small']['type'] != $_FILES['big']['type'])
{
throw new DidgeridooArtwork_Exception('Beide Bilder müssen vom selben Dateityp sein.');
}
$filename = $upload->product($this->_getParam('productId'), $_FILES);
$product = new Product();
$product->addImage($this->_getParam('productId'), $filename);
DidgeridooArtwork_Notice::add('Das Hochladen war erfolgreich.');
$this->_location('edit', 'adminShop', array('productId' => $this->_getParam('productId')));
}
}
}