2015-08-12 14:10:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require(dirname(__FILE__).'/../../blockadshooks.php');
|
|
|
|
|
|
|
|
class AdminAdsController extends ModuleAdminController {
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->identifier = 'id_block_ads';
|
|
|
|
$this->lang = true;
|
|
|
|
$this->table = 'ads';
|
|
|
|
$this->className = 'BlockAds';
|
|
|
|
$this->bootstrap = true;
|
|
|
|
|
|
|
|
$this->addRowAction('view');
|
|
|
|
$this->addRowAction('edit');
|
|
|
|
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderList()
|
|
|
|
{
|
|
|
|
$this->fields_list = array(
|
|
|
|
'id_block_ads' => array(
|
|
|
|
'title' => 'ID',
|
|
|
|
'width' => 25,
|
|
|
|
'class' => 'text-center',
|
|
|
|
),
|
|
|
|
'label' => array(
|
|
|
|
'title' => $this->l('Label'),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
return parent::renderList();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderForm()
|
|
|
|
{
|
|
|
|
$this->fields_form = array(
|
|
|
|
'multilang' => true,
|
|
|
|
'tinymce' => true,
|
|
|
|
'legend' => array(
|
|
|
|
'title' => $this->l('Ads'),
|
|
|
|
),
|
|
|
|
'submit' => array(
|
|
|
|
'title' => $this->l('Save'),
|
|
|
|
),
|
|
|
|
'input' => array(
|
|
|
|
|
|
|
|
array(
|
|
|
|
'type' => 'text',
|
|
|
|
'label' => $this->l('Label'),
|
|
|
|
'name' => 'label',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'type' => 'text',
|
|
|
|
'label' => $this->l('Width'),
|
|
|
|
'name' => 'width',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'type' => 'text',
|
|
|
|
'label' => $this->l('Height'),
|
|
|
|
'name' => 'height',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'type' => 'textarea',
|
|
|
|
'label' => $this->l('Default content'),
|
|
|
|
'name' => 'content',
|
|
|
|
'lang' => true
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
return parent::renderForm();
|
|
|
|
}
|
2015-08-13 09:59:25 +02:00
|
|
|
|
|
|
|
public function renderView()
|
|
|
|
{
|
|
|
|
$helper = new HelperList();
|
|
|
|
if (empty($this->toolbar_title))
|
|
|
|
$this->initToolbarTitle();
|
|
|
|
// tocheck
|
|
|
|
if ($this->object && $this->object->id)
|
|
|
|
$helper->id = $this->object->id;
|
|
|
|
|
|
|
|
// @todo : move that in Helper
|
|
|
|
$helper->title = $this->l('Liste des publications liées');
|
|
|
|
$helper->toolbar_btn = array('new' => array(
|
|
|
|
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
|
|
|
|
'desc' => $this->l('Add new')
|
|
|
|
));
|
|
|
|
$helper->show_toolbar = true;
|
|
|
|
$helper->toolbar_scroll = false;
|
|
|
|
$helper->override_folder = $this->tpl_folder;
|
|
|
|
$helper->actions = array('edit');
|
|
|
|
$helper->simple_header = $this->list_simple_header;
|
|
|
|
$helper->bulk_actions = $this->bulk_actions;
|
|
|
|
$helper->currentIndex = self::$currentIndex;
|
|
|
|
$helper->className = $this->className;
|
|
|
|
$helper->table = $this->table;
|
|
|
|
$helper->name_controller = Tools::getValue('controller');
|
|
|
|
$helper->orderBy = $this->_orderBy;
|
|
|
|
$helper->orderWay = $this->_orderWay;
|
|
|
|
$helper->listTotal = $this->_listTotal;
|
|
|
|
$helper->shopLink = $this->shopLink;
|
|
|
|
$helper->shopLinkType = $this->shopLinkType;
|
|
|
|
$helper->identifier = $this->identifier;
|
|
|
|
$helper->token = $this->token;
|
|
|
|
$helper->languages = $this->_languages;
|
|
|
|
$helper->specificConfirmDelete = $this->specificConfirmDelete;
|
|
|
|
$helper->imageType = $this->imageType;
|
|
|
|
$helper->no_link = $this->list_no_link;
|
|
|
|
$helper->colorOnBackground = $this->colorOnBackground;
|
|
|
|
$helper->ajax_params = (isset($this->ajax_params) ? $this->ajax_params : null);
|
|
|
|
$helper->default_form_language = $this->default_form_language;
|
|
|
|
$helper->allow_employee_form_lang = $this->allow_employee_form_lang;
|
|
|
|
$helper->multiple_fieldsets = $this->multiple_fieldsets;
|
|
|
|
$helper->row_hover = $this->row_hover;
|
|
|
|
$helper->position_identifier = $this->position_identifier;
|
|
|
|
$helper->position_group_identifier = $this->position_group_identifier;
|
|
|
|
$helper->controller_name = $this->controller_name;
|
|
|
|
$helper->list_id = isset($this->list_id) ? $this->list_id : $this->table;
|
|
|
|
$helper->bootstrap = $this->bootstrap;
|
|
|
|
|
|
|
|
// For each action, try to add the corresponding skip elements list
|
|
|
|
$helper->list_skip_actions = $this->list_skip_actions;
|
|
|
|
|
|
|
|
$this->helper = $helper;
|
|
|
|
|
|
|
|
|
|
|
|
$this->context->smarty->assign(array(
|
|
|
|
'publications_list' => array();
|
|
|
|
));
|
|
|
|
|
|
|
|
return parent::renderView();
|
|
|
|
}
|
2015-08-12 14:10:25 +02:00
|
|
|
}
|