5093 Posts in 1516 Topics by 1113 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1331 Views |
-
ImageUploader doesn't work

31 January 2009 at 9:05am
Hello
I'm trying to add image field. According to tutorial, this code
static $has_one = array(
'Photo' => 'Image'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Images", new ImageField('Photo'));
return $fields;
}should work. But I'm getting error
FATAL ERROR: i18n::include_by_class: Class ImageUploader not found
At line 1258 in D:\htdocs\pss\sapphire\core\i18n.phpuser_error(i18n::include_by_class: Class ImageUploader not found,512)
line 1258 of i18n.phpi18n::include_by_class(ImageUploader)
line 134 of Core.php_t(ImageUploader.ATTACH,Attach %s,50,Attach image/file)
line 535 of Image.phpImage_Uploader->EditImageForm()
call_user_func_array(Array,Array)
In sources I've found class Image_Uploader. Is this correct name of image class? What should I do to run this code?
-
Re: ImageUploader doesn't work

2 February 2009 at 11:14pm
Hello
I've found solution. Problem isn't in class name but in code that create strings (in methods EditImageForm and DeleteImageForm). This code doesn't work:
$title = sprintf(
_t('ImageUploader.REPLACE', "Replace %s", PR_MEDIUM, 'Replace file/image'),
$type
);
$fromYourPC = _t('ImageUploader.ONEFROMCOMPUTER', "With one from your computer");
$fromTheDB = _t('ImageUplaoder.ONEFROMFILESTORE', "With one from the file store");but after replacing to this:
$title = 'Replace file/image';
$fromYourPC = 'With one from your computer';
$fromTheDB = "With one from the file store";everything is ok
| 1331 Views | ||
|
Page:
1
|
Go to Top |

