本文整理汇总了PHP中Stack::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Stack::add方法的具体用法?PHP Stack::add怎么用?PHP Stack::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_admin_header
public function action_admin_header($theme)
{
if ($theme->page == 'configure_block' && $_GET['inline'] == 1) {
Plugins::act('add_jwysiwyg_admin');
Stack::add('admin_stylesheet', array('#block_admin { display: none; } textarea { height: 250px; width: 540px; }', 'screen'));
}
}
示例2: add_template_vars
/**
* Add additional template variables to the template output.
*
* You can assign additional output values in the template here, instead of
* having the PHP execute directly in the template. The advantage is that
* you would easily be able to switch between template types (RawPHP/Smarty)
* without having to port code from one to the other.
*
* You could use this area to provide "recent comments" data to the template,
* for instance.
*
* Note that the variables added here should possibly *always* be added,
* especially 'user'.
*
* Also, this function gets executed *after* regular data is assigned to the
* template. So the values here, unless checked, will overwrite any existing
* values.
*/
public function add_template_vars ( ) {
parent::add_template_vars();
$this->home_tab = 'Blog';
$this->show_author = false;
$this->add_template( 'k2_text', dirname( __FILE__ ) . '/formcontrol_text.php' );
if ( !isset( $this->pages ) ) {
$this->pages = Posts::get( array( 'content_type' => 'page', 'status' => 'published', 'nolimit' => true ) );
}
if ( User::identify()->loggedin ) {
Stack::add( 'template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery' );
}
if ( ( $this->request->display_entry || $this->request->display_page ) && isset( $this->post ) && $this->post->title != '' ) {
$this->page_title = $this->post->title . ' - ' . Options::get('title');
}
else {
$this->page_title = Options::get('title');
}
}
示例3: action_init_theme_any
/**
* Add the tracking code to the template_header_javascript Stack.
*
* @todo determine if there is a better action to use
* @return null
*/
public function action_init_theme_any($theme)
{
$code = $this->tracking_code();
if ($code != null) {
Stack::add('template_header_javascript', $code, 'googleanalytics');
}
}
示例4: filter_theme_call_header
public function filter_theme_call_header($return, $theme)
{
if (User::identify() != FALSE) {
Stack::add('template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery');
}
return $return;
}
示例5: test_stack_order
function test_stack_order()
{
Stack::add( 'test_stack', 'a', 'a' );
Stack::add( 'test_stack', 'b after(a)', 'b', 'a' );
$sorted = Stack::get_sorted_stack('test_stack');
$this->assert_equal( implode(', ', $sorted), 'a, b after(a)' );
Stack::add( 'test_stack', 'c after(b,d,f)', 'c', array('b','d','f') );
$sorted = Stack::get_sorted_stack('test_stack');
$this->assert_equal( implode(', ', $sorted), 'a, b after(a), c after(b,d,f)' );
Stack::add( 'test_stack', 'd after(b)', 'd', 'b' );
$sorted = Stack::get_sorted_stack('test_stack');
$this->assert_equal( implode(', ', $sorted), 'a, b after(a), d after(b), c after(b,d,f)' );
Stack::add( 'test_stack', 'e after(b)', 'e', 'b' );
$sorted = Stack::get_sorted_stack('test_stack');
$this->assert_equal( implode(', ', $sorted), 'a, b after(a), d after(b), c after(b,d,f), e after(b)' );
Stack::add( 'test_stack', 'f after(b)', 'f', 'b' );
$sorted = Stack::get_sorted_stack('test_stack');
$this->assert_equal( implode(', ', $sorted), 'a, b after(a), d after(b), f after(b), e after(b), c after(b,d,f)' );
Stack::add( 'test_stack', 'g after(e)', 'g', 'e');
$sorted = Stack::get_sorted_stack('test_stack');
$this->output(implode(', ', $sorted));
$this->assert_equal( implode(', ', $sorted), 'a, b after(a), d after(b), f after(b), c after(b,d,f), e after(b), g after(e)' );
}
示例6: action_admin_header
/**
* Actually add the required javascript to the publish page
* @param Theme $theme The admin theme instance
**/
public function action_admin_header($theme)
{
if( $theme->page == 'publish' ) {
Stack::add( 'admin_header_javascript', 'multicomplete' );
Stack::add( 'admin_header_javascript', 'tags_auto' );
}
}
示例7: action_template_header
public function action_template_header($theme)
{
Stack::add('template_header_javascript', Site::get_url('scripts') . "/jquery.js", 'jquery');
Stack::add('template_header_javascript', Site::get_url('theme') . "/js/jquery.bigframe.js", 'jquery.bigframe', 'jquery');
Stack::add('template_header_javascript', Site::get_url('theme') . "/js/jquery.dimensions.js", 'jquery.dimensions', 'jquery');
Stack::add('template_header_javascript', Site::get_url('theme') . "/js/jquery.tooltip.js", 'jquery.tooltip', 'jquery');
}
示例8: action_add_template_vars
/**
* Add the Javascript file needed by this plugin to the theme's header.
*/
public function action_add_template_vars()
{
$jq_js_file = Site::get_url('scripts', TRUE) . 'jquery.js';
$ss_js_file = Site::get_url('user', TRUE) . 'plugins/' . basename(dirname(__FILE__)) . '/styleswitcher.js';
Stack::add('template_header_javascript', $jq_js_file, 'jquery');
Stack::add('template_header_javascript', $ss_js_file, 'styleswitcher');
}
示例9: action_admin_header
function action_admin_header()
{
$url = URL::get('auth_ajax', 'context=extendedlog');
$script = <<<SCRIPT
\$(function(){
\tvar initi = itemManage.initItems;
\titemManage.initItems = function(){
\t\tiniti();
\t\t\$('.page-logs .manage .item .less,.page-logs .manage .item .message.minor').hide();
\t\t\$('.page-logs .manage .item .more').show().css({clear: 'both', marginLeft: '40px', fontWeight: 'bold', width: '100%'});
\t\t\$('.page-logs .manage .item').click(function(){
\t\t\t\$('.extendedlog').remove();
\t\t\t\$(this).after('<div class="extendedlog"><div class="textarea" style="white-space:pre;font-family:consolas,courier new,monospace;border:1px solid #999;padding:20px;margin:20px 0px;height:100px;overflow-y:auto;">Loading...</div></div>');
\t\t\t\$('.extendedlog .textarea').resizeable();
\t\t\t\$.post(
\t\t\t\t'{$url}',
\t\t\t\t{
\t\t\t\t\tlog_id: \$('.checkbox input', \$(this)).attr('id').match(/\\[([0-9]+)\\]/)[1]
\t\t\t\t},
\t\t\t\tfunction(result){
\t\t\t\t\t\$('.extendedlog .textarea').html(result)
\t\t\t\t}
\t\t\t);
\t\t});
\t}
});
SCRIPT;
Stack::add('admin_header_javascript', $script, 'extendedlog', array('jquery', 'admin'));
}
示例10: action_init_theme
public function action_init_theme()
{
Format::apply('tag_and_list', 'post_tags_out', ', ', ', ');
Format::apply_with_hook_params('more', 'post_content_out', 'More ›', null, 1);
Stack::add('template_stylesheet', array(Site::get_url('theme') . '/css/screen.css', 'screen, projection'), 'screen');
Stack::add('template_stylesheet', array(Site::get_url('theme') . '/css/style.css', 'screen, projection'), 'style');
}
示例11: get_dashboard
/**
* Handles get requests for the dashboard
* @todo update check should probably be cron'd and cached, not re-checked every load
*/
public function get_dashboard()
{
// Not sure how best to determine this yet, maybe set an option on install, maybe do this:
$firstpostdate = DB::get_value('SELECT min(pubdate) FROM {posts} WHERE status = ?', array(Post::status('published')));
if ($firstpostdate) {
$this->theme->active_time = DateTime::create($firstpostdate);
}
// check to see if we have updates to display
$this->theme->updates = Options::get('updates_available', array());
// collect all the stats we display on the dashboard
$user = User::identify();
$this->theme->stats = array('author_count' => Users::get(array('count' => 1)), 'post_count' => Posts::get(array('count' => 1, 'content_type' => Post::type('any'), 'status' => Post::status('published'))), 'comment_count' => Comments::count_total('approved', false), 'tag_count' => Tags::vocabulary()->count_total(), 'user_draft_count' => Posts::get(array('count' => 1, 'content_type' => Post::type('any'), 'status' => Post::status('draft'), 'user_id' => $user->id)), 'unapproved_comment_count' => User::identify()->can('manage_all_comments') ? Comments::count_total('unapproved', false) : Comments::count_by_author(User::identify()->id, Comment::status('unapproved')), 'spam_comment_count' => $user->can('manage_all_comments') ? Comments::count_total('spam', false) : Comments::count_by_author($user->id, Comment::status('spam')), 'user_scheduled_count' => Posts::get(array('count' => 1, 'content_type' => Post::type('any'), 'status' => Post::status('scheduled'), 'user_id' => $user->id)));
// check for first run
$u = User::identify();
$uinfo = $u->info;
if (!isset($uinfo->experience_level)) {
$this->theme->first_run = true;
$u->info->experience_level = 'user';
$u->info->commit();
} else {
$this->theme->first_run = false;
}
$this->get_additem_form();
Stack::add('admin_header_javascript', 'dashboard-js');
$this->display('dashboard');
}
示例12: action_admin_header
/**
* Add appropriate CSS to this plugin's configuration form
*/
public function action_admin_header($theme)
{
$vars = Controller::get_handler_vars();
if ($theme->admin_page == 'plugins' && isset($vars['configure']) && $vars['configure'] === $this->plugin_id) {
Stack::add('admin_stylesheet', array($this->get_url() . '/metaseo.css', 'screen'));
}
}
示例13: action_admin_header
/**
* Add the required javascript to the publish page
* @param Theme $theme The admin theme instance
**/
public function action_admin_header($theme)
{
if ($theme->page == 'publish') {
Stack::add('admin_header_javascript', $this->get_url(true) . 'tagtray.js', 'tagtray', 'jquery');
Stack::add('admin_footer_javascript', 'resetTags();', 'tagtray', 'tagtray');
Stack::add('admin_stylesheet', $this->get_url(true) . 'tagtray.css', 'tagtray');
}
}
示例14: action_init_theme
public function action_init_theme()
{
Stack::add('template_header_javascript', $this->get_url() . '/ident/jquery-1.3.2.min.js', 'jquery');
Stack::add('template_header_javascript', $this->get_url() . '/js/jquery-ui-1.7.2.custom.min.js', 'jqueryui', 'jquery');
Stack::add('template_header_javascript', $this->get_url() . '/ident/ident-0.1.js', 'ident_lib');
Stack::add('template_header_javascript', $this->get_url() . '/js/main.js', 'ident_main', 'jquery');
Stack::add('template_stylesheet', array($this->get_url() . '/css/dialog.css', 'screen'), 'ident_dialog');
}
示例15: action_template_header
public function action_template_header($theme)
{
Stack::add('template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery');
Stack::add('template_header_javascript', Site::get_url('theme') . '/thickbox-compressed.js', 'thickbox');
Stack::add('template_header_javascript', Site::get_url('theme') . '/swfobject.js', 'swfobject');
Stack::add('template_header_javascript', Site::get_url('theme') . '/features.js', 'features');
Stack::add('template_stylesheet', array(Site::get_url('theme') . '/thickbox.css', 'screen'), 'thickbox');
}