Changeset 5571


Ignore:
Timestamp:
Apr 2, 2010, 3:05:53 PM (10 years ago)
Author:
plg
Message:

Improve the install confirmation page: dedicated button to download the
database.inc.php file.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/themes/default/template/install.tpl

    r5408 r5571  
    9292  color: #ff3363;
    9393}
     94
     95.config_creation_failed {
     96  text-align:left;
     97  border:3px solid #F20D00;
     98  color:#999;
     99  margin:20px;
     100  padding:0px 20px 5px 20px;
     101  background-image:url(admin/themes/default/icon/errors.png);
     102  background-repeat:no-repeat;
     103}
    94104</style>
    95105{/literal}
     
    104114
    105115<h2>Piwigo {$RELEASE} - {'Installation'|@translate}</h2>
     116
     117{if isset($config_creation_failed)}
     118<div class="config_creation_failed">
     119  <p style="margin-left:30px;">
     120    <strong>{'Creation of config file local/config/database.inc.php failed.'|@translate}</strong>
     121  </p>
     122  <ul>
     123    <li>
     124      <p>{'You can download the config file and upload it to local/config directory of your installation.'|@translate}</p>
     125      <p style="text-align:center">
     126          <input type="button" value="{'Download the config file'|@translate}" onClick="window.open('{$config_url}');">
     127      </p>
     128    </li>
     129    <li>
     130      <p>{'An alternate solution is to copy the text in the box above and paste it into the file "local/config/database.inc.php" (Warning : database.inc.php must only contain what is in the textarea, no line return or space character)'|@translate}</p>
     131      <textarea rows="15" cols="70">{$config_file_content}</textarea>
     132    </li>
     133  </ul>
     134</div>
     135{/if}
    106136
    107137{if isset($errors)}
  • trunk/install.php

    r5452 r5571  
    336336      @fclose($fh);
    337337
    338       $error_copy = l10n('Creation of config file local/config/database.inc.php failed.');
    339       $error_copy .= sprintf('<br><a href="install.php?dl=%s">%s</a> %s',
    340                              $tmp_filename,
    341                              l10n('You can download the config file'),
    342                              l10n('and upload it to local/config directory of your installation.')
     338      $template->assign(
     339        array(
     340          'config_creation_failed' => true,
     341          'config_url' => 'install.php?dl='.$tmp_filename,
     342          'config_file_content' => $file_content,
     343          )
    343344        );
    344 
    345       $error_copy .= '<br><br>';
    346       $error_copy .= l10n('An alternate solution is to copy the text in the box above and paste it into the file "local/config/database.inc.php" (Warning : database.inc.php must only contain what is in the textarea, no line return or space character)');
    347       $error_copy .= '<br><br>';
    348       $error_copy .= '<textarea rows="15" cols="70">' . $file_content . '</textarea>';
    349345    }
    350346    @fputs($fp, $file_content, strlen($file_content));
     
    444440    $html_content = htmlentities( $file_content, ENT_QUOTES );
    445441    $html_content = nl2br( $html_content );
    446     $error_copy = l10n('Copy the text in pink between hyphens and paste it into the file "local/config/database.inc.php"(Warning : database.inc.php must only contain what is in pink, no line return or space character)');
    447     $error_copy .= '<br>--------------------------------------------------------------------<br>';
    448     $error_copy .= '<span class="sql_content">' . $html_content . '</span>';
    449     $error_copy .= '<br>--------------------------------------------------------------------<br>';
     442   
     443    $error_copy = l10n('An alternate solution is to copy the text in the box above and paste it into the file "local/config/database.inc.php" (Warning : database.inc.php must only contain what is in the textarea, no line return or space character)');
     444    $error_copy .= '<br><br>';
     445    $error_copy .= '<textarea rows="15" cols="70">'.$html_content.'</textarea>';
    450446  }
    451447  else
     
    463459      'T_CONTENT_ENCODING' => 'utf-8',
    464460      'migration' => true
    465           ));
     461      )
     462    );
    466463}
    467464else
Note: See TracChangeset for help on using the changeset viewer.