Пример #1
0
 public function hookLeftColumn($params)
 {
     if (!$this->checkServerConf()) {
         return false;
     }
     $is_home = Tools::getValue('controller') == 'index' ? true : false;
     require_once _PS_MODULE_DIR_ . "psnews/psnews.php";
     require_once _PS_MODULE_DIR_ . "psnews/classes/News.php";
     $pref = array_merge(Psnews::getPreferences(), self::getPreferences());
     if (!($is_home && $pref['news_articles_home'] == 1)) {
         $this->calculHookCommon($params);
         return $this->display(__FILE__, 'news.tpl');
     }
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     $this->context = Context::getContext();
     $this->conf = Psnews::getPreferences();
 }
Пример #3
0
 public static function getPreferences()
 {
     if (is_null(self::$prefnews)) {
         $config = Configuration::get('PSNEWS_CONF');
         $options = self::$default_values;
         if ($config) {
             $options = array_merge($options, unserialize(base64_decode($config)));
         }
         self::$prefnews = $options;
     }
     return self::$prefnews;
 }