ngg_rotateImage
The NextCellent Gallery ngg rotateImage function.
Description
ngg_rotateImage();
Usage
if ( !function_exists( 'ngg_rotateImage' ) ) { require_once ABSPATH . PLUGINDIR . 'nextcellent-gallery/admin/ajax.php'; } // NOTICE! Understand what this does before running. $result = ngg_rotateImage();
Defined (1)
The function is defined in the following location(s).
- /admin/ajax.php
- function ngg_rotateImage() {
- // check for correct capability
- if ( !is_user_logged_in() )
- die('-1');
- // check for correct NextGEN capability
- if ( !current_user_can('NextGEN Manage gallery') )
- die('-1');
- require_once( dirname( dirname(__FILE__) ) . '/ngg-config.php');
- // include the ngg function
- include_once (dirname (__FILE__). '/functions.php');
- $ngg_options = get_option(ngg_options);
- $id = (int) $_POST['id'];
- $result = '-1';
- switch ( $_POST['ra'] ) {
- case 'cw' :
- $result = nggAdmin::rotate_image($id, 'CW');
- break;
- case 'ccw' :
- $result = nggAdmin::rotate_image($id, 'CCW');
- break;
- case 'fv' :
- $result = nggAdmin::rotate_image($id, 0, 'V');
- break;
- case 'fh' :
- $result = nggAdmin::rotate_image($id, 0, 'H');
- break;
- }
- // recreate the thumbnail
- nggAdmin::create_thumbnail($id);
- if ( $result == 1 )
- die('1');
- header('HTTP/1.1 500 Internal Server Error');
- die( $result );
- }