C_NextGEN_Wizard

Class C_NextGEN_Wizard.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php  
  1. class C_NextGEN_Wizard 
  2. var $_id = null; 
  3. var $_active = false; 
  4. var $_priority = 100; 
  5. var $_data = array(); 
  6. var $_steps = array(); 
  7. var $_current_step = null; 
  8. var $_view = null; 
  9. function __construct($id) 
  10. $this->_id = $id; 
  11. function get_id() 
  12. return $this->_id; 
  13. function is_active() 
  14. return $this->_active; 
  15. function set_active($active) 
  16. $this->_active = $active; 
  17. function get_priority() 
  18. return $this->_priority; 
  19. function set_priority($priority) 
  20. $this->_priority = $priority; 
  21. function is_completed() 
  22. if (isset($this->_data['state'])) { 
  23. return $this->_data['state'] == 'completed'; 
  24. return false; 
  25. function set_completed() 
  26. $this->_data['state'] = 'completed'; 
  27. function is_cancelled() 
  28. if (isset($this->_data['state'])) { 
  29. return $this->_data['state'] == 'cancelled'; 
  30. return false; 
  31. function set_cancelled() 
  32. $this->_data['state'] = 'cancelled'; 
  33. function add_step($step_id, $label = null, $properties = null) 
  34. $step = array('label' => $label, 'target_anchor' => 'top center', 'popup_anchor' => 'bottom center', 'target_wait' => '0'); 
  35. if ($properties != null) { 
  36. $step = array_merge($step, $properties); 
  37. $this->_steps[$step_id] = $step; 
  38. function get_step_list() 
  39. return array_keys($this->_steps); 
  40. function get_step_property($step_id, $prop_name) 
  41. if (isset($this->_steps[$step_id][$prop_name])) { 
  42. return $this->_steps[$step_id][$prop_name]; 
  43. return null; 
  44. function set_step_property($step_id, $prop_name, $prop_value) 
  45. if (!isset($this->_steps[$step_id])) { 
  46. $this->add_step($step_id); 
  47. if (isset($this->_steps[$step_id])) { 
  48. $this->_steps[$step_id][$prop_name] = $prop_value; 
  49. function get_step_label($step_id) 
  50. return $this->get_step_property($step_id, 'label'); 
  51. function set_step_label($step_id, $label) 
  52. $this->set_step_property($step_id, 'label', $label); 
  53. function get_step_text($step_id) 
  54. return $this->get_step_property($step_id, 'text'); 
  55. function set_step_text($step_id, $text) 
  56. $this->set_step_property($step_id, 'text', $text); 
  57. function get_step_target_anchor($step_id) 
  58. return $this->get_step_property($step_id, 'target_anchor'); 
  59. function set_step_target_anchor($step_id, $anchor) 
  60. $this->set_step_property($step_id, 'target_anchor', $anchor); 
  61. function get_step_target_wait($step_id) 
  62. return $this->get_step_property($step_id, 'target_wait'); 
  63. function set_step_target_wait($step_id, $wait) 
  64. $this->set_step_property($step_id, 'target_wait', $wait); 
  65. function get_step_lazy($step_id) 
  66. return $this->get_step_property($step_id, 'lazy'); 
  67. function set_step_lazy($step_id, $lazy) 
  68. $this->set_step_property($step_id, 'lazy', $lazy); 
  69. function get_step_context($step_id) 
  70. return $this->get_step_property($step_id, 'context'); 
  71. function set_step_context($step_id, $context) 
  72. $this->set_step_property($step_id, 'context', $context); 
  73. function get_step_popup_anchor($step_id) 
  74. return $this->get_step_property($step_id, 'popup_anchor'); 
  75. function set_step_popup_anchor($step_id, $anchor) 
  76. $this->set_step_property($step_id, 'popup_anchor', $anchor); 
  77. function get_step_target($step_id) 
  78. return $this->get_step_property($step_id, 'target'); 
  79. function set_step_target($step_id, $target, $target_anchor = null, $popup_anchor = null) 
  80. $this->set_step_property($step_id, 'target', $target); 
  81. if ($target_anchor != null) { 
  82. $this->set_step_target_anchor($step_id, $target_anchor); 
  83. if ($popup_anchor != null) { 
  84. $this->set_step_popup_anchor($step_id, $popup_anchor); 
  85. function get_step_view($step_id) 
  86. return $this->get_step_property($step_id, 'view'); 
  87. function set_step_view($step_id, $view) 
  88. $this->set_step_property($step_id, 'view', $view); 
  89. function get_step_condition($step_id) 
  90. return $this->get_step_property($step_id, 'condition'); 
  91. function set_step_condition($step_id, $condition_type, $condition_value, $condition_context = null, $condition_timeout = -1) 
  92. $condition = array('type' => $condition_type, 'value' => $condition_value, 'context' => $condition_context, 'timeout' => $condition_timeout); 
  93. $this->set_step_property($step_id, 'condition', $condition); 
  94. function get_current_step() 
  95. return $this->_current_step; 
  96. function set_current_step($step_id) 
  97. $this->_current_step = $step_id; 
  98. function get_view() 
  99. return $this->_view; 
  100. function set_view($view) 
  101. $this->_view = $view; 
  102. function toData() 
  103. $steps = array(); 
  104. $view = $this->_view; 
  105. $current_step = $this->_current_step; 
  106. foreach ($this->_steps as $step_id => $step) { 
  107. if ($current_step == null) { 
  108. $current_step = $step_id; 
  109. if ($current_step == $step_id && isset($step['view'])) { 
  110. $view = $step['view']; 
  111. $step['id'] = $step_id; 
  112. $steps[] = $step; 
  113. $ret = new stdClass(); 
  114. $ret->id = $this->_id; 
  115. $ret->view = $view; 
  116. $ret->steps = $steps; 
  117. $ret->current_step = $this->_current_step; 
  118. return $ret; 
  119. function _set_data($data) 
  120. if ($data == null) { 
  121. $data = array(); 
  122. $this->_data = $data;