Prestashop - 1.4 Guide de l'utilisateur Page 27

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 36
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 26
protected $fieldsValidate = array( 'test' => 'isGenericName' );
protected $table = 'test';
protected $identifier = 'id_test';
public function getFields()
{
parent::validateFields();
$fields[ 'test' ] = pSQL( $this->test );
return $fields;
}
}
?>
1. Create a blank file named AdminTest.php in PrestaShop's /admin/tabs.
2. Add the following lines to that file:
AdminTest.php
<?php
include_once( PS_ADMIN_DIR . '/../classes/AdminTab.php' );
class AdminTest extends AdminTab
{
public function __construct()
{
$this->table = 'test';
$this->className = 'Test';
$this->lang = false;
$this->edit = true;
$this->delete = true;
$this->fieldsDisplay = array(
'id_test' => array(
'title' => $this->l( 'ID' ),
'align' => 'center',
'width' => 25 ),
'test' => array(
'title' => $this->l( 'Name' ),
'width' => 200 )
);
$this->identifier = 'id_test';
parent::__construct();
}
public function displayForm()
{
global $currentIndex;
$defaultLanguage = intval( Configuration::get( 'PS_LANG_DEFAULT' ) );
$languages = Language::getLanguages();
$obj = $this->loadObject( true );
echo '
<script type="text/javascript">
id_language = Number('.$defaultLanguage.');
</script>';
echo '
Vue de la page 26
1 2 ... 22 23 24 25 26 27 28 29 30 31 32 ... 35 36

Commentaires sur ces manuels

Pas de commentaire