<?php if (!isset($gCms)) { exit; } if (!$this->CheckPermission('Use Gallery')) { echo $this->ShowErrors(lang('needpermissionto', 'Use Gallery')); return; } if (!isset($params['fid']) || !isset($params['degr'])) { $params = array('active_tab' => 'galleries', 'module_error' => lang('missingparams')); $this->Redirect($id, 'defaultadmin', '', $params); return; } // get image info $imageprops = Gallery_utils::Getimagebyid($params['fid']); $image = '../' . DEFAULT_GALLERY_PATH . $imageprops['filepath'] . $imageprops['filename']; Gallery_utils::RotateImage($image, $params['degr']); $params = array('fid' => $params['fid'], 'mode' => 'edit', 'active_tab' => 'thumbs', 'module_message' => $this->Lang('imageupdated')); $this->Redirect($id, 'editimage', '', $params);
if (!$gCms) { exit; } if (!$this->CheckPermission('Use Gallery')) { echo $this->ShowErrors(lang('needpermissionto', 'Use Gallery')); return; } $themeObject =& $gCms->variables['admintheme']; // check parameters if (!isset($params['fid']) || !isset($params['mode'])) { $params['module_error'] = lang('missingparams'); $this->Redirect($id, 'defaultadmin', '', $params); return; } $params['template'] = empty($params['template']) ? 0 : $params['template']; $file = Gallery_utils::Getimagebyid($params['fid']); if ($params['mode'] == 'edit') { $trueimage = $themeObject->DisplayImage('icons/system/true.gif', $this->Lang('setfalse'), '', '', 'systemicon'); $falseimage = $themeObject->DisplayImage('icons/system/false.gif', $this->Lang('settrue'), '', '', 'systemicon'); $falseimage2 = $themeObject->DisplayImage('icons/system/false.gif', $this->Lang('noalbumcover'), '', '', 'systemicon'); $onerow = new stdClass(); $onerow->fileid = $file['fileid']; $onerow->file = '../' . DEFAULT_GALLERY_PATH . $file['filepath'] . $file['filename']; $imgdata = getimagesize($onerow->file); $onerow->filewidthheight = ''; $maxwidth = 480; $imgscale = 1; if ($imgdata[0] > $maxwidth) { $imgratio = $imgdata[0] / $imgdata[1]; // width/height $height = ceil($maxwidth / $imgratio);
} } if (isset($params['id'])) { $imginfo = Gallery_utils::Getimagebyid($params['id']); if ($imginfo && substr($imginfo['filename'], -1) == '/') { $params['dir'] = $imginfo['filepath'] . $imginfo['filename']; } elseif ($imginfo) { $params['img'] = $params['id']; } } if (isset($params['img'])) { // display single image $template = isset($params['template']) ? $params['template'] : $this->GetPreference('singleimg_template'); $templateprops = Gallery_utils::GetTemplateprops($template); if (!isset($imginfo)) { $imginfo = Gallery_utils::Getimagebyid($params['img']); } if ($imginfo) { $filepath = $imginfo['filepath']; $file = $filepath . $imginfo['filename']; $rec = new stdClass(); $rec->fileid = $imginfo['fileid']; $rec->file = DEFAULT_GALLERY_PATH . $file; $rec->filedate = $imginfo['filedate']; $rec->filename = trim($imginfo['filename'], "/"); $rec->title = $imginfo['title']; $rec->titlename = empty($imginfo['title']) ? $imginfo['filename'] : $imginfo['title']; $rec->comment = $imginfo['comment']; $rec->fileorder = $imginfo['fileorder']; $rec->active = $imginfo['active']; $rec->isdir = false;