A_Import_Media_Library_Form

Class A_Import_Media_Library_Form.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/nextgen_addgallery_page/package.module.nextgen_addgallery_page.php  
  1. class A_Import_Media_Library_Form extends Mixin 
  2. function get_title() 
  3. return __('Import from WordPress Media Library', 'nggallery'); 
  4. function enqueue_static_resources() 
  5. wp_enqueue_media(); 
  6. wp_enqueue_script('nextgen_media_library_import-js'); 
  7. wp_enqueue_style('nextgen_media_library_import-css'); 
  8. $url = admin_url() . 'admin.php?page=nggallery-manage-gallery&mode=edit&gid={gid}'; 
  9. $i18n_array = array('admin_url' => admin_url(), 'title' => __('Import Images into NextGen Gallery', 'nggallery'), 'import_multiple' => __('Import %s images', 'nggallery'), 'import_singular' => __('Import 1 image', 'nggallery'), 'imported_multiple' => sprintf(__('{count} images were uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url), 'imported_singular' => sprintf(__('1 image was uploaded successfully. <a href="%s" target="_blank">Manage gallery</a>', 'nggallery'), $url), 'imported_none' => __('0 images were uploaded', 'nggallery'), 'progress_title' => __('Importing gallery', 'nggallery'), 'in_progress' => __('In Progress...', 'nggallery'), 'gritter_title' => __('Upload complete', 'nggallery'), 'gritter_error' => __('An unexpected error occured. This is most likely due to a server misconfiguration. Check your PHP error log or ask your hosting provider for assistance.', 'nggallery')); 
  10. foreach (C_WordPress_Security_Manager::get_instance()->get_request_token('nextgen_upload_image')->get_request_list() as $name => $value) { 
  11. $i18n_array['sectoken'][$name] = $value; 
  12. wp_localize_script('nextgen_media_library_import-js', 'ngg_importml_i18n', $i18n_array); 
  13. function render() 
  14. $i18n = array('select-images-to-continue' => __('Please make a selection to continue', 'nggallery'), 'select-opener' => __('Select images', 'nggallery'), 'selected-image-import' => __('Import %d image(s)', 'nggallery')); 
  15. return $this->object->render_partial('photocrati-nextgen_addgallery_page#import_media_library', array('i18n' => $i18n, 'galleries' => $this->object->get_galleries()), TRUE); 
  16. function get_galleries() 
  17. $security = $this->get_registry()->get_utility('I_Security_Manager'); 
  18. $sec_actor = $security->get_current_actor(); 
  19. $galleries = array(); 
  20. if ($sec_actor->is_allowed('nextgen_edit_gallery')) { 
  21. $galleries = C_Gallery_Mapper::get_instance()->find_all(); 
  22. if (!$sec_actor->is_allowed('nextgen_edit_gallery_unowned')) { 
  23. $galleries_all = $galleries; 
  24. $galleries = array(); 
  25. foreach ($galleries_all as $gallery) { 
  26. if ($sec_actor->is_user() && $sec_actor->get_entity_id() == (int) $gallery->author) { 
  27. $galleries[] = $gallery; 
  28. return $galleries;