diff --git a/application/controller/AdminPageController.php b/application/controller/AdminPageController.php index d580fa3..4c37b28 100644 --- a/application/controller/AdminPageController.php +++ b/application/controller/AdminPageController.php @@ -26,7 +26,7 @@ class AdminPageController extends Katharsis_Controller_Abstract $type = 'page'; } - $path = getcwd().'/img/' . $type . '/'; + $path = getcwd().'/public/img/' . $type . '/'; if(isset($_FILES['myfile'])) { @@ -54,7 +54,7 @@ class AdminPageController extends Katharsis_Controller_Abstract } $ar = array(); - if (is_readable($path) && $handle = opendir()) + if (is_readable($path) && $handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if(is_dir($file)) continue; @@ -63,6 +63,7 @@ class AdminPageController extends Katharsis_Controller_Abstract closedir($handle); } + $this->_view->type = $type; $this->_view->files = $ar; echo $this->_view->render('AdminPage/image'); diff --git a/application/model/Upload.php b/application/model/Upload.php index e327650..296a629 100644 --- a/application/model/Upload.php +++ b/application/model/Upload.php @@ -55,13 +55,11 @@ class Upload extends Katharsis_Model_Abstract break; } - $fullName = $dir . '/' . $name . $ext; - - if (!move_uploaded_file($file['tmp_name'], $fullName)) + if (!move_uploaded_file($file['tmp_name'], $dir . '/' . $name . $ext)) { throw new DidgeridooArtwork_Exception('Hochladen fehlgeschlagen. (move_uploaded_file: false)'); return false; } - return $fullName; + return $name . $ext; } } \ No newline at end of file diff --git a/application/view/AdminPage/image.phtml b/application/view/AdminPage/image.phtml index 29efa22..a834ffa 100644 --- a/application/view/AdminPage/image.phtml +++ b/application/view/AdminPage/image.phtml @@ -1,9 +1,8 @@ - Swiss Didgeridoo Artwork + Seinheit - @@ -18,8 +17,8 @@