本文整理汇总了PHP中C_NextGen_Settings::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP C_NextGen_Settings::get_instance方法的具体用法?PHP C_NextGen_Settings::get_instance怎么用?PHP C_NextGen_Settings::get_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_NextGen_Settings
的用法示例。
在下文中一共展示了C_NextGen_Settings::get_instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_defaults
function set_defaults($entity)
{
$this->call_parent('set_defaults', $entity);
if ($entity->name == NGG_PRO_HORIZONTAL_FILMSTRIP) {
$settings = C_NextGen_Settings::get_instance();
$this->object->_set_default_value($entity, 'settings', 'override_thumbnail_settings', 1);
$this->object->_set_default_value($entity, 'settings', 'thumbnail_width', 120);
$this->object->_set_default_value($entity, 'settings', 'thumbnail_height', 90);
$this->object->_set_default_value($entity, 'settings', 'thumbnail_quality', $settings->thumbquality);
$this->object->_set_default_value($entity, 'settings', 'thumbnail_crop', $settings->thumbfix);
$this->object->_set_default_value($entity, 'settings', 'thumbnail_watermark', 0);
$this->object->_set_default_value($entity, 'settings', 'override_image_settings', 0);
$this->object->_set_default_value($entity, 'settings', 'image_quality', '100');
$this->object->_set_default_value($entity, 'settings', 'image_crop', 0);
$this->object->_set_default_value($entity, 'settings', 'image_watermark', 0);
// options inherited from the pro-slideshow module
$this->object->_set_default_value($entity, 'settings', 'image_pan', 1);
$this->object->_set_default_value($entity, 'settings', 'show_playback_controls', 1);
$this->object->_set_default_value($entity, 'settings', 'show_captions', 0);
$this->object->_set_default_value($entity, 'settings', 'caption_class', 'caption_overlay_bottom');
$this->object->_set_default_value($entity, 'settings', 'aspect_ratio', '1.5');
$this->object->_set_default_value($entity, 'settings', 'width', 100);
$this->object->_set_default_value($entity, 'settings', 'width_unit', '%');
$this->object->_set_default_value($entity, 'settings', 'transition', 'fade');
$this->object->_set_default_value($entity, 'settings', 'transition_speed', 1);
$this->object->_set_default_value($entity, 'settings', 'slideshow_speed', 5);
$this->object->_set_default_value($entity, 'settings', 'border_size', 0);
$this->object->_set_default_value($entity, 'settings', 'border_color', '#ffffff');
$this->object->_set_default_value($entity, 'settings', 'ngg_triggers_display', 'always');
}
}
开发者ID:CodeNoEvil,项目名称:mbp_web_infrastructure,代码行数:31,代码来源:adapter.nextgen_pro_horizontal_filmstrip_mapper.php
示例2: install
function install()
{
$settings = C_NextGen_Settings::get_instance();
$settings->set_default_value('proofing_page_confirmation', '');
$settings->set_default_value('proofing_lightbox_active_color', '#ffff00');
$settings->set_default_value('proofing_trigger_text', __('Submit proofs', 'nggallery'));
$settings->set_default_value('proofing_email_template', 'Hi %%admin%% Administrator,
%%user_name%% has submitted images from a proofing gallery.
You can find the proofed images at %%proof_link%%
Here is a comma separated list of the image file names. You can copy and
paste this in your favorite image management software to quickly search for
and find all selected images.
Files: %%file_list%%');
$settings->set_default_value('proofing_enable_user_email', 0);
$settings->set_default_value('proofing_user_email_subject', __('Confirmation of image proof', 'nggallery'));
$settings->set_default_value('proofing_user_email_template', 'Hello %%user_name%%,
This is confirmation that you have selected and submitted the following
images from one of our proofing galleries: %%proof_link%%
Thanks very much!');
$settings->set_default_value('proofing_user_confirmation_template', '<p>%%user_name%% has submitted the following images for proofing. <a href="%%proof_link%%">Go back</a></p>
%%proof_details%%');
$settings->set_default_value('proofing_user_confirmation_not_found', __('Oops! This page usually displays details for image proofs, but you have not proofed any images yet. Please feel free to continue browsing. Thanks for visiting.', 'nggallery'));
}
示例3: enqueue_pro_lightbox_resources
function enqueue_pro_lightbox_resources($displayed_gallery = FALSE)
{
$settings = C_NextGen_Settings::get_instance();
if ($settings->thumbEffect == NGG_PRO_LIGHTBOX) {
$router = C_Router::get_instance();
if (!self::$run_once) {
// ensure the gallery exists
if ($displayed_gallery && $displayed_gallery->id()) {
$this->object->_add_script_data('ngg_common', 'galleries.gallery_' . $displayed_gallery->id() . '.wordpress_page_root', get_permalink(), FALSE);
}
wp_enqueue_script('underscore');
wp_enqueue_script('backbone');
wp_enqueue_script('velocity', $router->get_static_url('photocrati-nextgen_pro_lightbox_legacy#velocity.min.js'));
wp_enqueue_script('galleria', $router->get_static_url('photocrati-galleria#galleria-1.4.2.min.js'));
wp_enqueue_style('ngg_pro_lightbox_theme_css', $router->get_static_url('photocrati-nextgen_pro_lightbox_legacy#theme/galleria.nextgen_pro_lightbox.css'));
wp_enqueue_script('ngg_pro_lightbox_theme_js', $router->get_static_url('photocrati-nextgen_pro_lightbox_legacy#theme/galleria.nextgen_pro_lightbox.js'), 'galleria');
if (!wp_style_is('fontawesome', 'registered')) {
C_Display_Type_Controller::get_instance()->enqueue_displayed_gallery_trigger_buttons_resources();
}
wp_enqueue_style('fontawesome');
// retrieve the lightbox so we can examine its settings
$mapper = C_Lightbox_Library_Mapper::get_instance();
$library = $mapper->find_by_name(NGG_PRO_LIGHTBOX, TRUE);
$library->display_settings += array('is_front_page' => is_front_page() ? 1 : 0, 'share_url' => $router->get_url('/nextgen-share/{gallery_id}/{image_id}/{named_size}', TRUE, 'root'), 'protect_images' => !empty($settings->protect_images) ? TRUE : FALSE, 'style' => str_replace('.css', '', $library->display_settings['style']), 'i18n' => array('toggle_social_sidebar' => __('Toggle social sidebar', 'nextgen-gallery-pro'), 'play_pause' => __('Play / Pause', 'nextgen-gallery-pro'), 'toggle_fullscreen' => __('Toggle fullscreen', 'nextgen-gallery-pro'), 'toggle_image_info' => __('Toggle image info', 'nextgen-gallery-pro'), 'close_window' => __('Close window', 'nextgen-gallery-pro'), 'share' => array('twitter' => __('Share on Twitter', 'nextgen-gallery-pro'), 'googlep' => __('Share on Google+', 'nextgen-gallery-pro'), 'facebook' => __('Share on Facebook', 'nextgen-gallery-pro'), 'pinterest' => __('Share on Pinterest', 'nextgen-gallery-pro'))));
// provide the current language so ajax requests can request translations in the same locale
if (defined('ICL_LANGUAGE_CODE')) {
$library->display_settings['lang'] = $router->param('lang', NULL, FALSE) ? $router->param('lang') : ICL_LANGUAGE_CODE;
}
wp_localize_script('photocrati_ajax', 'nplModalSettings', $library->display_settings);
}
self::$run_once = TRUE;
}
}
开发者ID:CodeNoEvil,项目名称:mbp_web_infrastructure,代码行数:33,代码来源:adapter.nextgen_pro_lightbox_resources.php
示例4: __construct
function __construct()
{
$this->blog_settings = C_NextGen_Settings::get_instance();
$this->site_settings = C_NextGen_Global_Settings::get_instance();
$this->_global_settings = array('gallerypath' => implode(DIRECTORY_SEPARATOR, array('wp-content', 'uploads', 'sites', '%BLOG_ID%', 'nggallery')) . DIRECTORY_SEPARATOR, 'wpmuCSSfile' => 'nggallery.css', 'wpmuStyle' => FALSE, 'wpmuRoles' => FALSE, 'wpmuImportFolder' => FALSE, 'wpmuZipUpload' => FALSE, 'wpmuQuotaCheck' => FALSE, 'datamapper_driver' => 'custom_table_datamapper', 'gallerystorage_driver' => 'ngglegacy_gallery_storage', 'maximum_entity_count' => 500, 'router_param_slug' => 'nggallery');
$this->_local_settings = array('gallerypath' => 'wp-content' . DIRECTORY_SEPARATOR . 'gallery' . DIRECTORY_SEPARATOR, 'deleteImg' => TRUE, 'swfUpload' => TRUE, 'usePermalinks' => FALSE, 'permalinkSlug' => 'nggallery', 'graphicLibrary' => 'gd', 'imageMagickDir' => '/usr/local/bin/', 'useMediaRSS' => FALSE, 'galleries_in_feeds' => FALSE, 'activateTags' => 0, 'appendType' => 'tags', 'maxImages' => 7, 'relatedHeading' => '<h3>' . __('Related Images', 'nggallery') . ':</h3>', 'thumbwidth' => 240, 'thumbheight' => 160, 'thumbfix' => True, 'thumbquality' => 100, 'imgWidth' => 800, 'imgHeight' => 600, 'imgQuality' => 100, 'imgBackup' => True, 'imgAutoResize' => False, 'galImages' => '20', 'galPagedGalleries' => 0, 'galColumns' => 0, 'galShowSlide' => True, 'galTextSlide' => __('[Show slideshow]', 'nggallery'), 'galTextGallery' => __('[Show thumbnails]', 'nggallery'), 'galShowOrder' => 'gallery', 'galSort' => 'sortorder', 'galSortDir' => 'ASC', 'galNoPages' => True, 'galImgBrowser' => 0, 'galHiddenImg' => 0, 'galAjaxNav' => 0, 'thumbEffect' => 'fancybox', 'thumbCode' => 'class="ngg-fancybox" rel="%GALLERY_NAME%"', 'thumbEffectContext' => 'nextgen_images', 'wmPos' => 'botRight', 'wmXpos' => 5, 'wmYpos' => 5, 'wmType' => 'image', 'wmPath' => '', 'wmFont' => 'arial.ttf', 'wmSize' => 10, 'wmText' => get_option('blogname'), 'wmColor' => '000000', 'wmOpaque' => '100', 'slideFX' => 'fade', 'irWidth' => 600, 'irHeight' => 400, 'irRotatetime' => 10, 'activateCSS' => 1, 'CSSfile' => 'nggallery.css', 'always_enable_frontend_logic' => FALSE);
}
示例5: update
static function update($reset = FALSE)
{
$global_settings = C_NextGen_Global_Settings::get_instance();
$local_settings = C_NextGen_Settings::get_instance();
$last_module_list = $reset ? array() : $global_settings->get('pope_module_list', array());
$current_module_list = self::_generate_module_info();
if (count($modules = array_diff($current_module_list, $last_module_list)) > 0) {
// The cache should be flushed
C_Photocrati_Cache::flush();
// Delete auto-update cache
update_option('photocrati_auto_update_admin_update_list', null);
update_option('photocrati_auto_update_admin_check_date', '');
foreach ($modules as $module_name) {
if ($handler = self::get_handler_instance(array_shift(explode('|', $module_name)))) {
if (method_exists($handler, 'install')) {
$handler->install($reset);
}
}
}
// Update the module list
$global_settings->set('pope_module_list', $current_module_list);
// Save any changes settings
$global_settings->save();
$local_settings->save();
}
}
示例6: enqueue_static_resources
function enqueue_static_resources()
{
$router = C_Router::get_instance();
wp_enqueue_script('jquery-ui-accordion');
// For some reason ajax.js isn't registered yet in 2.0.67.14 and above, so we have
// to do it manually.
if (method_exists('M_Ajax', 'register_scripts')) {
M_Ajax::register_scripts();
}
if (version_compare(NGG_PLUGIN_VERSION, '2.0.67') >= 0) {
wp_enqueue_script('ngg-pro-lightbox-ecommerce-overrides', $router->get_static_url('photocrati-nextgen_pro_ecommerce#lightbox_overrides.js'));
} else {
wp_enqueue_script('ngg-pro-lightbox-ecommerce-overrides', $router->get_static_url('photocrati-nextgen_pro_ecommerce#lightbox_overrides.js'), array('ngg-store-js'));
}
wp_enqueue_style('ngg-pro-add-to-cart', $router->get_static_url('photocrati-nextgen_pro_ecommerce#add_to_cart.css'));
M_NextGen_Pro_Ecommerce::enqueue_cart_resources();
if (!self::$_template_rendered) {
self::$_template_rendered = TRUE;
$parameters = array('not_for_sale_msg' => C_NextGen_Settings::get_instance()->ecommerce_not_for_sale_msg, 'sources' => $this->get_sources(), 'i18n' => $this->get_i18n_strings());
$add_to_cart_tmpl = new C_MVC_View('photocrati-nextgen_pro_ecommerce#add_to_cart_tmpl', $parameters);
$add_to_cart_item_tmpl = new C_MVC_View('photocrati-nextgen_pro_ecommerce#add_to_cart_source_item_tmpl', $parameters);
$add_to_cart_items_tmpl = new C_MVC_View('photocrati-nextgen_pro_ecommerce#add_to_cart_source_items_tmpl', $parameters);
wp_localize_script('ngg-pro-lightbox-ecommerce-overrides', 'ngg_add_to_cart_templates', array('add_to_cart' => $add_to_cart_tmpl->render(TRUE), 'add_to_cart_item' => $add_to_cart_item_tmpl->render(TRUE), 'add_to_cart_items' => $add_to_cart_items_tmpl->render(TRUE)));
wp_localize_script('ngg-pro-lightbox-ecommerce-overrides', 'ngg_cart_i18n', (array) $this->get_i18n_strings());
}
}
示例7: define
function define($context = FALSE)
{
parent::define('photocrati-frame_communication', 'Frame/iFrame Inter-Communication', 'Provides a means for HTML frames to share server-side events with each other', '0.4', 'http://www.nextgen-gallery.com', 'Photocrati Media', 'http://www.photocrati.com', $context);
include_once 'class.frame_communication_option_handler.php';
C_NextGen_Settings::get_instance()->add_option_handler('C_Frame_Communication_Option_Handler', array('frame_event_cookie_name'));
C_NextGen_Global_Settings::get_instance()->add_option_handler('C_Frame_Communication_Option_Handler', array('frame_event_cookie_name'));
}
示例8: index_action
function index_action($return = FALSE)
{
// If the site was accessed as http://foobar.com but the iframe/site_url() is http://www.foobar.com,
// then the JS will generate cross origin framing errors
if (isset($_GET['ngg_fix_cross_origins']) && isset($_SERVER['HTTP_REFERER'])) {
$referrer = parse_url($_SERVER['HTTP_REFERER']);
$host = parse_url(site_url());
$referrer = $referrer['host'];
$host = $host['host'];
if ($host != $referrer) {
$parts = explode('.', $host);
$host = implode('.', array_slice($parts, -2, 2));
if ($host == $referrer) {
header("X-Frame-Options: ALLOW-FROM {$host}");
}
}
}
$this->object->expires("1 year");
// IMPORTANT: The Displayed Gallery has already been fetched by the
// parent frame, and is available on the client side as
// window.galleries.gallery_[id] and therefore fetching the
// displayed gallery on the server side is strongly discouraged as it's
// a redundant database query. Instead, find a way to make use of the
// client side object
$protect_images = !empty(C_NextGen_Settings::get_instance()->protect_images) ? TRUE : FALSE;
return $this->object->render_view('photocrati-galleria#galleria_iframe', array('id' => $this->param('id'), 'jquery_url' => includes_url('/js/jquery/jquery.js'), 'galleria_url' => $this->get_static_url('photocrati-galleria#galleria-1.2.9.min.js'), 'galleria_instance_js' => $this->object->galleria_instance_js(), 'ngg_settings' => array('protect_images' => $protect_images)), $return);
}
示例9: _set_ngglegacy_page_parameter
function _set_ngglegacy_page_parameter($key, $value = NULL, $id = NULL, $use_prefix = NULL)
{
// Get the returned url
$retval = $this->object->get_method_property($this->method_called, ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE);
// Get the settings manager
$settings = C_NextGen_Settings::get_instance();
// Create regex pattern
$param_slug = preg_quote($settings->router_param_slug, '#');
if ($key == 'nggpage') {
$regex = "#(/{$param_slug}/.*)(/?page/\\d+/?)(.*)#";
if (preg_match($regex, $retval, $matches)) {
$new_segment = $value ? "/page/{$value}" : "";
$retval = rtrim(str_replace($matches[0], rtrim($matches[1], "/") . $new_segment . ltrim($matches[3], "/"), $retval), "/");
// Set new return value
$this->object->set_method_property($this->method_called, ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE, $retval);
}
}
# Convert the nggpage parameter to a slug
if (preg_match("#(/{$param_slug}/.*)nggpage--(.*)#", $retval, $matches)) {
$retval = rtrim(str_replace($matches[0], rtrim($matches[1], "/") . "/page/" . ltrim($matches[2], "/"), $retval), "/");
// Set new return value
$this->object->set_method_property($this->method_called, ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE, $retval);
}
# Convert the show parameter to a slug
if (preg_match("#(/{$param_slug}/.*)show--(.*)#", $retval, $matches)) {
$retval = rtrim(str_replace($matches[0], rtrim($matches[1], "/") . '/' . $matches[2], $retval), "/");
$retval = str_replace(NGG_BASIC_SLIDESHOW, 'slideshow', $retval);
$retval = str_replace(NGG_BASIC_THUMBNAILS, 'thumbnails', $retval);
$retval = str_replace(NGG_BASIC_IMAGEBROWSER, 'imagebrowser', $retval);
// Set new return value
$this->object->set_method_property($this->method_called, ExtensibleObject::METHOD_PROPERTY_RETURN_VALUE, $retval);
}
return $retval;
}
示例10: reset_action
function reset_action()
{
global $wpdb;
// Flush the cache
C_Photocrati_Cache::flush('all');
// Uninstall the plugin
$settings = C_NextGen_Settings::get_instance();
if (defined('NGG_PRO_PLUGIN_VERSION') || defined('NEXTGEN_GALLERY_PRO_VERSION')) {
C_Photocrati_Installer::uninstall('photocrati-nextgen-pro');
}
C_Photocrati_Installer::uninstall('photocrati-nextgen');
// removes all ngg_options entry in wp_options
$settings->reset();
$settings->destroy();
// clear NextGEN's capabilities from the roles system
$capabilities = array("NextGEN Gallery overview", "NextGEN Use TinyMCE", "NextGEN Upload images", "NextGEN Manage gallery", "NextGEN Manage others gallery", "NextGEN Manage tags", "NextGEN Edit album", "NextGEN Change style", "NextGEN Change options", "NextGEN Attach Interface");
$roles = array("subscriber", "contributor", "author", "editor", "administrator");
foreach ($roles as $role) {
$role = get_role($role);
foreach ($capabilities as $capability) {
$role->remove_cap($capability);
}
}
// Some installations of NextGen that upgraded from 1.9x to 2.0x have duplicates installed,
// so for now (as of 2.0.21) we explicitly remove all display types and lightboxes from the
// db as a way of fixing this.
$wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'display_type'));
$wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'lightbox_library'));
// the installation will run on the next page load; so make our own request before reloading the browser
wp_remote_get(admin_url('plugins.php'), array('timeout' => 180, 'blocking' => true, 'sslverify' => false));
header('Location: ' . $_SERVER['REQUEST_URI']);
throw new E_Clean_Exit();
}
示例11: render
function render($displayed_gallery, $return = FALSE, $mode = NULL)
{
$do_rewrites = FALSE;
$album_types = array(NGG_PRO_ALBUMS, NGG_PRO_LIST_ALBUM, NGG_PRO_GRID_ALBUM);
// Get the original display type
$original_display_type = isset($displayed_gallery->display_settings['original_display_type']) ? $displayed_gallery->display_settings['original_display_type'] : '';
if (in_array($displayed_gallery->display_type, $album_types)) {
$do_rewrites = TRUE;
$router = C_Router::get_instance();
$app = $router->get_routed_app();
$slug = '/' . C_NextGen_Settings::get_instance()->router_param_slug;
// ensure to pass $stop=TRUE to $app->rewrite() on parameters that may be shared with other display types
$app->rewrite('{*}' . $slug . '/page/{\\d}{*}', '{1}' . $slug . '/nggpage--{2}{3}', FALSE, TRUE);
$app->rewrite('{*}' . $slug . '/page--{*}', '{1}' . $slug . '/nggpage--{2}', FALSE, TRUE);
$app->rewrite('{*}' . $slug . '/{\\w}', '{1}' . $slug . '/album--{2}');
$app->rewrite('{*}' . $slug . '/{\\w}/{\\w}', '{1}' . $slug . '/album--{2}/gallery--{3}');
$app->rewrite('{*}' . $slug . '/{\\w}/{\\w}/{\\w}{*}', '{1}' . $slug . '/album--{2}/gallery--{3}/{4}{5}');
} elseif (in_array($original_display_type, $album_types)) {
$do_rewrites = TRUE;
$router = C_Router::get_instance();
$app = $router->get_routed_app();
$slug = '/' . C_NextGen_Settings::get_instance()->router_param_slug;
$app->rewrite("{*}{$slug}/album--{\\w}", "{1}{$slug}/{2}");
$app->rewrite("{*}{$slug}/album--{\\w}/gallery--{\\w}", "{1}{$slug}/{2}/{3}");
$app->rewrite("{*}{$slug}/album--{\\w}/gallery--{\\w}/{*}", "{1}{$slug}/{2}/{3}/{4}");
}
if ($do_rewrites) {
$app->do_rewrites();
}
// Continue rendering
return $this->call_parent('render', $displayed_gallery, $return, $mode);
}
示例12: find_static_abspath
/**
* Gets the absolute path to a static resource. If it doesn't exist, then NULL is returned
*
* @param string $path
* @param string $module
* @param string $relative
* @return string|NULL
*/
function find_static_abspath($path, $module = FALSE, $relative = FALSE)
{
// Find the module directory
$fs = $this->object->get_registry()->get_utility('I_Fs');
if (!$module) {
list($path, $module) = $fs->parse_formatted_path($path);
}
$mod_dir = $this->object->get_registry()->get_module_dir($module);
// Create the absolute path to the file
$path = $fs->join_paths($mod_dir, C_NextGen_Settings::get_instance()->get('mvc_static_dirname'), $path);
// Get the relative path, if asked. Skip when docroot=/ lest we generate url like
// wp-contentpluginsnextgen-galleryproducts..
if ($relative) {
$original_length = strlen($path);
$roots = array('plugins', 'plugins_mu', 'templates', 'stylesheets');
$found_root = FALSE;
foreach ($roots as $root) {
$path = str_replace($this->object->get_document_root($root), '', $path);
if (strlen($path) != $original_length) {
$found_root = $root;
break;
}
}
}
return $path;
}
示例13: enqueue_backend_resources
function enqueue_backend_resources()
{
$this->call_parent('enqueue_backend_resources');
// Enqueue frame event publishing
wp_enqueue_script('frame_event_publisher');
// Enqueue JQuery UI libraries
wp_enqueue_script('jquery-ui-tabs');
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('jquery-ui-tooltip');
wp_enqueue_script('ngg_tabs', $this->get_static_url('photocrati-attach_to_post#ngg_tabs.js'));
// Ensure select2
wp_enqueue_style('select2');
wp_enqueue_script('select2');
// Ensure that the Photocrati AJAX library is loaded
wp_enqueue_script('photocrati_ajax');
// Enqueue logic for the Attach to Post interface as a whole
wp_enqueue_script('ngg_attach_to_post', $this->get_static_url('photocrati-attach_to_post#attach_to_post.js'));
wp_enqueue_style('ngg_attach_to_post', $this->get_static_url('photocrati-attach_to_post#attach_to_post.css'));
// Enqueue backbone.js library, required by the Attach to Post display tab
wp_enqueue_script('backbone');
// provided by WP
// Ensure underscore sting, a helper utility
wp_enqueue_script('underscore.string', $this->get_static_url('photocrati-attach_to_post#underscore.string.js'), array('underscore'), '2.3.0');
// Enqueue the backbone app for the display tab
$settings = C_NextGen_Settings::get_instance();
$preview_url = $settings->gallery_preview_url;
$display_tab_js_url = $settings->attach_to_post_display_tab_js_url;
if ($this->object->_displayed_gallery->id()) {
$display_tab_js_url .= '/id--' . $this->object->_displayed_gallery->id();
}
wp_enqueue_script('ngg_display_tab', $display_tab_js_url, array('backbone', 'underscore.string'));
wp_localize_script('ngg_display_tab', 'ngg_displayed_gallery_preview_url', $settings->gallery_preview_url);
}
示例14: index_action
function index_action()
{
$this->enqueue_static_resources();
$settings = C_NextGen_Settings::get_instance();
$retval = $settings->proofing_user_confirmation_not_found;
if ($proof = C_NextGen_Pro_Proofing_Mapper::get_instance()->find_by_hash($this->param('proof'), TRUE)) {
$image_mapper = C_Image_Mapper::get_instance();
$images = array();
foreach ($proof->proofed_gallery['image_list'] as $image_id) {
$images[] = $image_mapper->find($image_id);
}
$message = $settings->proofing_user_confirmation_template;
if (preg_match_all('/%%(\\w+)%%/', $settings->proofing_user_confirmation_template, $matches, PREG_SET_ORDER) > 0) {
foreach ($matches as $match) {
switch ($match[1]) {
case 'user_name':
$message = str_replace('%%user_name%%', $proof->customer_name, $message);
break;
case 'user_email':
$message = str_replace('%%user_email%%', $proof->email, $message);
break;
case 'proof_link':
$message = str_replace('%%proof_link%%', $proof->referer, $message);
break;
case 'proof_details':
$imagehtml = $this->object->render_partial('photocrati-nextgen_pro_proofing#confirmation', array('images' => $images, 'storage' => C_Gallery_Storage::get_instance()), TRUE);
$message = str_replace('%%proof_details%%', $imagehtml, $message);
break;
}
}
$retval = $message;
}
}
return $retval;
}
示例15: render_related_string
function render_related_string()
{
$settings = C_NextGen_Settings::get_instance();
$type = $settings->appendType;
$maxImages = $settings->maxImages;
$sluglist = array();
switch ($type) {
case 'tags':
if (function_exists('get_the_tags')) {
$taglist = get_the_tags();
if (is_array($taglist)) {
foreach ($taglist as $tag) {
$sluglist[] = $tag->slug;
}
}
}
break;
case 'category':
$catlist = get_the_category();
if (is_array($catlist)) {
foreach ($catlist as $cat) {
$sluglist[] = $cat->category_nicename;
}
}
break;
}
$taglist = implode(',', $sluglist);
if ($taglist === 'uncategorized' || empty($taglist)) {
return;
}
$renderer = C_Component_Registry::get_instance()->get_utility('I_Displayed_Gallery_Renderer');
$view = C_Component_Registry::get_instance()->get_utility('I_Component_Factory')->create('mvc_view', '');
$retval = $renderer->display_images(array('source' => 'tags', 'container_ids' => $taglist, 'display_type' => NEXTGEN_GALLERY_BASIC_THUMBNAILS, 'images_per_page' => $maxImages, 'maximum_entity_count' => $maxImages, 'template' => $view->get_template_abspath('photocrati-nextgen_gallery_display#related'), 'show_all_in_lightbox' => FALSE, 'show_slideshow_link' => FALSE, 'disable_pagination' => TRUE));
return apply_filters('ngg_show_related_gallery_content', $retval, $taglist);
}
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:35,代码来源:adapter.displayed_gallery_related_element.php