Update of /cvsroot/php-blog/serendipity/include/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15167
Modified Files:
upgrader.inc.php
Log Message:
- Correctly announce we are calling a class function
- Always use arrays as arguments, so we don't need call_user_func
- Use CSS class 'serendipityAdminMsgSuccess' when upgrade is done
Index: upgrader.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/upgrader.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- upgrader.inc.php 16 Dec 2004 15:45:31 -0000 1.7
+++ upgrader.inc.php 16 Dec 2004 17:03:52 -0000 1.8
@@ -89,13 +89,13 @@
array('version' => '0.8-alpha3',
'function' => 'serendipity_removeFiles',
'title' => 'Removal of obsolete files',
- 'arguments' => $obsolete_files,
+ 'arguments' => array($obsolete_files),
'desc' => 'The directory structure has been reworked. The following files will be moved to a folder called "backup". If you made manual changes to those files, be sure to read the file docs/CHANGED_FILES to re-implement your changes.<br /><div style="font-size: x-small; margin: 15px">' . implode(', ', $obsolete_files) . '</div>'),
array('version' => '0.8-alpha4',
'function' => 'serendipity_removeFiles',
'title' => 'Removal of serendipity_entries.php',
- 'arguments' => array('serendipity_entries.php'),
+ 'arguments' => array(array('serendipity_entries.php')),
'desc' => 'In order to implement the new administration, we have to remove the leftovers'),
array('version' => '0.8-alpha4',
@@ -111,7 +111,6 @@
array('version' => '0.8-alpha8',
'function' => array('serendipity_plugin_api', 'create_plugin_instance'),
'arguments' => array('serendipity_event_browsercompatibility', null, 'event'),
- 'arg_array' => true,
'title' => 'Plugin for Browser Compatibility',
'desc' => 'Includes some CSS-behaviours and other functions to maximize browser compatibility'),
);
@@ -165,15 +164,12 @@
foreach ($tasks as $task) {
if (version_compare(serendipity_version($serendipity['versionInstalled']), $task['version'], '<') ) {
if (is_callable($task['function'])) {
- echo 'Calling ' . $task['function'] . '...<br />';
+ echo sprintf('Calling %s ...<br />', (is_array($task['function']) ? $task['function'][0] . '::'. $task['function'][1] : $task['function']));;
+
if (empty($task['arguments'])) {
call_user_func($task['function']);
} else {
- if ($task['arg_array']) {
- call_user_func_array($task['function'], $task['arguments']);
- } else {
- call_user_func($task['function'], $task['arguments']);
- }
+ call_user_func_array($task['function'], $task['arguments']);
}
} else {
$errors[] = 'Unable to call '. $task['function'];
@@ -208,10 +204,10 @@
if ($serendipity['GET']['action'] == 'ignore') {
echo SERENDIPITY_UPGRADER_YOU_HAVE_IGNORED;
} elseif ($serendipity['GET']['action'] == 'upgrade') {
- printf(SERENDIPITY_UPGRADER_NOW_UPGRADED, $serendipity['version']);
+ printf('<div class="serendipityAdminMsgSuccess">'. SERENDIPITY_UPGRADER_NOW_UPGRADED .'</div>', $serendipity['version']);
}
echo '<br />';
- printf(SERENDIPITY_UPGRADER_RETURN_HERE, '<a href="'. $serendipity['serendipityHTTPPath'] .'">', '</a>');
+ printf('<div align="center">'. SERENDIPITY_UPGRADER_RETURN_HERE .'</div>', '<a href="'. $serendipity['serendipityHTTPPath'] .'">', '</a>');
$_SESSION['serendipityAuthedUser'] = false;
@session_destroy();
} else {
|