HEX
Server: Apache
System: Linux srv13.cpanelhost.cl 3.10.0-962.3.2.lve1.5.38.el7.x86_64 #1 SMP Thu Jun 18 05:28:41 EDT 2020 x86_64
User: cca63905 (4205)
PHP: 7.3.20
Disabled: NONE
Upload Files
File: /home4/cca63905/public_html/nueva/modules/cmscontact/cmscontact.php
<?php
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2015 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

class Cmscontact extends Module
{
    protected $config_form = false;

    public function __construct()
    {
        $this->name = 'cmscontact';
        $this->tab = 'front_office_features';
        $this->version = '1.0.0';
        $this->author = 'PrestaMarketing™';
        $this->need_instance = 0;

        $this->bootstrap = true;

        parent::__construct();

        $this->displayName = $this->l('Contact form in CMS');
        $this->description = $this->l('Include the contact form in any CMS page');

        $this->confirmUninstall = $this->l('');

        $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
    }

    public function install()
    {
        Configuration::updateValue('cmscontact_key','');
        Configuration::updateValue('cmscontact_activationKey','');
        return parent::install();
    }

    public function uninstall()
    {
        Configuration::deleteByName('cmscontact_key');
        Configuration::deleteByName('cmscontact_activationKey');
        return parent::uninstall();
    }

    public function getContent()
    {
        $this->smarty->assign(array());
        

        return $this->display(__FILE__, 'views/templates/admin/admin.tpl');

    }

    public function formActivacion()
    {   
        $default_lang = (int)Configuration::get('PS_LANG_DEFAULT');
        
        $fields_form[0]['form'] = array(
            'legend' => array(
                'title' => $this->l('Module activation'),
            ),
            'input' => array(
                array(
                    'type' => 'text',
                    'label' => $this->l('Code'),
                    'name' => 'activationCode',
                    'desc' => $this->l('leave this field empty in localhost'),
                    'size' => 20,
                    'required' => true,
                    'col' => 3,
                ),
                
            ),
            'submit' => array(
                'title' => $this->l('Send'),
                'class' => 'button'
            )
        );
         
        $helper = new HelperForm();
         
        // Module, token and currentIndex
        $helper->module = $this;
        $helper->name_controller = $this->name;
        $helper->token = Tools::getAdminTokenLite('AdminModules');
        $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
         
        // Language
        $helper->default_form_language = $default_lang;
        $helper->allow_employee_form_lang = $default_lang;
         
        // Title and toolbar
        $helper->title = $this->displayName;
        $helper->show_toolbar = true;        // false -> remove toolbar
        $helper->toolbar_scroll = true;      // yes - > Toolbar is always visible on the top of the screen.
        $helper->submit_action = 'submit'.$this->name;
        $helper->toolbar_btn = array(
            'save' =>
            array(
                'desc' => $this->l('Save'),
                'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name.
                '&token='.Tools::getAdminTokenLite('AdminModules'),
            ),
            'back' => array(
                'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'),
                'desc' => $this->l('Back to list')
            )
        );       
        return $helper->generateForm($fields_form);
    }
}