C_Attach_Controller

Class C_Attach_Controller.

Defined (1)

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

/products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php  
  1. class C_Attach_Controller extends C_NextGen_Admin_Page_Controller 
  2. static $_instances = array(); 
  3. var $_displayed_gallery; 
  4. var $_marked_scripts; 
  5. var $_is_rendering; 
  6. static function &get_instance($context = 'all') 
  7. if (!isset(self::$_instances[$context])) { 
  8. $klass = get_class(); 
  9. self::$_instances[$context] = new $klass($context); 
  10. return self::$_instances[$context]; 
  11. function define($context = FALSE) 
  12. if (!is_array($context)) { 
  13. $context = array($context); 
  14. array_unshift($context, 'ngg_attach_to_post'); 
  15. parent::define($context); 
  16. $this->add_mixin('Mixin_Attach_To_Post'); 
  17. $this->add_mixin('Mixin_Attach_To_Post_Display_Tab'); 
  18. $this->implement('I_Attach_To_Post_Controller'); 
  19. function initialize() 
  20. parent::initialize(); 
  21. $this->_load_displayed_gallery(); 
  22. $this->_marked_scripts = array(); 
  23. if (did_action('wp_print_scripts')) { 
  24. $this->_handle_scripts(); 
  25. } else { 
  26. add_action('wp_print_scripts', array($this, '_handle_scripts'), 9999); 
  27. function _handle_scripts() 
  28. if (is_admin() && $this->_is_rendering) { 
  29. global $wp_scripts; 
  30. $queue = $wp_scripts->queue; 
  31. $marked = $this->_marked_scripts; 
  32. foreach ($marked as $tag => $value) { 
  33. $this->_handle_script($tag, $queue); 
  34. foreach ($queue as $extra) { 
  35. wp_dequeue_script($extra); 
  36. function _handle_script($tag, &$queue) 
  37. global $wp_scripts; 
  38. $registered = $wp_scripts->registered; 
  39. $idx = array_search($tag, $queue); 
  40. if ($idx !== false) { 
  41. unset($queue[$idx]); 
  42. if (isset($registered[$tag])) { 
  43. $script = $registered[$tag]; 
  44. if ($script->deps) { 
  45. foreach ($script->deps as $dep) { 
  46. $this->_handle_script($dep, $queue);