Exemplo n.º 1
0
    /**
     * Формирует и возвращает HTML-код строки навигации.
     *
     * @param void
     * @return string
     */
    public function getHtml()
    {
        ob_start();
        $self_uri = $this->createRequestUri();
        $qs = $this->createQueryString();
        ?>
    <?php 
        if ($this->view_first_page_label && $this->manager->getCurrentSeparator() && $this->manager->getCurrentSeparator() != 1) {
            ?>
        &nbsp;<a<?php 
            echo $this->createInlineCssClassDeclaration('first_page_class', 'normal_link_class');
            ?>
 title="<?php 
            echo $this->html['first_page_title'];
            ?>
" href="<?php 
            echo $self_uri;
            ?>
?<?php 
            echo $qs;
            echo $this->manager->getPageName();
            ?>
=1&amp;<?php 
            echo $this->manager->getSeparatorName();
            ?>
=1<?php 
            echo $this->createFragmentIdentifier();
            ?>
"><?php 
            echo $this->html['first_page_anchor'];
            ?>
</a>&nbsp;
    <?php 
        }
        ?>

    <?php 
        if ($this->view_previous_block_label && $this->manager->getPreviousBlockSeparator()) {
            ?>
        <a<?php 
            echo $this->createInlineCssClassDeclaration('previous_block_class', 'normal_link_class');
            ?>
 title="<?php 
            echo $this->html['previous_block_title'];
            ?>
" href="<?php 
            echo $self_uri;
            ?>
?<?php 
            echo $qs;
            echo $this->manager->getPageName();
            ?>
=<?php 
            echo $this->manager->getPageForPreviousBlock();
            ?>
&amp;<?php 
            echo $this->manager->getSeparatorName();
            ?>
=<?php 
            echo $this->manager->getPreviousBlockSeparator();
            echo $this->createFragmentIdentifier();
            ?>
"><?php 
            echo $this->html['previous_block_anchor'];
            ?>
</a>&nbsp;
    <?php 
        }
        ?>

    <?php 
        if ($this->manager->getPreviousPageSeparator() && $this->manager->getPreviousPage()) {
            ?>
        <a<?php 
            echo $this->createInlineCssClassDeclaration('previous_page_class', 'normal_link_class');
            ?>
 title="<?php 
            echo $this->html['previous_page_title'];
            ?>
" href="<?php 
            echo $self_uri;
            ?>
?<?php 
            echo $qs;
            echo $this->manager->getPageName();
            ?>
=<?php 
            echo $this->manager->getPreviousPage();
            ?>
&amp;<?php 
            echo $this->manager->getSeparatorName();
            ?>
=<?php 
            echo $this->manager->getPreviousPageSeparator();
            echo $this->createFragmentIdentifier();
            ?>
"><?php 
            echo $this->html['previous_page_anchor'];
            ?>
</a>&nbsp;
    <?php 
        }
        ?>

    <?php 
        foreach ($this->manager->getTemplateData() as $row) {
            ?>
        <?php 
            if ($this->manager->getCurrentPage() == $row["page"]) {
                ?>
            <span<?php 
                echo $this->createInlineCssClassDeclaration('active_link_class');
                ?>
><?php 
                echo $this->createHyperlinkAnchor($row);
                ?>
</span>
        <?php 
            } else {
                ?>
            <a<?php 
                echo $this->createInlineCssClassDeclaration('normal_link_class');
                ?>
 href="<?php 
                echo $self_uri;
                ?>
?<?php 
                echo $qs;
                echo $this->manager->getSeparatorName();
                ?>
=<?php 
                echo $row["separator"];
                ?>
&amp;<?php 
                echo $this->manager->getPageName();
                ?>
=<?php 
                echo $row["page"];
                echo $this->createFragmentIdentifier();
                ?>
"><?php 
                echo $this->createHyperlinkAnchor($row);
                ?>
</a>
        <?php 
            }
            ?>
    <?php 
        }
        ?>

    <?php 
        if ($this->manager->getNextPageSeparator() && $this->manager->getNextPage()) {
            ?>
        &nbsp;<a<?php 
            echo $this->createInlineCssClassDeclaration('next_page_class', 'normal_link_class');
            ?>
 title="<?php 
            echo $this->html['next_page_title'];
            ?>
" href="<?php 
            echo $self_uri;
            ?>
?<?php 
            echo $qs;
            echo $this->manager->getPageName();
            ?>
=<?php 
            echo $this->manager->getNextPage();
            ?>
&amp;<?php 
            echo $this->manager->getSeparatorName();
            ?>
=<?php 
            echo $this->manager->getNextPageSeparator();
            echo $this->createFragmentIdentifier();
            ?>
"><?php 
            echo $this->html['next_page_anchor'];
            ?>
</a>
    <?php 
        }
        ?>

    <?php 
        if ($this->view_next_block_label && $this->manager->getNextBlockSeparator()) {
            ?>
        &nbsp;<a<?php 
            echo $this->createInlineCssClassDeclaration('next_block_class', 'normal_link_class');
            ?>
 title="<?php 
            echo $this->html['next_block_title'];
            ?>
" href="<?php 
            echo $self_uri;
            ?>
?<?php 
            echo $qs;
            echo $this->manager->getSeparatorName();
            ?>
=<?php 
            echo $this->manager->getNextBlockSeparator();
            echo $this->createFragmentIdentifier();
            ?>
"><?php 
            echo $this->html['next_block_anchor'];
            ?>
</a>
    <?php 
        }
        ?>

    <?php 
        if ($this->view_last_page_label && $this->manager->getLastSeparator() && $this->manager->getCurrentSeparator() != $this->manager->getLastSeparator()) {
            ?>
        &nbsp;<a<?php 
            echo $this->createInlineCssClassDeclaration('last_page_class', 'normal_link_class');
            ?>
 title="<?php 
            echo $this->html['last_page_title'];
            ?>
" href="<?php 
            echo $self_uri;
            ?>
?<?php 
            echo $qs;
            echo $this->manager->getPageName();
            ?>
=<?php 
            echo $this->manager->getLastPage();
            ?>
&amp;<?php 
            echo $this->manager->getSeparatorName();
            ?>
=<?php 
            echo $this->manager->getLastSeparator();
            echo $this->createFragmentIdentifier();
            ?>
"><?php 
            echo $this->html['last_page_anchor'];
            ?>
</a>
    <?php 
        }
        $str = ob_get_contents();
        ob_end_clean();
        return $str;
    }