Changeset 369298
- Timestamp:
- 04/06/2011 12:36:14 AM (15 years ago)
- File:
-
- 1 edited
-
prophoto-beta-tester/trunk/pp-beta-tester.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
prophoto-beta-tester/trunk/pp-beta-tester.php
r367960 r369298 5 5 Description: Facilitates beta-testing for future releases of the ProPhoto theme 6 6 Author: Jared Henderson 7 Version: 0.0 57 Version: 0.06 8 8 Author URI: http://www.prophotoblogs.com/beta-testing-plugin/ 9 9 */ … … 26 26 add_action( 'post_pp_loaded', array( &$this, 'importP3Menu' ) ); 27 27 add_action( 'post_pp_loaded', array( &$this, 'updateSeoTerms' ) ); 28 add_action( 'post_pp_loaded', array( &$this, 'fixMenuSplittage' ) ); 29 } 30 31 32 function fixMenuSplittage() { 33 34 if ( pp::site()->svn > 295 ) { 35 ppOpt::delete( 'p3_menu_imported' ); 36 return; 37 } 38 39 // .foo { margin:0 } nav #toplevel #main_menu_link_17 { float:right; margin-right:0 } 40 if ( !ppOpt::test( 'menu_align_beta_fixed' ) && pp::site()->svn < 285 ) { 41 42 if ( ppOpt::test( 'headerlayout', 'pptclassic' ) ) { 43 ppOpt::update( 'nav_align', 'left' ); 44 } 45 46 if ( ppOpt::test( 'nav_align', 'center || right' ) ) { 47 return; 48 } 49 50 $css = ppOpt::id( 'override_css' ); 51 52 if ( preg_match( '/nav #toplevel #main_menu_([^ ]*) { float:right; margin-right:0 }/', $css, $match ) ) { 53 $searchID = 'main_menu_' . $match[1]; 54 NrDump::it( $match ); 55 NrDump::it( $css ); 56 NrDump::it( $searchID ); 57 NrDump::it( str_replace( $match[0], '', $css ) ); 58 59 $menuItems = json_decode( ppOpt::id( 'main_menu_structure' ), true ); 60 $lastID = null; 61 foreach ( $menuItems as $ID => $ignore ) { 62 if ( $ID == $searchID ) { 63 NrDump::it( 'set split_id to ' . $lastID ); 64 ppOpt::update( 'nav_split_after_id', $lastID ); 65 } 66 $lastID = $ID; 67 } 68 ppOpt::update( 'override_css', str_replace( $match[0], '', $css ) ); 69 ppOpt::update( 'menu_align_beta_fixed', 'true' ); 70 ppOpt::update( 'nav_align', 'split' ); 71 } 72 } 28 73 } 29 74 30 75 31 76 function importP3Menu() { 32 if ( pp::site()->svn > 280 ) { 77 if ( pp::site()->svn > 290 ) { 78 ppOpt::delete( 'p3_menu_imported' ); 33 79 return; 34 80 } … … 58 104 $contactText = ppOpt::id( 'contactform_link_text' ) ? ppOpt::id( 'contactform_link_text' ) : 'Contact'; 59 105 106 if ( method_exists( 'ppUtil', 'logVar' ) ) { 107 ppUtil::logVar( 'importing menu from beta testing plugin', 'importing menu from beta plugin' ); 108 } 60 109 $imported = ppImportP3Menu::importMenu( $design, $contactText ); 61 110 $imported['options']['p3_menu_imported'] = 'yes_imported';
Note: See TracChangeset
for help on using the changeset viewer.