/** * 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 backend if (class_exists('backend') && class_exists('shop')) { $backend = backend::getInstance(); $method_menu = $backend->getMenu('shop_payment_methods'); if (!is_null($method_menu)) { $method_menu->addChild('', new backend_MenuItem($this->getLanguageConstant('menu_google_checkout'), url_GetFromFilePath($this->path . 'images/icon.png'), window_Open('paypal', 650, $this->getLanguageConstant('title_settings'), true, true, backend_UrlMake($this->name, 'settings')), $level = 5)); } } // register payment method if (class_exists('shop')) { require_once "units/google_checkout_payment_method.php"; GoogleCheckout_PaymentMethod::getInstance($this); } }