CVS update: /cowiki/htdocs/setup/class/task/
[email protected] 24 Apr 2005 03:47:37 -0000
| Newsgroups | gmane.comp.php.cowiki.cvs |
|---|---|
| Message-ID | <[email protected]> |
User: dgorski Date: 2005/04/23 20:47:37 Modified: cowiki/htdocs/setup/class/task/class.TaskMigrator.php Log: Display pending migrator/update tasks File Changes: Directory: /cowiki/htdocs/setup/class/task/ =========================================== File [changed]: class.TaskMigrator.php Url: http://cowiki.tigris.org/source/browse/cowiki/htdocs/setup/class/task/class.TaskMigrator.php?r1=1.1&r2=1.2 Delta lines: +34 -4 -------------------- --- class.TaskMigrator.php 21 Apr 2005 00:17:14 -0000 1.1 +++ class.TaskMigrator.php 24 Apr 2005 03:47:35 -0000 1.2 @@ -2,7 +2,7 @@ /** * - * $Id: class.TaskMigrator.php,v 1.1 2005/04/21 00:17:14 dgorski Exp $ + * $Id: class.TaskMigrator.php,v 1.2 2005/04/24 03:47:35 dgorski Exp $ * * This file is part of coWiki. coWiki is free software under the terms of * the GNU General Public License (GPL). Read the LICENSE file. If you did @@ -17,7 +17,7 @@ * @author Daniel T. Gorski, <[email protected]> * @copyright (C) Daniel T. Gorski, {@link http://www.develnet.org} * @license http://www.gnu.org/licenses/gpl.html - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * */ @@ -77,7 +77,22 @@ // ---------------------------------------------------------------- - $nCount = sizeof($aMig); + // Count pending tasks + $nCount = 0; + + foreach ($aMig as $k => $v) { + + try { + // Instantiate migrator class + $Mig = new $v($this->State); + + // Get description(s) count + $nCount += sizeof($Mig->getDescription()); + + } catch (MigratorException $me) { + $this->addError($me->getExceptionMessage()); + } + } $sStr = '<table width="100%" cellpadding="0" cellspacing="0"'; $sStr .= ' border="0">'; @@ -117,13 +132,15 @@ if (is_string($mDesc)) { $sStr .= '<li>'; - $sStr .= $Mig->getDescription() . '<br/>'; + $sStr .= $this->getMigrationDate($k); + $sStr .= $mDesc . '<br/>'; $sStr .= '</li>'; } if (is_array($mDesc)) { foreach ($mDesc as $sDesc) { $sStr .= '<li>'; + $sStr .= $this->getMigrationDate($k); $sStr .= $sDesc . '<br/>'; $sStr .= '</li>'; } @@ -206,6 +223,19 @@ ksort($aMig); return $aMig; + } + + // -------------------------------------------------------------------- + + private function getMigrationDate($sDate) { + if ($sDate == '0') { + return ''; + } + + return strftime( + '%B %d, %Y', + strtotime(str_replace('_', '-', $sDate)) + ) . ': '; } } // of class