Esempio n. 1
0
function doc_get_section_menu($doc_id)
{
    $menu = doc_get_menu_meta($doc_id);
    $section = doc_get_section($doc_id);
    $menu['parent'] = isset($menu['parent']) ? $menu['parent'] : array();
    ?>
    <div class="doc-dd" id="doc-nestable">
        <ol class="doc-dd-list">
            <?php 
    foreach ($menu['parent'] as $post_id) {
        if (isset($section[$post_id])) {
            ?>
                <li class="doc-dd-item doc-item-<?php 
            echo $post_id;
            ?>
" data-id="<?php 
            echo $post_id;
            ?>
">
                    <div class="doc-menu-text-wrap">
                        <div class="doc-delete"><i class="fa fa-times doc-section-delete"></i></div>
                        <span class="doc-section-edit">
                            <a href="<?php 
            echo '#doc-cotent-id-' . $post_id;
            ?>
">
                                <?php 
            echo doc_excerpt($section[$post_id]->post_title, 20);
            ?>
                            </a>

                        </span>

                        <div class="doc-menu-action-wrap">
                            <i class="doc-dd-handle   fa fa-arrows-alt"></i>

                        </div>
                        <div class="doc-clear"></div>
                    </div>
                    <?php 
            if (array_key_exists($post_id, $menu['child'])) {
                doc_show_child_menu($post_id, $section, $menu['child']);
            }
            ?>
                </li>
                <?php 
        }
    }
    ?>
        </ol>
    </div>
    <?php 
}
Esempio n. 2
0
 function read_document($atts)
 {
     extract(shortcode_atts(array('doc_id' => 0), $atts));
     if (empty($doc_id)) {
         echo 'No Documentation Found!';
         return;
     }
     $section = doc_get_section($doc_id);
     $menu = doc_get_menu_meta($doc_id);
     ob_start();
     require_once dirname(__FILE__) . '/../views/read.php';
     return ob_get_clean();
 }