public function renderForm()
 {
     $mod = new posstaticfooter();
     $listModules = $mod->getListModuleInstalled();
     $listHookModules = array(array('hook_position' => 'displayFooter'), array('hook_position' => 'blockFooter1'), array('hook_position' => 'blockFooter2'), array('hook_position' => 'blockFooter3'));
     $listHookFooterModules = array(array('hook_position' => 'displayFooter'));
     $this->fields_form = array('tinymce' => true, 'legend' => array('title' => $this->l('Slideshow'), 'image' => '../img/admin/cog.gif'), 'input' => array(array('type' => 'text', 'label' => $this->l('Title:'), 'name' => 'title', 'size' => 40, 'lang' => true), array('type' => 'text', 'label' => $this->l('Identify:'), 'name' => 'identify', 'size' => 40, 'require' => false), array('type' => 'radio', 'label' => $this->l('Show/hide title'), 'desc' => $this->l('Show/hide title?'), 'name' => 'active', 'required' => true, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'select', 'label' => $this->l('Hook Position:'), 'name' => 'hook_position', 'required' => true, 'options' => array('query' => $listHookModules, 'id' => 'hook_position', 'name' => 'hook_position'), 'desc' => $this->l('Choose the type of the Hooks <br> With new hooks as blockFooter1, block Footer2 , blockFooter3 must been  insert at tpl file. For example {hook h = "newHook"}')), array('type' => 'radio', 'label' => $this->l('Show/hide Hook'), 'desc' => $this->l('Show/hide Hook?'), 'name' => 'showhook', 'required' => true, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'textarea', 'label' => $this->l('Description'), 'name' => 'description', 'autoload_rte' => TRUE, 'lang' => true, 'required' => TRUE, 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => $this->l('Order:'), 'name' => 'posorder', 'size' => 40, 'require' => false), array('type' => 'radio', 'label' => $this->l('Insert Module?'), 'desc' => $this->l('Insert module?'), 'name' => 'insert_module', 'required' => true, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on_module', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off_module', 'value' => 0, 'label' => $this->l('Disabled')))), array('type' => 'select', 'label' => $this->l('Modules:'), 'name' => 'name_module', 'required' => true, 'options' => array('query' => $listModules, 'id' => 'name', 'name' => 'name'), 'desc' => $this->l('Choose the type of the Module')), array('type' => 'select', 'label' => $this->l('Hook-Modules:'), 'name' => 'hook_module', 'required' => true, 'options' => array('query' => $listHookFooterModules, 'id' => 'hook_position', 'name' => 'hook_position'), 'desc' => $this->l('Choose the type of the Hooks'))), 'submit' => array('title' => $this->l('Save'), 'class' => 'btn btn-default pull-right'));
     if (Shop::isFeatureActive()) {
         $this->fields_form['input'][] = array('type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso');
     }
     if (!($obj = $this->loadObject(true))) {
         return;
     }
     return parent::renderForm();
 }
示例#2
0
 public function getListModuleInstalled()
 {
     $mod = new posstaticfooter();
     $modules = $mod->getModulesInstalled(0);
     $arrayModule = array();
     foreach ($modules as $key => $module) {
         if ($module['active'] == 1) {
             $arrayModule[0] = array('id_module' => 0, 'name' => 'Chose Module');
             $arrayModule[$key] = $module;
         }
     }
     if ($arrayModule) {
         return $arrayModule;
     }
     return array();
 }
示例#3
0
<?php

require_once dirname(__FILE__) . '../../../config/config.inc.php';
require_once dirname(__FILE__) . '../../../init.php';
include dirname(__FILE__) . '/posstaticfooter.php';
$pos = new posstaticfooter();
$name_module = $_POST['module_id'];
$module = Module::getInstanceByName($name_module);
$id_module = $module->id;
$hooks = $pos->getHooksByModuleId($id_module);
$hookArrays = array();
foreach ($hooks as $key => $hook) {
    $hookArrays[$key] = array('id_hook' => $hook['name'], 'name' => $hook['name']);
}
$json = json_encode($hookArrays);
die(json_encode($json));