__construct(); } /** * nggAddGallery::__construct() * * @return void */ function __construct() { // same as $_SERVER['REQUEST_URI'], but should work under IIS 6.0 $this->filepath = admin_url() . 'admin.php?page=' . $_GET['page']; //Look for POST updates if ( !empty($_POST) ) $this->processor(); } /** * Perform the upload and add a new hook for plugins * * @return void */ function processor() { global $wpdb, $ngg, $nggdb; $defaultpath = $ngg->options['gallerypath']; if ( isset($_POST['addgallery']) ){ check_admin_referer('ngg_addgallery'); if ( !nggGallery::current_user_can( 'NextGEN Add new gallery' )) wp_die(__('Cheatin’ uh?')); $newgallery = esc_attr( $_POST['galleryname']); if ( !empty($newgallery) ) nggAdmin::create_gallery($newgallery, $defaultpath); } if ( isset($_POST['zipupload']) ){ check_admin_referer('ngg_addgallery'); if ( !nggGallery::current_user_can( 'NextGEN Upload a zip' )) wp_die(__('Cheatin’ uh?')); if ($_FILES['zipfile']['error'] == 0 || (!empty($_POST['zipurl']))) nggAdmin::import_zipfile( intval( $_POST['zipgalselect'] ) ); else nggGallery::show_error( __('Upload failed!','nggallery') ); } if ( isset($_POST['importfolder']) ){ check_admin_referer('ngg_addgallery'); if ( !nggGallery::current_user_can( 'NextGEN Import image folder' )) wp_die(__('Cheatin’ uh?')); $galleryfolder = $_POST['galleryfolder']; if ( ( !empty($galleryfolder) ) AND ($defaultpath != $galleryfolder) ) nggAdmin::import_gallery($galleryfolder); } if ( isset($_POST['uploadimage']) ){ check_admin_referer('ngg_addgallery'); if ( !nggGallery::current_user_can( 'NextGEN Upload in all galleries' )) wp_die(__('Cheatin’ uh?')); if ( $_FILES['imagefiles']['error'][0] == 0 ) $messagetext = nggAdmin::upload_images(); else nggGallery::show_error( __('Upload failed! ' . nggAdmin::decode_upload_error( $_FILES['imagefiles']['error'][0]),'nggallery') ); } if ( isset($_POST['swf_callback']) ){ if ($_POST['galleryselect'] == '0' ) nggGallery::show_error(__('No gallery selected !','nggallery')); else { if ($_POST['swf_callback'] == '-1' ) nggGallery::show_error( __('Upload failed! ','nggallery') ); else { $gallery = $nggdb->find_gallery( (int) $_POST['galleryselect'] ); nggAdmin::import_gallery( $gallery->path ); } } } if ( isset($_POST['disable_flash']) ){ check_admin_referer('ngg_addgallery'); $ngg->options['swfUpload'] = false; update_option('ngg_options', $ngg->options); } if ( isset($_POST['enable_flash']) ){ check_admin_referer('ngg_addgallery'); $ngg->options['swfUpload'] = true; update_option('ngg_options', $ngg->options); } do_action( 'ngg_update_addgallery_page' ); } /** * Render the page content * * @return void */ function controller() { global $ngg, $nggdb; // check for the max image size $this->maxsize = nggGallery::check_memory_limit(); //get all galleries (after we added new ones) $this->gallerylist = $nggdb->find_all_galleries('gid', 'DESC'); $this->defaultpath = $ngg->options['gallerypath']; // link for the flash file $swf_upload_link = NGGALLERY_URLPATH . 'admin/upload.php'; // get list of tabs $tabs = $this->tabs_order(); // with this filter you can add custom file types $file_types = apply_filters( 'ngg_swf_file_types', '*.jpg;*.jpeg;*.gif;*.png;*.JPG;*.JPEG;*.GIF;*.PNG' ); // Set the post params, which plupload will post back with the file, and pass them through a filter. $post_params = array( "auth_cookie" => (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]), "logged_in_cookie" => $_COOKIE[LOGGED_IN_COOKIE], "_wpnonce" => wp_create_nonce('ngg_swfupload'), "galleryselect" => "0", ); $p = array(); foreach ( $post_params as $param => $val ) { $val = esc_js( $val ); $p[] = "'$param' : '$val'"; } $post_params_str = implode( ',', $p ). "\n"; ?> options['swfUpload'] && !empty ($this->gallerylist) ) { ?> gallerylist) ) $tabs['uploadimage'] = __( 'Upload Images', 'nggallery' ); if ( nggGallery::current_user_can( 'NextGEN Add new gallery' )) $tabs['addgallery'] = __('Add new gallery', 'nggallery'); if ( wpmu_enable_function('wpmuZipUpload') && nggGallery::current_user_can( 'NextGEN Upload a zip' ) ) $tabs['zipupload'] = __('Upload a Zip-File', 'nggallery'); if ( wpmu_enable_function('wpmuImportFolder') && nggGallery::current_user_can( 'NextGEN Import image folder' ) ) $tabs['importfolder'] = __('Import image folder', 'nggallery'); $tabs = apply_filters('ngg_addgallery_tabs', $tabs); return $tabs; } function tab_addgallery() { ?>

:
defaultpath ?>
( : a-z, A-Z, 0-9, -, _ )

:
:

maxsize; ?>
" . ini_get('upload_max_filesize') . "Byte\n"; ?>



( )
maxsize; ?>

options['swfUpload'] && defined('IS_WP_3_3') ) { ?>

 


maxsize; ?>
options['swfUpload']) { ?>