Mixin_Display_Type_Form

Class Mixin_Display_Type_Form.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php  
  1. class Mixin_Display_Type_Form extends Mixin 
  2. public $_model = null; 
  3. public function initialize() 
  4. $this->object->implement('I_Display_Type_Form'); 
  5. /** 
  6. * Returns the name of the display type. Sub-class should override 
  7. * @throws Exception 
  8. * @returns string 
  9. */ 
  10. public function get_display_type_name() 
  11. throw new Exception(__METHOD__ . ' not implemented'); 
  12. /** 
  13. * Returns the model (display type) used in the form 
  14. * @return stdClass 
  15. */ 
  16. public function get_model() 
  17. if ($this->_model == null) { 
  18. $mapper = C_Display_Type_Mapper::get_instance(); 
  19. $this->_model = $mapper->find_by_name($this->object->get_display_type_name(), TRUE); 
  20. return $this->_model; 
  21. /** 
  22. * Returns the title of the form, which is the title of the display type 
  23. * @returns string 
  24. */ 
  25. public function get_title() 
  26. return __($this->object->get_model()->title, 'nggallery'); 
  27. /** 
  28. * Saves the settings for the display type 
  29. * @param array $attributes 
  30. * @return boolean 
  31. */ 
  32. public function save_action($attributes = array()) 
  33. return $this->object->get_model()->save(array('settings' => $attributes));