C_MVC_View_Element

The NextGEN Gallery C MVC View Element class.

Defined (1)

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

/products/photocrati_nextgen/modules/mvc/package.module.mvc.php  
  1. class C_MVC_View_Element 
  2. var $_id; 
  3. var $_type; 
  4. var $_list; 
  5. var $_context; 
  6. function __construct($id, $type = null) 
  7. $this->_id = $id; 
  8. $this->_type = $type; 
  9. $this->_list = array(); 
  10. $this->_context = array(); 
  11. function get_id() 
  12. return $this->_id; 
  13. function append($child) 
  14. $this->_list[] = $child; 
  15. function insert($child, $position = 0) 
  16. array_splice($this->_list, $position, 0, $child); 
  17. function delete($child) 
  18. $index = array_search($child, $this->_list); 
  19. if ($index !== false) { 
  20. array_splice($this->_list, $index, 1); 
  21. function find($id, $recurse = false) 
  22. $list = array(); 
  23. $this->_find($list, $id, $recurse); 
  24. return $list; 
  25. function _find(array &$list, $id, $recurse = false) 
  26. foreach ($this->_list as $index => $element) { 
  27. if ($element instanceof C_MVC_View_Element) { 
  28. if ($element->get_id() == $id) { 
  29. $list[] = $element; 
  30. if ($recurse) { 
  31. $element->_find($list, $id, $recurse); 
  32. function get_context($name) 
  33. if (isset($this->_context[$name])) { 
  34. return $this->_context[$name]; 
  35. return null; 
  36. function set_context($name, $value) 
  37. $this->_context[$name] = $value; 
  38. function get_object() 
  39. return $this->get_context('object'); 
  40. // XXX not implemented 
  41. function parse() 
  42. function rasterize() 
  43. $ret = null; 
  44. foreach ($this->_list as $index => $element) { 
  45. if ($element instanceof C_MVC_View_Element) { 
  46. $ret .= $element->rasterize(); 
  47. } else { 
  48. $ret .= (string) $element; 
  49. return $ret;