Skip to content

Commit

Permalink
Update update folder related to former Qf, PEAR and Smarty update
Browse files Browse the repository at this point in the history
  • Loading branch information
olafgleba committed Jun 16, 2012
1 parent 974cf49 commit 15457c0
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 102 deletions.
30 changes: 13 additions & 17 deletions welcompose/update/license.php
Expand Up @@ -60,32 +60,28 @@

// apply filters to all fields
$FORM->addRecursiveFilter('trim');


// checkbox for confirm_license
$FORM->addElement('checkbox', 'confirm_license', gettext('Confirm license'), null,
array('id' => 'license_confirm_license', 'class' => 'chbx'));

$FORM->addRule('confirm_license', gettext('Please confirm the license'), 'required');
$FORM->addRule('confirm_license', gettext('The field to confirm the license accepts only 0 or 1'),
'regex', WCOM_REGEX_ZERO_OR_ONE);

$confirm_license = $FORM->addElement('checkbox', 'confirm_license',
array('id' => 'license_confirm_license', 'class' => 'chbx'),
array('label' => gettext('Confirm license'))
);
$confirm_license->addRule('required', gettext('Please confirm the license'));
$confirm_license->addRule('regex', gettext('Field license must be valued by 0 or 1'), WCOM_REGEX_ZERO_OR_ONE);
// submit button
$FORM->addElement('submit', 'submit', gettext('Go to next step'),
array('class' => 'submit240nomargin'));
$submit = $FORM->addElement('submit', 'submit',
array('class' => 'submit240nomargin', 'value' => gettext('Next step'))
);

// validate it
if (!$FORM->validate()) {
// render it
$renderer = $BASE->utility->loadQuickFormSmartyRenderer();
$quickform_tpl_path = dirname(__FILE__).'/quickform.tpl.php';
include(Base_Compat::fixDirectorySeparator($quickform_tpl_path));

// remove attribute on form tag for XHTML compliance
$FORM->removeAttribute('name');
$FORM->removeAttribute('target');

$FORM->accept($renderer);
// fetch {function} template to set
// required/error markup on each form fields
$BASE->utility->smarty->fetch(dirname(__FILE__).'/quickform.tpl');

// assign the form to smarty
$BASE->utility->smarty->assign('form', $FORM->render($renderer)->toArray());
Expand Down
3 changes: 3 additions & 0 deletions welcompose/update/parse/parse.help.php
Expand Up @@ -58,6 +58,9 @@
// get page name
$page = Base_Cnc::filterRequest($_REQUEST['page'], WCOM_REGEX_HELP);

// set header
header("Content-Type: text/html; charset=utf-8");

// display the correlated navigation template
$BASE->utility->smarty->display('help/'.$page.'.html');

Expand Down
8 changes: 4 additions & 4 deletions welcompose/update/parse/parse.js.php
Expand Up @@ -56,14 +56,14 @@
gettextInitSoftware($BASE->_conf['locales']['all']);

// delimiters for js files
$BASE->utility->smarty->left_delimiter = '<%';
$BASE->utility->smarty->right_delimiter = '%>';
$BASE->utility->smarty->left_delimiter = '%=';
$BASE->utility->smarty->right_delimiter = '=%';

// set new tpl dir
$BASE->utility->smarty->template_dir = dirname(__FILE__).'/../static/libs';
$BASE->utility->smarty->setTemplateDir(dirname(__FILE__).'/../static/libs');

// set header
header("Content-Type: text/javascript");
header("Content-Type: text/javascript; charset=utf-8");

// fetch javascript
if (!is_null(Base_Cnc::filterRequest($_REQUEST['file'], WCOM_REGEX_UPDATE_JS))) {
Expand Down
11 changes: 11 additions & 0 deletions welcompose/update/quickform.tpl
@@ -0,0 +1,11 @@
{function name=qt}
{strip}
{if $el["required"]}
{if $el["error"]}
<span class="req">*</span>
{else}
<span>*</span>
{/if}
{/if}
{/strip}
{/function}
28 changes: 0 additions & 28 deletions welcompose/update/quickform.tpl.php

This file was deleted.

16 changes: 10 additions & 6 deletions welcompose/update/smarty.inc.php
Expand Up @@ -41,17 +41,21 @@
// configure i18n
require(SMARTY_DIR.DIRECTORY_SEPARATOR.'gettext_plugin'.DIRECTORY_SEPARATOR.'Smarty_GettextHelper.class.php');
require(SMARTY_DIR.DIRECTORY_SEPARATOR.'gettext_plugin'.DIRECTORY_SEPARATOR.'compiler.i18n.php');
$smarty->register_compiler_function('i18n', 'smarty_compiler_i18n');
$smarty->registerPlugin('compiler', 'i18n', 'smarty_compiler_i18n');

// configure smarty
$smarty->debug = false;
$smarty->template_dir = SMARTY_TPL_DIR.DIRECTORY_SEPARATOR.'templates';
$smarty->compile_dir = SMARTY_TPL_DIR.DIRECTORY_SEPARATOR.'compiled';
$smarty->cache_dir = SMARTY_TPL_DIR.DIRECTORY_SEPARATOR.'cache';
$smarty->plugins_dir = array(
$smarty->debugging = false;
$smarty->auto_literal = false;
$smarty->muteExpectedErrors();

$smarty->setTemplateDir(SMARTY_TPL_DIR.DIRECTORY_SEPARATOR.'templates');
$smarty->setCompileDir(SMARTY_TPL_DIR.DIRECTORY_SEPARATOR.'compiled');
$smarty->setCacheDir(SMARTY_TPL_DIR.DIRECTORY_SEPARATOR.'cache');
$smarty->setPluginsDir(array(
SMARTY_DIR.DIRECTORY_SEPARATOR.'my_plugins',
SMARTY_DIR.DIRECTORY_SEPARATOR.'plugins',
SMARTY_DIR.DIRECTORY_SEPARATOR.'software_plugins'
)
);

?>
16 changes: 8 additions & 8 deletions welcompose/update/smarty/templates/backup.html
Expand Up @@ -4,13 +4,13 @@
<title>{i18n 'Welcompose Update'}</title>
<link rel="stylesheet" type="text/css" href="static/styles/wcom.update.css" media="screen, projection" />

<script type="text/javascript" src="static/libs/thirdparty/prototype.js"></script>
<script type="text/javascript" src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="static/libs/thirdparty/behaviours.js"></script>
<script type="text/javascript" src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.core.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.helper.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.events.js"></script></head>
<script src="static/libs/thirdparty/prototype.js"></script>
<script src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script src="static/libs/thirdparty/behaviours.js"></script>
<script src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script src="static/libs/wcom.update.core.js"></script>
<script src="static/libs/wcom.update.helper.js"></script>
<script src="static/libs/wcom.update.events.js"></script></head>

<body>
<div id="container">
Expand All @@ -29,7 +29,7 @@

<h1>{i18n 'Backup'}</h1>

<p>{i18n 'Before continuing the update process, we <strong>strongly</strong> recommend to perform a <strong>backup of your database</strong>. This can be easily done with third-party applications like phpMyAdmin. If you don't know how to perform a backup, the upgrading guide in the Welcompose manual will help you'}.</p>
<p>{i18n 'Before continuing the update process, we <strong>strongly</strong> recommend to perform a <strong>backup of your database</strong>. This can be easily done with third-party applications like phpMyAdmin. If you don\'t know how to perform a backup, the upgrading guide in the Welcompose manual will help you'}.</p>

<p>{i18n 'Second, we recommend to take a <strong>copy of the whole Welcompose installation</strong>. That may help you doing restores if something goes wrong during the update process (like a server crash)'}.</p>

Expand Down
17 changes: 8 additions & 9 deletions welcompose/update/smarty/templates/database.html
Expand Up @@ -4,14 +4,13 @@
<title>{i18n 'Welcompose Update'}</title>
<link rel="stylesheet" type="text/css" href="static/styles/wcom.update.css" media="screen, projection" />

<script type="text/javascript" src="static/libs/thirdparty/prototype.js"></script>
<script type="text/javascript" src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="static/libs/thirdparty/behaviours.js"></script>
<script type="text/javascript" src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.core.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.helper.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.events.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.updater.js"></script></head>
<script src="static/libs/thirdparty/prototype.js"></script>
<script src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script src="static/libs/thirdparty/behaviours.js"></script>
<script src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script src="static/libs/wcom.update.core.js"></script>
<script src="static/libs/wcom.update.helper.js"></script>
<script src="static/libs/wcom.update.events.js"></script>

<body>
<div id="container">
Expand All @@ -30,7 +29,7 @@

<h1>{i18n 'Database'}</h1>

<p>{i18n 'Now, it's time to update your database structure. The update script has determined which modifications have to be done. As soon as you press on <em>Start</em>, the database update process will begin. Please note that the update scripts may ask you some questions. Answer them to complete the update process'}.</p>
<p>{i18n 'Now, it\'s time to update your database structure. The update script has determined which modifications have to be done. As soon as you press on <em>Start</em>, the database update process will begin. Please note that the update scripts may ask you some questions. Answer them to complete the update process'}.</p>


<form class="botbg">
Expand Down
16 changes: 8 additions & 8 deletions welcompose/update/smarty/templates/finish.html
Expand Up @@ -4,13 +4,13 @@
<title>{i18n 'Welcompose Update'}</title>
<link rel="stylesheet" type="text/css" href="static/styles/wcom.update.css" media="screen, projection" />

<script type="text/javascript" src="static/libs/thirdparty/prototype.js"></script>
<script type="text/javascript" src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="static/libs/thirdparty/behaviours.js"></script>
<script type="text/javascript" src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.core.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.helper.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.events.js"></script></head>
<script src="static/libs/thirdparty/prototype.js"></script>
<script src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script src="static/libs/thirdparty/behaviours.js"></script>
<script src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script src="static/libs/wcom.update.core.js"></script>
<script src="static/libs/wcom.update.helper.js"></script>
<script src="static/libs/wcom.update.events.js"></script>

<body>
<div id="container">
Expand All @@ -31,7 +31,7 @@ <h1>{i18n 'Update finished'}</h1>

<p>{i18n 'You have successfully performed the Welcompose update. Now you can go back to the admin area and start using our improved software'}.</p>

<p>{i18n 'As the update procedure isn't fully automated yet, <strong>you are strongly advised to delete the entire update directory from your webspace</strong>'}.</p>
<p>{i18n 'As the update procedure isn\'t fully automated yet, <strong>you are strongly advised to delete the entire update directory from your webspace</strong>'}.</p>

<div class="linkconbackup">
<a href="../admin/" class="submit240">{i18n 'Take me to the admin area'}</a>
Expand Down
14 changes: 7 additions & 7 deletions welcompose/update/smarty/templates/license.html
Expand Up @@ -4,13 +4,13 @@
<title>{i18n 'Welcompose Update'}</title>
<link rel="stylesheet" type="text/css" href="static/styles/wcom.update.css" media="screen, projection" />

<script type="text/javascript" src="static/libs/thirdparty/prototype.js"></script>
<script type="text/javascript" src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="static/libs/thirdparty/behaviours.js"></script>
<script type="text/javascript" src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.core.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.helper.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.events.js"></script>
<script src="static/libs/thirdparty/prototype.js"></script>
<script src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script src="static/libs/thirdparty/behaviours.js"></script>
<script src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script src="static/libs/wcom.update.core.js"></script>
<script src="static/libs/wcom.update.helper.js"></script>
<script src="static/libs/wcom.update.events.js"></script>
</head>

<body>
Expand Down
20 changes: 10 additions & 10 deletions welcompose/update/smarty/templates/requirements.html
Expand Up @@ -4,13 +4,13 @@
<title>{i18n 'Welcompose Update'}</title>
<link rel="stylesheet" type="text/css" href="static/styles/wcom.update.css" media="screen, projection" />

<script type="text/javascript" src="static/libs/thirdparty/prototype.js"></script>
<script type="text/javascript" src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="static/libs/thirdparty/behaviours.js"></script>
<script type="text/javascript" src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.core.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.helper.js"></script>
<script type="text/javascript" src="static/libs/wcom.update.events.js"></script></head>
<script src="static/libs/thirdparty/prototype.js"></script>
<script src="static/libs/thirdparty/scriptaculous.js?load=effects"></script>
<script src="static/libs/thirdparty/behaviours.js"></script>
<script src="parse/parse.js.php?file=wcom.update.strings.js"></script>
<script src="static/libs/wcom.update.core.js"></script>
<script src="static/libs/wcom.update.helper.js"></script>
<script src="static/libs/wcom.update.events.js"></script>

<body>
<div id="container">
Expand Down Expand Up @@ -74,15 +74,15 @@ <h2>{i18n 'Checking for up-to-date versions'}</h2>
<table>
<tr>
<td class="status_indicator marker_error">{i18n 'Red'}</td>
<td class="status_indicator_text">{i18n 'Welcompose won't work'}</td>
<td class="status_indicator_text">{i18n 'Welcompose won\'t work'}</td>
</tr>
<tr>
<td class="status_indicator marker_warning">{i18n 'Orange'}</td>
<td class="status_indicator_text">{i18n 'Welcompose may work -- don't blame us for errors'}</td>
<td class="status_indicator_text">{i18n 'Welcompose may work -- don\'t blame us for errors'}</td>
</tr>
<tr>
<td class="status_indicator marker_fine">{i18n 'Green'}</td>
<td class="status_indicator_text">{i18n 'Everything's fine'}</td>
<td class="status_indicator_text">{i18n 'Everything\'s fine'}</td>
</tr>
</table>

Expand Down
10 changes: 5 additions & 5 deletions welcompose/update/static/libs/wcom.update.strings.js
Expand Up @@ -24,13 +24,13 @@
/**
* debug output strings (used with debug state 2)
*/
var e_msg_str_prefix = '<%i18n An javascript error occured: %>';
var e_msg_str_suffix = '<%i18n If the error remains, please get in touch with our support.%>';
var e_msg_str_prefix = '=%i18n An javascript error occured: %=';
var e_msg_str_suffix = '=%i18n If the error remains, please get in touch with our support.%=';

/**
* used in func getHelp(), removeHelp()
*/
var hideHelp = '<%i18n Hide help on this topic%>';
var showHelp = '<%i18n Show help on this topic%>';
var hideHelp = '<%i18n Hide help on this topic%=';
var showHelp = '<%i18n Show help on this topic%=';

var alertOnMissingHelpFiles = '<%i18n There is currently no help available.%>';
var alertOnMissingHelpFiles = '=%i18n There is currently no help available.%=';

0 comments on commit 15457c0

Please sign in to comment.