Пример #1
0
/**
 * Render Previous and next buttons
 *
 * @param bool $echo
 */
function ca_get_links($echo = true)
{
    global $first_chapter, $prev_chapter, $next_chapter;
    $first_chapter = pb_get_first();
    $prev_chapter = pb_get_prev();
    $next_chapter = pb_get_next();
    if ($echo) {
        ?>
<div class="nav">
    <?php 
        if ($prev_chapter != '/') {
            ?>
    <span class="previous"><a href="<?php 
            echo $prev_chapter;
            ?>
"><?php 
            _e('Previous Page', 'pressbooks');
            ?>
</a></span>
  <?php 
        }
        ?>
    <!-- 	<h2 class="entry-title"><?php 
        the_title();
        ?>
</h2> -->
    <?php 
        if ($next_chapter != '/') {
            ?>
    <span class="next"><a href="<?php 
            echo $next_chapter;
            ?>
"><?php 
            _e('Next Page', 'pressbooks');
            ?>
</a></span>
  <?php 
        }
        ?>
    </div><?php 
    }
}
Пример #2
0
/**
 * Render Previous and next buttons
 *
 * @param bool $echo
 */
function ca_get_links($echo = true)
{
    global $first_chapter, $prev_chapter, $next_chapter;
    $first_chapter = pb_get_first();
    $prev_chapter = pb_get_prev();
    $next_chapter = pb_get_next();
    if ($echo) {
        ?>
<div class="bottom-nav-buttons">
    <?php 
        if ($prev_chapter != '/') {
            ?>
    <a class="page-nav-btn" id="prev" href="<?php 
            echo $prev_chapter;
            ?>
"><?php 
            _e('Previous', 'pressbooks');
            ?>
</a>
  <?php 
        }
        ?>
    <?php 
        if ($next_chapter != '/') {
            ?>
    <a class="page-nav-btn" id="next" href="<?php 
            echo $next_chapter;
            ?>
"><?php 
            _e('Next', 'pressbooks');
            ?>
</a>
  <?php 
        }
        ?>
    </div><?php 
    }
}
Пример #3
0
/**
 * Render Previous and Next Buttons
 *
 * @param bool $echo
 */
function ca_get_links($echo = true)
{
    global $first_chapter, $prev_chapter, $next_chapter;
    $first_chapter = pb_get_first();
    $prev_chapter = pb_get_prev();
    $next_chapter = pb_get_next();
    if (isset($_GET['content_only'])) {
        $next_chapter = add_query_arg('content_only', 1, $next_chapter);
        $prev_chapter = add_query_arg('content_only', 1, $prev_chapter);
    }
    if (isset($_GET['lti_context_id'])) {
        $next_chapter = add_query_arg('lti_context_id', $_GET['lti_context_id'], $next_chapter);
        $prev_chapter = add_query_arg('lti_context_id', $_GET['lti_context_id'], $prev_chapter);
    }
    if ($echo) {
        ?>
    <div class="bottom-nav-buttons">
      <?php 
        if ($prev_chapter != '/') {
            ?>
        <a class="page-nav-btn" id="prev" href="<?php 
            echo esc_url($prev_chapter);
            ?>
"><?php 
            _e('Previous', 'pressbooks');
            ?>
</a>
      <?php 
        }
        ?>

      <?php 
        if ($next_chapter != '/') {
            ?>
        <a class="page-nav-btn" id="next" href="<?php 
            echo esc_url($next_chapter);
            ?>
"><?php 
            _e('Next', 'pressbooks');
            ?>
</a>
      <?php 
        }
        ?>
    </div>
  <?php 
    }
}