当前位置: 首页>>代码示例>>PHP>>正文


PHP nggAdmin::copy_images方法代码示例

本文整理汇总了PHP中nggAdmin::copy_images方法的典型用法代码示例。如果您正苦于以下问题:PHP nggAdmin::copy_images方法的具体用法?PHP nggAdmin::copy_images怎么用?PHP nggAdmin::copy_images使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nggAdmin的用法示例。


在下文中一共展示了nggAdmin::copy_images方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: post_processor_images

 function post_processor_images()
 {
     global $wpdb, $ngg, $nggdb;
     // bulk update in a single gallery
     if (isset($_POST['bulkaction']) && isset($_POST['doaction'])) {
         check_admin_referer('ngg_updategallery');
         switch ($_POST['bulkaction']) {
             case 'no_action':
                 break;
             case 'rotate_cw':
                 nggAdmin::do_ajax_operation('rotate_cw', $_POST['doaction'], __('Rotate images', 'nggallery'));
                 break;
             case 'rotate_ccw':
                 nggAdmin::do_ajax_operation('rotate_ccw', $_POST['doaction'], __('Rotate images', 'nggallery'));
                 break;
             case 'recover_images':
                 nggAdmin::do_ajax_operation('recover_image', $_POST['doaction'], __('Recover from backup', 'nggallery'));
                 break;
             case 'set_watermark':
                 nggAdmin::do_ajax_operation('set_watermark', $_POST['doaction'], __('Set watermark', 'nggallery'));
                 break;
             case 'delete_images':
                 if (is_array($_POST['doaction'])) {
                     foreach ($_POST['doaction'] as $imageID) {
                         $image = $nggdb->find_image($imageID);
                         if ($image) {
                             if ($ngg->options['deleteImg']) {
                                 $storage = C_Component_Registry::get_instance()->get_utility('I_Gallery_Storage');
                                 $storage->delete_image($image->pid);
                             }
                             do_action('ngg_delete_picture', $image->pid);
                             $delete_pic = nggdb::delete_image($image->pid);
                         }
                     }
                     if ($delete_pic) {
                         nggGallery::show_message(__('Pictures deleted successfully ', 'nggallery'));
                     }
                 }
                 break;
             case 'import_meta':
                 nggAdmin::do_ajax_operation('import_metadata', $_POST['doaction'], __('Import metadata', 'nggallery'));
                 break;
         }
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_ResizeImages'])) {
         check_admin_referer('ngg_thickbox_form');
         //save the new values for the next operation
         $ngg->options['imgWidth'] = (int) $_POST['imgWidth'];
         $ngg->options['imgHeight'] = (int) $_POST['imgHeight'];
         update_option('ngg_options', $ngg->options);
         $pic_ids = explode(',', $_POST['TB_imagelist']);
         nggAdmin::do_ajax_operation('resize_image', $pic_ids, __('Resize images', 'nggallery'));
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_NewThumbnail'])) {
         check_admin_referer('ngg_thickbox_form');
         // save the new values for the next operation
         $settings = C_NextGen_Settings::get_instance();
         $settings->thumbwidth = (int) $_POST['thumbwidth'];
         $settings->thumbheight = (int) $_POST['thumbheight'];
         $settings->thumbfix = isset($_POST['thumbfix']) ? TRUE : FALSE;
         $settings->save();
         ngg_refreshSavedSettings();
         $pic_ids = explode(',', $_POST['TB_imagelist']);
         nggAdmin::do_ajax_operation('create_thumbnail', $pic_ids, __('Create new thumbnails', 'nggallery'));
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_SelectGallery'])) {
         check_admin_referer('ngg_thickbox_form');
         $pic_ids = explode(',', $_POST['TB_imagelist']);
         $dest_gid = (int) $_POST['dest_gid'];
         switch ($_POST['TB_bulkaction']) {
             case 'copy_to':
                 // Copy images
                 nggAdmin::copy_images($pic_ids, $dest_gid);
                 break;
             case 'move_to':
                 // Move images
                 nggAdmin::move_images($pic_ids, $dest_gid);
                 break;
         }
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_EditTags'])) {
         // do tags update
         check_admin_referer('ngg_thickbox_form');
         // get the images list
         $pic_ids = explode(',', $_POST['TB_imagelist']);
         $taglist = explode(',', $_POST['taglist']);
         $taglist = array_map('trim', $taglist);
         if (is_array($pic_ids)) {
             foreach ($pic_ids as $pic_id) {
                 // which action should be performed ?
                 switch ($_POST['TB_bulkaction']) {
                     case 'no_action':
                         // No action
                         break;
                     case 'overwrite_tags':
                         // Overwrite tags
                         wp_set_object_terms($pic_id, $taglist, 'ngg_tag');
                         break;
                     case 'add_tags':
                         // Add / append tags
//.........这里部分代码省略.........
开发者ID:JeffreyBue,项目名称:jb,代码行数:101,代码来源:manage.php

示例2: post_processor_images

 function post_processor_images()
 {
     global $wpdb, $ngg, $nggdb;
     // bulk update in a single gallery
     if (isset($_POST['bulkaction']) && isset($_POST['doaction'])) {
         check_admin_referer('ngg_updategallery');
         switch ($_POST['bulkaction']) {
             case 'no_action':
                 break;
             case 'rotate_cw':
                 nggAdmin::do_ajax_operation('rotate_cw', $_POST['doaction'], __('Rotate images', 'nggallery'));
                 break;
             case 'rotate_ccw':
                 nggAdmin::do_ajax_operation('rotate_ccw', $_POST['doaction'], __('Rotate images', 'nggallery'));
                 break;
             case 'recover_images':
                 nggAdmin::do_ajax_operation('recover_image', $_POST['doaction'], __('Recover from backup', 'nggallery'));
                 break;
             case 'set_watermark':
                 nggAdmin::do_ajax_operation('set_watermark', $_POST['doaction'], __('Set watermark', 'nggallery'));
                 break;
             case 'delete_images':
                 if (is_array($_POST['doaction'])) {
                     foreach ($_POST['doaction'] as $imageID) {
                         $image = $nggdb->find_image($imageID);
                         if ($image) {
                             if ($ngg->options['deleteImg']) {
                                 @unlink($image->imagePath);
                                 @unlink($image->thumbPath);
                                 @unlink($image->imagePath . "_backup");
                             }
                             do_action('ngg_delete_picture', $image->pid);
                             $delete_pic = nggdb::delete_image($image->pid);
                         }
                     }
                     if ($delete_pic) {
                         nggGallery::show_message(__('Pictures deleted successfully ', 'nggallery'));
                     }
                 }
                 break;
             case 'import_meta':
                 nggAdmin::do_ajax_operation('import_metadata', $_POST['doaction'], __('Import metadata', 'nggallery'));
                 break;
         }
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_ResizeImages'])) {
         check_admin_referer('ngg_thickbox_form');
         //save the new values for the next operation
         $ngg->options['imgWidth'] = (int) $_POST['imgWidth'];
         $ngg->options['imgHeight'] = (int) $_POST['imgHeight'];
         update_option('ngg_options', $ngg->options);
         $pic_ids = explode(',', $_POST['TB_imagelist']);
         nggAdmin::do_ajax_operation('resize_image', $pic_ids, __('Resize images', 'nggallery'));
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_NewThumbnail'])) {
         check_admin_referer('ngg_thickbox_form');
         //save the new values for the next operation
         $ngg->options['thumbwidth'] = (int) $_POST['thumbwidth'];
         $ngg->options['thumbheight'] = (int) $_POST['thumbheight'];
         $ngg->options['thumbfix'] = isset($_POST['thumbfix']) ? true : false;
         update_option('ngg_options', $ngg->options);
         $pic_ids = explode(',', $_POST['TB_imagelist']);
         nggAdmin::do_ajax_operation('create_thumbnail', $pic_ids, __('Create new thumbnails', 'nggallery'));
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_SelectGallery'])) {
         check_admin_referer('ngg_thickbox_form');
         $pic_ids = explode(',', $_POST['TB_imagelist']);
         $dest_gid = (int) $_POST['dest_gid'];
         switch ($_POST['TB_bulkaction']) {
             case 'copy_to':
                 // Copy images
                 nggAdmin::copy_images($pic_ids, $dest_gid);
                 break;
             case 'move_to':
                 // Move images
                 nggAdmin::move_images($pic_ids, $dest_gid);
                 break;
         }
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_EditTags'])) {
         // do tags update
         check_admin_referer('ngg_thickbox_form');
         // get the images list
         $pic_ids = explode(',', $_POST['TB_imagelist']);
         $taglist = explode(',', $_POST['taglist']);
         $taglist = array_map('trim', $taglist);
         if (is_array($pic_ids)) {
             foreach ($pic_ids as $pic_id) {
                 // which action should be performed ?
                 switch ($_POST['TB_bulkaction']) {
                     case 'no_action':
                         // No action
                         break;
                     case 'overwrite_tags':
                         // Overwrite tags
                         wp_set_object_terms($pic_id, $taglist, 'ngg_tag');
                         break;
                     case 'add_tags':
                         // Add / append tags
                         wp_set_object_terms($pic_id, $taglist, 'ngg_tag', TRUE);
//.........这里部分代码省略.........
开发者ID:ahsaeldin,项目名称:projects,代码行数:101,代码来源:manage.php

示例3: processor


//.........这里部分代码省略.........
                             if ($ngg->options['deleteImg']) {
                                 @unlink(WINABSPATH . $gallerypath . '/' . $thumb_folder . '/' . "thumbs_" . $filename);
                                 @unlink(WINABSPATH . $gallerypath . '/' . $filename);
                             }
                             $delete_pic = $wpdb->query("DELETE FROM {$wpdb->nggpictures} WHERE pid = {$imageID}");
                         }
                     }
                     if ($delete_pic) {
                         nggGallery::show_message(__('Pictures deleted successfully ', "nggallery"));
                     }
                 }
                 break;
             case 'import_meta':
                 // Import Metadata
                 nggAdmin::import_MetaData($_POST['doaction']);
                 nggGallery::show_message(__('Import metadata finished', "nggallery"));
                 break;
         }
     }
     // will be called after a ajax operation
     if (isset($_POST['ajax_callback'])) {
         if ($_POST['ajax_callback'] == 1) {
             nggGallery::show_message(__('Operation successfull. Please clear your browser cache.', "nggallery"));
         }
         $this->mode = 'edit';
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_SelectGallery'])) {
         check_admin_referer('ngg_thickbox_form');
         $pic_ids = explode(",", $_POST['TB_imagelist']);
         $dest_gid = (int) $_POST['dest_gid'];
         switch ($_POST['TB_bulkaction']) {
             case 'copy_to':
                 // Copy images
                 nggAdmin::copy_images($pic_ids, $dest_gid);
                 break;
             case 'move_to':
                 // Move images
                 nggAdmin::move_images($pic_ids, $dest_gid);
                 break;
         }
     }
     if (isset($_POST['TB_bulkaction']) && isset($_POST['TB_EditTags'])) {
         // do tags update
         check_admin_referer('ngg_thickbox_form');
         // get the images list
         $pic_ids = explode(",", $_POST['TB_imagelist']);
         $taglist = explode(",", $_POST['taglist']);
         $taglist = array_map('trim', $taglist);
         if (is_array($pic_ids)) {
             foreach ($pic_ids as $pic_id) {
                 // which action should be performed ?
                 switch ($_POST['TB_bulkaction']) {
                     case 'no_action':
                         // No action
                         break;
                     case 'overwrite_tags':
                         // Overwrite tags
                         wp_set_object_terms($pic_id, $taglist, 'ngg_tag');
                         break;
                     case 'add_tags':
                         // Add / append tags
                         wp_set_object_terms($pic_id, $taglist, 'ngg_tag', TRUE);
                         break;
                     case 'delte_tags':
                         // Delete tags
                         $oldtags = wp_get_object_terms($pic_id, 'ngg_tag', 'fields=names');
开发者ID:pravinhirmukhe,项目名称:flow1,代码行数:67,代码来源:manage.php


注:本文中的nggAdmin::copy_images方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。