示例#1
0
 /**
  * Class constructor
  * @param str $orientation Paper orientation
  * @param str $unit The unit that is used
  * @param str $format The aper size
  */
 public function __construct($orientation = 'P', $unit = 'mm', $format = 'A4')
 {
     parent::__construct($orientation, $unit, $format);
     $this->SetCreator(utf8_decode('Websailors'));
     $this->linker = sh_linker::getInstance();
     $this->i18nClassName = 'sh_pdf';
 }
示例#2
0
 public static function explodePalette($source, $file = null)
 {
     $model = imagecreatefrompng($source);
     $colors = array();
     $loops = array('reallyDark', 'dark', 'normal', 'shiny', 'reallyShiny');
     for ($x = 0; $x < 370; $x += 10) {
         foreach ($loops as $factor => $name) {
             $rgb = imagecolorat($model, $x, 5 + $factor * 10);
             $color = imagecolorsforindex($model, $rgb);
             $rgbCol = array('R' => $color['red'], 'G' => $color['green'], 'B' => $color['blue']);
             $out = self::RGBToHSV($rgbCol);
             $out['R'] = $color['red'];
             $out['G'] = $color['green'];
             $out['B'] = $color['blue'];
             $out['alpha'] = $color['alpha'];
             $hex = '#';
             $hex .= str_pad(dechex($color['red']), 2, '0', STR_PAD_LEFT);
             $hex .= str_pad(dechex($color['green']), 2, '0', STR_PAD_LEFT);
             $hex .= str_pad(dechex($color['blue']), 2, '0', STR_PAD_LEFT);
             $out['hex'] = $hex;
             $colors[$x][$name] = $out;
         }
     }
     $colors[370] = $colors[360];
     if (!is_null($file)) {
         sh_linker::getInstance()->helper->writeArrayInFile($file, 'palette', $colors, false);
     }
     return $colors;
 }
示例#3
0
 /**
  * Constructs the class.<br />
  * As a singleton, this method is protected, to defend from external creating.
  */
 protected function __construct()
 {
     // This class shouldn't depend on any other, so there is no need for any updating process (replacing this file
     //by a newer version should just work directly
     self::$instance = $this;
     // We construct the classes that need to be built at the beginning
     $this->__get('session');
     $this->__get('site');
 }
 public function admin_getMenuContent()
 {
     $adminMenu['Newsletters'][] = array('link' => 'newsletters/manage/', 'text' => 'Gérer la newsletter', 'icon' => 'picto_tool.png');
     $newsletterClass = sh_linker::getInstance()->newsletters;
     if ($newsletterClass->isActivated()) {
         $adminMenu['Newsletters'][] = array('link' => 'newsletters/createNewsletter/0', 'text' => 'Créer une newsletter', 'icon' => 'picto_add.png');
         $adminMenu['Newsletters'][] = array('link' => 'newsletters/showInvisible/', 'text' => 'Liste des newsletters', 'icon' => 'picto_list.png');
         $adminMenu['Newsletters'][] = array('link' => 'newsletters/manageLists/0', 'text' => 'Gérer les listes de diffusion', 'icon' => 'picto_list.png');
     }
     return $adminMenu;
 }
示例#5
0
 public function admin_getMenuContent()
 {
     $myLinks = sh_linker::getInstance();
     $menusNumber = $myLinks->template->menusNumber;
     $menusDescription = $myLinks->template->menusDescription;
     $adminMenu = array();
     for ($cpt = 0; $cpt < $menusNumber; $cpt++) {
         $adminMenu['Contenu'][] = array('link' => 'menu/edit/' . ($cpt + 1), 'text' => 'Modifier le menu ' . $menusDescription[$cpt], 'icon' => 'picto_modify.png');
     }
     return $adminMenu;
 }
function endDebug()
{
    if (defined('SH_DEBUG_VERIFY_FOLDER') && is_dir(SH_DEBUG_VERIFY_FOLDER)) {
        if (defined('SH_DEBUG_COVERAGE_PAGE')) {
            $linker = sh_linker::getInstance();
            if (file_exists(SH_DEBUG_COVERAGE_PAGE)) {
                include SH_DEBUG_COVERAGE_PAGE;
            } else {
                $coverage = array();
            }
            $all_elements = debug_get_coverage($coverage);
            $linker->helper->writeArrayInFile(SH_DEBUG_COVERAGE_PAGE, "coverage", $all_elements);
            xdebug_stop_code_coverage();
        }
    }
}
<?php

/**
 * @author Brice PARENT (Websailors) for Shopsailors
 * @copyright Shopsailors 2009
 * @license http://www.cecill.info
 * @version See version in the params/global.params.php file.
 * @package Shopsailors Core Classes
 */
