Ejemplo n.º 1
0
                 Gallery_utils::DeleteGalleryDB($fileinfo['filepath'] . $fileinfo['filename'], $fid);
             }
         }
         $gid = empty($params['gid']) ? $fileinfo['galleryid'] : $params['gid'];
     } else {
         $nopermission += count($fid_array);
     }
     break;
 case 'rotateclockwise':
 case 'rotateanticlockwise':
     if ($permission_to_edit == 'all' || $permission_to_edit == 'this') {
         foreach ($fid_array as $fid) {
             $fileinfo = Gallery_utils::Getgalleryinfobyid($fid);
             $image = '../' . DEFAULT_GALLERY_PATH . $fileinfo['filepath'] . $fileinfo['filename'];
             $degrees = $params['multiaction'] == 'rotateclockwise' ? 270 : 90;
             Gallery_utils::RotateImage($image, $degrees);
         }
     } else {
         $nopermission++;
     }
     break;
 case 'active':
     $query = "UPDATE " . cms_db_prefix() . "module_gallery SET active = 1 WHERE fileid IN (" . $fids . ")";
     $db->Execute($query);
     break;
 case 'inactive':
     $query = "UPDATE " . cms_db_prefix() . "module_gallery SET active = 0 WHERE fileid IN (" . $fids . ")";
     $db->Execute($query);
     break;
 case 'switchactive':
     $query = "UPDATE " . cms_db_prefix() . "module_gallery SET active = active^1 WHERE fileid IN (" . $fids . ")";
Ejemplo n.º 2
0
<?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);