/** * This class implements singleton pattern */ public static function getInstance() { if (!self::$_instance) { self::$_instance = new self(); } return self::$_instance; }
protected function l($string, $class = 'AdminTab', $addslashes = FALSE, $htmlentities = TRUE) { if ($class != __CLASS__) { $parentTranslation = parent::l($string, 'AdminFeatures', $addslashes, $htmlentities, false); if ($string != $parentTranslation) { return $parentTranslation; } return parent::l($string, $class, $addslashes, $htmlentities); } return exfeatures::getInstance()->l($string, strtolower($class)); }
public function __construct() { $this->className = 'FeatureGroup'; $this->fieldsDisplay = array('name' => array('title' => $this->l('Name', __CLASS__), 'width' => 200), 'position' => array('title' => $this->l('Position', __CLASS__), 'width' => 40)); $this->lang = true; $this->edit = true; $this->delete = true; $this->identifier = 'id_group'; $this->table = 'feature_group'; $this->_moduleDir = _PS_ROOT_DIR_ . '/modules/' . exfeatures::getInstance()->name; $this->_templatesDir = $this->_moduleDir . "/templates/"; parent::__construct(); }
protected function l($string, $class = 'AdminTab', $addslashes = FALSE, $htmlentities = TRUE) { if ($class != __CLASS__) { if (!in_array($class, array("AdminCategories", "AdminProducts"))) { $class = "AdminCatalog"; } $parentTranslation = parent::l($string, $class, $addslashes, $htmlentities); if ($string != $parentTranslation) { return $parentTranslation; } global $_LANGADM; $key = md5(str_replace('\'', '\\\'', $string)); $str = key_exists($class . $key, $_LANGADM) ? $_LANGADM[$class . $key] : $string; $str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str; return str_replace('"', '"', $addslashes ? addslashes($str) : stripslashes($str)); } return exfeatures::getInstance()->l($string, strtolower($class)); }