Skip to content

Instantly share code, notes, and snippets.

@kpodemski
Last active December 11, 2015 20:58
Show Gist options
  • Save kpodemski/4658547 to your computer and use it in GitHub Desktop.
Save kpodemski/4658547 to your computer and use it in GitHub Desktop.
PrestaShop AdminController override
<?php
class AdminXXXController extends AdminXXXControllerCore
{
public function renderForm()
{
$this->multiple_fieldsets = true;
$this->fields_form = array(
array(
'form' => array(
'tinymce' => true,
'legend' => array(
'title' => $this->l('Some fieldset legend'),
'image' => '../path/to/icon.gif'
),
'input' => array(
array(
'type' => 'text',
'label' => $this->l('Name:'),
'name' => 'name',
'lang' => true,
'size' => 48,
'required' => true,
'class' => 'copy2friendlyUrl',
'hint' => $this->l('Invalid characters:').' <>;=#{}',
),
array(
'type' => 'radio',
'label' => $this->l('Displayed:'),
'name' => 'active',
'required' => false,
'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')
)
)
)
),
'submit' => array(
'title' => $this->l('Save'),
'class' => 'button'
),
),
),
array(
'form' => array(
'legend' => array(
'title' => $this->l('Other fieldset')
),
'input' => array(
array(
'type' => 'text',
'label' => $this->l('Domain:'),
'name' => 'domain',
'size' => 50,
),
array(
'type' => 'text',
'label' => $this->l('Domain SSL:'),
'name' => 'domain_ssl',
'size' => 50,
),
array(
'type' => 'text',
'label' => $this->l('Physical URI:'),
'name' => 'physical_uri',
'desc' => $this->l('Physical folder of your store on your server. Leave this field empty if your store is installed on the root path (e.g. if your store is available at www.my-prestashop.com/my-store/, you would set my-store/ in this field).'),
'size' => 50,
),
array(
'type' => 'text',
'label' => $this->l('Virtual URI:'),
'name' => 'virtual_uri',
'desc' => $desc_virtual_uri,
'size' => 50,
'hint' => (!$update_htaccess) ? $this->l('Warning: URL rewriting (e.g. mod_rewrite for Apache) seems to be disabled. If your URL don\'t work, please check with your host provider how to activate URL rewriting.') : '',
),
array(
'type' => 'text',
'label' => $this->l('Your final URL will be:'),
'name' => 'final_url',
'size' => 76,
'readonly' => true
),
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment