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


PHP nggAdmin::decode_upload_error方法代码示例

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


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

示例1: 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');
 }
开发者ID:popovdenis,项目名称:kmst,代码行数:75,代码来源:addgallery.php


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