/** * Public function that creates a single instance */ public static function getInstance($parent) { if (!isset(self::$_instance)) { self::$_instance = new self($parent); } return self::$_instance; }
/** * Constructor */ protected function __construct() { global $section; parent::__construct(__FILE__); // register delivery method and create menu items if (class_exists('backend') && class_exists('shop')) { require_once 'units/method.php'; require_once 'units/pickup_method.php'; Simple_DeliveryMethod::getInstance($this); Simple_ManualPickupMethod::getInstance($this); $backend = backend::getInstance(); $method_menu = $backend->getMenu('shop_delivery_methods'); if (!is_null($method_menu)) { $method_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_delivery'), url_GetFromFilePath($this->path . 'images/icon.png'), window_Open('delivery_intervals', 650, $this->getLanguageConstant('title_intervals'), true, true, backend_UrlMake($this->name, 'intervals')), $level = 5)); } } // register backend style $head_tag = head_tag::getInstance(); $head_tag->addTag('link', array('href' => url_GetFromFilePath($this->path . 'include/backend.css'), 'rel' => 'stylesheet', 'type' => 'text/css')); $head_tag->addTag('script', array('src' => url_GetFromFilePath($this->path . 'include/backend.js'), 'type' => 'text/javascript')); }