Exemplo n.º 1
1
 public function getObjectLink($id_lang)
 {
     $url = ph_simpleblog::myRealUrl();
     $dispatcher = Dispatcher::getInstance();
     $params = array();
     $params['sb_category'] = $this->link_rewrite;
     return $url . $dispatcher->createUrl('module-ph_simpleblog-category', $id_lang, $params);
 }
Exemplo n.º 2
0
 public static function getLink($tag, $id_lang = null, $id_shop = null)
 {
     $url = ph_simpleblog::myRealUrl();
     $dispatcher = Dispatcher::getInstance();
     $params = array();
     $params['tag'] = $tag;
     return $url . $dispatcher->createUrl('ph_simpleblog_tag', $id_lang, $params);
 }
Exemplo n.º 3
0
 public static function getPaginationLink($nb = false, $sort = false, $pagination = true, $array = false)
 {
     $vars = array();
     $vars_nb = array('n', 'search_query');
     $vars_sort = array('orderby', 'orderway');
     $vars_pagination = array('p');
     $url = ph_simpleblog::myRealUrl();
     foreach ($_GET as $k => $value) {
         if (Configuration::get('PS_REWRITING_SETTINGS') && ($k == 'isolang' || $k == 'id_lang')) {
             continue;
         }
         $if_nb = !$nb || $nb && !in_array($k, $vars_nb);
         $if_sort = !$sort || $sort && !in_array($k, $vars_sort);
         $if_pagination = !$pagination || $pagination && !in_array($k, $vars_pagination);
         if ($if_nb && $if_sort && $if_pagination) {
             if (!is_array($value)) {
                 $vars[urlencode($k)] = $value;
             } else {
                 foreach (explode('&', http_build_query(array($k => $value), '', '&')) as $key => $val) {
                     $data = explode('=', $val);
                     $vars[urldecode($data[0])] = $data[1];
                 }
             }
         }
     }
     if (!$array) {
         if (count($vars)) {
             return $url . (Configuration::get('PS_REWRITING_SETTINGS') == 1 ? '?' : '&') . http_build_query($vars, '', '&');
         } else {
             return $url;
         }
     }
     $vars['requestUrl'] = $url;
     return $vars;
 }