Changeset 127

Show
Ignore:
Timestamp:
04/04/06 00:13:48 (3 years ago)
Author:
laurentj
Message:

ajout design pour testapp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/testapp.mn

    r126 r127  
    1414  xmlrpc.php 
    1515  index.php 
     16cd testapp/www/design 
     17  screen.css 
    1618cd testapp/www/jelix 
    1719  json.js 
     
    3638cd testapp/modules/testapp/templates 
    3739  hello.tpl 
     40  hello2.tpl 
    3841  main.tpl 
    3942  error.tpl 
     
    6366  testunit.ISO-8859-1.properties 
    6467cd testapp/modules/unittest/templates 
    65   accueil.tpl 
     68  menu.tpl 
    6669cd testapp/modules/unittest/controllers 
    6770  default.classic.php 
     
    7578  urls.xml 
    7679cd testapp/var/themes/default/testapp 
    77   main.tpl 
     80  hello2.tpl 
    7881cd testapp/var/overloads/testapp/daos 
    7982cd testapp/var/overloads/testapp/locales 
  • trunk/lib/jelix/core/jController.class.php

    r125 r127  
    4848    } 
    4949 
    50     protected function getResponse($name){ 
    51         return $this->request->getResponse($name); 
     50    protected function getResponse($name, $useOriginal=false){ 
     51        return $this->request->getResponse($name, $useOriginal); 
    5252    } 
    5353 
  • trunk/lib/jelix/core/jRequest.class.php

    r121 r127  
    4242        $this->_initParams(); 
    4343    } 
    44      
    45      
     44 
     45 
    4646    abstract protected function _initParams(); 
    4747 
     
    101101    } 
    102102 
    103     public function getResponse($type=''){ 
    104         global $gJCoord, $gJConfig
     103    public function getResponse($type='', $useOriginal = false){ 
     104        global $gJCoord, $gJConfig, $gDefaultConfig
    105105        if($type == ''){ 
    106106            $type = $this->defaultResponseType; 
    107107        } 
    108108 
    109         if(!isset($gJConfig->responses[$type])){ 
    110             trigger_error(jLocale::get('jelix~errors.ad.response.type.unknow',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 
    111             return null; 
     109        if($useOriginal){ 
     110            if(!isset($gDefaultConfig->responses[$type])){ 
     111               trigger_error(jLocale::get('jelix~errors.ad.response.type.unknow',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 
     112               return null; 
     113            } 
     114            $respclass = $gDefaultConfig->responses[$type]; 
     115        }else{ 
     116            if(!isset($gJConfig->responses[$type])){ 
     117               trigger_error(jLocale::get('jelix~errors.ad.response.type.unknow',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())),E_USER_ERROR); 
     118               return null; 
     119            } 
     120            $respclass = $gJConfig->responses[$type]; 
    112121        } 
    113         $respclass = $gJConfig->responses[$type]; 
    114122        if(file_exists($path=JELIX_LIB_RESPONSE_PATH.$respclass.'.class.php')){ 
    115123           require_once ($path); 
  • trunk/testapp/modules/testapp/controllers/forms.classic.php

    r126 r127  
    5050      $tpl->assign('form', $form->getContainer()); 
    5151      $rep->body->assign('MAIN',$tpl->fetch('sampleform')); 
     52      $rep->body->assign('page_title','formulaires'); 
    5253 
    5354      return $rep; 
     
    7475      $tpl->assign('prenom', $datas['prenom']); 
    7576 
    76  
    77  
     77      $rep->body->assign('page_title','formulaires'); 
    7878      $rep->body->assign('MAIN',$tpl->fetch('sampleformresult')); 
    7979      return $rep; 
  • trunk/testapp/modules/testapp/controllers/main.classic.php

    r126 r127  
    1717      $rep = $this->getResponse('html'); 
    1818      $rep->title = 'Accueil de TestApp'; 
    19       $rep->body->assignZone('MAIN','sommaire'); 
     19      $rep->body->assign('page_title','Test App'); 
     20      $rep->body->assign('MAIN','<p>Bienvenue sur cette application de test</p>'); 
    2021      return $rep; 
    2122   } 
     
    2425 
    2526      if($this->param('output') == 'text'){ 
    26          $rep = $this->getResponse('text'); 
     27         $rep = $this->getResponse('text', true); 
    2728         $rep->content = 'Hello World !'; 
    2829      }else{ 
    29  
    30          $rep = $this->getResponse('html'); 
     30         $rep = $this->getResponse('html',true); 
    3131         $rep->title = 'Hello From Jelix !'; 
    3232         $rep->bodyTpl = 'testapp~hello'; 
     
    3838   } 
    3939 
     40   function hello2(){ 
     41 
     42      $rep = $this->getResponse('html',true); 
     43      $rep->title = 'Hello 2 From Jelix !'; 
     44      $rep->bodyTpl = 'testapp~hello2'; 
     45 
     46      return $rep; 
     47   } 
    4048 
    4149   function testdao(){ 
  • trunk/testapp/modules/testapp/templates/main.tpl

    r60 r127  
    1 <h1>Hello {$person|upper} !</h1> 
    2 <p>Ceci est une page HTML g�r�par {@jelix~jelix.framework.name@}</p> 
     1<div id="header"> 
     2{$page_title} 
     3</div> 
     4 
     5<div id="main"> 
    36{$MAIN} 
     7</div> 
     8 
     9<div id="sidemenu"> 
     10   {$menu} 
     11</div> 
     12 
     13<div id="footer"> 
     14page HTML g�r�par {@jelix~jelix.framework.name@} 
     15</div> 
  • trunk/testapp/modules/testapp/templates/sampleformresult.tpl

    r126 r127  
    77   <dd>{$prenom}</dd> 
    88</dl> 
     9<a href="{jurl ''}"></a> 
  • trunk/testapp/modules/testapp/templates/sommaire.tpl

    r126 r127  
    44   <li><a href="{jurl 'main_hello'}">Hello world en html</a></li> 
    55   <li><a href="{jurl 'main_hello', array('output'=>'text')}">Hello world en texte</a></li> 
     6   <li><a href="{jurl 'main_hello2'}">Template Hello world surcharg�a></li> 
    67   <li><a href="{jurl 'unittest~default_index'}">Tests unitaires</a></li> 
    78</ul> 
  • trunk/testapp/responses/myHtmlResponse.class.php

    r126 r127  
    1818 
    1919   public $bodyTpl = 'testapp~main'; 
    20    public $bodyErrorTpl = 'testapp~error'; 
    2120 
    2221   // modifications communes aux actions utilisant cette reponses 
    2322   protected function _commonProcess(){ 
    24        $this->title .= ($this->title !=''?' - ':'').' My Test App !'; 
     23       $this->title .= ($this->title !=''?' - ':'').' Test App'; 
    2524 
    26        $this->body->assignIfNone('person','you'); 
     25       $this->body->assignZone('menu','testapp~sommaire'); 
    2726       $this->body->assignIfNone('MAIN','<p>No content</p>'); 
     27       $this->body->assignIfNone('page_title','Test App'); 
     28       $this->addCSSLink('design/screen.css'); 
    2829   } 
    2930} 
  • trunk/testapp/responses/testUnitResponse.class.php

    r67 r127  
    1717 
    1818 
    19     public $bodyTpl = 'unittest~accueil'; 
     19    public $bodyTpl = 'testapp~main'; 
    2020 
    2121    protected function _commonProcess(){ 
    2222       $this->title .= ($this->title !=''?' - ':'').' Test unitaires'; 
    23        $this->addCSSLink('/unittest.css'); 
    24     } 
     23 
     24       $tpl = new jTpl(); 
     25       $this->body->assign('menu',$tpl->fetch('unittest~menu')); 
     26       $this->body->assignIfNone('MAIN','<p></p>'); 
     27       $this->body->assign('page_title', 'Test unitaires sur Jelix'); 
     28       $this->addCSSLink('design/screen.css'); 
     29   } 
     30 
    2531 
    2632 
  • trunk/testapp/var/themes/default/testapp/hello2.tpl

    r60 r127  
    1 <h1>Hello {$person|upper} !</h1> 
     1<h1>Hello world</h1> 
    22<p>Ceci est un template surcharg�/p> 
    33<p>Il s'agit d'un template situ�ans var/themes/testapp/, et qui 
    4 redefinit le template main.tpl du module testapp.</p> 
     4redefinit le template hello2.tpl du module testapp.</p> 
    55 
    6 {$MAIN} 
     6 
     7<p><a href="{jurl 'main_index'}">Retour au sommaire</a></p> 
Download in other formats: Unified Diff Zip Archive