예제 #1
0
/**
 * Gets the pagination links of search pagination
 *
 * @return string pagination links
 */
function osc_search_pagination()
{
    $params = array();
    if (View::newInstance()->_exists('search_uri')) {
        // CANONICAL URL
        $params['url'] = osc_base_url() . View::newInstance()->_get('search_uri') . '/{PAGE}';
        $params['first_url'] = osc_base_url() . View::newInstance()->_get('search_uri');
    } else {
        $params['first_url'] = osc_update_search_url(array('iPage' => null));
    }
    $pagination = new Pagination($params);
    return $pagination->doPagination();
}
예제 #2
0
 public function __construct($params = null)
 {
     $this->total = isset($params['total']) ? $params['total'] : osc_search_total_pages();
     $this->selected = isset($params['selected']) ? $params['selected'] : osc_search_page();
     $this->class_first = isset($params['class_first']) ? $params['class_first'] : 'searchPaginationFirst';
     $this->class_last = isset($params['class_last']) ? $params['class_last'] : 'searchPaginationLast';
     $this->class_prev = isset($params['class_prev']) ? $params['class_prev'] : 'searchPaginationPrev';
     $this->class_next = isset($params['class_next']) ? $params['class_next'] : 'searchPaginationNext';
     $this->text_first = isset($params['text_first']) ? $params['text_first'] : '«';
     $this->text_last = isset($params['text_last']) ? $params['text_last'] : '&raquo';
     $this->text_prev = isset($params['text_prev']) ? $params['text_prev'] : '<';
     $this->text_next = isset($params['text_next']) ? $params['text_next'] : '>';
     $this->class_selected = isset($params['class_selected']) ? $params['class_selected'] : 'searchPaginationSelected';
     $this->class_non_selected = isset($params['class_non_selected']) ? $params['class_non_selected'] : 'searchPaginationNonSelected';
     $this->delimiter = isset($params['delimiter']) ? $params['delimiter'] : " ";
     $this->force_limits = isset($params['force_limits']) ? (bool) $params['delimiter'] : false;
     $this->sides = isset($params['sides']) ? $params['sides'] : 2;
     $this->url = isset($params['url']) ? $params['url'] : osc_update_search_url(array('iPage' => '{PAGE}'));
 }
예제 #3
0
                            <?php 
    osc_current_web_theme_path('search_list.php');
    ?>
                            <?php 
    osc_alert_form();
    ?>
                        <?php 
}
?>
                        <div class="paginate" >
                            <?php 
for ($i = 0; $i < osc_search_total_pages(); $i++) {
    if ($i == osc_search_page()) {
        printf('<a class="searchPaginationSelected" href="%s">%d</a>', osc_update_search_url(array('iPage' => $i)), $i + 1);
    } else {
        printf('<a class="searchPaginationNonSelected" href="%s">%d</a>', osc_update_search_url(array('iPage' => $i)), $i + 1);
    }
}
?>
                        </div>
                    </div>
                </div>
                <div id="sidebar">
                    <div class="filters">
                        <form action="<?php 
echo osc_base_url(true);
?>
" method="get" onSubmit="return checkEmptyCategories()">
                            <input type="hidden" name="page" value="search" />
                            <h3 class="your_search"><strong><?php 
_e('Your search', 'masjob');
예제 #4
0
/**
 * Helper to use twitter pagination in search results
 */
