function messages_add_autocomplete_css() { global $bp; if (bp_is_messages_component() && bp_is_current_action('compose')) { if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) { nxt_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), '20110723'); } else { nxt_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.css', array(), '20110723'); } nxt_print_styles(); } }
/** * Outputs the HTML for a single instance of the editor. * * @param string $content The initial content of the editor. * @param string $editor_id ID for the textarea and TinyMCE and Quicktags instances (can contain only ASCII letters and numbers). * @param array $settings See the _parse_settings() method for description. */ public static function editor($content, $editor_id, $settings = array()) { $set = self::parse_settings($editor_id, $settings); $editor_class = ' class="' . trim($set['editor_class'] . ' nxt-editor-area') . '"'; $tabindex = $set['tabindex'] ? ' tabindex="' . (int) $set['tabindex'] . '"' : ''; $rows = ' rows="' . (int) $set['textarea_rows'] . '"'; $switch_class = 'html-active'; $toolbar = $buttons = ''; if (!current_user_can('upload_files')) { $set['media_buttons'] = false; } if (self::$this_quicktags && self::$this_tinymce) { $switch_class = 'html-active'; if ('html' == nxt_default_editor()) { add_filter('the_editor_content', 'nxt_htmledit_pre'); } else { add_filter('the_editor_content', 'nxt_richedit_pre'); $switch_class = 'tmce-active'; } $buttons .= '<a id="' . $editor_id . '-html" class="hide-if-no-js nxt-switch-editor switch-html" onclick="switchEditors.switchto(this);">' . __('HTML') . "</a>\n"; $buttons .= '<a id="' . $editor_id . '-tmce" class="hide-if-no-js nxt-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">' . __('Visual') . "</a>\n"; } echo '<div id="nxt-' . $editor_id . '-wrap" class="nxt-editor-wrap ' . $switch_class . '">'; if (self::$editor_buttons_css) { nxt_print_styles('editor-buttons'); self::$editor_buttons_css = false; } if (!empty($set['editor_css'])) { echo $set['editor_css'] . "\n"; } if (!empty($buttons) || $set['media_buttons']) { echo '<div id="nxt-' . $editor_id . '-editor-tools" class="nxt-editor-tools">'; echo $buttons; if ($set['media_buttons']) { self::$has_medialib = true; if (!function_exists('media_buttons')) { include ABSPATH . 'nxt-admin/includes/media.php'; } echo '<div id="nxt-' . $editor_id . '-media-buttons" class="hide-if-no-js nxt-media-buttons">'; do_action('media_buttons', $editor_id); echo "</div>\n"; } echo "</div>\n"; } $the_editor = apply_filters('the_editor', '<div id="nxt-' . $editor_id . '-editor-container" class="nxt-editor-container"><textarea' . $editor_class . $rows . $tabindex . ' cols="40" name="' . $set['textarea_name'] . '" id="' . $editor_id . '">%s</textarea></div>'); $content = apply_filters('the_editor_content', $content); printf($the_editor, $content); echo "\n</div>\n\n"; self::editor_settings($editor_id, $set); }
/** * Enqueues CSS files. * * @since 2.0 * @global object $bp BuddyPress global settings */ function dpa_add_css() { global $bp; if (is_active_widget(false, false, 'achievements-sitewide') || is_active_widget(false, false, 'achievements-available-achievements') || is_active_widget(false, false, 'achievements-member-achievements') || is_active_widget(false, false, 'achievements-featured-achievement') || is_active_widget(false, false, 'achievements-member-achievements-available') || is_active_widget(false, false, 'achievements-member-points')) { nxt_enqueue_style('achievements-widget', plugins_url('/css/widget.css', __FILE__), array(), ACHIEVEMENTS_VERSION); } if (!bp_is_current_component($bp->achievements->slug)) { if (bp_is_active('activity') && bp_is_activity_component() && !bp_is_blog_page() || bp_is_component_front_page('activity') && bp_is_front_page()) { nxt_enqueue_style('achievements-directory', plugins_url('/css/directory.css', __FILE__), array(), ACHIEVEMENTS_VERSION); } nxt_print_styles(); return; } if (DPA_SLUG_CREATE == $bp->current_action && dpa_permission_can_user_create() || DPA_SLUG_ACHIEVEMENT_EDIT == $bp->current_action && dpa_permission_can_user_edit() || DPA_SLUG_ACHIEVEMENT_CHANGE_PICTURE == $bp->current_action && dpa_permission_can_user_change_picture() || DPA_SLUG_ACHIEVEMENT_GRANT == $bp->current_action && dpa_permission_can_user_grant()) { nxt_enqueue_style('achievements-admin', plugins_url('/css/admin.css', __FILE__), array(), ACHIEVEMENTS_VERSION); } if ($bp->is_single_item) { nxt_enqueue_style('achievements-detail', plugins_url('/css/detail.css', __FILE__), array(), ACHIEVEMENTS_VERSION); } else { nxt_enqueue_style('achievements-directory', plugins_url('/css/directory.css', __FILE__), array(), ACHIEVEMENTS_VERSION); } nxt_print_styles(); }
function bp_styles() { do_action('bp_styles'); nxt_print_styles(); }
/** * Include OpenID stylesheet. * * "Intelligently" decides whether to enqueue or print the CSS file, based on whether * the 'nxt_print_styles' * action has been run. (This logic taken from the core nxt_admin_css function) **/ function openid_style() { if (!nxt_style_is('openid', 'registered')) { nxt_register_style('openid', plugins_url('openid/f/openid.css'), array(), OPENID_PLUGIN_REVISION); } if (did_action('nxt_print_styles')) { nxt_print_styles('openid'); } else { nxt_enqueue_style('openid'); } }
/** * Enqueues or directly prints a stylesheet link to the specified CSS file. * * "Intelligently" decides to enqueue or to print the CSS file. If the * 'nxt_print_styles' action has *not* yet been called, the CSS file will be * enqueued. If the nxt_print_styles action *has* been called, the CSS link will * be printed. Printing may be forced by passing TRUE as the $force_echo * (second) parameter. * * For backward compatibility with NXTClass 2.3 calling method: If the $file * (first) parameter does not correspond to a registered CSS file, we assume * $file is a file relative to nxt-admin/ without its ".css" extension. A * stylesheet link to that generated URL is printed. * * @package NXTClass * @since 2.3.0 * @uses $nxt_styles NXTClass Styles Object * * @param string $file Optional. Style handle name or file name (without ".css" extension) relative * to nxt-admin/. Defaults to 'nxt-admin'. * @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued. */ function nxt_admin_css($file = 'nxt-admin', $force_echo = false) { global $nxt_styles; if (!is_a($nxt_styles, 'nxt_Styles')) { $nxt_styles = new nxt_Styles(); } // For backward compatibility $handle = 0 === strpos($file, 'css/') ? substr($file, 4) : $file; if ($nxt_styles->query($handle)) { if ($force_echo || did_action('nxt_print_styles')) { // we already printed the style queue. Print this one immediately nxt_print_styles($handle); } else { // Add to style queue nxt_enqueue_style($handle); } return; } echo apply_filters('nxt_admin_css', "<link rel='stylesheet' href='" . esc_url(nxt_admin_css_uri($file)) . "' type='text/css' />\n", $file); if (is_rtl()) { echo apply_filters('nxt_admin_css', "<link rel='stylesheet' href='" . esc_url(nxt_admin_css_uri("{$file}-rtl")) . "' type='text/css' />\n", "{$file}-rtl"); } }