<?php
/**
  @licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  05/01/11, 17:14
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
*/

/**
  Recherche widget name fournis, on return false
  @author oscim <mail oscim@oscss.org> <www http://www.oscim.fr>
*/
function tep_widget_box($name, $class="box"){
  if (file_exists(DIR_WS_WIDGET.$name)) return array('name'=>DIR_WS_WIDGET.$name,'class'=>$class);
  else return false;
}


/**
  load widget context page
  @author oscim <mail oscim@oscss.org> <www http://www.oscim.fr>
*/
function load_widget_context(){
  global $current_page,$oscss,$language;
  if( ($widg=tep_widget_box($current_page, "adminBlock"))  !=false){
    $file=basename($widg['name']);
    $oscss->pile_file_lang(DIR_WS_LANGUAGES . $language . '/widget/'.substr($file,0,strlen($file)-4).'.txt');
    require($widg['name']);
  }
}
?>