Jump to content

Cosa sono i Tab?


g4b0

Recommended Posts

Smanettando un modulo open source per capirne il funzionamento mi sono imbattuto nella funzione seguente:

 /**
    * Install a module tab
    *
    * @param  $tabClass
    * @param  $tabName
    * @param  $idTabParent
    *
    * @return boolean true if the tab is inserted correctly
    */
   private function installModuleTab($tabClass, $tabName, $idTabParent) {

       $retVal = true;

       @copy(_PS_MODULE_DIR_.$this->name.'/logo.gif', _PS_IMG_DIR_.'t/'.$tabClass.'.gif');
       $tab = new Tab();
       $tab->name = $tabName;
       $tab->class_name = $tabClass;
       $tab->module = $this->name;
       $tab->id_parent = $idTabParent;
       if(!$tab->save()) {
           $retVal = false;
       }

       return $retVal;
   }



Ho capito che si occupa di copiare logo.gif in nomemodulo.gif nel posto giusto (infatti l'icona del modulo appare nei posti giusti), ma non sono riuscito a capire il seguito. Ho guardato anche il codice della classe Tab, ma non c'é una riga di commento...

Cosa sono i tab?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...