Jump to content

Edit History

Alexandre Carette

Alexandre Carette

bonjour, quand vous parlez du dashboard vous voulez dire un encart dans le tableau de bord ?

 

<?php

if (!defined('_PS_VERSION_')) {
    exit;
}

class cafe_dashboardcustom extends Module
{
    public function __construct()
    {
        $this->name = 'cafe_dashboardcustom';
        $this->tab = 'administration';
        $this->version = '1.0.0';
        $this->author = 'presta.cafe';
        $this->need_instance = 0;
        $this->bootstrap = true;
        parent::__construct();
        $this->displayName = $this->l('cafe_dashboardcustom');
        $this->description = $this->l('Module Sample');
        $this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
    }

    public function install()
    {
        if (!parent::install()
        || !$this->registerHook([
            'dashboardZoneTwo',
        ])
        ) {
            return false;
        }
        return true;
    }

    public function uninstall()
    {
        if (
            !parent::uninstall()
        ) {
            return false;
        }
        return true;
    }

    public function hookDashboardZoneTwo($params)
    {
        if (Module::isInstalled('cafe_dashboardcustom')) {
            $this->_html = '
            <div class="panel widget">
            <header class="panel-heading">'.$this->displayName.'</header>
                <div class="row row-margin-bottom">
                    <div class="col-lg-12">
                    '.$this->sqlRequest().'
                    </div>
                </div>
            </div>';
        } else {

            $this->_html = '<p>'.$this->trans('The %s module must be installed.', array($this->newsletter_module_human_readable_name), 'Modules.Statsnewsletter.Admin').'</p>';
        
        }

        return $this->_html;
    }

    private function sqlRequest() {

        $query = 'result query';

        return $query;


    }
}

 

Alexandre Carette

Alexandre Carette

bonjour, quand vous parlez du dashboard vous voulez dire un encart dans le tableau de bord ?

×
×
  • Create New...