Ejemplo n.º 1
0
 protected function setBaseUrl(Url $url = null)
 {
     if ($url === null) {
         $url = new Url();
         //Use currently requested page
     }
     //Remove page number if present, so we don't end up with a long chain of concatenated page numbers in the address bar
     $url->removeQuerystringParams(array('page', 'records_per_page', 'message'));
     $this->url = $url;
 }
Ejemplo n.º 2
0
    public function renderSortButtons($col_name, Url $url = null)
    {
        if (!$url) {
            $url = new Url();
            $url->removeQuerystringParams(array('sort_by', 'sort_reverse', 'message'));
        }
        $this->loadSortButtonJs($url);
        $asc_selected = isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] == $col_name && !@$_REQUEST['sort_reverse'];
        $desc_selected = isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] == $col_name && @$_REQUEST['sort_reverse'];
        if (!$asc_selected) {
            ?>
            <a href="<?php 
            echo $url;
            ?>
&sort_by=<?php 
            echo $col_name;
            ?>
" onclick="sort_submit('<?php 
            echo $col_name;
            ?>
');return false;" style="text-decoration:none;">
            <?php 
        }
        ?>
        <img src="<?php 
        echo $this->language->routing['bare_entry_url'];
        ?>
&resource=image&id=ascending<?php 
        echo $asc_selected ? '_selected' : '';
        ?>
" alt="<?php 
        echo $this->language->scaffold['ascending'];
        ?>
" />
        <?php 
        if (!$asc_selected) {
            ?>
            </a>
        <?php 
        }
        if (!$desc_selected) {
            ?>
            <a href="<?php 
            echo $url;
            ?>
&sort_by=<?php 
            echo $col_name;
            ?>
&sort_reverse=1" onclick="sort_submit('<?php 
            echo $col_name;
            ?>
', true);return false;" style="text-decoration:none;">
            <?php 
        }
        ?>
        <img src="<?php 
        echo $this->language->routing['bare_entry_url'];
        ?>
&resource=image&id=descending<?php 
        echo $desc_selected ? '_selected' : '';
        ?>
" alt="<?php 
        echo $this->language->scaffold['ascending'];
        ?>
" />
        <?php 
        if (!$desc_selected) {
            ?>
            </a>
            <?php 
        }
    }