Changeset 1093
- Timestamp:
- 09/16/08 22:46:17 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix-scripts/commands/createmodule.cmd.php
r1092 r1093 14 14 15 15 public $name = 'createmodule'; 16 public $allowed_options=array('-nosubdir'=>false, '-nocontroller'=>false, '-cmdline'=>false, '-addinstallzone'=>false );16 public $allowed_options=array('-nosubdir'=>false, '-nocontroller'=>false, '-cmdline'=>false, '-addinstallzone'=>false, '-defaultmodule'=>false); 17 17 public $allowed_parameters=array('module'=>true); 18 18 19 public $syntaxhelp = "[-nosubdir] [-nocontroller] [-cmdline] MODULE";19 public $syntaxhelp = "[-nosubdir] [-nocontroller] [-cmdline] [-addinstallzone] [-defaultmodule] MODULE"; 20 20 public $help=array( 21 21 'fr'=>" … … 28 28 -cmdline (facultatif) : crée le module avec un contrôleur pour la ligne de commande 29 29 -addinstallzone (facultatif) : ajoute la zone check_install pour une nouvelle application 30 -defaultmodule (facultatif) : le module devient le module par defaut de l'application 31 30 32 MODULE : le nom du module à créer.", 31 33 'en'=>" … … 36 38 -cmdline (optional): create a controller for command line (jControllerCmdLine) 37 39 -addinstallzone (optional) : add the check_install zone for new application 40 -defaultmodule (optional) : the new module become the default module 38 41 MODULE: name of the new module." 39 42 ); … … 80 83 JELIX_APP_CONFIG_PATH.'xmlrpc/config.ini.php', 81 84 ); 82 foreach($inifiles as $filename) { 85 $isdefault = $this->getOption('-defaultmodule'); 86 foreach($inifiles as $k=> $filename) { 83 87 try { 84 88 $ini = new jIniFileModifier($filename); 85 if ($ini->getValue('startModule') == '') 89 if ($isdefault && $k == 0) { 90 $ini->setValue('startModule', $this->_parameters['module']); 91 $ini->setValue('startAction', 'default:index'); 92 } 93 else if ($ini->getValue('startModule') == '') 86 94 $ini->setValue('startModule', $this->_parameters['module']); 87 95 $ini->save();
