/usr/share/horde/ansel/lib/Form/Image.php is in php-horde-ansel 3.0.5+debian0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | <?php
/**
* Copyright 2003-2016 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Chuck Hagenbuch <chuck@horde.org>
* @package Ansel
*/
class Ansel_Form_Image extends Horde_Form
{
protected $_useFormToken = false;
public function __construct(&$vars, $title)
{
global $gallery;
parent::__construct($vars, $title);
$this->setButtons(_("Save"));
$this->addHidden('', 'actionID', 'text', false);
$this->addHidden('', 'gallery', 'text', false);
$this->addHidden('', 'image', 'text', false);
$this->addHidden('', 'page', 'text', false);
$filesize = ini_get('upload_max_filesize');
if (substr($filesize, -1) == 'M') {
$filesize = $filesize * 1048576;
}
$filesize = $this->_get_size($filesize);
$this->addVariable(_("Make this the default photo for this gallery?"),
'image_default', 'boolean', false);
$this->addVariable(_("Caption"), 'image_desc', 'longtext', false, false,
null, array('4', '40'));
$this->addVariable(_("Original Date"), 'image_originalDate',
'monthdayyear', true, false, null,
array('start_year' => 1900));
$this->addVariable(_("Tags"), 'image_tags', 'text', false);
$this->addHidden('', 'image0', 'text', false);
$upload = $this->addVariable(
_("Replace photo with this file"), 'file0', 'file', false, false,
_("Maximum photo size:") . ' ' . $filesize, array(false));
$upload->setHelp('upload');
}
/**
* Format file size
*/
protected function _get_size($size)
{
$bytes = array('B', 'KB', 'MB', 'GB', 'TB');
foreach ($bytes as $val) {
if ($size > 1024) {
$size = $size / 1024;
} else {
break;
}
}
return round($size, 2) . ' ' . $val;
}
}
|