packages: phorum/translate-macros.patch - done file related macros
glen
glen at pld-linux.org
Thu Oct 21 23:51:17 CEST 2010
Author: glen Date: Thu Oct 21 21:51:17 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- done file related macros
---- Files affected:
packages/phorum:
translate-macros.patch (1.1 -> 1.2)
---- Diffs:
================================================================
Index: packages/phorum/translate-macros.patch
diff -u packages/phorum/translate-macros.patch:1.1 packages/phorum/translate-macros.patch:1.2
--- packages/phorum/translate-macros.patch:1.1 Thu Oct 21 23:38:39 2010
+++ packages/phorum/translate-macros.patch Thu Oct 21 23:51:12 2010
@@ -1,15 +1,28 @@
add new macros, to avoid using language constructs in translations.
- $PHORUM['file_space_quota'] -> %file_space_quota%
+- str_replace(";", ", ", $PHORUM['file_types']) -> %file_types%
+- $PHORUM['max_file_size'] -> %max_file_size%
still todo:
- $PHORUM[title] -> %phorum_title%
-- $PHORUM['max_file_size'] -> %max_file_size%
- phorum_get_url(PHORUM_LOGIN_URL) -> %login_url%
---- ../BUILD/phorum-5.2.15a/include/api/file.php 2010-10-22 00:35:13.428590924 +0300
-+++ /usr/share/phorum/include/api/file.php 2010-10-22 00:34:39.120486837 +0300
-@@ -212,9 +212,10 @@
+--- phorum-5.2.15a/include/api/file.php 2010-10-22 00:35:13.428590924 +0300
++++ phorum-5.2.15a/include/api/file.php 2010-10-22 00:46:32.460815378 +0300
+@@ -201,9 +201,10 @@
+ // Check if the file doesn't exceed the maximum allowed file size.
+ if (isset($file["filesize"]) && $PHORUM["max_file_size"] > 0 &&
+ $file["filesize"] > $PHORUM["max_file_size"]*1024) {
++ $msg = str_replace("%max_file_size%", $PHORUM['max_file_size'], $PHORUM["DATA"]["LANG"]["FileTooLarge"]);
+ return phorum_api_error_set(
+ PHORUM_ERRNO_NOACCESS,
+- $PHORUM["DATA"]["LANG"]["FileTooLarge"]
++ $msg
+ );
+ }
+
+@@ -212,9 +213,10 @@
$sz = phorum_db_get_user_filesize_total($PHORUM["user"]["user_id"]);
$sz += $file["filesize"];
if ($sz > $PHORUM["file_space_quota"]*1024) {
@@ -21,3 +34,30 @@
);
}
}
+@@ -236,9 +238,10 @@
+
+ // Check if the extension for the file is an allowed extension.
+ if (!in_array($ext, $allowed_exts)) {
++ $msg = str_replace('%file_types%', str_replace(";", ", ", $PHORUM['file_types']), $PHORUM["DATA"]["LANG"]["FileWrongType"]);
+ return phorum_api_error_set(
+ PHORUM_ERRNO_NOACCESS,
+- $PHORUM["DATA"]["LANG"]["FileWrongType"]
++ $msg
+ );
+ }
+ }
+--- phorum-5.2.15a/include/controlcenter/files.php 2010-10-22 00:35:13.265257620 +0300
++++ phorum-5.2.15a/include/controlcenter/files.php 2010-10-22 00:42:47.237295406 +0300
+@@ -101,7 +101,11 @@
+ }
+
+ if($PHORUM["file_types"]){
+- $PHORUM["DATA"]["FILE_TYPE_LIMIT"]=$PHORUM["DATA"]["LANG"]["FileTypeLimits"];
++ $PHORUM["DATA"]["FILE_TYPE_LIMIT"]= str_replace(
++ '%file_types%',
++ str_replace(";", ", ", $PHORUM['file_types']),
++ $PHORUM["DATA"]["LANG"]["FileTypeLimits"]
++ );
+ }
+
+ if($PHORUM["file_space_quota"]){
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/phorum/translate-macros.patch?r1=1.1&r2=1.2&f=u
More information about the pld-cvs-commit
mailing list