root/afridex/plugins/Flutter/RC_Format.php @ 23

Revision 21, 0.8 kB (checked in by admin, 18 years ago)
Line 
1<?php
2class RC_Format
3{
4        function BoolToSql($value)
5        {
6                $sql = $value == true ? "'true'" : "'false'";
7                return $sql;
8        }
9       
10        function GetInputName($fieldName)
11        {
12                $name = 'rc_cwp_meta_' . str_replace(' ', '_', $fieldName);
13                $name = attribute_escape(str_replace('.', '$DOT$', $name));
14                return $name;
15        }
16       
17        function GetFieldName($inputName)
18        {
19                $fieldName = str_replace('rc_cwp_meta_', '', $inputName);
20                //$fieldName = str_replace('_', ' ', $fieldName);
21                $fieldName = str_replace('$DOT$', '.', $fieldName);
22                return $fieldName;
23        }
24       
25        function TextToSql($value)
26        {
27                $value = trim($value);
28                $sql = $value == '' ? 'NULL' : "'$value'";
29                return $sql;
30        }
31       
32        function TrimArrayValues(&$value, $key)
33        {
34                $value = trim($value);
35        }
36}
37?>
Note: See TracBrowser for help on using the browser.