summaryrefslogtreecommitdiffstats
path: root/albums.php
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2012-04-09 16:18:13 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2012-04-09 16:18:13 -0400
commitec9389f5c64f7de1d985d364b55a7872580034c2 (patch)
tree57f572f384315853c93c1b5a51f91fff91990895 /albums.php
parent8b27b6aee2e7662f1363692f647aff2d70720063 (diff)
downloadampache-ec9389f5c64f7de1d985d364b55a7872580034c2.tar.gz
ampache-ec9389f5c64f7de1d985d364b55a7872580034c2.tar.bz2
ampache-ec9389f5c64f7de1d985d364b55a7872580034c2.zip
Make Art->get_from_source() static
Half the calls to it were already trying to call it as a static method anyway. The only time $this was referenced was to get the type, so pass type as a parameter.
Diffstat (limited to 'albums.php')
-rw-r--r--albums.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/albums.php b/albums.php
index dd16e317..933873e0 100644
--- a/albums.php
+++ b/albums.php
@@ -48,11 +48,9 @@ switch ($_REQUEST['action']) {
}
$album = new Album($_REQUEST['album_id']);
- $art = new Art($album->id,'album');
-
// Pull the image information
$data = array('file'=>$_FILES['file']['tmp_name']);
- $image_data = $art->get_from_source($data);
+ $image_data = Art::get_from_source($data, 'album');
// If we got something back insert it
if ($image_data) {
@@ -82,7 +80,7 @@ switch ($_REQUEST['action']) {
$path_info = pathinfo($_FILES['file']['name']);
$upload['file'] = $_FILES['file']['tmp_name'];
$upload['mime'] = 'image/' . $path_info['extension'];
- $image_data = $art->get_from_source($upload);
+ $image_data = Art::get_from_source($upload, 'album');
if ($image_data) {
$art->insert($image_data,$upload['0']['mime']);
@@ -155,7 +153,7 @@ switch ($_REQUEST['action']) {
$album_id = $_REQUEST['album_id'];
$art = new Art($album_id,'album');
- $image = $art->get_from_source($_SESSION['form']['images'][$image_id]);
+ $image = Art::get_from_source($_SESSION['form']['images'][$image_id], 'album');
$mime = $_SESSION['form']['images'][$image_id]['mime'];
$art->insert($image,$mime);