本文整理汇总了PHP中require_js_helper函数的典型用法代码示例。如果您正苦于以下问题:PHP require_js_helper函数的具体用法?PHP require_js_helper怎么用?PHP require_js_helper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了require_js_helper函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// call parent:
parent::display_init();
// Add CSS:
require_css('basic_styles.css', 'blog');
// the REAL basic styles
require_css('basic.css', 'blog');
// Basic styles
require_css('blog_base.css', 'blog');
// Default styles for the blog navigation
require_css('item_base.css', 'blog');
// Default styles for the post CONTENT
// Make sure standard CSS is called ahead of custom CSS generated below:
require_css('style.css', 'relative');
require_js('ajax.js', 'blog');
require_js('functions.js');
require_js('rollovers.js');
skin_content_header();
// Sets charset!
require_js('jquery-1.2.3.min.js');
require_js('jquery.easing.min.js');
require_js('jquery.lavalamp.min.js');
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting("colorbox")) {
require_js_helper('colorbox', 'blog');
}
}
示例2: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// call parent:
parent::display_init();
// Add CSS:
require_css('basic_styles.css', 'blog');
// the REAL basic styles
require_css('basic.css', 'blog');
// Basic styles
require_css('blog_base.css', 'blog');
// Default styles for the blog navigation
require_css('item_base.css', 'blog');
// Default styles for the post CONTENT
require_js('ajax.js', 'blog');
require_js('functions.js');
require_js('rollovers.js');
// Make sure standard CSS is called ahead of custom CSS generated below:
require_css('style.css', 'relative');
// Width switch styles
add_headline('<link rel="stylesheet" href="style.css" type="text/css" title="fixed"/>');
add_headline('<link rel="alternate stylesheet" href="fluid.css" type="text/css" title="fluid"/>');
add_headline('<script type="text/javascript" src="rsc/js/styleswitcher.js"></script>');
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting("colorbox")) {
require_js_helper('colorbox', 'blog');
}
}
示例3: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// call parent:
parent::display_init();
// Add CSS:
require_css('basic_styles.css', 'blog');
// the REAL basic styles
require_css('basic.css', 'blog');
// Basic styles
require_css('blog_base.css', 'blog');
// Default styles for the blog navigation
require_css('item_base.css', 'blog');
// Default styles for the post CONTENT
// Make sure standard CSS is called ahead of custom CSS generated below:
require_css('rsc/css/style.css', 'relative');
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting("colorbox")) {
require_js_helper('colorbox', 'blog');
}
// Add custom CSS:
$custom_css = '';
$html5support = '';
if ($this->get_setting('html5_support') == '1') {
// HTML5 Support
$html5support .= '
<!--[if IE]>
<script src="rsc/js/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="rsc/css/html5.css" type="text/css" />
';
}
$custom_css = '' . $html5support . '
';
add_headline($custom_css);
}
示例4: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// call parent:
parent::display_init();
// Add CSS:
// fp> Note: having those here should allow
// 1) Requesting them earlier as if they are @import'ed
// 2) Allow bundling
// fp> I am not 100% sure though. Comments welcome :)
/*require_css( 'basic_styles.css', 'blog' ); // the REAL basic styles
require_css( 'basic.css', 'blog' ); // Basic styles
require_css( 'blog_base.css', 'blog' ); // Default styles for the blog navigation
require_css( 'item_base.css', 'blog' ); // Default styles for the post CONTENT
require_css( 'item.css', 'relative' );
require_css( 'style.css', 'relative' );*/
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting('colorbox')) {
require_js_helper('colorbox', 'blog');
}
require_css('basic_styles.css', 'blog');
// the REAL basic styles
require_css('basic.css', 'blog');
// Basic styles
require_css('style.css', 'relative');
require_js('js/core.js', 'relative');
require_js('navigation.js', 'blog');
}
示例5: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// call parent:
parent::display_init();
// Add CSS:
require_css('basic_styles.css', 'blog');
// the REAL basic styles
require_css('basic.css', 'blog');
// Basic styles
require_css('blog_base.css', 'blog');
// Default styles for the blog navigation
require_css('item_base.css', 'blog');
// Default styles for the post CONTENT
// Make sure standard CSS is called ahead of custom CSS generated below:
require_css('style.css', 'relative');
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting("colorbox")) {
require_js_helper('colorbox', 'blog');
}
add_headline('<link rel="stylesheet" href="rsc/css/style.css" type="text/css" />
<link rel="alternate stylesheet" href="rsc/css/red.css" type="text/css" title="red" />
<link rel="alternate stylesheet" href="rsc/css/blue.css" type="text/css" title="blue" />
<link rel="alternate stylesheet" href="rsc/css/green.css" type="text/css" title="green" />
<link rel="alternate stylesheet" href="rsc/css/brown.css" type="text/css" title="brown" />
<link rel="alternate stylesheet" href="rsc/css/magenta.css" type="text/css" title="magenta" />');
// Add custom CSS:
$custom_css = '';
$skincolor = $this->get_setting('skin_color');
$widthstyle = '';
$html5support = '';
if ($this->get_setting('width_style') == 'fixed') {
// Fixed Layout
$widthstyle .= 'width: 950px !important; /* fixed */';
}
if ($this->get_setting('width_style') == 'fluid') {
// Fluid Layout
$widthstyle .= 'width: 90% !important; /* fluid */';
}
if ($this->get_setting('html5_support') == '1') {
// HTML5 Support
$html5support .= '
<!--[if IE]>
<script src="rsc/js/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="rsc/css/html5.css" type="text/css" />
';
}
$custom_css = '' . $html5support . '
<link rel="stylesheet" href="rsc/css/' . $skincolor . '.css" type="text/css" title="' . $skincolor . '" />
<style type="text/css">
div.widthstyle {
' . $widthstyle . '
}
</style>
';
add_headline($custom_css);
}
示例6: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
global $disp;
// call parent:
parent::display_init();
// Add CSS:
require_css('basic_styles.css', 'blog');
// the REAL basic styles
require_css('basic.css', 'blog');
// Basic styles
require_css('blog_base.css', 'blog');
// Default styles for the blog navigation
require_css('item_base.css', 'blog');
// Default styles for the post CONTENT
require_css('style.css', 'relative');
// Add custom CSS:
$custom_css = '';
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting("colorbox")) {
require_js_helper('colorbox', 'blog');
}
if ($main_content_headline = $this->get_setting('main_content_headline')) {
// Custom introduction title:
$custom_css .= 'div#main h1:before { content: "' . $main_content_headline . '" }';
}
if ($main_content = $this->get_setting('main_content')) {
// Custom inroduction text:
$custom_css .= 'div#main p:before { content: "' . $main_content . '" }';
}
if (!empty($custom_css)) {
if ($disp == 'front') {
// Use standard bootstrap style on width <= 640px only for disp=front
$custom_css = '@media only screen and (min-width: 641px)
{
' . $custom_css . '
}';
}
$custom_css = '<style type="text/css">
<!--
' . $custom_css . '
-->
</style>';
add_headline($custom_css);
}
}
示例7: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// call parent:
parent::display_init();
// Add CSS:
require_css('basic_styles.css', 'blog');
// the REAL basic styles
require_css('basic.css', 'blog');
// Basic styles
require_css('blog_base.css', 'blog');
// Default styles for the blog navigation
require_css('item_base.css', 'blog');
// Default styles for the post CONTENT
// Make sure standard CSS is called ahead of custom CSS generated below:
require_css('style.css', 'relative');
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting("colorbox")) {
require_js_helper('colorbox', 'blog');
}
}
示例8: display_init
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// Request some common features that the parent function (Skin::display_init()) knows how to provide:
parent::display_init(array('jquery', 'font_awesome', 'bootstrap', 'bootstrap_evo_css', 'bootstrap_messages', 'style_css', 'colorbox', 'bootstrap_init_tooltips', 'disp_auto'));
// Add CSS:
require_css('basic_styles.css', 'blog');
// the REAL basic styles
require_css('basic.css', 'blog');
// Basic styles
require_css('blog_base.css', 'blog');
// Default styles for the blog navigation
require_css('item_base.css', 'blog');
// Default styles for the post CONTENT
require_css('style.css', 'relative');
// Add custom CSS:
$custom_css = '';
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting("colorbox")) {
require_js_helper('colorbox', 'blog');
}
}
示例9: init_list_mode
/**
* Initialize list mode; Several actions need this.
*/
function init_list_mode()
{
global $tab, $Blog, $UserSettings, $ItemList, $AdminUI, $posttypes_perms;
// set default itemslist param prefix
$items_list_param_prefix = 'items_';
if (param('p', 'integer', NULL) || param('title', 'string', NULL)) {
// Single post requested, do not filter any post types. If the user
// has clicked a post link on the dashboard and previously has selected
// a tab which would filter this post, it wouldn't be displayed now.
$tab = 'full';
// in case of single item view params prefix must be empty
$items_list_param_prefix = NULL;
} else {
// Store/retrieve preferred tab from UserSettings:
$UserSettings->param_Request('tab', 'pref_browse_tab', 'string', NULL, true, true);
}
/*
* Init list of posts to display:
*/
load_class('items/model/_itemlist.class.php', 'ItemList2');
if (!empty($tab) && !empty($items_list_param_prefix)) {
// Use different param prefix for each tab
$items_list_param_prefix .= substr($tab, 0, 7) . '_';
}
// Create empty List:
$ItemList = new ItemList2($Blog, NULL, NULL, $UserSettings->get('results_per_page'), 'ItemCache', $items_list_param_prefix, $tab);
// COPY (func)
$ItemList->set_default_filters(array('visibility_array' => get_visibility_statuses('keys')));
if ($Blog->get_setting('orderby') == 'RAND') {
// Do not display random posts in backoffice for easy management
$ItemList->set_default_filters(array('orderby' => 'datemodified'));
}
switch ($tab) {
case 'full':
$ItemList->set_default_filters(array('types' => NULL));
// $AdminUI->breadcrumbpath_add( T_('All items'), '?ctrl=items&blog=$blog$&tab='.$tab.'&filter=restore' );
// require colorbox js
require_js_helper('colorbox');
break;
case 'manual':
if ($Blog->get('type') != 'manual') {
// Display this tab only for manual blogs
global $admin_url;
header_redirect($admin_url . '?ctrl=items&blog=' . $Blog->ID . '&tab=list&filter=restore');
}
$AdminUI->breadcrumbpath_add(T_('Manual Pages'), '?ctrl=items&blog=$blog$&tab=' . $tab . '&filter=restore');
break;
case 'list':
// Nothing special
$AdminUI->breadcrumbpath_add(T_('Regular posts'), '?ctrl=items&blog=$blog$&tab=' . $tab . '&filter=restore');
break;
case 'pages':
$ItemList->set_default_filters(array('types' => implode(',', $posttypes_perms['page'])));
$AdminUI->breadcrumbpath_add(T_('Pages'), '?ctrl=items&blog=$blog$&tab=' . $tab . '&filter=restore');
break;
case 'intros':
$ItemList->set_default_filters(array('types' => implode(',', $posttypes_perms['intro'])));
$AdminUI->breadcrumbpath_add(T_('Intro posts'), '?ctrl=items&blog=$blog$&tab=' . $tab . '&filter=restore');
break;
case 'podcasts':
$ItemList->set_default_filters(array('types' => implode(',', $posttypes_perms['podcast'])));
$AdminUI->breadcrumbpath_add(T_('Podcasts'), '?ctrl=items&blog=$blog$&tab=' . $tab . '&filter=restore');
break;
case 'links':
$ItemList->set_default_filters(array('types' => '3000'));
$AdminUI->breadcrumbpath_add(T_('Links'), '?ctrl=items&blog=$blog$&tab=' . $tab . '&filter=restore');
break;
case 'ads':
$ItemList->set_default_filters(array('types' => '4000'));
$AdminUI->breadcrumbpath_add(T_('Advertisements'), '?ctrl=items&blog=$blog$&tab=' . $tab . '&filter=restore');
break;
case 'tracker':
// In tracker mode, we want a different default sort:
$ItemList->set_default_filters(array('orderby' => 'priority', 'order' => 'ASC'));
break;
default:
// Delete the pref_browse_tab setting so that the default
// (full) gets used the next time the user wants to browse
// a blog and we don't run into the same error again.
$UserSettings->delete('pref_browse_tab');
$UserSettings->dbupdate();
debug_die('Unknown filterset [' . $tab . ']');
}
// Init filter params:
if (!$ItemList->load_from_Request()) {
// If we could not init a filterset from request
// typically happens when we could no fall back to previously saved filterset...
// echo ' no filterset!';
}
}
示例10: require_js
$AdminUI->set_path('site', 'dashboard');
$AdminUI->breadcrumbpath_init(false);
$AdminUI->breadcrumbpath_add(T_('Site'), $admin_url . '?ctrl=dashboard');
$AdminUI->breadcrumbpath_add(T_('Site Dashboard'), $admin_url . '?ctrl=dashboard');
// Set an url for manual page:
$AdminUI->set_page_manual_link('site-dashboard');
}
// Load jquery UI to animate background color on change comment status and to transfer a comment to recycle bin
require_js('#jqueryUI#');
require_js('communication.js');
// auto requires jQuery
// Load the appropriate blog navigation styles (including calendar, comment forms...):
require_css($AdminUI->get_template('blog_base.css'));
// Default styles for the blog navigation
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
require_js_helper('colorbox');
// Include files to work with charts
require_js('#easypiechart#');
require_css('jquery/jquery.easy-pie-chart.css');
if (empty($blog)) {
// Init JS to quick edit an order of the blogs in the table cell by AJAX
init_field_editor_js(array('field_prefix' => 'order-blog-', 'action_url' => $admin_url . '?ctrl=dashboard&order_action=update&order_data='));
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
if ($blog) {
// We want to look at a specific blog:
// Begin payload block:
// This div is to know where to display the message after overlay close:
示例11: require_js_helper
/**
* Memorize that a specific js helper will be required by the current page.
* This allows to require JS + SS + do init.
*
* All requested helpers will be included in the page head only once (when headlines is called)
* Requested helpers should add their required translation strings and any other settings
*
* @param string helper, name of the required helper
*/
function require_js_helper($helper = '', $relative_to = 'rsc_url')
{
static $helpers;
if (empty($helpers) || !in_array($helper, $helpers)) {
// Helper not already added, add the helper:
switch ($helper) {
case 'helper':
// main helper object required
global $debug;
require_js('#jquery#', $relative_to);
// dependency
require_js('helper.js', $relative_to);
add_js_headline('jQuery(document).ready(function()
{
b2evoHelper.Init({
debug:' . ($debug ? 'true' : 'false') . '
});
});');
break;
case 'communications':
// communications object required
require_js_helper('helper', $relative_to);
// dependency
global $dispatcher;
require_js('communication.js', $relative_to);
add_js_headline('jQuery(document).ready(function()
{
b2evoCommunications.Init({
dispatcher:"' . $dispatcher . '"
});
});');
// add translation strings
T_('Update cancelled', NULL, array('for_helper' => true));
T_('Update paused', NULL, array('for_helper' => true));
T_('Changes pending', NULL, array('for_helper' => true));
T_('Saving changes', NULL, array('for_helper' => true));
break;
case 'colorbox':
// Colorbox: a lightweight Lightbox alternative -- allows zooming on images and slideshows in groups of images
// Added by fplanque - (MIT License) - http://colorpowered.com/colorbox/
require_js('#jqueryUI#', $relative_to);
require_js('voting.js', $relative_to);
require_js('colorbox/jquery.colorbox-min.js', $relative_to);
require_css('colorbox/colorbox.css', $relative_to);
if (is_logged_in()) {
// If user is logged in - display a voting panel
$colorbox_params = ',
displayVoting: true,
votingUrl: "' . get_secure_htsrv_url() . 'anon_async.php?action=voting&vote_type=file&' . url_crumb('voting') . '",
minWidth: 345';
} else {
// Set minimum width
$colorbox_params = ',
minWidth: 255';
}
add_js_headline('jQuery(document).ready(function()
{
jQuery("a[rel^=\'lightbox\']").colorbox(
{
maxWidth: "95%",
maxHeight: "90%",
slideshow: true,
slideshowAuto: false' . $colorbox_params . '
} );
} );');
// TODO: translation strings
break;
}
// add to list of loaded helpers
$helpers[] = $helper;
}
}
示例12: display_init
//.........这里部分代码省略.........
// Include the b2evo_base CSS (OLD / v5 style) - Use this when you DON'T use Bootstrap:
if ($debug) {
// Use readable CSS:
// require_css( 'basic_styles.css', 'blog' ); // the REAL basic styles
// require_css( 'basic.css', 'blog' ); // Basic styles
// require_css( 'blog_base.css', 'blog' ); // Default styles for the blog navigation
// require_css( 'item_base.css', 'blog' ); // Default styles for the post CONTENT
// require_css( 'b2evo_base.bundle.css', 'blog' ); // Concatenation of the above
require_css('b2evo_base.bundle.css', 'blog');
// Concatenation + Minifaction of the above
} else {
// Use minified CSS:
require_css('b2evo_base.bmin.css', 'blog');
// Concatenation + Minifaction of the above
}
break;
case 'style_css':
// Include the default skin style.css:
// You should make sure this is called ahead of any custom generated CSS.
if ($this->use_min_css == false || $debug || $this->use_min_css == 'check' && !file_exists(dirname(__FILE__) . '/style.min.css')) {
// Use readable CSS:
require_css('style.css', 'relative');
// Relative to <base> tag (current skin folder)
} else {
// Use minified CSS:
require_css('style.min.css', 'relative');
// Relative to <base> tag (current skin folder)
}
break;
case 'colorbox':
// Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
if ($this->get_setting('colorbox')) {
// This can be enabled by a setting in skins where it may be relevant
require_js_helper('colorbox', 'blog');
}
break;
case 'disp_auto':
// Automatically add a disp_xxx for current $disp:
$features[] = 'disp_' . $disp;
break;
case 'disp_single':
// Specific features for disp=single:
// Specific features for disp=single:
case 'disp_page':
// Specific features for disp=page:
global $Blog;
// Used to init functions for AJAX forms to add a comment:
init_ajax_forms('blog');
// Used to set rating for a new comment:
init_ratings_js('blog');
// Used to vote on the comments:
init_voting_comment_js('blog');
// Used to display a tooltip to the right of plugin help icon:
init_plugins_js('blog', $this->get_template('tooltip_plugin'));
// Used to autocomplete usernames in textarea:
init_autocomplete_usernames_js('blog');
if ($Blog->get_setting('allow_rating_comment_helpfulness')) {
// Load jquery UI to animate background color on change comment status or on vote:
require_js('#jqueryUI#', 'blog');
}
break;
case 'disp_users':
// Specific features for disp=users:
// Used to add new search field "Specific criteria":
require_js('#jqueryUI#', 'blog');
require_css('#jqueryUI_css#', 'blog');
示例13: init_list_mode
/**
* Initialize list mode; Several actions need this.
*/
function init_list_mode()
{
global $tab, $tab_type, $Blog, $UserSettings, $ItemList, $AdminUI;
// set default itemslist param prefix
$items_list_param_prefix = 'items_';
if (param('p', 'integer', NULL) || param('title', 'string', NULL)) {
// Single post requested, do not filter any post types. If the user
// has clicked a post link on the dashboard and previously has selected
// a tab which would filter this post, it wouldn't be displayed now.
$tab = 'full';
// in case of single item view params prefix must be empty
$items_list_param_prefix = NULL;
} else {
// Store/retrieve preferred tab from UserSettings:
$UserSettings->param_Request('tab', 'pref_browse_tab', 'string', NULL, true, true);
$UserSettings->param_Request('tab_type', 'pref_browse_tab_type', 'string', NULL, true, true);
}
if ($tab == 'tracker' && !$Blog->get_setting('use_workflow')) {
// Display workflow view only if it is enabled
global $Messages;
$Messages->add(T_('Workflow feature has not been enabled for this collection.'), 'note');
$tab = 'full';
}
/*
* Init list of posts to display:
*/
load_class('items/model/_itemlist.class.php', 'ItemList2');
if (!empty($tab) && !empty($items_list_param_prefix)) {
// Use different param prefix for each tab
$items_list_param_prefix .= substr($tab, 0, 7) . '_';
//.utf8_strtolower( $tab_type ).'_';
}
// Set different filterset name for each different tab and tab_type
$filterset_name = $tab == 'type' ? $tab . '_' . utf8_strtolower($tab_type) : $tab;
// Create empty List:
$ItemList = new ItemList2($Blog, NULL, NULL, $UserSettings->get('results_per_page'), 'ItemCache', $items_list_param_prefix, $filterset_name);
// COPY (func)
$ItemList->set_default_filters(array('visibility_array' => get_visibility_statuses('keys')));
if ($Blog->get_setting('orderby') == 'RAND') {
// Do not display random posts in backoffice for easy management
$ItemList->set_default_filters(array('orderby' => 'datemodified'));
}
switch ($tab) {
case 'full':
$ItemList->set_default_filters(array('types' => NULL));
// $AdminUI->breadcrumbpath_add( T_('All items'), '?ctrl=items&blog=$blog$&tab='.$tab.'&filter=restore' );
// require colorbox js
require_js_helper('colorbox');
$AdminUI->breadcrumbpath_add(T_('All'), '?ctrl=items&blog=$blog$&tab=full&filter=restore');
break;
case 'manual':
if ($Blog->get('type') != 'manual') {
// Display this tab only for manual blogs
global $admin_url;
header_redirect($admin_url . '?ctrl=items&blog=' . $Blog->ID . '&tab=type&tab_type=posts&filter=restore');
}
global $ReqURI, $blog;
init_field_editor_js(array('action_url' => $ReqURI . '&blog=' . $blog . '&order_action=update&order_data='));
$AdminUI->breadcrumbpath_add(T_('Manual view'), '?ctrl=items&blog=$blog$&tab=' . $tab . '&filter=restore');
break;
case 'type':
// Filter a posts list by type
$ItemList->set_default_filters(array('types' => get_item_types_by_tab($tab_type)));
$AdminUI->breadcrumbpath_add(T_($tab_type), '?ctrl=items&blog=$blog$&tab=' . $tab . '&tab_type=' . urlencode($tab_type) . '&filter=restore');
break;
case 'tracker':
// In tracker mode, we want a different default sort:
$ItemList->set_default_filters(array('orderby' => 'priority', 'order' => 'ASC'));
$AdminUI->breadcrumbpath_add(T_('Workflow view'), '?ctrl=items&blog=$blog$&tab=tracker&filter=restore');
$AdminUI->set_page_manual_link('workflow-features');
// JS to edit priority of items from list view
require_js('jquery/jquery.jeditable.js', 'rsc_url');
break;
default:
// Delete the pref_browse_tab setting so that the default
// (full) gets used the next time the user wants to browse
// a blog and we don't run into the same error again.
$UserSettings->delete('pref_browse_tab');
$UserSettings->dbupdate();
debug_die('Unknown filterset [' . $tab . ']');
}
// Init filter params:
if (!$ItemList->load_from_Request()) {
// If we could not init a filterset from request
// typically happens when we could no fall back to previously saved filterset...
// echo ' no filterset!';
}
}
示例14: require_js_helper
/**
* Memorize that a specific js helper will be required by the current page.
* This allows to require JS + SS + do init.
*
* All requested helpers will be included in the page head only once (when headlines is called)
* Requested helpers should add their required translation strings and any other settings
*
* @param string helper, name of the required helper
*/
function require_js_helper($helper = '', $relative_to = 'rsc_url')
{
static $helpers;
if (empty($helpers) || !in_array($helper, $helpers)) {
// Helper not already added, add the helper:
switch ($helper) {
case 'helper':
// main helper object required
global $debug;
require_js('#jquery#', $relative_to);
// dependency
require_js('helper.js', $relative_to);
add_js_headline('jQuery(document).ready(function()
{
b2evoHelper.Init({
debug:' . ($debug ? 'true' : 'false') . '
});
});');
break;
case 'communications':
// communications object required
require_js_helper('helper', $relative_to);
// dependency
global $dispatcher;
require_js('communication.js', $relative_to);
add_js_headline('jQuery(document).ready(function()
{
b2evoCommunications.Init({
dispatcher:"' . $dispatcher . '"
});
});');
// add translation strings
T_('Update cancelled', NULL, array('for_helper' => true));
T_('Update paused', NULL, array('for_helper' => true));
T_('Changes pending', NULL, array('for_helper' => true));
T_('Saving changes', NULL, array('for_helper' => true));
break;
case 'colorbox':
// Colorbox: a lightweight Lightbox alternative -- allows zooming on images and slideshows in groups of images
// Added by fplanque - (MIT License) - http://colorpowered.com/colorbox/
global $b2evo_icons_type, $blog;
$blog_param = empty($blog) ? '' : '&blog=' . $blog;
// Colorbox params to translate the strings:
$colorbox_strings_params = 'current: "' . TS_('image {current} of {total}') . '",
previous: "' . TS_('Previous') . '",
next: "' . TS_('Next') . '",
close: "' . TS_('Close') . '",
openNewWindowText: "' . TS_('Open in a new window') . '",
slideshowStart: "' . TS_('Start slideshow') . '",
slideshowStop: "' . TS_('Stop slideshow') . '",';
// Colorbox params to display a voting panel:
$colorbox_voting_params = '{' . $colorbox_strings_params . '
displayVoting: true,
votingUrl: "' . get_secure_htsrv_url() . 'anon_async.php?action=voting&vote_type=link&b2evo_icons_type=' . $b2evo_icons_type . $blog_param . '",
minWidth: 305}';
// Colorbox params without voting panel:
$colorbox_no_voting_params = '{' . $colorbox_strings_params . '
minWidth: 255}';
// Initialize js variables b2evo_colorbox_params* that are used in async loaded colorbox file
if (is_logged_in()) {
// User is logged in
// All unknown images have a voting panel
$colorbox_params_other = 'var b2evo_colorbox_params_other = ' . $colorbox_voting_params;
if (is_admin_page()) {
// Display a voting panel for all images in backoffice
$colorbox_params_post = 'var b2evo_colorbox_params_post = ' . $colorbox_voting_params;
$colorbox_params_cmnt = 'var b2evo_colorbox_params_cmnt = ' . $colorbox_voting_params;
$colorbox_params_user = 'var b2evo_colorbox_params_user = ' . $colorbox_voting_params;
} else {
// Display a voting panel depending on skin settings
global $Skin;
if (!empty($Skin)) {
$colorbox_params_post = 'var b2evo_colorbox_params_post = ' . ($Skin->get_setting('colorbox_vote_post') ? $colorbox_voting_params : $colorbox_no_voting_params);
$colorbox_params_cmnt = 'var b2evo_colorbox_params_cmnt = ' . ($Skin->get_setting('colorbox_vote_comment') ? $colorbox_voting_params : $colorbox_no_voting_params);
$colorbox_params_user = 'var b2evo_colorbox_params_user = ' . ($Skin->get_setting('colorbox_vote_user') ? $colorbox_voting_params : $colorbox_no_voting_params);
}
}
}
if (!isset($colorbox_params_post)) {
// Don't display a voting panel for all images if user is NOT logged in OR for case when $Skin is not defined
$colorbox_params_other = 'var b2evo_colorbox_params_other = ' . $colorbox_no_voting_params;
$colorbox_params_post = 'var b2evo_colorbox_params_post = ' . $colorbox_no_voting_params;
$colorbox_params_cmnt = 'var b2evo_colorbox_params_cmnt = ' . $colorbox_no_voting_params;
$colorbox_params_user = 'var b2evo_colorbox_params_user = ' . $colorbox_no_voting_params;
}
require_js('#jquery#', $relative_to);
// Initialize the colorbox settings:
add_js_headline('var b2evo_colorbox_params = {
maxWidth: jQuery( window ).width() > 480 ? "95%" : "100%",
maxHeight: jQuery( window ).height() > 480 ? "90%" : "100%",
slideshow: true,
//.........这里部分代码省略.........
示例15: header_redirect
// Change to 'redemption' status only if status is 'warning', 'suspicious1', 'suspicious2', 'suspicious3' or 'prmerror'
$EmailAddress->set('status', 'redemption');
$EmailAddress->dbupdate();
}
// Redirect so that a reload doesn't write to the DB twice:
header_redirect($admin_url . '?ctrl=user&user_tab=' . $user_tab . '&user_ID=' . $user_ID);
// Will EXIT
// We have EXITed already at this point!!
break;
}
}
if ($display_mode != 'js') {
// Display a form to quick search users
$AdminUI->top_block = get_user_quick_search_form();
// require colorbox js
require_js_helper('colorbox', 'rsc_url');
$AdminUI->breadcrumbpath_init(false);
// fp> I'm playing with the idea of keeping the current blog in the path here...
$AdminUI->breadcrumbpath_add(T_('Users'), '?ctrl=users');
if ($action == 'new') {
$AdminUI->breadcrumbpath_add($edited_User->login, '?ctrl=user&user_ID=' . $edited_User->ID);
} else {
$AdminUI->breadcrumbpath_add($edited_User->get_colored_login(array('login_text' => 'name')), '?ctrl=user&user_ID=' . $edited_User->ID);
}
switch ($user_tab) {
case 'profile':
$AdminUI->breadcrumbpath_add(T_('Profile'), '?ctrl=user&user_ID=' . $edited_User->ID . '&user_tab=' . $user_tab);
init_userfields_js('rsc_url', $AdminUI->get_template('tooltip_plugin'));
require_js('#jcrop#', 'rsc_url');
require_css('#jcrop_css#', 'rsc_url');
// Set an url for manual page: