/**
  * comments_template_loader function.
  */
 public function comments_template_loader($template)
 {
     if (get_post_type() !== 'pacowiki') {
         return $template;
     }
     if (file_exists(STYLESHEETPATH . '/pacowiki/single-pacowiki-discussion.php')) {
         return STYLESHEETPATH . '/pacowiki/single-pacowiki-discussion.php';
     } elseif (file_exists(TEMPLATEPATH . '/pacowiki/single-pacowiki-discussion.php')) {
         return TEMPLATEPATH . '/pacowiki/single-pacowiki-discussion.php';
     } else {
         return PacoWiki()->template_path . 'single-pacowiki-discussion.php';
     }
 }
 function register_taxonomies()
 {
     // register categories
     if (PacoWiki()->options['pacowiki_category_enable']) {
         $category_slug = PacoWiki()->slug . '/' . PacoWiki()->options['pacowiki_category_slug'];
         // category slug
         register_taxonomy('pacowiki_category', 'pacowiki', array('hierarchical' => true, 'rewrite' => array('slug' => $category_slug, 'with_front' => false), 'labels' => array('name' => __('Wiki Categories', 'pacowiki'), 'singular_name' => __('Wiki Category', 'pacowiki'), 'search_items' => __('Search Wiki Categories', 'pacowiki'), 'all_items' => __('All Categories', 'pacowiki'), 'parent_item' => __('Parent Category', 'pacowiki'), 'parent_item_colon' => __('Parent Category:', 'pacowiki'), 'edit_item' => __('Edit Wiki Category', 'pacowiki'), 'update_item' => __('Update Wiki Category', 'pacowiki'), 'add_new_item' => __('Add New Wiki Category', 'pacowiki'), 'new_item_name' => __('New Wiki Category Name', 'pacowiki')), 'show_admin_column' => true, 'show_ui' => true, 'query_var' => true));
     }
     // register tags
     if (PacoWiki()->options['pacowiki_tag_enable']) {
         $tag_slug = PacoWiki()->slug . '/' . PacoWiki()->options['pacowiki_tag_slug'];
         register_taxonomy('pacowiki_tag', 'pacowiki', array('rewrite' => array('slug' => $tag_slug, 'with_front' => false), 'labels' => array('name' => __('Wiki Tags', 'pacowiki'), 'singular_name' => __('Wiki Tag', 'pacowiki'), 'search_items' => __('Search Wiki Tags', 'pacowiki'), 'popular_items' => __('Popular Wiki Tags', 'pacowiki'), 'all_items' => __('All Wiki Tags', 'pacowiki'), 'edit_item' => __('Edit Wiki Tag', 'pacowiki'), 'update_item' => __('Update Wiki Tag', 'pacowiki'), 'add_new_item' => __('Add New Wiki Tag', 'pacowiki'), 'new_item_name' => __('New Wiki Tag Name', 'pacowiki'), 'separate_items_with_commas' => __('Separate wiki tags with commas', 'pacowiki'), 'add_or_remove_items' => __('Add or remove wiki tags', 'pacowiki'), 'choose_from_most_used' => __('Choose from the most used wiki tags', 'pacowiki')), 'show_admin_column' => true, 'show_ui' => true, 'show_tagcloud' => PacoWiki()->options['pacowiki_tag_tagcloud']));
     }
 }
Exemple #3
0
<div>
	<label class="desc">Enable Tags</label>
	<div class="on-off-checkbox-container">
			<input type="checkbox" class="on-off-checkbox" value="1" <?php 
echo PacoWiki()->get_option('pacowiki_tag_enable') ? ' checked=""' : '';
?>
 id="pacowiki_tag_enable" name="pacowiki_options[pacowiki_tag_enable]">
		<label for="pacowiki_tag_enable">
		</label>
	</div>
</div>
<div>
	<label class="desc">Tag Slug</label>
	<div>
		<input id="pacowiki_tag_slug" name="pacowiki_options[pacowiki_tag_slug]" type="text" class="field text fn" value="<?php 
echo PacoWiki()->get_option('pacowiki_tag_slug');
?>
" size="8" tabindex="1">
	</div>
</div>
<div>
	<label class="desc">Include in Cloud Tags</label>
	<div class="on-off-checkbox-container">
			<input type="checkbox" class="on-off-checkbox" value="1" <?php 
echo PacoWiki()->get_option('pacowiki_tag_tagcloud') ? ' checked=""' : '';
?>
 id="pacowiki_tag_tagcloud" name="pacowiki_options[pacowiki_tag_tagcloud]">
		<label for="pacowiki_tag_tagcloud">
		</label>
	</div>
