A_Miscellaneous_Form

Class A_Miscellaneous_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_Miscellaneous_Form extends Mixin 
  2. function get_model() 
  3. return C_Settings_Model::get_instance('global'); 
  4. function get_title() 
  5. return __('Miscellaneous', 'nggallery'); 
  6. function render() 
  7. return $this->object->render_partial('photocrati-nextgen_other_options#misc_tab', array('mediarss_activated' => C_NextGen_Settings::get_instance()->useMediaRSS, 'mediarss_activated_label' => __('Add MediaRSS link?', 'nggallery'), 'mediarss_activated_help' => __('When enabled, adds a MediaRSS link to your header. Third-party web services can use this to publish your galleries', 'nggallery'), 'mediarss_activated_no' => __('No'), 'mediarss_activated_yes' => __('Yes'), 'galleries_in_feeds' => C_NextGen_Settings::get_instance()->galleries_in_feeds, 'galleries_in_feeds_label' => __('Display galleries in feeds', 'nggallery'), 'galleries_in_feeds_help' => __('NextGEN hides its gallery displays in feeds other than MediaRSS. This enables image galleries in feeds.', 'nggallery'), 'galleries_in_feeds_no' => __('No'), 'galleries_in_feeds_yes' => __('Yes'), 'cache_label' => __('Clear image cache', 'nggallery'), 'cache_confirmation' => __("Completely clear the NextGEN cache of all image modifications?\n\nChoose [Cancel] to Stop, [OK] to proceed.", 'nggallery'), 'slug_field' => $this->_render_text_field((object) array('name' => 'misc_settings'), 'router_param_slug', __('Permalink slug', 'nggallery'), $this->object->get_model()->router_param_slug), 'maximum_entity_count_field' => $this->_render_number_field((object) array('name' => 'misc_settings'), 'maximum_entity_count', __('Maximum image count', 'nggallery'), $this->object->get_model()->maximum_entity_count, __('This is the maximum limit of images that NextGEN will restrict itself to querying', 'nggallery') . " \n " . __('Note: This limit will not apply to slideshow widgets or random galleries if/when those galleries specify their own image limits', 'nggallery'), FALSE, '', 1)), TRUE); 
  8. function cache_action() 
  9. $cache = C_Cache::get_instance(); 
  10. $cache->flush_galleries(); 
  11. C_Photocrati_Transient_Manager::flush(); 
  12. function save_action() 
  13. if ($settings = $this->object->param('misc_settings')) { 
  14. // The Media RSS setting is actually a local setting, not a global one 
  15. $local_settings = C_NextGen_Settings::get_instance(); 
  16. $local_settings->set('useMediaRSS', $settings['useMediaRSS']); 
  17. unset($settings['useMediaRSS']); 
  18. // It's important the router_param_slug never be empty 
  19. if (empty($settings['router_param_slug'])) { 
  20. $settings['router_param_slug'] = 'nggallery'; 
  21. // If the router slug has changed, then flush the cache 
  22. if ($settings['router_param_slug'] != $this->object->get_model()->router_param_slug) { 
  23. C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); 
  24. // Do not allow this field to ever be unset 
  25. if (empty($settings['maximum_entity_count']) || (int) $settings['maximum_entity_count'] <= 0) { 
  26. $settings['maximum_entity_count'] = 500; 
  27. // Save both setting groups 
  28. $this->object->get_model()->set($settings)->save(); 
  29. $local_settings->save();