function twitter_search_pagination()
{
    $params = array('total' => osc_search_total_pages(), 'selected' => osc_search_page(), 'class_first' => '', 'class_last' => '', 'class_prev' => 'prev', 'class_next' => 'next', 'delimiter' => '', 'text_prev' => sprintf(__('%s Previous', 'twitter'), '&larr;'), 'text_next' => sprintf(__('Next %s', 'twitter'), '&rarr;'), 'class_selected' => 'active', 'class_non_selected' => '', 'force_limits' => false, 'url' => osc_update_search_url(array('iPage' => '{PAGE}')));
    $pagination = new TwitterPagination($params);
    return $pagination->doPagination();
}
function pop_print_sidebar_category_search($aCategories, $current_category = null, $i = 0)
{
    $class = '';
    if (!isset($aCategories[$i])) {
        return null;
    }
    if ($i === 0) {
        $class = 'class="category"';
    }
    $c = $aCategories[$i];
    $i++;
    if (!isset($c['pk_i_id'])) {
        echo '<ul ' . $class . '>';
        if ($i == 1) {
            echo '<li><a href="' . osc_esc_html(osc_update_search_url(array('sCategory' => null, 'iPage' => null))) . '">' . __('All categories', 'pop') . "</a></li>";
        }
        foreach ($c as $key => $value) {
            ?>
            <li>
                <a id="cat_<?php 
            echo osc_esc_html($value['pk_i_id']);
            ?>
" href="<?php 
            echo osc_esc_html(osc_update_search_url(array('sCategory' => $value['pk_i_id'], 'iPage' => null)));
            ?>
">
                    <?php 
            if (isset($current_category) && $current_category == $value['pk_i_id']) {
                echo '<strong>' . $value['s_name'] . '</strong>';
            } else {
                echo $value['s_name'];
            }
            ?>
                </a>

            </li>
            <?php 
        }
        if ($i == 1) {
            echo "</ul>";
        } else {
            echo "</ul>";
        }
    } else {
        ?>
        <ul <?php 
        echo $class;
        ?>
>
            <?php 
        if ($i == 1) {
            ?>
                <li><a href="<?php 
            echo osc_esc_html(osc_update_search_url(array('sCategory' => null, 'iPage' => null)));
            ?>
"><?php 
            _e('All categories', 'pop');
            ?>
</a></li>
            <?php 
        }
        ?>
            <li>
                <a id="cat_<?php 
        echo osc_esc_html($c['pk_i_id']);
        ?>
" href="<?php 
        echo osc_esc_html(osc_update_search_url(array('sCategory' => $c['pk_i_id'], 'iPage' => null)));
        ?>
">
                    <?php 
        if (isset($current_category) && $current_category == $c['pk_i_id']) {
            echo '<strong>' . $c['s_name'] . '</strong>';
        } else {
            echo $c['s_name'];
        }
        ?>
                </a>
                <?php 
        pop_print_sidebar_category_search($aCategories, $current_category, $i);
        ?>
            </li>
            <?php 
        if ($i == 1) {
            ?>
            <?php 
        }
        ?>
        </ul>
        <?php 
    }
}
예제 #6
0
        ?>
            <?php 
        if (osc_search_order() == $params['sOrder'] && osc_search_order_type() == $orderType) {
            ?>
                <a class="current" href="<?php 
            echo osc_update_search_url($params);
            ?>
"><?php 
            echo $label;
            ?>
</a>
            <?php 
        } else {
            ?>
                <a href="<?php 
            echo osc_update_search_url($params);
            ?>
"><?php 
            echo $label;
            ?>
</a>
            <?php 
        }
        ?>
            <?php 
        if ($i != count($orders) - 1) {
            ?>
                <span>&middot;</span>
            <?php 
        }
        ?>
예제 #7
0
    ?>
                          <?php 
    if (osc_search_order() == $params['sOrder'] && osc_search_order_type() == $orderType) {
        ?>
                              <li><a class="current" href="<?php 
        echo osc_esc_html(osc_update_search_url($params));
        ?>
"><?php 
        echo $label;
        ?>
</a></li>
                          <?php 
    } else {
        ?>
                              <li><a href="<?php 
        echo osc_esc_html(osc_update_search_url($params));
        ?>
"><?php 
        echo $label;
        ?>
</a></li>
                          <?php 
    }
    ?>
                          <?php 
    $i++;
    ?>
                      <?php 
}
?>
                    </ul>
예제 #8
0
/**
 * Gets for a default search (all categories, noother option)
 *
 * @return string
 */
function osc_search_show_all_url($params = array())
{
    $params['page'] = 'search';
    return osc_update_search_url($params);
}
                toggleMenu();
            }
        }

        document.getElementById('toggle').addEventListener('click', function (e) {
            toggleMenu();
        });

        window.addEventListener(WINDOW_CHANGE_EVENT, closeMenu);
    })(this, this.document);

</script>

<script type="text/javascript">
    var sUrl = '<?php 
echo osc_update_search_url(array('sPattern' => ' '));
?>
';
    var sUrl = '<?php 
echo osc_search_url();
?>
';
    var sQuery = '-';
    function doSearch(_class) {
       if( $('form.' + _class + ' input[name=sPattern]').val().length < 3 ) {
            $('form.' + _class + ' input[name=sPattern]').css('background', '#FFC6C6');
            return false;
        } else {
            <?php 
if (osc_rewrite_enabled()) {
    ?>
        ?>
' href="<?php 
        echo osc_update_search_url(array('sCity' => osc_list_city_name()));
        ?>
"><?php 
        echo osc_list_city_name();
        ?>
</a>
    <?php 
        if ($active != '') {
            ?>
        <a class="<?php 
            echo $active;
            ?>
"  href="<?php 
            echo osc_update_search_url(array('sCity' => null));
            ?>
"><i class="fa fa-times-circle"></i>&nbsp;</a>
    <?php 
        }
        ?>
    </div>
        <?php 
        $i++;
        if ($i == $limit_cities) {
            ?>

        <?php 
            break;
        }
        ?>