A_Lightbox_Manager_Form

Class A_Lightbox_Manager_Form.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_other_options/package.module.nextgen_other_options.php  
  1. class A_Lightbox_Manager_Form extends Mixin 
  2. function get_model() 
  3. return C_Settings_Model::get_instance(); 
  4. function get_title() 
  5. return __('Lightbox Effects', 'nggallery'); 
  6. function render() 
  7. $form_manager = C_Form_Manager::get_instance(); 
  8. // retrieve and render the settings forms for each library 
  9. $sub_fields = array(); 
  10. $form_manager->add_form(NGG_LIGHTBOX_OPTIONS_SLUG, 'custom_lightbox'); 
  11. foreach ($form_manager->get_forms(NGG_LIGHTBOX_OPTIONS_SLUG, TRUE) as $form) { 
  12. $form->enqueue_static_resources(); 
  13. $sub_fields[$form->context] = $form->render(FALSE); 
  14. // Highslide and jQuery.Lightbox were removed in 2.0.73 due to licensing. If a user has selected 
  15. // either of those options we silently make their selection fallback to Fancybox 
  16. $selected = $this->object->get_model()->thumbEffect; 
  17. if (in_array($selected, array('highslide', 'lightbox'))) { 
  18. $selected = 'fancybox'; 
  19. // Render container tab 
  20. return $this->render_partial('photocrati-nextgen_other_options#lightbox_library_tab', array('lightbox_library_label' => __('What effect would you like to use?', 'nggallery'), 'libs' => C_Lightbox_Library_Manager::get_instance()->get_all(), 'selected' => $selected, 'sub_fields' => $sub_fields, 'lightbox_global' => $this->object->get_model()->thumbEffectContext), TRUE); 
  21. function save_action() 
  22. $settings = $this->object->get_model(); 
  23. // Ensure that a lightbox library was selected 
  24. if ($id = $this->object->param('lightbox_library_id')) { 
  25. $lightboxes = C_Lightbox_Library_Manager::get_instance(); 
  26. if (!$lightboxes->get($id)) { 
  27. $settings->add_error('Invalid lightbox effect selected'); 
  28. } else { 
  29. $settings->thumbEffect = $id; 
  30. // Get thumb effect context 
  31. if ($thumbEffectContext = $this->object->param('thumbEffectContext')) { 
  32. $settings->thumbEffectContext = $thumbEffectContext; 
  33. $settings->save(); 
  34. // Save other forms 
  35. $form_manager = C_Form_Manager::get_instance(); 
  36. $form_manager->add_form(NGG_LIGHTBOX_OPTIONS_SLUG, 'custom_lightbox'); 
  37. foreach ($form_manager->get_forms(NGG_LIGHTBOX_OPTIONS_SLUG, TRUE) as $form) { 
  38. if ($form->has_method('save_action')) { 
  39. $form->save_action();