Changeset 348407
- Timestamp:
- 02/21/2011 12:34:28 AM (15 years ago)
- Location:
- wordpress-wiki/trunk
- Files:
-
- 7 edited
-
controllers/wiki_admin.php (modified) (11 diffs)
-
controllers/wiki_pages.php (modified) (8 diffs)
-
readme.txt (modified) (1 diff)
-
static/style.css (modified) (6 diffs)
-
views/options_page.php (modified) (2 diffs)
-
wiki_helpers.php (modified) (2 diffs)
-
wordpress-wiki.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-wiki/trunk/controllers/wiki_admin.php
r346548 r348407 38 38 return true; 39 39 } else { 40 <<<<<<< HEAD41 $wiki = get_role('wiki_editor');42 if ( $wiki->has_cap('edit_posts') ) {43 return true;44 } else {45 =======46 40 $wiki = get_role('wiki_editor'); 47 41 if ( $wiki != null) { … … 53 47 add_role( 'wiki_editor', 'Wiki Editor', array('read' => true) ); 54 48 } 55 >>>>>>> master56 49 return false; 57 50 } … … 60 53 61 54 function options_page() { 62 <<<<<<< HEAD63 //TODO: This options page needs to provide a means to upgrade old WP-Wiki installs.64 // 1. For installs on 3.0, upgrade wiki pages to custom post types65 // 2. For all installs, upgrade options. They are:66 // wiki_email_admins67 // wiki_show_toc_onfrontpage68 // wiki_cron_email69 =======70 >>>>>>> master71 55 global $wp_version; 72 56 $wpw_options = get_option('wpw_options'); … … 79 63 if ($wiki->has_cap('edit_posts')) { 80 64 remove_role('wiki_editor'); 81 <<<<<<< HEAD82 add_role( 'wiki_editor', 'Wiki Editor', array('read' => true) );83 =======84 >>>>>>> master85 65 } 86 66 echo "Succesfully upgraded Wiki Editor role"; … … 151 131 //On page update/edit 152 132 153 <<<<<<< HEAD154 function replace_current_with_pending($id) {155 //$revision = get_posts('include='.$id.'&post_status=pending');156 //var_dump($revision[0]);157 =======158 133 function convert_pages_recursively($id) { 159 134 $children = get_posts('post_type=any&post_parent='.$id.'&status=publish&numberposts=-1'); … … 172 147 //var_dump($revision[0]) 173 148 174 >>>>>>> master175 149 if(!isset($_POST['wpw_is_admin'])) 176 150 return; … … 182 156 183 157 if($wp_version < 3.0) { 184 <<<<<<< HEAD185 if(isset($_POST['wpw_is_wiki']) && $_POST['wpw_is_wiki'] == "true" )186 update_post_meta($id, '_wiki_page', 1);187 else188 delete_post_meta($id, '_wiki_page');189 }190 191 if($this->WikiHelper->is_wiki('check_no_post',$id)) {192 if(isset( $_POST['wpw_toc']) ):193 if ($_POST['wpw_toc'] == "true" )194 update_post_meta($id, '_wiki_page_toc', 1);195 else196 delete_post_meta($id, '_wiki_page_toc');197 =======198 158 if(isset($_POST['wpw_is_wiki']) && $_POST['wpw_is_wiki'] == "true" ): 199 159 update_post_meta($id, '_wiki_page', 1); … … 208 168 else: 209 169 delete_post_meta($id, '_wiki_page_toc'); 210 >>>>>>> master211 170 endif; 212 171 … … 226 185 $id_we_are_changing = $_POST['wpw_change_wiki_id']; 227 186 $update_post = get_post($id_we_are_changing, 'ARRAY_A'); 228 <<<<<<< HEAD229 unset($update_post['ID']);230 unset($update_post['post_parent']);231 $update_post['post_type'] = 'wiki';232 $update_post['post_status'] = 'publish';233 $new = wp_insert_post($update_post);234 wp_delete_post($id_we_are_changing, true);235 =======236 187 //The hackiest hack that ever hacked 237 188 $this->convert_pages_recursively($id_we_are_changing); … … 239 190 $update_post['post_status'] = 'publish'; 240 191 $new = wp_update_post($update_post); 241 >>>>>>> master242 192 wp_redirect( get_edit_post_link($new, 'go_to_it') ); 243 193 } 244 194 245 195 //echo print_r($_POST, true).get_option('wiki_email_admins'); 246 <<<<<<< HEAD247 }248 249 =======250 196 } 251 >>>>>>> master252 197 253 198 ///BUH … … 318 263 <h5><?php _e('Wiki Page'); ?></h5> 319 264 <input type="checkbox" name="wpw_change_to_wiki" value="true" /> 320 <<<<<<< HEAD321 <label for="wpw_change_to_wiki"><?php _e('This is a Wiki page. Logged in users can edit its content.'); ?></label>322 =======323 265 <label for="wpw_change_to_wiki"><?php _e('Convert this page and all of its subpages to Wikis.'); ?></label> 324 >>>>>>> master325 266 <input type="hidden" name="wpw_change_wiki_id" value="<?php echo $_GET['post']; ?>" /> 326 267 <?php -
wordpress-wiki/trunk/controllers/wiki_pages.php
r346548 r348407 29 29 if($revisions) { 30 30 //Loop through them! 31 <<<<<<< HEAD32 =======33 31 $count = 0; 34 >>>>>>> master35 32 foreach ($revisions as $revision) { 36 33 if( @wp_get_post_autosave($post->ID)->ID != $revision->ID) { … … 41 38 $revision_title = sprintf(__('Revision @ %1s by %2s'), $date, $author); 42 39 $output.= '<a href="'.get_permalink($post->ID).'?revision='.$revision->ID.'">'.$revision_title.'</a><br />'; 43 <<<<<<< HEAD44 }45 }46 }47 =======48 40 $count++; 49 41 } 50 42 } 51 43 } 52 >>>>>>> master53 44 return $output; 54 45 } … … 110 101 111 102 function styles() { 112 <<<<<<< HEAD113 wp_enqueue_style('wordpress-wiki', PLUGIN_URL ."/".WPWIKI_DIR_NAME."/static/style.css");114 =======115 103 wp_enqueue_style('wordpress-wiki', PLUGIN_URL ."/".WPWIKI_DIR_NAME."/static/style.css"); 116 104 if ( is_rtl() ) 117 105 wp_enqueue_style('wordpress-wiki-rtl', PLUGIN_URL ."/".WPWIKI_DIR_NAME."/static/rtl.css"); 118 >>>>>>> master119 106 } 120 107 … … 145 132 if ( $this->WikiHelper->is_wiki('front_end_check') ) { 146 133 $wpw_options = get_option('wpw_options'); 147 <<<<<<< HEAD148 //if ( current_user_can('edit_wiki') ) {149 remove_filter('the_content', 'wpautop');150 remove_filter('the_content', 'wptexturize');151 add_action('get_header', array($this,'styles'));152 add_action('get_header', array($this,'scripts'), 9);153 add_filter('the_content',array($this, 'substitute_in_revision_content'),11);154 add_filter('the_content',array($this,'front_end_interface'),12);155 add_action('wp_footer',array($this,'inline_editor'));156 157 //} else {158 // add_filter('the_content','wpw_nope');159 //}160 =======161 134 remove_filter('the_content', 'wpautop'); 162 135 remove_filter('the_content', 'wptexturize'); … … 170 143 add_filter('the_content',array($this,'wpw_nope') ); 171 144 } 172 >>>>>>> master173 145 } 174 146 } … … 179 151 function wpw_nope($content) { 180 152 global $post; 181 <<<<<<< HEAD182 $content = wpw_wiki_parser($content, $post->post_title);183 $content = wpw_table_of_contents($content);184 =======185 153 $content = $this->get_content($content); 186 >>>>>>> master187 154 $message = __('This page is a Wiki!'); 188 155 $message .= ' <a href="'.wp_login_url(get_permalink($post->ID)).'">'.__('Log in or register an account to edit.').'</a>'; … … 351 318 352 319 function set_toc($post_id) { 353 <<<<<<< HEAD354 if ($this->WikiHelper->is_wiki('check_no_post',$post_id))355 update_post_meta($post_id,'_wiki_page_toc',1);356 }357 358 function save_post() {359 if (isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'wpw_edit_form')) {360 =======361 320 if ($this->WikiHelper->is_wiki('check_no_post',$post_id) & get_post_meta($post_id,'_wiki_page_toc_on_by_default', true) != 1) { 362 321 update_post_meta($post_id,'_wiki_page_toc',1); … … 367 326 function save_post() { 368 327 if (!$this->WikiHelper->is_restricted() && isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'wpw_edit_form')) { 369 >>>>>>> master370 328 if ($_POST['wpw_editor_content'] != null) { 371 329 extract($_POST); -
wordpress-wiki/trunk/readme.txt
r346558 r348407 5 5 Requires at least: 2.8 6 6 Tested up to: 3.1 7 Stable Tag: 1.0 .17 Stable Tag: 1.0 8 8 9 9 == Description == -
wordpress-wiki/trunk/static/style.css
r346548 r348407 9 9 font-size: 85%; 10 10 max-width: 45%; 11 <<<<<<< HEAD12 13 =======14 >>>>>>> master15 11 } 16 12 … … 18 14 list-style-type: none; 19 15 background: none; 20 <<<<<<< HEAD21 list-style-position:outside;22 font-family:"Lucida Grande",Verdana,"Bitstream Vera Sans",Arial,sans-serif;23 font-size: 85%;24 }25 =======26 16 list-style-position: outside; 27 17 font-family: "Lucida Grande", Verdana, "Bitstream Vera Sans", Arial, sans-serif; 28 18 font-size: 85%; 29 19 } 30 >>>>>>> master31 20 32 21 div.contents ol li.lvl2 { … … 34 23 } 35 24 36 <<<<<<< HEAD37 38 39 div.contents a:hover {40 color:#D54E21;41 }42 43 div.contents a {44 color:#21759B;45 font-weight:bold;46 text-decoration:none;47 }48 49 div.contents h3 {50 color:#333333;51 background: none;52 font-family:Georgia,"Times New Roman",Times,serif;53 margin-bottom:10px;54 padding-left: 0px;55 padding-bottom: 3px;56 border-bottom:1px solid #DADADA;57 margin-top: 0px;58 =======59 25 div.contents a:hover { 60 26 color: #D54E21; … … 76 42 border-bottom: 1px solid #DADADA; 77 43 margin-top: 0px; 78 >>>>>>> master79 44 } 80 45 … … 83 48 font-size: 85%; 84 49 } 85 <<<<<<< HEAD86 div.contents a.hide, div.contents a.show {87 cursor: pointer;88 font-size: 85%;89 display: inline;90 }91 #wpw_tab_nav {92 list-style-type:none;93 text-align:right;94 width:100%;95 }96 #wpw_tab_nav li {97 display:inline;98 margin-left:10px;99 }100 #wpw_tab_nav li a {101 text-decoration:none;102 }103 #wpw_tab_nav li.ui-tabs-selected {104 font-weight:bold;105 border-bottom:1px dotted #000;106 }107 .ui-tabs .ui-tabs-hide, .wpw-hide-it {108 display: none!important;109 }110 =======111 50 112 51 div.contents a.hide, div.contents a.show { … … 139 78 display: none!important; 140 79 } 141 >>>>>>> master -
wordpress-wiki/trunk/views/options_page.php
r346548 r348407 64 64 </tr> 65 65 66 <<<<<<< HEAD67 =======68 66 <tr valign="top"> 69 67 <th scope="row"> … … 74 72 </tr> 75 73 76 >>>>>>> master77 74 <!--tr valign="top"> 78 75 <th scope="row"> -
wordpress-wiki/trunk/wiki_helpers.php
r346548 r348407 53 53 return false; 54 54 } 55 <<<<<<< HEAD56 =======57 55 58 56 function is_restricted() { … … 67 65 endif; 68 66 } 69 >>>>>>> master70 67 } 71 68 ?> -
wordpress-wiki/trunk/wordpress-wiki.php
r334363 r348407 4 4 Plugin URI: http://wordpress.org/extend/plugins/wordpress-wiki/ 5 5 Description: Add Wiki functionality to your wordpress site. 6 Version: 1.0 6 Version: 1.0.1RC3 7 7 Author: Dan Milward/Matthew Gerring 8 8 Author URI: http://www.instinct.co.nz … … 16 16 function WP_Wiki() { 17 17 global $wp_version; 18 19 //include component controllers20 include('model/wiki_post_type.php');21 include('controllers/wiki_pages.php');22 include('controllers/wiki_notifications.php');23 include('controllers/wiki_feed.php');24 include('controllers/wiki_admin.php');25 include('controllers/wiki_dashboard_widget.php');26 include('controllers/wiki_user_contrib_widget.php');27 include('wiki_helpers.php');28 29 //include Wiki Parser class here so it doesn't get re-declared- fixes issue #4 on GitHub. Thanks Nexiom!30 include('lib/WPW_WikiParser.php');31 32 18 /** 33 19 * Guess the wp-content and plugin urls/paths … … 45 31 define('WPWIKI_FILE_PATH', dirname(__FILE__)); 46 32 define('WPWIKI_DIR_NAME', basename(WPWIKI_FILE_PATH)); 33 34 //include component controllers 35 include(WPWIKI_FILE_PATH.'/model/wiki_post_type.php'); 36 include(WPWIKI_FILE_PATH.'/controllers/wiki_pages.php'); 37 include(WPWIKI_FILE_PATH.'/controllers/wiki_notifications.php'); 38 include(WPWIKI_FILE_PATH.'/controllers/wiki_feed.php'); 39 include(WPWIKI_FILE_PATH.'/controllers/wiki_admin.php'); 40 include(WPWIKI_FILE_PATH.'/controllers/wiki_dashboard_widget.php'); 41 include(WPWIKI_FILE_PATH.'/controllers/wiki_user_contrib_widget.php'); 42 include(WPWIKI_FILE_PATH.'/wiki_helpers.php'); 43 44 //include Wiki Parser class here so it doesn't get re-declared- fixes issue #4 on GitHub. Thanks Nexiom! 45 include(WPWIKI_FILE_PATH.'/lib/wpw_wikiparser.php'); 46 47 47 48 48 49 //Enables Wiki Pages … … 66 67 67 68 //Make Table of Contents on by default for Wiki post type 68 add_action('publish_wiki',array($WikiPageController,'set_toc') );69 add_action('publish_wiki',array($WikiPageController,'set_toc'), 12); 69 70 70 71 //Make Table of Contents on by default for pages marked as Wikis … … 102 103 //Admin pages 103 104 add_action('admin_menu', array($WikiAdmin,'register_options_page')); 104 add_action('save_post',array($WikiAdmin,'replace_current_with_pending')); 105 add_action('publish_wiki', array($WikiAdmin,'replace_current_with_pending'), 11); 106 add_action('publish_page', array($WikiAdmin,'replace_current_with_pending'), 11); 105 107 add_action('admin_menu', array($WikiAdmin,'add_custom_box')); 106 108
Note: See TracChangeset
for help on using the changeset viewer.