cvs: pear /PEAR_PackageFileManager_Frontend_Web/Frontend/Web ReplacementsPage.php
| From: | Laurent Laville | Date: | Mon, 21 Aug 2006 16:32:23 +0000 |
| Subject: | cvs: pear /PEAR_PackageFileManager_Frontend_Web/Frontend/Web ReplacementsPage.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-41796@lists.php.net to get a copy of this message | ||
farell Mon Aug 21 16:32:23 2006 UTC
Modified files:
/pear/PEAR_PackageFileManager_Frontend_Web/Frontend/Web
ReplacementsPage.php
Log:
add support for converting line ending task; <tasks:windowseol>, <tasks:unixeol> tags
on replacements page.
http://cvs.php.net/viewvc.cgi/pear/PEAR_PackageFileManager_Frontend_Web/Frontend/Web/ReplacementsPage.php?r1=1.7&r2=1.8&diff_format=u
Index: pear/PEAR_PackageFileManager_Frontend_Web/Frontend/Web/ReplacementsPage.php
diff -u pear/PEAR_PackageFileManager_Frontend_Web/Frontend/Web/ReplacementsPage.php:1.7
pear/PEAR_PackageFileManager_Frontend_Web/Frontend/Web/ReplacementsPage.php:1.8
--- pear/PEAR_PackageFileManager_Frontend_Web/Frontend/Web/ReplacementsPage.php:1.7 Sat Aug 19
09:51:39 2006
+++ pear/PEAR_PackageFileManager_Frontend_Web/Frontend/Web/ReplacementsPage.php Mon Aug 21 16:32:23
2006
@@ -12,7 +12,7 @@
* @author Laurent Laville <pear@laurent-laville.org>
* @copyright 2005-2006 Laurent Laville
* @license http://www.php.net/license/3_01.txt PHP License 3.01
- * @version CVS: $Id: ReplacementsPage.php,v 1.7 2006/08/19 09:51:39 farell Exp $
+ * @version CVS: $Id: ReplacementsPage.php,v 1.8 2006/08/21 16:32:23 farell Exp $
* @since File available since Release 0.1.0
*/
@@ -199,6 +199,11 @@
$platform = array_combine($platform, $platform);
$this->addElement('select', 'platform_exception', 'Platform
exception:', $platform);
+ // we need a simple select box for platform end-of-line
+ $eol = array('', 'windows', 'unix');
+ $eol = array_combine($eol, $eol);
+ $this->addElement('select', 'eol_exception', 'Line
ending:', $eol);
+
if ($selection_count == 0) {
$key1 = -1;
$def = array();
@@ -245,7 +250,8 @@
'replace_file' => $keys,
'replace_from' => $item['from'],
'replace_type' => array($item['type'],
$item['to']),
- 'platform_exception' =>
$sess['files'][$key1]['platform']
+ 'platform_exception' =>
$sess['files'][$key1]['platform'],
+ 'eol_exception' =>
$sess['files'][$key1]['eol']
);
}
@@ -390,7 +396,7 @@
case 'new':
case 'save':
$data = $page->exportValues(array(
-
'replace_file','replace_from','replace_type','platform_exception')
+
'replace_file','replace_from','replace_type','platform_exception','eol_exception')
);
$keys = $data['replace_file'];
@@ -407,13 +413,17 @@
} else {
$rid = $sess['values'][$pageName]['replaceid'];
}
- $sess['files'][$k]['replacements'][$rid] = array(
- 'from' => $data['replace_from'],
- 'type' => $data['replace_type'][0],
- 'to' => $data['replace_type'][1]
- );
+ if ($rid > 0) {
+ $sess['files'][$k]['replacements'][$rid] = array(
+ 'from' => $data['replace_from'],
+ 'type' => $data['replace_type'][0],
+ 'to' => $data['replace_type'][1]
+ );
+ }
$sess['files'][$k]['platform'] =
empty($data['platform_exception'])
? false : $data['platform_exception'];
+ $sess['files'][$k]['eol'] =
empty($data['eol_exception'])
+ ? false : $data['eol_exception'];
$fe->log('info',
str_pad($pageName .'('. __LINE__ .')', 20,
'.') .
' add replacement: "'.
$types[$data['replace_type'][0]] .