<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @subpackage slimbox2
  @package osCSS-2 <www http://www.oscss.org>
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
*/
/**
  function de definiton de l'execution
*/
function slimbox_add_propriete(){
  global $template;
  $prop=array('products_image'=>array(
                                'key_shearch'=>'products_image',
                                'class_page'=>'product,',
                                'replace'=>'slimbox_replace',
                ) );

  return $prop;
}

/**
   fucntion d'execution du plugin
*/
function slimbox_replace($product_info, $class='lightbox', $img_w, $img_h){
  global $page;

  $img_gd=(isset($product_info['products_image_xl']))? $product_info['products_image_xl']: $product_info['products_image'];

  $m  =''."\n";
  $m .='<p><a class="'.$class.'" rel="'.$class.'" href="' .tep_image(DIR_WS_IMAGES . $img_gd, $product_info['products_name'], $page->_conf_value('POPUP_IMAGE_WIDTH'), $page->_conf_value('POPUP_IMAGE_HEIGHT'), "", true)  . '" title="' . addslashes($product_info['products_name']) . '" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), $img_w, $img_h,' id="image_master" ') . '</a></p>'."\n";
  $m .=''."\n";
  $m .='<noscript>'."\n";
  $m .='<p><a class="'.$class.'" href="' .tep_image(DIR_WS_IMAGES . $img_gd, $product_info['products_name'], $page->_conf_value('POPUP_IMAGE_WIDTH'), $page->_conf_value('POPUP_IMAGE_HEIGHT'), "", true) . '">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], $img_w, $img_h,' id="image_master" ') . '</a><br /><a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '">' . TEXT_CLICK_TO_ENLARGE . '</a></p>'."\n";
  $m .='</noscript>'."\n";

  return $m;
}


/**
  Definition des scripts du plugins
*/
function slimbox_scripts(){
  global $page;
  $dir_ws_here=$page->getPathTemplate().'includes/plugins/product/slimbox/';
  $scripts=array('jquery'=> array(
                    'type'=>'framework',
                    'file'=>"ext/jquery/jquery.min.js",
                    'pages'=>'product_info,'
                                ),
                '1'=>array(
                    'type'=>'script',
		    'place'=>'header',
                    'file'=>array(
                                  $dir_ws_here."inc/slimbox2.css",
                                ),
                    'sort'=> 6
			),
                '2'=>array(
                    'type'=>'script',
		    'place'=>'footer',
                    'file'=>array(
                                  $dir_ws_here."inc/slimbox2.js"
                                ),
                    'sort'=> 6
			),
               );
  return $scripts;
}



?>
