removing app access check, fix title for links in tiles

This commit is contained in:
Bartek Przybylski 2012-06-09 15:12:28 +02:00
parent e073cd756c
commit 7ee722e0da
3 changed files with 6 additions and 5 deletions

View File

@ -4,9 +4,6 @@ namespace OC\Pictures;
require_once('lib/base.php');
\OCP\JSON::checkLoggedIn();
\OCP\JSON::checkAppEnabled('gallery');
class DatabaseManager {
private static $instance = null;
const TAG = 'DatabaseManager';

View File

@ -95,7 +95,7 @@ class TileSingle extends TileBase {
public function get($extra = '') {
// !HACK! file path needs to be encoded twice because files app decode twice url, so any special chars like + or & in filename
// !HACK! will result in failing of opening them
return '<a rel="images" title="'.basename($this->getPath()).'" href="'.\OCP\Util::linkTo('files', 'download.php').'?file='.urlencode(urlencode($this->getPath())).'"><img rel="images" src="'.\OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'&filepath='.urlencode($this->getPath()).'" '.$extra.'></a>';
return '<a rel="images" title="'.htmlentities(basename($this->getPath())).'" href="'.\OCP\Util::linkTo('files', 'download.php').'?file='.urlencode(urlencode($this->getPath())).'"><img rel="images" src="'.\OCP\Util::linkTo('gallery', 'ajax/thumbnail.php').'&filepath='.urlencode($this->getPath()).'" '.$extra.'></a>';
}
public function getMiniatureSrc() {

View File

@ -400,7 +400,11 @@ class OC_Image {
break;
*/
default:
$this->resource = imagecreatefromstring(file_get_contents($imagepath));
error_log($imagepath);
error_log(\OC_Filesystem::getInternalPath($imagepath));
error_log(\OC_Filesystem::getLocalFile($imagepath));
// this is mostly file created from encrypted file
$this->resource = imagecreatefromstring(\OC_Filesystem::file_get_contents(\OC_Filesystem::getInternalPath($imagepath)));
$itype = IMAGETYPE_PNG;
OC_Log::write('core','OC_Image->loadFromFile, Default', OC_Log::DEBUG);
break;