From: Cash Costello Date: Sat, 20 Jun 2009 20:52:39 +0000 (+0000) Subject: cleaned up icon code - don't need tidypics/icon view anymore - may reinstate it at... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=1bf62f1bc10831d559df147868dd889e5985adcc;p=lorea%2Felgg.git cleaned up icon code - don't need tidypics/icon view anymore - may reinstate it at a later time --- diff --git a/actions/icon.php b/actions/icon.php deleted file mode 100644 index bfc18198a..000000000 --- a/actions/icon.php +++ /dev/null @@ -1,36 +0,0 @@ -thumbnail; - $mime = $file->mimetype; - - header("Content-type: $mime"); - if (strpos($mime, "image/")!==false) - header("Content-Disposition: inline; filename=\"$filename\""); - else - header("Content-Disposition: attachment; filename=\"$filename\""); - - - $readfile = new ElggFile(); - $readfile->owner_guid = $file->owner_guid; - $readfile->setFilename($filename); - - $contents = $readfile->grabFile(); - - if (empty($contents)) - echo file_get_contents(dirname(dirname(__FILE__)) . "/graphics/icons/general.jpg" ); - else - echo $contents; - - exit; - } else { - register_error(elgg_echo("file:downloadfailed")); - } -?> \ No newline at end of file diff --git a/start.php b/start.php index dec7e36ed..cfd20db62 100644 --- a/start.php +++ b/start.php @@ -386,7 +386,6 @@ register_action("tidypics/addalbum", false, $CONFIG->pluginspath. "tidypics/actions/addalbum.php"); register_action("tidypics/edit", false, $CONFIG->pluginspath. "tidypics/actions/edit.php"); register_action("tidypics/delete", false, $CONFIG->pluginspath. "tidypics/actions/delete.php"); - register_action("tidypics/icon", true, $CONFIG->pluginspath. "tidypics/actions/icon.php"); register_action("tidypics/edit_multi", false, $CONFIG->pluginspath. "tidypics/actions/edit_multi.php"); register_action("tidypics/download", true, $CONFIG->pluginspath . "tidypics/actions/download.php"); register_action("tidypics/addtag", true, $CONFIG->pluginspath . "tidypics/actions/addtag.php"); diff --git a/views/default/object/album.php b/views/default/object/album.php index 3a5f5a975..ca28d1672 100644 --- a/views/default/object/album.php +++ b/views/default/object/album.php @@ -64,7 +64,11 @@ $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")"; $info .= "

"; - $icon = "getURL()}\">" . elgg_view("tidypics/icon", array('album' => true, 'size' => 'small')) . ""; + //get album cover if one was set + if ($album->cover) + $icon = "getURL()}\">" . 'thumbnail'; + else + $icon = "getURL()}\">" . 'new album'; echo elgg_view_listing($icon, $info); } diff --git a/views/default/object/image.php b/views/default/object/image.php index 03ba12a02..d09b721f1 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -78,7 +78,7 @@ if ($photo_tags) { if ($numcomments) $info .= ", getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")"; $info .= "

"; - $icon = "getURL()}\">" . elgg_view("tidypics/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'small')) . ""; + $icon = "getURL()}\">" . '' . $title . ''; echo elgg_view_listing($icon, $info); } diff --git a/views/default/tidypics/icon.php b/views/default/tidypics/icon.php deleted file mode 100644 index c960bc00b..000000000 --- a/views/default/tidypics/icon.php +++ /dev/null @@ -1,37 +0,0 @@ -wwwroot}mod/tidypics/graphics/icons/album.gif\" border=\"0\" />"; -} -else{ - - $mime = $vars['mimetype']; - if (isset($vars['thumbnail'])) { - $thumbnail = $vars['thumbnail']; - } else { - $thumbnail = false; - } - - $size = $vars['size']; - if ($size != 'large') { - $size = 'small'; - } - - if ($thumbnail && strpos($mime, "image/")!==false) - echo ""; - else - { - if ($size == 'large') - echo "wwwroot}mod/tidypics/graphics/icons/general_lrg.gif\" border=\"0\" />"; - else - echo "wwwroot}mod/tidypics/graphics/icons/general.gif\" border=\"0\" />"; - } -} -?> \ No newline at end of file