-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f180280
commit 1e26699
Showing
31 changed files
with
350 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
wp-content/plugins/nextgen-gallery/non_pope/class.nextgen_shortcode_manager.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
<?php | ||
|
||
class C_NextGen_Shortcode_Manager | ||
{ | ||
private static $_instance = NULL; | ||
private $_shortcodes = array(); | ||
|
||
/** | ||
* Gets an instance of the class | ||
* @return C_NextGen_Shortcode_Manager | ||
*/ | ||
static function get_instance() | ||
{ | ||
if (is_null(self::$_instance)) { | ||
$klass = get_class(); | ||
self::$_instance = new $klass; | ||
} | ||
return self::$_instance; | ||
} | ||
|
||
/** | ||
* Adds a shortcode | ||
* @param $name | ||
* @param $callback | ||
*/ | ||
static function add($name, $callback) | ||
{ | ||
$manager = self::get_instance(); | ||
$manager->add_shortcode($name, $callback); | ||
} | ||
|
||
/** | ||
* Removes a previously added shortcode | ||
* @param $name | ||
*/ | ||
static function remove($name) | ||
{ | ||
$manager = self::get_instance(); | ||
$manager->remove_shortcode($name); | ||
} | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
private function __construct() | ||
{ | ||
add_filter('the_content', array(&$this, 'deactivate_all'), 1); | ||
add_filter('the_content', array(&$this, 'parse_content'), PHP_INT_MAX-1); | ||
} | ||
|
||
/** | ||
* Deactivates all shortcodes | ||
*/ | ||
function deactivate_all($content) | ||
{ | ||
foreach (array_keys($this->_shortcodes) as $shortcode) { | ||
$this->deactivate($shortcode); | ||
} | ||
|
||
return $content; | ||
} | ||
|
||
/** | ||
* Activates all registered shortcodes | ||
*/ | ||
function activate_all() | ||
{ | ||
foreach (array_keys($this->_shortcodes) as $shortcode) { | ||
$this->activate($shortcode); | ||
} | ||
} | ||
|
||
/** | ||
* Parses the content for shortcodes and returns the substituted content | ||
* @param $content | ||
* @return string | ||
*/ | ||
function parse_content($content) | ||
{ | ||
$this->activate_all(); | ||
return do_shortcode($content); | ||
} | ||
|
||
/** | ||
* Adds a shortcode | ||
* @param $name | ||
* @param $callback | ||
*/ | ||
function add_shortcode($name, $callback) | ||
{ | ||
$this->_shortcodes[$name] = $callback; | ||
$this->activate($name); | ||
} | ||
|
||
/** | ||
* Activates a particular shortcode | ||
* @param $shortcode | ||
*/ | ||
function activate($shortcode) | ||
{ | ||
if (isset($this->_shortcodes[$shortcode])) { | ||
add_shortcode($shortcode, $this->_shortcodes[$shortcode]); | ||
} | ||
} | ||
|
||
/** | ||
* Removes a shortcode | ||
* @param $name | ||
*/ | ||
function remove_shortcode($name) | ||
{ | ||
unset($this->_shortcodes[$name]); | ||
$this->deactivate($name); | ||
} | ||
|
||
/** | ||
* De-activates a shortcode | ||
* @param $shortcode | ||
*/ | ||
function deactivate($shortcode) | ||
{ | ||
if (isset($this->_shortcodes[$shortcode])) | ||
remove_shortcode($shortcode); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 11 additions & 7 deletions
18
...ery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
jQuery(function($) { | ||
$(".ngg-fancybox").fancybox({ | ||
titlePosition: 'inside', | ||
// Needed for twenty eleven | ||
onComplete: function(){ | ||
$('#fancybox-wrap').css('z-index', 10000); | ||
} | ||
}); | ||
var nextgen_fancybox_init = function() { | ||
$(".ngg-fancybox").fancybox({ | ||
titlePosition: 'inside', | ||
// Needed for twenty eleven | ||
onComplete: function() { | ||
$('#fancybox-wrap').css('z-index', 10000); | ||
} | ||
}); | ||
}; | ||
$(this).bind('refreshed', nextgen_fancybox_init); | ||
nextgen_fancybox_init(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ery/products/photocrati_nextgen/modules/lightbox/static/thickbox/nextgen_thickbox_init.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.