</div>
Exemple #4
0
            wp_register_style('pacowiki-css', PACOWIKI_PLUGIN_URL . 'assets/css/wiki.css');
            wp_register_script('pacowiki-js', PACOWIKI_PLUGIN_URL . 'assets/js/wiki.js');
            if (get_query_var('post_type') == 'pacowiki') {
                wp_enqueue_style('pacowiki-css');
                wp_enqueue_script('pacowiki-js');
            }
        }
        /*
         *		Run during the initialization of Wordpress
         */
        function initialize()
        {
            do_action('before_pacowiki_initialize');
            // Load class instances
            $this->wiki_post = new PacoWikiPostType();
            do_action('pacowiki_initialize');
        }
    }
    // Initalize the your plugin
    //$wp_pacowiki = new wp_pacowiki_class();
    //$wp_pacowiki = wp_pacowiki::get_instance();
    //add_action('init', 'pacowiki_initialize');
}
// Return main instance
function PacoWiki()
{
    return wp_pacowiki::instance();
}
// Global for backwards compatibility.
$GLOBALS['PacoWiki'] = PacoWiki();
/**
 * The Template for displaying Single WIKI Pages
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
global $wp_pacowiki, $post;
get_header('pacowiki');
?>
<div id="primary" class="content-area wiki-area">
    <div id="content" class="site-content wiki-content" role="main">
			<ul class="wiki-nav">
			<?php 
$nav = PacoWiki()->get_wiki_tabs();
foreach ($nav as $key => $nav_item) {
    echo '<li class="wiki-item ' . $nav_item['class'] . '-item"><a class="' . $nav_item['class'] . '-link" href="' . $nav_item['url'] . '">' . $nav_item['text'] . '</a></li>';
}
?>
			</ul>
			
			<header class="entry-header">
				<h1 class="entry-title"><?php 
the_title();
?>
</h1>
			</header>
			
			<?php 
if (post_password_required()) {
Exemple #6
0
		<legend id="title5" class="desc">
			Load Default Styling
		</legend>
		<div class="on-off-checkbox-container">
				<input type="checkbox" class="on-off-checkbox" value="1" <?php 
echo PacoWiki()->get_option('pacowiki_load_styles') ? ' checked=""' : '';
?>
 id="pacowiki_load_styles" name="pacowiki_options[pacowiki_load_styles]">
			<label for="pacowiki_load_styles">
			</label>
		</div>
	</fieldset>
</div>  

<h2>Custom CSS</h2>
<div>
	<p>the css code bellow will only be added to wiki posts.</p>
	<textarea rows="6" name="pacowiki_options[pacowiki_custom_css]"><?php 
echo PacoWiki()->get_option('pacowiki_custom_css');
?>
</textarea>
</div> 

<h2>Custom JavaScript</h2>
<div>
	<p>the JavaScript code bellow will only be added to wiki post's header.</p>
	<textarea rows="6" name="pacowiki_options[pacowiki_custom_js]"><?php 
echo PacoWiki()->get_option('pacowiki_custom_js');
?>
</textarea>
</div>
        echo $diff_output;
    }
} elseif ($view_revision) {
    // View an old revision
    ?>
			<header class="entry-header">
				<h1 class="entry-title"><?php 
    the_title();
    ?>
</h1>
			</header>
		<?php 
    $old_post = get_post($view_revision);
    $content = $old_post->post_content;
    if (PacoWiki()->get_option('pacowiki_show_table_of_contents')) {
        $result = PacoWiki()->get_table_of_contents($content);
        $table_of_contents = $result['toc'];
        $content = $result['content'];
        if ($table_of_contents) {
            ?>
						<div class="wiki-table-of-contents">
							<span class="wiki-table-of-contents-header">
								<strong><?php 
            _e('Contents', 'pacowiki');
            ?>
</strong>
								<span class="wiki-toggle-table-of-contents"><a id="wiki-toggle-table-of-contents-link" showhide="<?php 
            _e('Show', 'pacowiki');
            ?>
" onclick="wiki_toggle_content_table(event);" href="#"><?php 
            _e('Hide', 'pacowiki');
Exemple #8
0
    <th>Delete Other's</th>
    <th>Edit Own Post</th>
    <th>Delete Own Post</th>
    <th>Edit</th>
    <th>Delete</th>
    <th>Read</th>
  </tr>
<?php 
$roles = pacowiki_get_all_roles();
foreach ($roles as $key => $role) {
    if ($key == 'administrator') {
        $is_admin = true;
    } else {
        $is_admin = false;
    }
    $capabilities = PacoWiki()->get_capabilities($key);
    ?>
  <tr>
    <td><?php 
    echo $role["name"];
    ?>
</td>
    <td data-th="Create Wiki"> 		<input type="checkbox" name="pacowiki_options[pacowiki_cap_<?php 
    echo $key;
    ?>
][publish_posts]" <?php 
    echo @$capabilities['publish_posts'] ? ' value="1" checked=""' : '';
    ?>
 <?php 
    echo $is_admin ? ' disabled="disabled"' : '';
    ?>
 /**
  * 		Check to see if plugin is updated
  */
 public function check_version()
 {
     if (!defined('IFRAME_REQUEST') && PacoWiki()->get_option('pacowiki_version') != PacoWiki()->version) {
         $this->update();
     }
 }