Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.52 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('_PS_VERSION_'))
  4.     exit;
  5.  
  6. class GameHinter extends Module {
  7.  
  8.     private $html = '';
  9.  
  10.     public function __construct() {
  11.         $this->name = 'gamehinter';
  12.         $this->tab = 'smart_shopping';
  13.         $this->version = '0.0.2';
  14.         $this->author = 'Lucas Dyduch';
  15.         $this->need_instance = 0;
  16.         $this->ps_versions_compliancy = [
  17.             'min' => '1.7',
  18.             'max' => _PS_VERSION_
  19.         ];
  20.         $this->bootstrap = true;
  21.  
  22.         parent::__construct();
  23.  
  24.         $this->displayName = $this->l('Game hinter');
  25.         $this->description = $this->l('It shows what game can handle hardware you are browsing.');
  26.  
  27.         $this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
  28.  
  29.         if (!Configuration::get('GAMEHINTER'))
  30.             $this->warning = $this->l('No name provided');
  31.     }
  32.  
  33.     public function install() {
  34.         return parent::install()
  35.             && $this->registerHook('displayProductAdditionalInfo');
  36.     }
  37.  
  38.     public function uninstall() {
  39.         if(!parent::uninstall())
  40.             return false;
  41.         return true;
  42.     }
  43.  
  44.     public function hookDisplayProductAdditionalInfo($params) {
  45.         //$sql = 'SELECT @@version;'
  46.         //$results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
  47.         $this->html .= '<script>alert(1)</script><h1>It works $params</h1>';
  48.  
  49.         //TODO pobranie z parametów informacji ze jest to karta grafczina
  50.        
  51.         return $this->html;
  52.     }
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement