Changeset 45322
- Timestamp:
- 05/12/08 01:16:09 (2 months ago)
- Files:
-
- ajaxd-wordpress/trunk/aWP.php (modified) (1 diff)
- ajaxd-wordpress/trunk/control/aWP-admin.php (modified) (6 diffs)
- ajaxd-wordpress/trunk/control/aWP-admin_panel.php (modified) (2 diffs)
- ajaxd-wordpress/trunk/images/throbberlarge.gif (added)
- ajaxd-wordpress/trunk/modules/ajaxnav/ajaxnav.php (modified) (11 diffs)
- ajaxd-wordpress/trunk/modules/awp-edit-comments.php (modified) (1 diff)
- ajaxd-wordpress/trunk/modules/awpcache.php (modified) (6 diffs)
- ajaxd-wordpress/trunk/modules/core_cache/core_cache.php (modified) (3 diffs)
- ajaxd-wordpress/trunk/modules/customoptions.php (modified) (7 diffs)
- ajaxd-wordpress/trunk/modules/embeddedposts.php (modified) (1 diff)
- ajaxd-wordpress/trunk/modules/inlinecommentform/inlinecommentform.php (modified) (5 diffs)
- ajaxd-wordpress/trunk/modules/inlinecomments/inlinecomments.php (modified) (7 diffs)
- ajaxd-wordpress/trunk/modules/inlineposts.php (modified) (11 diffs)
- ajaxd-wordpress/trunk/modules/livepreview/livepreview.php (modified) (1 diff)
- ajaxd-wordpress/trunk/modules/preview_comment.php (modified) (1 diff)
- ajaxd-wordpress/trunk/modules/quicktags/quicktags.php (modified) (1 diff)
- ajaxd-wordpress/trunk/modules/richtext/awp-richeditor.php (modified) (2 diffs)
- ajaxd-wordpress/trunk/modules/threaded_comments.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ajaxd-wordpress/trunk/aWP.php
r45246 r45322 71 71 /*Load modules. If we restore defaults, no modules are needed.*/ 72 72 if ( is_array($awp_mods) && $_POST["action"] != "restoredefaults") { 73 $awp_init = array(); 73 74 foreach ($awp_mods as $mod) { 74 75 if ('' != $mod && file_exists(ABSPATH . PLUGINDIR . AWP_MODULES. '/' . $mod)) 75 76 include_once(ABSPATH . PLUGINDIR . AWP_MODULES . '/' . $mod); 77 } 78 if(count($awp_init) > 0){ // loop once to set up the classes and once to initiate them. 79 foreach($awp_init as $class){ 80 $$class = null; 81 global $$class; 82 $$class = new $class; 83 } 84 reset($awp_init); 85 foreach($awp_init as $class){ 86 $$class->init(); 87 } 76 88 } 77 89 } ajaxd-wordpress/trunk/control/aWP-admin.php
r45246 r45322 9 9 */ 10 10 11 $AWP_admin = new AWP_admin(); 12 11 13 if(!$_REQUEST['custom_options_menu']) 12 add_action('awp_build_menu',array('AWP_admin','admin_panel')); 14 add_action('awp_build_menu',array($AWP_admin,'admin_panel')); 15 16 13 17 14 18 add_action('awp_admin_overall', 'admin_panel_overall'); … … 113 117 114 118 if(is_array($marray[menus])){ 115 AWP_admin::admin_panel_menu($marray[menus][menu]);119 $this->admin_panel_menu($marray[menus][menu]); 116 120 }elseif(is_array($marray[menu])){ 117 AWP_admin::admin_panel_menu($marray[menu]);121 $this->admin_panel_menu($marray[menu]); 118 122 }elseif(is_array($marray[submenu])){ 119 AWP_admin::admin_panel_sub($marray[submenu]);123 $this->admin_panel_sub($marray[submenu]); 120 124 }elseif(is_array($marray[item])){ 121 AWP_admin::admin_panel_item($marray[item]);125 $this->admin_panel_item($marray[item]); 122 126 } 123 127 } … … 160 164 $e_id = ($id)? ' id="'.$id.'"' : '' ; 161 165 echo '<div '.$class.$e_id.'>'; 162 AWP_admin::admin_panel_sub($m[submenu]);166 $this->admin_panel_sub($m[submenu]); 163 167 if($m[action]) 164 168 do_action($m[action]); … … 185 189 if(is_array($menu[item])){ 186 190 echo '<ul class="def">'; 187 AWP_admin::admin_panel_item($menu[item]);191 $this->admin_panel_item($menu[item]); 188 192 if($menu[action]) 189 193 do_action($menu[action]); … … 475 479 continue; 476 480 477 $modules_data = AWP_admin::get_modules_data( "$modules_root/$modules_file" );481 $modules_data = $this->get_modules_data( "$modules_root/$modules_file" ); 478 482 479 483 if ( empty ( $modules_data['Name'] ) ) … … 591 595 global $awpall, $aWP, $wp_version; 592 596 593 $aWP[modules] = AWP_admin::get_modules();597 $aWP[modules] = $this->get_modules(); 594 598 $messages = get_option('awp_messages'); 595 599 if(count($messages) > 1){ ajaxd-wordpress/trunk/control/aWP-admin_panel.php
r44986 r45322 1 1 <?php 2 global $aWP, $awpall ;3 AWP_admin::start_panel();2 global $aWP, $awpall,$AWP_admin; 3 $AWP_admin->start_panel(); 4 4 5 5 … … 85 85 <p><?php _e('AJAXed Wordpress is made up of many smaller plugins called modules.', 'awp'); ?> <?php _e('You may disable or enable modules here.', 'awp'); ?> <?php _e('Some modules may need to have some of their features explicitly enabled after activation.', 'awp'); ?></p> 86 86 87 <?php echo AWP_admin::print_modules();?>87 <?php echo $AWP_admin->print_modules();?> 88 88 </div> 89 89 </fieldset> ajaxd-wordpress/trunk/modules/ajaxnav/ajaxnav.php
r45279 r45322 10 10 */ 11 11 12 13 $awp_init[] = 'AWP_ajaxnav'; 14 15 register_activation_hook(__file__,array('AWP_ajaxnav','set_defaults')); 16 Class AWP_ajaxnav{ 17 18 function init(){ 19 global $awpall; 12 20 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){ 13 add_action('awp_admin_more_menus',array( 'AWP_nav','admin'));14 add_action('awp_admin_more_menu_links',array( 'AWP_nav','admin_link'));15 add_filter('awp_get_options',array( 'AWP_nav','awp_get_options'));21 add_action('awp_admin_more_menus',array($this,'admin')); 22 add_action('awp_admin_more_menu_links',array($this,'admin_link')); 23 add_filter('awp_get_options',array($this,'awp_get_options')); 16 24 }elseif($awpall['ajaxnav'] == 'Enabled'){ 17 add_action('awp_ajax_type_nav', array( 'AWP_nav', 'AJAX'));18 add_action('loop_end', array( 'AWP_nav', 'loop_end'));19 add_action('loop_start', array( 'AWP_nav', 'loop_start'));20 add_action('awp_js_start',array( 'AWP_nav','awp_js_start'));25 add_action('awp_ajax_type_nav', array($this, 'AJAX')); 26 add_action('loop_end', array($this, 'loop_end')); 27 add_action('loop_start', array($this, 'loop_start')); 28 add_action('awp_js_start',array($this,'awp_js_start')); 21 29 22 30 /*Template Functions*/ 23 add_action('awp_nav_bar_single', array( 'AWP_nav','post_nav_bar'));24 add_action('awp_nav_bar', array( 'AWP_nav','nav_bar'));25 26 27 add_filter('aWP_JS', array( 'AWP_nav','addJS'));28 29 add_action('awp_nav_single_onclick', array( 'AWP_nav','single_post_add_onclick'));31 add_action('awp_nav_bar_single', array($this,'post_nav_bar')); 32 add_action('awp_nav_bar', array($this,'nav_bar')); 33 34 35 add_filter('aWP_JS', array($this,'addJS')); 36 37 add_action('awp_nav_single_onclick', array($this,'single_post_add_onclick')); 30 38 31 39 if($awpall['ajax_nav_pages']) 32 add_filter('wp_list_pages', array( 'AWP_nav','pages_add_onclick'));40 add_filter('wp_list_pages', array($this,'pages_add_onclick')); 33 41 34 42 if($awpall['ajax_nav_categories']) 35 add_filter('wp_list_categories', array('AWP_nav','cats_add_onclick')); 36 37 } 38 39 register_activation_hook(__file__,array('AWP_nav','set_defaults')); 40 Class AWP_nav{ 43 add_filter('wp_list_categories', array($this,'cats_add_onclick')); 44 } 45 } 41 46 42 47 function addJS(){ 43 48 echo "\n"."\n".'/* start AJAX nav UnFocus */'."\n var historyKeeper; \n var unFocus;"; 44 49 include(ABSPATH . PLUGINDIR . AWP_MODULES . '/ajaxnav/unFocus-History-p.js'); 45 awp_nav::unfocus();50 $this->unfocus(); 46 51 } 47 52 … … 120 125 <?php 121 126 122 AWP_nav::search_form();127 $this->search_form(); 123 128 } 124 129 … … 274 279 275 280 if(is_single() && $awpall[ajax_nav_single] && $awpall[ajax_nav_single_links] == 'above'){ 276 AWP_nav::post_nav_bar();281 $this->post_nav_bar(); 277 282 }elseif(!$awpall[ajax_nav_home_loop] && is_home() && ($awpall[ajax_nav_home_links] == 'above' || $awpall[ajax_nav_home_links] == 'both')){ 278 AWP_nav::nav_bar();283 $this->nav_bar(); 279 284 } 280 285 } … … 285 290 if(!is_feed()){ 286 291 if(is_single() && $awpall[ajax_nav_single] && $awpall[ajax_nav_single_links] == 'below'){ 287 AWP_nav::post_nav_bar();292 $this->post_nav_bar(); 288 293 }elseif(!$awpall[ajax_nav_home_loop] && is_home() && ($awpall[ajax_nav_home_links] == 'below' || $awpall[ajax_nav_home_links] == 'both')){ 289 AWP_nav::nav_bar();294 $this->nav_bar(); 290 295 } 291 296 … … 335 340 336 341 function pages_add_onclick($pages) { 337 return preg_replace_callback('!(<li class="page_item page-item-([0-9]*)"><a([^>]*)>)!ims', array( 'AWP_nav','pages_add_onclick_finish'), $pages);342 return preg_replace_callback('!(<li class="page_item page-item-([0-9]*)"><a([^>]*)>)!ims', array($this,'pages_add_onclick_finish'), $pages); 338 343 } 339 344 … … 350 355 351 356 function cats_add_onclick($cats) { 352 return preg_replace_callback('!(<li class="cat-item cat-item-([0-9]*)">[\s\S]*?<a([^>]*)>)!ims', array( 'AWP_nav','cats_add_onclick_finish'), $cats);357 return preg_replace_callback('!(<li class="cat-item cat-item-([0-9]*)">[\s\S]*?<a([^>]*)>)!ims', array($this,'cats_add_onclick_finish'), $cats); 353 358 } 354 359 … … 518 523 } 519 524 if ( $max_num_pages > 1 ) { 520 AWP_nav::previous_posts($prelabel);525 $this->previous_posts($prelabel); 521 526 echo preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $sep); 522 AWP_nav::next_posts($nxtlabel);527 $this->next_posts($nxtlabel); 523 528 } 524 529 } … … 531 536 function single_post_add_onclick(){ 532 537 global $id; 533 echo AWP_nav::single_post_onclick($id);538 echo $this->single_post_onclick($id); 534 539 } 535 540 … … 552 557 553 558 if($awpall[ajax_nav_single]) 554 $string .= AWP_nav::single_post_onclick($post->ID);559 $string .= $this->single_post_onclick($post->ID); 555 560 556 561 $string .= '>'; … … 575 580 576 581 if($awpall[ajax_nav_single]) 577 $string .= AWP_nav::single_post_onclick($post->ID);582 $string .= $this->single_post_onclick($post->ID); 578 583 579 584 $string .= '>'; … … 589 594 590 595 function awp_posts_nav_link($sep=' — ', $prelabel='« Previous Page', $nxtlabel='Next Page »') { 591 AWP_nav::posts_nav($sep, $prelabel, $nxtlabel);596 $this->posts_nav($sep, $prelabel, $nxtlabel); 592 597 } 593 598 594 599 595 600 function awp_previous_posts_link($label='« Previous Page') { 596 AWP_nav::previous_posts($label);601 $this->previous_posts($label); 597 602 } 598 603 599 604 function awp_next_posts_link($label='Next Page »', $max_page=0) { 600 AWP_nav::next_posts($label, $max_page);605 $this->next_posts($label, $max_page); 601 606 } 602 607 603 608 function awp_previous_post_link($format='« %link', $link='%title', $in_same_cat=false, $excluded_categories = '') { 604 AWP_nav::previous_post($format, $link, $in_same_cat, $excluded_categories);609 $this->previous_post($format, $link, $in_same_cat, $excluded_categories); 605 610 } 606 611 607 612 function awp_next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') { 608 AWP_nav::next_post($format, $link, $in_same_cat, $excluded_categories);613 $this->next_post($format, $link, $in_same_cat, $excluded_categories); 609 614 } 610 615 ?> ajaxd-wordpress/trunk/modules/awp-edit-comments.php
r37571 r45322 21 21 22 22 function init(){ 23 24 23 if(class_exists('WPrapAjaxEditComments')) 25 24 WPrapAjaxEditComments::JS(); 26 27 25 } 28 29 26 30 27 function update_aecomments($actions){ ajaxd-wordpress/trunk/modules/awpcache.php
r42761 r45322 9 9 Author URI: http://anthologyoi.com/ 10 10 */ 11 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){12 add_action('awp_admin_other',array('AWP_Cache','admin'));13 add_filter('awp_get_options',array('AWP_Cache','awp_get_options'));14 add_action('awp_admin_update',array('AWP_Cache','delete'));15 }elseif($awpall['cache'] == 'Enabled'){16 add_action('init', array('AWP_Cache','init'));17 }18 11 19 register_activation_hook(__file__,array('AWP_Cache','set_defaults')); 12 $awp_init[] = "AWP_Cache"; 13 register_activation_hook(__file__,array($this,'set_defaults')); 20 14 class AWP_Cache { 21 15 22 16 function init(){ 23 global $awpall, $aWP; 24 if(AWP::enabled('inlineposts')){ 17 global $awpall, $aWP,$AWP_inlineposts; 18 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){ 19 add_action('awp_admin_other',array($this,'admin')); 20 add_filter('awp_get_options',array($this,'awp_get_options')); 21 add_action('awp_admin_update',array($this,'delete')); 22 }elseif($awpall['cache'] == 'Enabled'){ 23 if(AWP::enabled('inlineposts')){ 25 24 26 remove_action('awp_paginate', array('AWP_inlineposts', 'paginate')); 27 add_action('awp_paginate', array('AWP_Cache', 'post_paginate')); 25 remove_action('awp_paginate', array($AWP_inlineposts, 'paginate')); 26 add_action('awp_paginate', array($AWP_inlineposts, 'post_paginate')); 27 } 28 28 29 // remove_action('awp_pages',array('AWP_inlineposts','pages')); 30 // add_action('awp_pages',array('AWP_Cache','post_pages')); 29 if(AWP::enabled('inlinecomments')){ 31 30 31 $aWP['basic_comments'] = 1; 32 remove_action('awp_comments_do', array('AWP_inlinecomments','comments')); 33 add_action('awp_comments_do', array($this,'comments_comments')); 34 35 } 36 37 add_action('publish_post', array($this,'remove_post_cache'), 1); 38 add_action('edit_post', array($this,'remove_post_cache'), 1); 39 add_action('delete_post', array($this,'remove_post_cache'), 1); 40 add_action('publish_phone', array($this,'remove_post_cache'), 1); 41 add_action('delete_comment', array($this,'delete_comment_cache'), 1); 42 // these we check for validity before invalidating the cache 43 add_action('trackback_post', array($this,'remove_comment_cache'), 1); 44 add_action('pingback_post', array($this,'remove_comment_cache'), 1); 45 add_action('comment_post', array($this,'remove_comment_cache'), 1); 46 add_action('edit_comment', array($this,'remove_comment_cache'), 1); 47 add_action('wp_set_comment_status', array($this,'remove_comment_cache'), 1); 48 49 50 do_action('awp_cache_init'); 32 51 } 33 52 34 if(AWP::enabled('inlinecomments')){35 36 $aWP['basic_comments'] = 1;37 remove_action('awp_comments_do', array('AWP_inlinecomments','comments'));38 add_action('awp_comments_do', array('AWP_Cache','comments_comments'));39 40 }41 42 add_action('publish_post', array('AWP_Cache','remove_post_cache'), 1);43 add_action('edit_post', array('AWP_Cache','remove_post_cache'), 1);44 add_action('delete_post', array('AWP_Cache','remove_post_cache'), 1);45 add_action('publish_phone', array('AWP_Cache','remove_post_cache'), 1);46 add_action('delete_comment', array('AWP_Cache','delete_comment_cache'), 1);47 // these we check for validity before invalidating the cache48 add_action('trackback_post', array('AWP_Cache','remove_comment_cache'), 1);49 add_action('pingback_post', array('AWP_Cache','remove_comment_cache'), 1);50 add_action('comment_post', array('AWP_Cache','remove_comment_cache'), 1);51 add_action('edit_comment', array('AWP_Cache','remove_comment_cache'), 1);52 add_action('wp_set_comment_status', array('AWP_Cache','remove_comment_cache'), 1);53 54 55 do_action('awp_cache_init');56 53 57 54 } 58 55 59 56 function comments_comments(){ 60 global $id ;61 $cache = AWP_Cache::fetch('comments_'.$id);57 global $id, $AWP_inlinecomments; 58 $cache = $this->fetch('comments_'.$id); 62 59 if(!$cache){ 63 60 ob_start(); 64 AWP_inlinecomments::comments();61 $AWP_inlinecomments->comments(); 65 62 $cache = ob_get_contents(); 66 63 ob_end_clean(); 67 AWP_Cache::store('comments_'.$id, $cache);64 $this->store('comments_'.$id, $cache); 68 65 } 69 66 … … 73 70 function post_paginate(){ 74 71 global $id,$pages; 75 $cache = AWP_Cache::fetch('post_'.$id);72 $cache = $this->fetch('post_'.$id); 76 73 if(!$cache){ 77 $cache = AWP_inlineposts::paginate();78 AWP_Cache::store('post_'.$id, $cache);74 $cache = $AWP_inlineposts->paginate(); 75 $this->store('post_'.$id, $cache); 79 76 } 80 77 $pages = $cache; … … 83 80 function post_pages(){ 84 81 global $id; 85 $cache = AWP_Cache::fetch('post_pages_'.$id);82 $cache = $this->fetch('post_pages_'.$id); 86 83 if(!$cache){ 87 $cache = AWP_inlineposts::pages();88 AWP_Cache::store('post_pages_'.$id, $cache);84 $cache = $AWP_inlineposts->pages(); 85 $this->store('post_pages_'.$id, $cache); 89 86 } 90 87 return $cache; … … 92 89 93 90 function clear_cache($id) { 94 AWP_Cache::remove_cache('post_'.$id);95 AWP_Cache::remove_cache('post_'.$id);96 AWP_Cache::remove_cache('comments_'.$id);91 $this->remove_cache('post_'.$id); 92 $this->remove_cache('post_'.$id); 93 $this->remove_cache('comments_'.$id); 97 94 } 98 95 … … 100 97 101 98 $comment = get_commentdata($comment_id, 1, true); 102 AWP_Cache::remove_cache('comments_'.$comment['comment_post_ID']);99 $this->remove_cache('comments_'.$comment['comment_post_ID']); 103 100 } 104 101 105 102 function remove_post_cache($id) { 106 AWP_Cache::remove_cache('post_'.$id);107 AWP_Cache::remove_cache('post_pages_'.$id);103 $this->remove_cache('post_'.$id); 104 $this->remove_cache('post_pages_'.$id); 108 105 } 109 106 … … 114 111 return; 115 112 }else{ 116 AWP_Cache::remove_cache('comments_'.$comment['comment_post_ID']);113 $this->remove_cache('comments_'.$comment['comment_post_ID']); 117 114 } 118 115 } ajaxd-wordpress/trunk/modules/core_cache/core_cache.php
r42761 r45322 10 10 */ 11 11 12 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){13 add_action('awp_admin_other',array('AWP_corecache','admin'));14 add_filter('awp_get_options',array('AWP_corecache','awp_get_options'));15 add_action('awp_admin_update',array('AWP_corecache','recacheJS'));16 add_action('awp_admin_update',array('AWP_corecache','recacheCSS'));17 }elseif(AWP::enabled('corecache')){18 add_filter('awp_jscore', array('AWP_corecache','switchjs'));19 add_filter('awp_csscore', array('AWP_corecache','switchcss'));20 }21 12 13 $awp_init[] = 'AWP_corecache'; 22 14 register_activation_hook(__file__,array('AWP_corecache','set_defaults')); 23 15 class AWP_corecache { 24 16 17 function init(){ 18 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){ 19 add_action('awp_admin_other',array($this,'admin')); 20 add_filter('awp_get_options',array($this,'awp_get_options')); 21 add_action('awp_admin_update',array($this,'recacheJS')); 22 add_action('awp_admin_update',array($this,'recacheCSS')); 23 }elseif(AWP::enabled('corecache')){ 24 add_filter('awp_jscore', array($this,'switchjs')); 25 add_filter('awp_csscore', array($this,'switchcss')); 26 } 27 } 25 28 function switchjs($file){ 26 29 $home = get_settings('siteurl'); … … 44 47 } 45 48 function recache(){ 46 AWP_corecache::recacheJS();47 AWP_corecache::recacheCSS();49 $this->recacheJS(); 50 $this->recacheCSS(); 48 51 } 49 52 … … 112 115 113 116 function set_defaults(){ 114 global $awpall ;117 global $awpall,$AWP_corecache; 115 118 $awpall[corecache] = 'Enabled'; 116 AWP_corecache::recache(); 119 $AWP_corecache = new AWP_corecache(); 120 $AWP_corecache->recache(); 117 121 update_option('awp',$awpall); 118 122 } ajaxd-wordpress/trunk/modules/customoptions.php
r34720 r45322 13 13 require_once('../../../../wp-config.php'); 14 14 nocache_headers(); 15 AWP_customoptions::update_custom(); 16 }elseif(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){ 17 18 add_action('awp_admin_main_options',array('AWP_customoptions','admin')); 19 add_filter('awp_get_options',array('AWP_customoptions','awp_get_options')); 20 if($_GET['post']){ 21 add_filter('dbx_page_advanced', array('AWP_customoptions', 'customUI')); 22 add_filter('dbx_post_advanced', array('AWP_customoptions', 'customUI')); 23 add_action('init', array('AWP_customoptions','init')); 24 } 25 }elseif($awpall['allow_custom'] == 'Enabled' ){ 26 add_filter('awp_options', array('AWP_customoptions', 'get_custom')); 27 } 28 15 $AWP_customoptions = new AWP_customoptions(); 16 $AWP_customoptions->update_custom(); 17 } 18 19 $awp_init[] = 'AWP_customoptions'; 29 20 register_activation_hook(__file__,array('AWP_customoptions','set_defaults')); 30 //register_deactivation_hook(__file__,array( 'AWP_customoptions','rm_options'));21 //register_deactivation_hook(__file__,array($this,'rm_options')); 31 22 32 23 Class AWP_customoptions{ 24 function init(){ 25 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){ 26 27 add_action('awp_admin_main_options',array($this,'admin')); 28 add_filter('awp_get_options',array($this,'awp_get_options')); 29 if($_GET['post']){ 30 add_filter('dbx_page_advanced', array($this, 'customUI')); 31 add_filter('dbx_post_advanced', array($this, 'customUI')); 32 add_action('init', array($this,'init')); 33 } 34 }elseif($awpall['allow_custom'] == 'Enabled' ){ 35 add_filter('awp_options', array($this, 'get_custom')); 36 } 37 } 33 38 34 39 function get_char_map_html(){ … … 51 56 global $aWP; 52 57 remove_action('awp_build_menu',array('AWP_admin','admin_panel'),10); 53 add_action('awp_build_menu',array( 'AWP_customoptions','options_panel'));58 add_action('awp_build_menu',array($this,'options_panel')); 54 59 $aWP[custom_menu][items]['checkbox'][] = array('disable_awp',0); 55 60 … … 154 159 155 160 if(is_array($marray[menus])){ 156 AWP_customoptions::admin_panel_menu($marray[menus][menu]);161 $this->admin_panel_menu($marray[menus][menu]); 157 162 }elseif(is_array($marray[menu])){ 158 AWP_customoptions::admin_panel_menu($marray[menu]);163 $this->admin_panel_menu($marray[menu]); 159 164 }elseif(is_array($marray[submenu])){ 160 AWP_customoptions::admin_panel_sub($marray[submenu]);165 $this->admin_panel_sub($marray[submenu]); 161 166 }elseif(is_array($marray[item])){ 162 AWP_customoptions::admin_panel_item($marray[item]);167 $this->admin_panel_item($marray[item]); 163 168 } 164 169 } … … 175 180 176 181 if($m[submenu]){ 177 AWP_customoptions::admin_panel_sub($m[submenu]);182 $this->admin_panel_sub($m[submenu]); 178 183 if($m[action]) 179 184 do_action($m[action]); … … 186 191 foreach($smenu as $menu){ 187 192 if(is_array($menu[item])){ 188 AWP_customoptions::admin_panel_item($menu[item]);193 $this->admin_panel_item($menu[item]); 189 194 190 195 if($menu[action]) … … 301 306 $marray = AWP::XML($menu); 302 307 if(is_array($marray[menus])){ 303 AWP_customoptions::admin_panel_menu($marray[menus][menu]);308 $this->admin_panel_menu($marray[menus][menu]); 304 309 }elseif(is_array($marray[menu])){ 305 AWP_customoptions::admin_panel_menu($marray[menu]);310 $this->admin_panel_menu($marray[menu]); 306 311 }elseif(is_array($marray[submenu])){ 307 AWP_customoptions::admin_panel_sub($marray[submenu]);312 $this->admin_panel_sub($marray[submenu]); 308 313 }elseif(is_array($marray[item])){ 309 AWP_customoptions::admin_panel_item($marray[item]);314 $this->admin_panel_item($marray[item]); 310 315 } 311 316 … … 369 374 </script> 370 375 371 <?php AWP_customoptions::print_menu()?>376 <?php $this->print_menu()?> 372 377 373 378 </div> ajaxd-wordpress/trunk/modules/embeddedposts.php
r42761 r45322 26 26 27 27 function AJAX(){ 28 global $awpall, $id, $pages, $post ;28 global $awpall, $id, $pages, $post,$AWP_inlineposts; 29 29 30 30 // we remove the filter so the function doesn't call itself 31 31 if($awpall['simple_posts'] == 1){ 32 remove_filter('the_content', array( 'AWP_inlineposts','filter'),-10,1);33 add_filter('the_content',array( 'AWP_inlineposts','break_content'),99999);32 remove_filter('the_content', array($AWP_inlineposts,'filter'),-10,1); 33 add_filter('the_content',array($AWP_inlineposts,'break_content'),99999); 34 34 } 35 35 ajaxd-wordpress/trunk/modules/inlinecommentform/inlinecommentform.php
r43005 r45322 10 10 */ 11 11 12 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){ 13 add_action('awp_admin_commentform',array('AWP_commentform','admin')); 14 add_filter('awp_get_options',array('AWP_commentform','awp_get_options')); 15 }elseif(AWP::enabled('commentform')){ 16 /*Template Functions*/ 17 add_action('awp_commentform', array('AWP_commentform','div')); 18 add_action('awp_commentform_link', array('AWP_commentform','links')); 19 add_action('awp_commentform_quickclose', array('AWP_commentform','quickclose')); 20 21 /*Internal Functions*/ 22 add_action('awp_commentform_before_comment', array('AWP_commentform','integrate')); 23 add_filter('awp_commentform_on_submit', array('AWP_commentform','on_submit')); 24 add_action('awp_ajax_type_submit_commentform', array('AWP_commentform', 'submit_form')); 25 add_action('awp_ajax_type_commentform', array('AWP_commentform', 'AJAX')); 26 add_action('awp_simple_comments_last', array('AWP_commentform','div')); 27 add_action('awp_js_start',array('AWP_commentform','awp_js_start')); 28 add_action('awp_js_toggle',array('AWP_commentform','awp_js_toggle')); 29 add_action('awp_js_finish',array('AWP_commentform','awp_js_finish')); 30 add_filter('awp_input_suffix',array('AWP_commentform','input_suffix')); 31 } 32 12 $awp_init[] = 'AWP_commentform'; 33 13 register_activation_hook(__file__,array('AWP_commentform','set_defaults')); 34 //register_deactivation_hook(__file__,array( 'AWP_commentform','rm_options'));14 //register_deactivation_hook(__file__,array($this,'rm_options')); 35 15 36 16 class AWP_commentform{ 17 18 function init(){ 19 20 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){ 21 add_action('awp_admin_commentform',array($this,'admin')); 22 add_filter('awp_get_options',array($this,'awp_get_options')); 23 }elseif(AWP::enabled('commentform')){ 24 /*Template Functions*/ 25 add_action('awp_commentform', array($this,'div')); 26 add_action('awp_commentform_link', array($this,'links')); 27 add_action('awp_commentform_quickclose', array($this,'quickclose')); 28 29 /*Internal Functions*/ 30 add_action('awp_commentform_before_comment', array($this,'integrate')); 31 add_filter('awp_commentform_on_submit', array($this,'on_submit')); 32 add_action('awp_ajax_type_submit_commentform', array($this, 'submit_form')); 33 add_action('awp_ajax_type_commentform', array($this, 'AJAX')); 34 add_action('awp_simple_comments_last', array($this,'div')); 35 add_action('awp_js_start',array($this,'awp_js_start')); 36 add_action('awp_js_toggle',array($this,'awp_js_toggle')); 37 add_action('awp_js_finish',array($this,'awp_js_finish')); 38 add_filter('awp_input_suffix',array($this,'input_suffix')); 39 } 40 41 } 37 42 38 43 function awp_js_finish(){ … … 235 240 function submit_form(){ 236 241 global $wpdb, $post,$id,$awpall,$wp_actions, $user_ID; 237 add_filter('comment_post_redirect', array( 'AWP_commentform', 'remove_redirect'));242 add_filter('comment_post_redirect', array($this, 'remove_redirect')); 238 243 239 244 $wp_actions[] = 'admin_head'; //Yay for hacking Wordpress. … … 244 249 245 250 if(!$_POST['comment_parent']) 246 $vars = AWP_commentform::get_link_texts();251 $vars = $this->get_link_texts(); 247 252 248 253 if($awpall[nomove]) … … 307 312 308 313 if ( comments_open() ) { 309 $links = AWP_commentform::get_link_texts();314 $links = $this->get_link_texts(); 310 315 311 316 $anchor = $links[show]; … … 344 349 function quickclose(){ 345 350 global $id; 346 $links = AWP_commentform::get_link_texts();351 $links = $this->get_link_texts(); 347 352 $ops[_class] = "commentform_link"; 348 353 $ops[id] = 'awpcommentform_link0_'.$id; ajaxd-wordpress/trunk/modules/inlinecomments/inlinecomments.php
r44811 r45322 10 10 */ 11 11 12 $awp_init[] = 'AWP_inlinecomments'; 13 register_activation_hook(__file__,array($this,'set_defaults')); 14 15 class AWP_inlinecomments{ 16 17 function init(){ 12 18 if(strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false){ 13 add_action('awp_admin_comments',array( 'AWP_inlinecomments','admin'));14 add_filter('awp_get_options',array( 'AWP_inlinecomments','awp_get_options'));19 add_action('awp_admin_comments',array($this,'admin')); 20 add_filter('awp_get_options',array($this,'awp_get_options')); 15 21 }elseif(AWP::enabled('inlinecomments')){ 16 22 $awp_link_count = array(); 17 AWP_inlinecomments::awp_live();18 add_action('awp_die',array( 'AWP_inlinecomments','awp_die'));19 add_action('awp_live',array( 'AWP_inlinecomments','awp_live'));23 $this->awp_live(); 24 add_action('awp_die',array($this,'awp_die')); 25 add_action('awp_live',array($this,'awp_live')); 20 26 21 27 /*Template Functions*/ 22 add_action('awp_comments', array( 'AWP_inlinecomments','div'));23 add_action('awp_comments_link', array( 'AWP_inlinecomments','links'));28 add_action('awp_comments', array($this,'div')); 29 add_action('awp_comments_link', array($this,'links')); 24 30 25 31 /*Internal Functions*/ 26 add_action('awp_comments_do', array('AWP_inlinecomments','comments')); 27 add_action('awp_ajax_type_comments', array('AWP_inlinecomments', 'AJAX')); 28 add_action('awp_js_start',array('AWP_inlinecomments','awp_js_start')); 29 add_action('awp_print_comments',array('AWP_inlinecomments','the_comments')); 30 } 31 32 AWP_inlinecomments::default_options(); 33 34 35 register_activation_hook(__file__,array('AWP_inlinecomments','set_defaults')); 36 37 class AWP_inlinecomments{ 32 add_action('awp_comments_do', array($this,'comments')); 33 add_action('awp_ajax_type_comments', array($this, 'AJAX')); 34 add_action('awp_js_start',array($this,'awp_js_start')); 35 add_action('awp_print_comments',array($this,'the_comments')); 36 } 37 38 $this->default_options(); 39 40 41 } 38 42 39 43 function awp_die(){ 40 44 global $awpall; 41 45 if($awpall['simple_comments'] == 1){ 42 remove_filter('comments_template', array( 'AWP_inlinecomments','filter'),1);46 remove_filter('comments_template', array($this,'filter'),1); 43 47 } 44 48 } … … 50 54 if(!$started || $aWP['die']){ /* We do not want to do this several times.*/ 51 55 if($awpall['simple_comments'] == 1){ 52 add_filter('comments_template', array( 'AWP_inlinecomments','filter'),1);56 add_filter('comments_template', array($this,'filter'),1); 53 57 } 54 58 } … … 67 71 $actions[] = '_p[i].hide = _d[i].hide'; 68 72 69 $vars
