M_Third_Party_Compat

The NextGEN Gallery M Third Party Compat class.

Defined (1)

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

/products/photocrati_nextgen/modules/third_party_compat/module.third_party_compat.php  
  1. class M_Third_Party_Compat extends C_Base_Module 
  2. protected $wpseo_images = array(); 
  3.  
  4. function define($id = 'pope-module',  
  5. $name = 'Pope Module',  
  6. $description = '',  
  7. $version = '',  
  8. $uri = '',  
  9. $author = '',  
  10. $author_uri = '',  
  11. $context = FALSE) 
  12. parent::define( 
  13. 'photocrati-third_party_compat',  
  14. 'Third Party Compatibility',  
  15. "Adds Third party compatibility hacks, adjustments, and modifications",  
  16. '0.6',  
  17. 'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',  
  18. 'Imagely',  
  19. 'https://www.imagely.com' 
  20. ); 
  21.  
  22. // the following constants were renamed for 2.0.41; keep them declared for compatibility sake until 
  23. // other parties can update themselves. 
  24. $changed_constants = array( 
  25. 'NEXTGEN_ADD_GALLERY_SLUG' => 'NGG_ADD_GALLERY_SLUG',  
  26. 'NEXTGEN_BASIC_SINGLEPIC_MODULE_NAME' => 'NGG_BASIC_SINGLEPIC',  
  27. 'NEXTGEN_BASIC_TAG_CLOUD_MODULE_NAME' => 'NGG_BASIC_TAGCLOUD',  
  28. 'NEXTGEN_DISPLAY_PRIORITY_BASE' => 'NGG_DISPLAY_PRIORITY_BASE',  
  29. 'NEXTGEN_DISPLAY_PRIORITY_STEP' => 'NGG_DISPLAY_PRIORITY_STEP',  
  30. 'NEXTGEN_DISPLAY_SETTINGS_SLUG' => 'NGG_DISPLAY_SETTINGS_SLUG',  
  31. 'NEXTGEN_FS_ACCESS_SLUG' => 'NGG_FS_ACCESS_SLUG',  
  32. 'NEXTGEN_GALLERY_ATTACH_TO_POST_SLUG' => 'NGG_ATTACH_TO_POST_SLUG',  
  33. 'NEXTGEN_GALLERY_BASIC_SLIDESHOW' => 'NGG_BASIC_SLIDESHOW',  
  34. 'NEXTGEN_GALLERY_BASIC_THUMBNAILS' => 'NGG_BASIC_THUMBNAILS',  
  35. 'NEXTGEN_GALLERY_CHANGE_OPTIONS_CAP' => 'NGG_CHANGE_OPTIONS_CAP',  
  36. 'NEXTGEN_GALLERY_I18N_DOMAIN' => 'NGG_I18N_DOMAIN',  
  37. 'NEXTGEN_GALLERY_IMPORT_ROOT' => 'NGG_IMPORT_ROOT',  
  38. 'NEXTGEN_GALLERY_MODULE_DIR' => 'NGG_MODULE_DIR',  
  39. 'NEXTGEN_GALLERY_MODULE_URL' => 'NGG_MODULE_URL',  
  40. 'NEXTGEN_GALLERY_NEXTGEN_BASIC_COMPACT_ALBUM' => 'NGG_BASIC_COMPACT_ALBUM',  
  41. 'NEXTGEN_GALLERY_NEXTGEN_BASIC_EXTENDED_ALBUM' => 'NGG_BASIC_EXTENDED_ALBUM',  
  42. 'NEXTGEN_GALLERY_NEXTGEN_BASIC_IMAGEBROWSER' => 'NGG_BASIC_IMAGEBROWSER',  
  43. 'NEXTGEN_GALLERY_NGGLEGACY_MOD_DIR' => 'NGG_LEGACY_MOD_DIR',  
  44. 'NEXTGEN_GALLERY_NGGLEGACY_MOD_URL' => 'NGG_LEGACY_MOD_URL',  
  45. 'NEXTGEN_GALLERY_PLUGIN' => 'NGG_PLUGIN',  
  46. 'NEXTGEN_GALLERY_PLUGIN_BASENAME' => 'NGG_PLUGIN_BASENAME',  
  47. 'NEXTGEN_GALLERY_PLUGIN_DIR' => 'NGG_PLUGIN_DIR',  
  48. 'NEXTGEN_GALLERY_PLUGIN_STARTED_AT' => 'NGG_PLUGIN_STARTED_AT',  
  49. 'NEXTGEN_GALLERY_PLUGIN_URL' => 'NGG_PLUGIN_URL',  
  50. 'NEXTGEN_GALLERY_PLUGIN_VERSION' => 'NGG_PLUGIN_VERSION',  
  51. 'NEXTGEN_GALLERY_PRODUCT_DIR' => 'NGG_PRODUCT_DIR',  
  52. 'NEXTGEN_GALLERY_PRODUCT_URL' => 'NGG_PRODUCT_URL',  
  53. 'NEXTGEN_GALLERY_PROTECT_IMAGE_MOD_STATIC_URL' => 'NGG_PROTUCT_IMAGE_MOD_STATIC_URL',  
  54. 'NEXTGEN_GALLERY_PROTECT_IMAGE_MOD_URL' => 'NGG_PROTECT_IMAGE_MOD_URL',  
  55. 'NEXTGEN_GALLERY_TESTS_DIR' => 'NGG_TESTS_DIR',  
  56. 'NEXTGEN_LIGHTBOX_ADVANCED_OPTIONS_SLUG' => 'NGG_LIGHTBOX_ADVANCED_OPTIONS_SLUG',  
  57. 'NEXTGEN_LIGHTBOX_OPTIONS_SLUG' => 'NGG_LIGHTBOX_OPTIONS_SLUG',  
  58. 'NEXTGEN_OTHER_OPTIONS_SLUG' => 'NGG_OTHER_OPTIONS_SLUG' 
  59. ); 
  60. foreach ($changed_constants as $old => $new) { 
  61. if (defined($new) && !defined($old)) { 
  62. define($old, constant($new)); 
  63.  
  64. // Resolve problems with zlib compression: https://core.trac.wordpress.org/ticket/18525 
  65. if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 4) { 
  66. @ini_set('zlib.output_compression', 'Off'); 
  67.  
  68. // Detect 'Adminer' and whether the user is viewing its loader.php 
  69. if (class_exists('AdminerForWP') && function_exists('adminer_object')) 
  70. if (!defined('NGG_DISABLE_RESOURCE_MANAGER')) 
  71. define('NGG_DISABLE_RESOURCE_MANAGER', TRUE); 
  72.  
  73. // Cornerstone's page builder requires a 'clean slate' of css/js that our resource manager interefers with 
  74. if (class_exists('Cornerstone')) 
  75. if (!defined('NGG_DISABLE_FILTER_THE_CONTENT')) define('NGG_DISABLE_FILTER_THE_CONTENT', TRUE); 
  76. if (!defined('NGG_DISABLE_RESOURCE_MANAGER')) define('NGG_DISABLE_RESOURCE_MANAGER', TRUE); 
  77.  
  78. // Genesis Tabs creates a new query / do_shortcode loop which requires these be set 
  79. if (class_exists('Genesis_Tabs')) 
  80. if (!defined('NGG_DISABLE_FILTER_THE_CONTENT')) define('NGG_DISABLE_FILTER_THE_CONTENT', TRUE); 
  81. if (!defined('NGG_DISABLE_RESOURCE_MANAGER')) define('NGG_DISABLE_RESOURCE_MANAGER', TRUE); 
  82.  
  83. function _register_adapters() 
  84. $this->get_registry()->add_adapter( 
  85. 'I_Display_Type_Controller', 'A_Non_Cachable_Pro_Film_Controller', 'photocrati-nextgen_pro_film' 
  86. ); 
  87.  
  88. function _register_hooks() 
  89. add_action('init', array(&$this, 'colorbox'), PHP_INT_MAX); 
  90. add_action('init', array(&$this, 'flattr'), PHP_INT_MAX); 
  91. add_action('wp', array(&$this, 'bjlazyload'), PHP_INT_MAX); 
  92.  
  93. add_action('admin_init', array($this, 'excellent_themes_admin'), -10); 
  94.  
  95. add_action('plugins_loaded', array(&$this, 'wpml'), PHP_INT_MAX); 
  96. add_action('plugins_loaded', array(&$this, 'wpml_translation_management'), PHP_INT_MAX); 
  97.  
  98. add_filter('headway_gzip', array(&$this, 'headway_gzip'), (PHP_INT_MAX - 1)); 
  99. add_filter('ckeditor_external_plugins', array(&$this, 'ckeditor_plugins'), 11); 
  100. add_filter('bp_do_redirect_canonical', array(&$this, 'fix_buddypress_routing')); 
  101. add_filter('the_content', array($this, 'check_weaverii'), -(PHP_INT_MAX-2)); 
  102. add_action('wp', array($this, 'check_for_jquery_lightbox')); 
  103. add_filter('get_the_excerpt', array($this, 'disable_galleries_in_excerpts'), 1); 
  104. add_filter('get_the_excerpt', array($this, 'enable_galleries_in_excerpts'), PHP_INT_MAX-1); 
  105. add_action('debug_bar_enqueue_scripts', array($this, 'no_debug_bar')); 
  106. add_filter('ngg_non_minified_modules', array($this, 'dont_minify_nextgen_pro_cssjs')); 
  107. add_filter('ngg_atp_show_display_type', array($this, 'atp_check_pro_albums'), 10, 2); 
  108. add_filter('run_ngg_resource_manager', array($this, 'run_ngg_resource_manager')); 
  109. add_filter('wpseo_sitemap_urlimages', array($this, 'add_wpseo_xml_sitemap_images'), 10, 2); 
  110.  
  111. // WPML fix 
  112. if (class_exists('SitePress')) { 
  113. M_WordPress_Routing::$_use_canonical_redirect = FALSE; 
  114. M_WordPress_Routing::$_use_old_slugs = FALSE; 
  115. add_action('template_redirect', array(&$this, 'fix_wpml_canonical_redirect'), 1); 
  116.  
  117. // TODO: Only needed for NGG Pro 1.0.10 and lower 
  118. add_action('the_post', array(&$this, 'add_ngg_pro_page_parameter')); 
  119.  
  120.  
  121. /** 
  122. * Filter support for WordPress SEO 
  123. * @param array $images Provided by WPSEO Filter 
  124. * @param int $post ID Provided by WPSEO Filter 
  125. * @return array $image List of a displayed galleries entities 
  126. */ 
  127. function add_wpseo_xml_sitemap_images($images, $post_id) 
  128. $this->wpseo_images = $images; 
  129.  
  130. $post = get_post($post_id); 
  131.  
  132. // Assign our own shortcode handler; ngglegacy and ATP do this same routine for their own 
  133. // legacy and preview image placeholders. 
  134. remove_all_shortcodes(); 
  135. C_NextGen_Shortcode_Manager::add('ngg_images', array($this, 'wpseo_shortcode_handler')); 
  136. do_shortcode($post->post_content); 
  137.  
  138. return $this->wpseo_images; 
  139.  
  140. /** 
  141. * Processes ngg_images shortcode when WordPress SEO is building sitemaps. Adds images belonging to a 
  142. * displayed gallery to $this->wpseo_images for the assigned filter method to return. 
  143. * @param array $params Array of shortcode parameters 
  144. * @param null $inner_content 
  145. */ 
  146. function wpseo_shortcode_handler($params, $inner_content = NULL) 
  147. $renderer = C_Displayed_Gallery_Renderer::get_instance(); 
  148. $displayed_gallery = $renderer->params_to_displayed_gallery($params); 
  149.  
  150. if ($displayed_gallery) 
  151. $gallery_storage = C_Gallery_Storage::get_instance(); 
  152. $settings = C_NextGen_Settings::get_instance(); 
  153. $source = $displayed_gallery->get_source(); 
  154. if (in_array('image', $source->returns)) 
  155. foreach ($displayed_gallery->get_entities() as $image) { 
  156. $named_image_size = $settings->imgAutoResize ? 'full' : 'thumb'; 
  157. $sitemap_image = array( 
  158. 'src' => $gallery_storage->get_image_url($image, $named_image_size),  
  159. 'alt' => $image->alttext,  
  160. 'title' => $image->description ? $image->description: $image->alttext 
  161. ); 
  162. $this->wpseo_images[] = $sitemap_image; 
  163.  
  164. /** 
  165. * Some other plugins output content and die(); this causes problems with our resource manager which uses output buffering 
  166. * @param bool $valid_request 
  167. * @return bool 
  168. */ 
  169. function run_ngg_resource_manager($valid_request = TRUE) 
  170. // WP-Post-To-PDF-Enhanced 
  171. if (class_exists('wpptopdfenh') && !empty($_GET['format'])) 
  172. $valid_request = FALSE; 
  173.  
  174. // WP-Photo-Seller download 
  175. if (class_exists('WPS') && isset($_REQUEST['wps_file_dl']) && $_REQUEST['wps_file_dl'] == '1') 
  176. $valid_request = FALSE; 
  177.  
  178. // Multiverso Advanced File Sharing download 
  179. if (function_exists('mv_install') && isset($_GET['upf']) && isset($_GET['id'])) 
  180. $valid_request = FALSE; 
  181.  
  182. // WooCommerce downloads 
  183. if (class_exists('WC_Download_Handler') && isset($_GET['download_file']) && isset($_GET['order']) && isset($_GET['email'])) 
  184. $valid_request = FALSE; 
  185.  
  186. // WP-E-Commerce 
  187. if (isset($_GET['wpsc_download_id']) || (function_exists('wpsc_download_file') && isset($_GET['downloadid']))) 
  188. $valid_request = FALSE; 
  189.  
  190. // Easy Digital Downloads 
  191. if (function_exists('edd_process_download') && (isset($_GET['download_id']) || isset($_GET['download']))) 
  192. $valid_request = FALSE; 
  193.  
  194. return $valid_request; 
  195.  
  196. /** 
  197. * This style causes problems with Excellent Themes admin settings 
  198. */ 
  199. function excellent_themes_admin() 
  200. if (is_admin() && (!empty($_GET['page']) && strpos($_GET['page'], 'et_') == 0)) 
  201. wp_deregister_style('ngg-jquery-ui'); 
  202.  
  203. function atp_check_pro_albums($available, $display_type) 
  204. if (!defined('NGG_PRO_ALBUMS')) 
  205. return $available; 
  206.  
  207. if (in_array($display_type->name, array(NGG_PRO_LIST_ALBUM, NGG_PRO_GRID_ALBUM)) 
  208. && $this->get_registry()->is_module_loaded(NGG_PRO_ALBUMS)) 
  209. $available = TRUE; 
  210.  
  211. return $available; 
  212.  
  213. function no_debug_bar() 
  214. if (M_Attach_To_Post::is_atp_url()) { 
  215. wp_dequeue_script('debug-bar-console'); 
  216.  
  217. // A lot of routing issues start occuring with WordPress SEO when the routing system is 
  218. // initialized by the excerpt, and then again from the post content. 
  219. function disable_galleries_in_excerpts($excerpt) 
  220. if (class_exists('WPSEO_OpenGraph')) { 
  221. M_Attach_To_Post::$substitute_placeholders = FALSE; 
  222.  
  223. return $excerpt; 
  224.  
  225. function enable_galleries_in_excerpts($excerpt) 
  226. if (class_exists('WPSEO_OpenGraph')) { 
  227. M_Attach_To_Post::$substitute_placeholders = TRUE; 
  228.  
  229. return $excerpt; 
  230.  
  231. function fix_buddypress_routing() 
  232. M_WordPress_Routing::$_use_canonical_redirect = FALSE; 
  233.  
  234. return FALSE; 
  235.  
  236. function fix_wpml_canonical_redirect() 
  237. M_WordPress_Routing::$_use_canonical_redirect = FALSE; 
  238. M_WordPress_Routing::$_use_old_slugs = FALSE; 
  239.  
  240. /** 
  241. * CKEditor features a custom NextGEN shortcode generator that unfortunately relies on parts of the NextGEN 
  242. * 1.9x API that has been deprecated in NextGEN 2.0 
  243. * @param $plugins 
  244. * @return mixed 
  245. */ 
  246. function ckeditor_plugins($plugins) 
  247. if (!class_exists('add_ckeditor_button')) 
  248. return $plugins; 
  249.  
  250. if (!empty($plugins['nextgen'])) 
  251. unset($plugins['nextgen']); 
  252.  
  253. return $plugins; 
  254.  
  255. function check_for_jquery_lightbox() 
  256. // Fix for jQuery Lightbox: http://wordpress.org/plugins/wp-jquery-lightbox/ 
  257. // jQuery Lightbox tries to modify the content of a post, but it does so before we modify 
  258. // the content, and therefore it's modifications have no effect on our galleries 
  259. if (function_exists('jqlb_autoexpand_rel_wlightbox')) { 
  260. $settings = C_NextGen_Settings::get_instance(); 
  261.  
  262. // First, we make it appear that NGG has no lightbox effect enabled. That way 
  263. // we don't any lightbox resources 
  264. unset($settings->thumbEffect); 
  265.  
  266. // We would normally just let the third-party plugin do it's thing, but it's regex doesn't 
  267. // seem to work on our <a> tags (perhaps because they span multiple of lines or have data attributes) 
  268. // So instead, we just do what the third-party plugin wants - add the rel attribute 
  269. $settings->thumbCode="rel='lightbox[%POST_ID%]'"; 
  270.  
  271. /** 
  272. * Weaver II's 'weaver_show_posts' shortcode creates a new wp-query, causing a second round of 'the_content' 
  273. * filters to apply. This checks for WeaverII and enables all NextGEN shortcodes that would otherwise be left 
  274. * disabled by our shortcode manager. See https://core.trac.wordpress.org/ticket/17817 for more. 
  275. * @param $content 
  276. * @return $content 
  277. */ 
  278. function check_weaverii($content) 
  279. if (function_exists('weaverii_show_posts_shortcode')) 
  280. C_NextGen_Shortcode_Manager::get_instance()->activate_all(); 
  281.  
  282. return $content; 
  283.  
  284. /** 
  285. * WPML assigns an action to 'init' that *may* enqueue some admin-side JS. This JS relies on some inline JS 
  286. * to be injected that isn't present in ATP so for ATP requests ONLY we disable their action that enqueues 
  287. * their JS files. 
  288. */ 
  289. function wpml() 
  290. if (!class_exists('SitePress')) 
  291. return; 
  292.  
  293. if (!M_Attach_To_Post::is_atp_url()) 
  294. return; 
  295.  
  296. global $wp_filter; 
  297.  
  298. if (empty($wp_filter['init'][2]) && empty($wp_filter['after_setup_theme'][1])) 
  299. return; 
  300.  
  301. foreach ($wp_filter['init'][2] as $id => $filter) { 
  302. if (!strpos($id, 'js_load')) 
  303. continue; 
  304.  
  305. $object = $filter['function'][0]; 
  306.  
  307. if (is_object($object) && get_class($object) != 'SitePress') 
  308. continue; 
  309.  
  310. remove_action('init', array($object, 'js_load'), 2); 
  311.  
  312. foreach ($wp_filter['after_setup_theme'][1] as $id => $filter) { 
  313. if ($id !== 'wpml_installer_instance_delegator') 
  314. continue; 
  315.  
  316. remove_action('after_setup_theme', 'wpml_installer_instance_delegator', 1); 
  317.  
  318. /** 
  319. * WPML Translation Management has a similar problem to plain ol' WPML 
  320. */ 
  321. function wpml_translation_management() 
  322. if (!class_exists('WPML_Translation_Management')) 
  323. return; 
  324.  
  325. if (!M_Attach_To_Post::is_atp_url()) 
  326. return; 
  327.  
  328. global $wp_filter; 
  329.  
  330. if (empty($wp_filter['init'][10])) 
  331. return; 
  332.  
  333. foreach ($wp_filter['init'][10] as $id => $filter) { 
  334. if (!strpos($id, 'init')) 
  335. continue; 
  336.  
  337. $object = $filter['function'][0]; 
  338.  
  339. if (is_object($object) && get_class($object) != 'WPML_Translation_Management') 
  340. continue; 
  341.  
  342. remove_action('init', array($object, 'init'), 10); 
  343.  
  344. /** 
  345. * NGG Pro 1.0.10 relies on the 'page' parameter for pagination, but that conflicts with 
  346. * WordPress Post Pagination (<!-- nextpage -->). This was fixed in 1.0.11, so this code is 
  347. * for backwards compatibility 
  348. * TODO: This can be removed in a later release 
  349. */ 
  350. function add_ngg_pro_page_parameter() 
  351. global $post; 
  352.  
  353. if ($post AND !is_array($post->content) AND (strpos($post->content, "<!--nextpage-->") === FALSE) AND (strpos($_SERVER['REQUEST_URI'], '/page/') !== FALSE)) { 
  354. if (preg_match("#/page/(\\d+)#", $_SERVER['REQUEST_URI'], $match)) { 
  355. $_REQUEST['page'] = $match[1]; 
  356.  
  357. /** 
  358. * Headway themes offer gzip compression, but it causes problems with NextGEN output. Disable that feature while 
  359. * NextGEN is active. 
  360. * @param $option 
  361. * @return bool 
  362. */ 
  363. function headway_gzip($option) 
  364. if (!class_exists('HeadwayOption')) 
  365. return $option; 
  366.  
  367. return FALSE; 
  368.  
  369. /** 
  370. * Colorbox fires a filter (pri=100) to add class attributes to images via a the_content filter. We fire our 
  371. * shortcodes at PHP_INT_MAX-1 to avoid encoding issues with some themes. Here we move the Colorbox filters 
  372. * priority to PHP_INT_MAX so that they run after our shortcode text has been replaced with rendered galleries. 
  373. */ 
  374. function colorbox() 
  375. if (!class_exists('JQueryColorboxFrontend')) 
  376. return; 
  377.  
  378. global $wp_filter; 
  379.  
  380. if (empty($wp_filter['the_content'][100])) 
  381. return; 
  382.  
  383. foreach ($wp_filter['the_content'][100] as $id => $filter) { 
  384. if (!strpos($id, 'addColorboxGroupIdToImages')) 
  385. continue; 
  386.  
  387. $object = $filter['function'][0]; 
  388.  
  389. if (is_object($object) && get_class($object) != 'JQueryColorboxFrontend') 
  390. continue; 
  391.  
  392. remove_filter('the_content', array($object, 'addColorboxGroupIdToImages'), 100); 
  393. remove_filter('the_excerpt', array($object, 'addColorboxGroupIdToImages'), 100); 
  394. add_filter('the_content', array($object, 'addColorboxGroupIdToImages'), PHP_INT_MAX); 
  395. add_filter('the_excerpt', array($object, 'addColorboxGroupIdToImages'), PHP_INT_MAX); 
  396. break; 
  397.  
  398. /** 
  399. * Flattr fires a filter (pri=32767) on "the_content" that recurses. This causes problems,  
  400. * see https://core.trac.wordpress.org/ticket/17817 for more information. Moving their filter to PHP_INT_MAX 
  401. * is enough for us though 
  402. */ 
  403. function flattr() 
  404. if (!class_exists('Flattr')) 
  405. return; 
  406.  
  407. global $wp_filter; 
  408.  
  409. $level = 32767; 
  410.  
  411. if (empty($wp_filter['the_content'][$level])) 
  412. return; 
  413.  
  414. foreach ($wp_filter['the_content'][$level] as $id => $filter) { 
  415. if (!strpos($id, 'injectIntoTheContent')) 
  416. continue; 
  417.  
  418. $object = $filter['function'][0]; 
  419.  
  420. if (is_object($object) && get_class($object) != 'Flattr') 
  421. continue; 
  422.  
  423. remove_filter('the_content', array($object, 'injectIntoTheContent'), $level); 
  424. add_filter('the_content', array($object, 'injectIntoTheContent'), PHP_INT_MAX); 
  425. break; 
  426.  
  427. /** 
  428. * For the same reasons as Colorbox we move BJ-Lazy-load's filter() method to a later priority so it can access 
  429. * our rendered galleries. 
  430. */ 
  431. function bjlazyload() 
  432. if (!class_exists('BJLL')) 
  433. return; 
  434.  
  435. global $wp_filter; 
  436.  
  437. if (empty($wp_filter['the_content'][200])) 
  438. return; 
  439.  
  440. foreach ($wp_filter['the_content'][200] as $id => $filter) { 
  441. if (!strpos($id, 'filter')) 
  442. continue; 
  443.  
  444. $object = $filter['function'][0]; 
  445.  
  446. if (is_object($object) && get_class($object) != 'BJLL') 
  447. continue; 
  448.  
  449. remove_filter('the_content', array($object, 'filter'), 200); 
  450. add_filter('the_content', array($object, 'filter'), PHP_INT_MAX); 
  451. break; 
  452.  
  453. add_filter('the_content', array($this, 'bjlazyload_filter'), PHP_INT_MAX-1); 
  454.  
  455. /** 
  456. * BJ-Lazy-load's regex is lazy and doesn't handle multiline search or instances where <img is immediately followed 
  457. * by a newline. The following regex replaces newlines and strips unnecessary space. We fire this filter 
  458. * before BJ-Lazy-Load's to make our galleries compatible with its expectations. 
  459. * @param string $content 
  460. * @return string 
  461. */ 
  462. function bjlazyload_filter($content) 
  463. return trim(preg_replace("/\\s\\s+/", " ", $content)); 
  464.  
  465. /** 
  466. * NextGen 2.0.67.20 introduced CSS/JS minification; do not apply this to NextGen Pro yet 
  467. * @param $modules_to_not_minify 
  468. * @return array 
  469. */ 
  470. function dont_minify_nextgen_pro_cssjs($modules_to_not_minify) 
  471.  
  472. // TODO: once Pro 2.1.30 is widely circulated, we don't need to use 
  473. // the installer. We can use the component registry to fetch the product 
  474. // and call the product's get_modules_to_load() function 
  475. $installer = new C_NextGen_Product_Installer; 
  476.  
  477. if (defined('NGG_PRO_PLUGIN_VERSION') && class_exists('P_Photocrati_NextGen_Pro')) 
  478. $modules_to_not_minify += $installer->get_modules_to_load_for('photocrati-nextgen-pro'); 
  479. else if (defined('NGG_PLUS_PLUGIN_VERSION') && class_exists('P_Photocrati_NextGen_Plus')) 
  480. $modules_to_not_minify += $installer->get_modules_to_load_for('photocrati-nextgen-plus'); 
  481.  
  482. return $modules_to_not_minify; 
  483.  
  484. function get_type_list() 
  485. return array( 
  486. 'A_Non_Cachable_Pro_Film_Controller' => 'adapter.non_cachable_pro_film_controller.php' 
  487. );