Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8d96ab0
)
Revert "API CHANGE: removed format_options()"
author
Jason Woofenden
<jason@jasonwoof.com>
Tue, 24 May 2011 10:11:58 +0000
(06:11 -0400)
committer
Jason Woofenden
<jason@jasonwoof.com>
Tue, 24 May 2011 10:11:58 +0000
(06:11 -0400)
This reverts commit
cd68b6037f8558fd98e07486282e2a25f9c4626b
.
format.php
patch
|
blob
|
history
diff --git
a/format.php
b/format.php
index
0fbc88f
..
a6b0582
100644
(file)
--- a/
format.php
+++ b/
format.php
@@
-24,6
+24,22
@@
function format_caption($str) {
return str_replace('Email', 'E-mail', $str);
}
return str_replace('Email', 'E-mail', $str);
}
+# This function makes sure that $str is in the list of options, and returns "" otherwise
+function format_options($str, $name) {
+ if(!isset($GLOBALS[$name . '_options'])) {
+ die("Couldn't find options for \"$name\". Be sure to call pulldown().");
+ }
+
+ foreach($GLOBALS[$name . '_options']['options'] as $keyval) {
+ list($key, $value) = $keyval;
+ if($str == $key) {
+ return $str;
+ }
+ }
+
+ return '';
+}
+
function format_int($str) {
$str = ereg_replace('[^0-9]', '', $str);
return ereg_replace('^0*([0-9])', '\1', $str);
function format_int($str) {
$str = ereg_replace('[^0-9]', '', $str);
return ereg_replace('^0*([0-9])', '\1', $str);