Example #1
0
 /**
  * 创建一个超链接传入uri或者完整的url
  *
  * @param string URL或者URI字符串
  * @param array 图片的其它属性
  * @return string 链接字符串
  *
  */
 public static function image($url, $attrs = array())
 {
     //如果不是完整的链接,如:http://www.zotop.com/a/b/1.gif ,则将相对连接处理成绝对链接
     if (strpos($url, '://') === false && $url[0] != '/') {
         $url = url::root() . '/' . $url;
     }
     //解析url中的特殊字符串
     $url = url::decode($url);
     return '<img src="' . $url . '" ' . html::attributes($attrs) . '/>';
 }
Example #2
0
 function action_restore($args)
 {
     global $manager, $tree, $user, $lang;
     /* Decode argumenst */
     $id = array_shift($args);
     if ($user->admin()) {
         $this->_restoreItem($id);
         header("Location: " . url::item($id));
     } else {
         header("Location: " . url::root());
     }
     exit;
 }
Example #3
0
 function action_settings($args)
 {
     global $manager, $tree, $user, $lang;
     /* Get all admins */
     $admins = $manager->adminHandlers;
     /* Sort admins based on position */
     $compare_position = create_function('$a, $b', 'return ($a["position"] == $b["position"]) ? 0 : (($a["position"] < $b["position"]) ? -1 : 1);');
     uasort($admins, $compare_position);
     /* Decode arguments */
     $current = '';
     if (count($args)) {
         $current = array_shift($args);
     }
     if ($current == '' && count($admins)) {
         $current = key($admins);
     }
     reset($admins);
     // Setup template
     $page = new admin();
     // Notify plugins of a PreSkinParse event;
     $data = array('page' => &$page, 'template' => &$page->template, 'type' => 'admin', 'params' => array('action' => 'admin', 'args' => $args));
     $manager->handleEvent('PreSkinParse', $data);
     // Handle authorisation
     $ticket = false;
     if (isset($_REQUEST['ticket'])) {
         if (ticket::authorize($_REQUEST['ticket']) == $current) {
             $ticket = true;
         }
     }
     if ($ticket || $user->root() || $user->admin() && $admins[$current]['public']) {
         $t = new Template($this->getTemplate('tab.template'));
         $t->set('tabs', $admins);
         $t->set('current', $current);
         $page->template->set('tabs', $t->fetch());
         $manager->handleAdmin($current, $data);
         $page->show();
     } else {
         header('Location: ' . url::root());
         exit;
     }
 }
Example #4
0
 function logout()
 {
     header('Location: ' . url::root());
     exit;
 }
Example #5
0
                    <div class="quantite_title"><?php 
echo gettext("Quantity");
?>
</div>
                    <div class="price_title"><?php 
echo gettext("Price");
?>
</div>
                </div>
                <?$ids = array();?>
                <?foreach($order['items'] as $item):?>
                    <?            
                    $ids[] = $item[0]->id;
                    $products = get_object_vars($item[0]);  
                    $product_image = base_url().'public/images/products/70x70/0.jpg';
                    if (is_file(url::root().'public/images/products/70x70/'.$item[0]->id.'.jpg'))  $product_image =  base_url().'public/images/products/70x70/'.$item[0]->id.'.jpg';
                    ?>                
                    <div class="Produit_liste_item" id="<?php 
echo $item[0]->id;
?>
">
                        <div class="suprime"><input type="checkbox" value="<?php 
echo $item[0]->id;
?>
" id="checkbox_<?php 
echo $item[0]->id;
?>
" name="checkbox_supprim[]" /></div>
                        <div class="thumb"><img src="<?php 
echo $product_image;
?>
Example #6
0
 public static function abs($href)
 {
     if (strpos($href, '://') === false) {
         //如果格式如 /system/admin/themes/default/css/system.css
         if ($href[0] === '/') {
             $root = url::root();
             $href = $root . '/' . ltrim($href, $root);
         } else {
             $base = dirname(url::base());
             $href = $base . '/' . $href;
         }
     }
     return url::clean($href);
 }
Example #7
0
 public static function application($id = '', $key = '')
 {
     static $applications = array();
     if (empty($applications)) {
         $applications = zotop::config('zotop.application');
     }
     if (empty($id)) {
         return $applications;
     }
     if (is_array($id)) {
         $applications = array_merge($applications, $id);
         return $applications;
     }
     if (isset($applications[strtolower($id)])) {
         $application = $applications[strtolower($id)];
     }
     if (isset($application)) {
         $application['path'] = ZOTOP . DS . $application['path'];
         $application['url'] = url::root() . '/' . $application['url'];
         $application['base'] = trim($application['url'], '/') . '/' . $application['base'];
         $application['module'] = isset($application['module']) ? $application['module'] : 'zotop';
         $application['controller'] = isset($application['controller']) ? $application['controller'] : 'index';
         $application['action'] = isset($application['action']) ? $application['action'] : 'default';
     }
     if (empty($key)) {
         return $application;
     }
     return $application[strtolower($key)];
 }
Example #8
0
 public static function decode($url)
 {
     $url = strtr($url, array('$root' => url::root(), '$system' => url::system(), '$theme' => url::theme(), '$modules' => url::modules(), '$this' => url::controller(), '$common' => url::common()));
     return $url;
 }
Example #9
0
 public static function application($id = '', $key = '')
 {
     static $applications = array();
     if (empty($applications)) {
         $applications = zotop::config('zotop.application');
     }
     if (empty($id)) {
         return $applications;
     }
     if (is_array($id)) {
         $applications = array_merge($applications, $id);
         return $applications;
     }
     $application = array();
     if (isset($applications[strtolower($id)])) {
         $application = $applications[strtolower($id)];
     }
     if (isset($application)) {
         $application['path'] = ZOTOP . DS . $application['path'];
         $application['url'] = url::root() . '/' . $application['url'];
         $application['base'] = trim($application['url'], '/') . '/' . $application['base'];
     }
     if (empty($key)) {
         return $application;
     }
     return $application[$key];
 }
Example #10
0
                <ul id="wish_list">                    
                </ul>
                <input type="submit" class="commande" name="confirm_wishlist" onclick="confirm_wishlist(); return false;" value="<?php 
echo gettext("Order now");
?>
" />
            </form>         
            <input type="hidden" value="<?php 
echo $store_id;
?>
" id="store_id">
            </div>            
        </div>        
    </div>    
    
</div>

<? $popup_image = base_url().'public/images/products/250x381/0.jpg';?>
<? if (is_file(url::root().'public/images/products/250x381/'.$prod->id.'.jpg'))  $popup_image = base_url().'public/images/products/250x381/'.$prod->id.'.jpg';?>
<div class="simple_overlay" id="GrandeImage">
<img src="<?php 
echo $popup_image;
?>
" alt="" />
</div>
<script>
$(document).ready(function() {
$("img[rel]").overlay();
});
</script>
Example #11
0
 public static function decode($url)
 {
     $url = str_replace(array('%root%', '%zotop%', '%theme%', '%module%'), array(url::root(), url::zotop(), url::theme(), url::module()), $url);
     return $url;
 }