- }
- else {
- $filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.'.$a->config['imagecrop_ext'];
- $resolution = $a->config['imagecrop_resolution'];
- $tpl = get_markup_template("cropbody.tpl");
- $o .= replace_macros($tpl,array(
- '$filename' => $filename,
- '$profile' => intval($_REQUEST['profile']),
- '$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'],
- '$image_url' => App::get_baseurl() . '/photo/' . $filename,
- '$title' => t('Crop Image'),
- '$desc' => t('Please adjust the image cropping for optimum viewing.'),
- '$form_security_token' => get_form_security_token("profile_photo"),
- '$done' => t('Done Editing')
- ));
+ } else {
+ $filename = $imagecrop['hash'] . '-' . $imagecrop['resolution'] . '.' . $imagecrop['ext'];
+ $tpl = Renderer::getMarkupTemplate("cropbody.tpl");
+ $o = Renderer::replaceMacros($tpl,
+ [
+ '$filename' => $filename,
+ '$profile' => (isset($_REQUEST['profile']) ? intval($_REQUEST['profile']) : 0),
+ '$resource' => $imagecrop['hash'] . '-' . $imagecrop['resolution'],
+ '$image_url' => System::baseUrl() . '/photo/' . $filename,
+ '$title' => L10n::t('Crop Image'),
+ '$desc' => L10n::t('Please adjust the image cropping for optimum viewing.'),
+ '$form_security_token' => BaseModule::getFormSecurityToken("profile_photo"),
+ '$done' => L10n::t('Done Editing')
+ ]);