Development

Changeset 2692

You must first sign up to be able to contribute.

Changeset 2692

Show
Ignore:
Timestamp:
11/15/06 22:03:55 (3 years ago)
Author:
fabien
Message:

implemented the new design for default pages in symfony (thanks justin)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/data/modules/default/actions/actions.class.php

    r1415 r2692  
    1919class defaultActions extends sfActions 
    2020{ 
     21  public function preExecute() 
     22  { 
     23    $this->setLayout(sfLoader::getTemplateDir('default', 'defaultLayout.php').'/defaultLayout'); 
     24    $this->getResponse()->addStylesheet('/sf/sf_default/css/screen.css', 'last'); 
     25  } 
     26 
     27  /** 
     28   * Congratulations page for creating an application 
     29   * 
     30   */ 
     31  public function executeIndex() 
     32  { 
     33  } 
     34 
     35  /** 
     36   * Congratulations page for creating a module 
     37   * 
     38   */ 
     39  public function executeModule() 
     40  { 
     41  } 
     42 
     43  /** 
     44   * Error page for page not found (404) error 
     45   * 
     46   */ 
     47  public function executeError404() 
     48  { 
     49  } 
     50 
     51  /** 
     52   * Warning page for restricted area - requires login 
     53   * 
     54   */ 
     55  public function executeSecure() 
     56  { 
     57  } 
     58 
     59  /** 
     60   * Warning page for restricted area - requires credentials 
     61   * 
     62   */ 
     63  public function executeLogin() 
     64  { 
     65  } 
     66 
     67  /** 
     68   * Website temporarily unavailable 
     69   * 
     70   */ 
    2171  public function executeUnavailable() 
    2272  { 
    2373  } 
    2474 
    25   public function executeIndex() 
    26   { 
    27   } 
    28  
    29   public function executeError404() 
    30   { 
    31   } 
    32  
    33   public function executeLogin() 
    34   { 
    35   } 
    36  
     75  /** 
     76   * Website disabled by the site administrator (in settings.yml) 
     77   * 
     78   */ 
    3779  public function executeDisabled() 
    3880  { 
    3981  } 
    40  
    41   public function executeSecure() 
    42   { 
    43   } 
    4482} 
  • trunk/data/modules/default/templates/disabledSuccess.php

    r500 r2692  
    1 <p>This module is unavailable.</p> 
     1<div class="sfTMessageContainer sfTAlert">  
     2  <?php echo image_tag('/sf/sf_default/images/icons/disabled48.png', array('alt' => 'module disabled', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?> 
     3  <div class="sfTMessageWrap"> 
     4    <h1>This Module is Unavailable</h1> 
     5    <h5>This module has been disabled by a site administrator.</h5> 
     6  </div> 
     7</div> 
     8<dl class="sfTMessageInfo"> 
     9 
     10  <dt>What's next</dt> 
     11  <dd> 
     12    <ul class="sfTIconList"> 
     13      <li class="sfTLinkMessage"><a href="javascript:history.go(-1)">Back to previous page</a></li> 
     14      <li class="sfTLinkMessage"><?php echo link_to('Go to Homepage', '@homepage') ?></li> 
     15    </ul> 
     16  </dd> 
     17</dl> 
  • trunk/data/modules/default/templates/error404Success.php

    r500 r2692  
    1 <h1>Oops! We couldn't find this page for you.</h1> 
     1<div class="sfTMessageContainer sfTAlert">  
     2  <?php echo image_tag('/sf/sf_default/images/icons/cancel48.png', array('alt' => 'page not found', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?> 
     3  <div class="sfTMessageWrap"> 
     4    <h1>Oops! Page Not Found</h1> 
     5    <h5>The server returned a 404 response.</h5> 
     6  </div> 
     7</div> 
     8<dl class="sfTMessageInfo"> 
     9  <dt>Did you type the URL?</dt> 
     10  <dd>You may have typed the address (URL) incorrectly. Check it to make sure you've got the exact right spelling, capitalization, etc.</dd> 
    211 
    3 <h2>Did you type the URL?</h2
    4 <p>You may have typed the address (URL) incorrectly. Check it to make sure you've got the exact right spelling, capitalization, etc.</p
     12  <dt>Did you follow a link from somewhere else at this site?</dt
     13  <dd>If you reached this page from another part of this site, please email us at <?php echo mail_to('[email]') ?> so we can correct our mistake.</dd
    514 
    6 <h2>Did you follow a link from somewhere else at this site?</h2
    7 <p>If you reached this page from another part of this site, please email us at [email] so we can correct our mistake.</p
     15  <dt>Did you follow a link from another site?</dt
     16  <dd>Links from other sites can sometimes be outdated or misspelled. Email us at <?php echo mail_to('[email]') ?> where you came from and we can try to contact the other site in order to fix the problem.</dd
    817 
    9 <h2>Did you follow a link from another site?</h2> 
    10 <p>Links from other sites can sometimes be outdated or misspelled. Email us at [email] where you came from and we can try to contact the other site in order to fix the problem.</p> 
    11 <br /> 
    12 <p> 
    13 <a href="javascript:history.go(-1)">Go back a page</a><br /> 
    14 <!-- <a href="#">Search the site</a><br /> --> 
    15 <a href="/">Visit the home page</a> 
    16 </p> 
    17 <br /> 
    18 <p><em>404 Error : page not found</em></p> 
     18  <dt>What's next</dt> 
     19  <dd> 
     20    <ul class="sfTIconList"> 
     21      <li class="sfTLinkMessage"><a href="javascript:history.go(-1)">Back to previous page</a></li> 
     22      <li class="sfTLinkMessage"><?php echo link_to('Go to Homepage', '@homepage') ?></li> 
     23    </ul> 
     24  </dd> 
     25</dl> 
  • trunk/data/modules/default/templates/indexSuccess.php

    r500 r2692  
    1 <h1>Congratulations!</h1> 
     1<div class="sfTMessageContainer sfTMessage">  
     2  <?php echo image_tag('/sf/sf_default/images/icons/ok48.png', array('alt' => 'ok', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?> 
     3  <div class="sfTMessageWrap"> 
     4    <h1>Symfony Project Created</h1> 
     5    <h5>Congratulations! You have successfully created your symfony project.</h5> 
     6  </div> 
     7</div> 
     8<dl class="sfTMessageInfo"> 
     9  <dt>Project setup successful</dt> 
     10  <dd>This project uses the symfony libraries. If you see no image in this page, you may need to configure your web server so that it gains access to the <code>symfony_data/web/sf/</code> directory.</dd> 
    211 
    3 <p>If you see this page, it means that the creation of your symfony project on this system was successful.</p> 
     12  <dt>This is a temporary page</dt> 
     13  <dd>This page is part of the symfony <code>default</code> module. It will disappear as soon as you define a <code>homepage</code> route in your <code>routing.yml</code>.</dd> 
    414 
    5 <p>You can now create your model and customize default templates.</p> 
    6  
    7 <hr /> 
    8  
    9 <p>&copy; 2004-2005 <?php echo link_to('symfony project', 'http://www.symfony-project.org/') ?></p> 
     15  <dt>What's next</dt> 
     16  <dd> 
     17    <ul class="sfTIconList"> 
     18      <li class="sfTDatabaseMessage">Create your data model</li> 
     19      <li class="sfTColorMessage">Customize the layout of the generated templates</li> 
     20      <li class="sfTLinkMessage"><?php echo link_to('Learn more from the online documentation', 'http://www.symfony-project.com/content/documentation.html') ?></li> 
     21    </ul> 
     22  </dd> 
     23</dl> 
  • trunk/data/modules/default/templates/loginSuccess.php

    r2047 r2692  
    1 <p>You must enter your credentials to access this page.</p> 
     1<div class="sfTMessageContainer sfTLock">  
     2  <?php echo image_tag('/sf/sf_default/images/icons/lock48.png', array('alt' => 'credentials required', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?> 
     3  <div class="sfTMessageWrap"> 
     4    <h1>Credentials Required</h1> 
     5    <h5>This page is in a restricted area.</h5> 
     6  </div> 
     7</div> 
     8<dl class="sfTMessageInfo"> 
     9  <dt>You do not have the proper credentials to access this page</dt> 
     10  <dd>Even though you are already logged in, this page requires special credentials that you currently don't have. </dd> 
     11 
     12  <dt>How to access this page</dt> 
     13  <dd>You must ask a site administrator to grant you some special credentials.</dd> 
     14 
     15  <dt>What's next</dt> 
     16  <dd> 
     17    <ul class="sfTIconList"> 
     18      <li class="sfTLinkMessage"><a href="javascript:history.go(-1)">Back to previous page</a></li> 
     19    </ul> 
     20  </dd> 
     21</dl> 
  • trunk/data/modules/default/templates/secureSuccess.php

    r500 r2692  
    1 <p>You cannot access this page.</p> 
     1<div class="sfTMessageContainer sfTLock">  
     2  <?php echo image_tag('/sf/sf_default/images/icons/lock48.png', array('alt' => 'login required', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?> 
     3  <div class="sfTMessageWrap"> 
     4    <h1>Login Required</h1> 
     5    <h5>This page is not public.</h5> 
     6  </div> 
     7</div> 
     8<dl class="sfTMessageInfo"> 
     9  <dt>How to access this page</dt> 
     10  <dd>You must proceed to the login page and enter your id and password.</dd> 
     11 
     12  <dt>What's Next</dt> 
     13  <dd> 
     14    <ul class="sfTIconList"> 
     15      <li class="sfTLinkMessage"><?php echo link_to('Proceed to login', sfConfig::get('sf_login_module').'/'.sfConfig::get('sf_login_action')) ?></li> 
     16      <li class="sfTLinkMessage"><a href="javascript:history.go(-1)">Back to previous page</a></li> 
     17    </ul> 
     18  </dd> 
     19</dl> 
  • trunk/data/modules/default/templates/unavailableSuccess.php

    r500 r2692  
    1 <p>This website is unavailable.</p> 
     1<div class="sfTMessageContainer sfTAlert">  
     2  <?php echo image_tag('/sf/sf_default/images/icons/tools48.png', array('alt' => 'website unavailable', 'class' => 'sfTMessageIcon', 'size' => '48x48')) ?> 
     3  <div class="sfTMessageWrap"> 
     4    <h1>Website Currently Unavailable</h1> 
     5    <h5>This website has been temporarily disabled. Please try again later.</h5> 
     6  </div> 
     7</div> 
  • trunk/data/skeleton/module/module/actions/actions.class.php

    r1814 r2692  
    1717  public function executeIndex() 
    1818  { 
     19    $this->forward('default', 'module'); 
    1920  } 
    2021} 
  • trunk/data/skeleton/module/module/templates/indexSuccess.php

    r500 r2692  
    1 <h1>Module ##MODULE_NAME##</h1> 
    2  
    3 <p>Congratulations!</p> 
  • trunk/data/skeleton/module/test/actionsTest.php

    r2275 r2692  
    1212  isRequestParameter('module', '##MODULE_NAME##')-> 
    1313  isRequestParameter('action', 'index')-> 
    14   checkResponseElement('body', '/##MODULE_NAME##/') 
     14  checkResponseElement('body', '!/This is a temporary page/') 
    1515; 
  • trunk/lib/exception/sfException.class.php

    r2664 r2692  
    105105    if (!sfConfig::get('sf_debug')) 
    106106    { 
     107      error_log($exception->getMessage()); 
     108 
    107109      $file = sfConfig::get('sf_web_dir').'/error500.html'; 
    108       error_log($exception->getMessage()); 
    109       if (is_readable($file)) 
    110       { 
    111         include($file); 
    112       } 
    113       else 
    114       { 
    115         echo 'internal server error'; 
    116       } 
     110      include(is_readable($file) ? $file : sfConfig::get('sf_symfony_data_dir').'/web/error500.php'); 
    117111 
    118112      if (!sfConfig::get('sf_test')) 
  • trunk/lib/util/sfCore.class.php

    r2369 r2692  
    9393    { 
    9494      // application is not available 
    95       include(sfConfig::get('sf_web_dir').'/unavailable.html'); 
     95      $file = sfConfig::get('sf_web_dir').'/unavailable.html'; 
     96      include(is_readable($file) ? $file : sfConfig::get('sf_symfony_data_dir').'/web/unavailable.php'); 
     97 
    9698      die(1); 
    9799    } 
  • trunk/test/functional/genericTest.php

    r2277 r2692  
    6565  get('/configSecurityIsSecure')-> 
    6666  isStatusCode(200)-> 
    67   checkResponseElement('body', '/You must enter your credentials to access this page/i')-> 
     67  checkResponseElement('body', '/Credentials Required/i')-> 
    6868  checkResponseElement('body', 1) // check that there is no double output caused by the forwarding in a filter 
    6969; 
  • trunk/test/other/fixtures/test/functional/result-harness.txt

    r2275 r2692  
    11articleInitCrudActionsTest...........................................ok 
    2 fooActionsTest.......................................................ok 
    3 All tests successful. 
    4 Files=2, Tests=8 
     2fooActionsTest.......................................................not ok 
     3    Failed tests: 4 
     4Failed Test                     Stat  Total   Fail  List of Failed 
     5------------------------------------------------------------------ 
     6fooActionsTest                     0      1      1  4 
     7Failed 1/2 test scripts, 50.00% okay. 1/8 subtests failed, 87.50% okay. 
  • trunk/test/other/fixtures/test/functional/result.txt

    r2275 r2692  
    33ok 2 - request parameter module is articleInitCrud 
    44ok 3 - request parameter action is index 
    5 ok 4 - response selector body matches regex /articleInitCrud
     5ok 4 - response selector body does not match regex /This is a temporary page
    661..4 
  • trunk/test/other/fixtures/test/result-harness.txt

    r2275 r2692  
    11functional/frontend/articleInitCrudActionsTest.......................ok 
    2 functional/frontend/fooActionsTest...................................ok 
     2functional/frontend/fooActionsTest...................................not ok 
     3    Failed tests: 4 
    34unit/testTest........................................................ok 
    4 All tests successful. 
    5 Files=3, Tests=9 
     5Failed Test                     Stat  Total   Fail  List of Failed 
     6------------------------------------------------------------------ 
     7tional/frontend/fooActionsTest     0      1      1  4 
     8Failed 1/3 test scripts, 66.67% okay. 1/9 subtests failed, 88.89% okay. 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.