if (!defined('SH_MARKER')) {
    header('location: directCallForbidden.php');
}
// as the banks class is in the payment class, we load it to be able to extend sh_banks
sh_linker::getInstance()->payment;
class sh_payment_phone extends sh_banks
{
    const CLASS_VERSION = '1.1.11.12.06.2';
    protected $lastErrorId = 0;
    protected $needsManagementPage = true;
    const DEV_NAME = 'Phone / Shopsailors';
    const DEV_WEBSITE = 'http://wiki.websailors.fr';
    const DEV_EMAIL = '*****@*****.**';
    protected $bank_code = 100001;
    // It actually ins't a bank code, but as it is made with 6 digits, it may not leed to errors
    protected $curTrans = array();
    protected $payments = array();
    protected $merchant_id = '';
    protected $merchant_country = '';
    protected $currency = array();
    protected $price = array();
    protected $allowedCurrencies = array();
示例#8
0
 public function admin_getMenuContent()
 {
     $adminMenu['Boutique'][] = array('link' => 'shop/editParams/', 'text' => 'Gérer la boutique', 'icon' => 'picto_tool.png');
     $shopClass = sh_linker::getInstance()->shop;
     if ($shopClass->isActivated()) {
         $adminMenu['Boutique'][] = array('link' => 'shop/editProduct/0', 'text' => 'Ajouter un produit', 'icon' => 'picto_add.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/packsList/', 'text' => 'Lots de produits', 'icon' => 'picto_list.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/editCategory/0', 'text' => 'Ajouter une categorie', 'icon' => 'picto_add.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/listDiscounts/', 'text' => 'Liste des promotions', 'icon' => 'picto_list.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/showCommands/', 'text' => 'Liste des commandes', 'icon' => 'ship_modes.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/inactiveProducts/', 'text' => 'Produits désactivés', 'icon' => 'picto_list.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/editLayout/1', 'text' => 'Habillage de la boutique', 'icon' => 'picto_layout.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/editShipModes/', 'text' => 'Modes d\'expédition', 'icon' => 'ship_modes.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/editCustomProperty/0', 'text' => 'Propriétés personnalisées des produits', 'icon' => 'picto_modify.png');
         $adminMenu['Boutique'][] = array('link' => 'shop/editPaymentModes/', 'text' => 'Modes de paiement', 'icon' => 'picto_money.png');
     }
     return $adminMenu;
 }
示例#9
0
 /**
  * public function __construct
  *
  */
 public function __construct($className = null, $forceFile = false)
 {
     $this->className = $className;
     $this->linker = sh_linker::getInstance();
     $this->load($forceFile);
     $this->helper = $this->linker->helper;
 }
 public function __construct()
 {
     $this->linker = sh_linker::getInstance();
 }
示例#11
0
    }
    $domain = $_SERVER['SERVER_NAME'];
    $baseUri = $protocol . '://' . $domain;
    echo "\n\n" . 'Sitemap: ' . $baseUri . '/sitemap.xml' . "\n";
    exit;
}
// Creates the autoload function that will help finding the classes
function __autoload($className)
{
    if (file_exists(SH_CLASS_FOLDER . $className . '/' . $className . '.cls.php')) {
        include_once SH_CLASS_FOLDER . $className . '/' . $className . '.cls.php';
    }
    return true;
}
// Create the linker object
$linker = sh_linker::getInstance();
$updater = $linker->updater;
define('SH_MOBILE_DEVICE', $linker->session->checkIfIsMobileDevice());
// Verifies if the site can be accessed to any user
$linker->user->siteIsOpen();
// If the file is cached, we show it and exit
if (!$linker->admin->isAdmin()) {
    /*if(!($linker->rights->getUserRights() & sh_rights::RIGHT_READ)){
          $linker->path->error(403);
          exit;
      }*/
    $cache = sh_cache::getCachedFile();
    if ($cache) {
        echo $cache;
        exit(1);
    }
示例#12
0
 /**
  * This method sets a message in a specific folder. It will be shown when the users access this folder
  * through the browser.<br />
  * If there is no $message parametter, this method will remove any previously set message from this folder.
  * @param str $folder The folder name (from the filesystem root)
  * @param array $message An array containing the message in the different languages.<br />
  * Ex : array('fr_FR' => 'Bonjour le monde!','en_GB' => 'Hello World!');
  * @return bool True for success, false for failiure
  */
 public static function setMessage($folder, $message = null)
 {
     if (is_null($message)) {
         // We remove the message if there is one
         if (file_exists($folder . '/' . self::MESSAGEFILE)) {
             unlink($folder . '/' . self::MESSAGEFILE);
             return true;
         }
     }
     return sh_linker::getInstance()->helper->writeArrayInFile($folder . '/' . self::MESSAGEFILE, 'message', $message, false);
 }
示例#13
0
 /**
  * This function should only be called from this file and from
  * sh_core
  */
 public static function removeCache()
 {
     $path = self::staticGetPath();
     $linker = sh_linker::getInstance();
     $linker->helper->deleteDir($path);
     return true;
 }
<?php

/**
 * @author Brice PARENT for Shopsailors
 * @copyright Shopsailors 2009
 * @license http://www.cecill.info
 * @version See sh_payment_cic::CLASS_VERSION
 * @package Shopsailors Core Classes
 */
if (!defined('SH_MARKER')) {
    header('location: directCallForbidden.php');
}
$paymentObject = sh_linker::getInstance()->payment;
class sh_payment_cic extends sh_banks
{
    const CLASS_VERSION = '1.1.11.05.10';
    protected $ready = false;
    protected $bank_code = 0;
    protected $payments = array();
    protected $paymentConfirmPagesParams = null;
    protected $paymentsLogParams = null;
    protected $price = false;
    protected $successUrl = '';
    protected $failureUrl = '';
    protected $autoresponseUrl = '';
    protected $pathFolder = '';
    protected $currency = 0;
    protected $currencies = array(self::CUR_EUR, self::CUR_USD, self::CUR_CHF, self::CUR_GBP, self::CUR_CAD, self::CUR_JPY);
    protected $languages = array('FR', 'EN', 'DE', 'IT', 'ES', 'NL', 'PT', 'SV');
    protected $lang = 'EN';
    protected $customer_mail = '';
示例#15
0
 /**
  * public function __construct
  *
  */
 public function __construct()
 {
     $this->linker = sh_linker::getInstance();
     //$this->file = date('Ymd-His').md5(sh_linker::getInstance()->path->url);
 }
示例#16
0
 /**
  * public function __construct
  *
  */
 public function __construct($className)
 {
     $this->linker = sh_linker::getInstance();
     $this->className = $className;
 }