Framework  3.9
abstract_type_renderer.inc
Go to the documentation of this file.
1 <?php
5 /**************************************************************
6 
7  Copyright (c) 2007-2010 Sonjara, Inc
8 
9  Permission is hereby granted, free of charge, to any person
10  obtaining a copy of this software and associated documentation
11  files (the "Software"), to deal in the Software without
12  restriction, including without limitation the rights to use,
13  copy, modify, merge, publish, distribute, sublicense, and/or sell
14  copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following
16  conditions:
17 
18  The above copyright notice and this permission notice shall be
19  included in all copies or substantial portions of the Software.
20 
21  Except as contained in this notice, the name(s) of the above
22  copyright holders shall not be used in advertising or otherwise
23  to promote the sale, use or other dealings in this Software
24  without prior written authorization.
25 
26  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
28  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
30  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
31  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
32  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
33  OTHER DEALINGS IN THE SOFTWARE.
34 
35 *****************************************************************/
36 
37 require_once realpath(dirname(__FILE__)."/boolean_type_renderer.inc");
38 require_once realpath(dirname(__FILE__)."/currency_type_renderer.inc");
39 require_once realpath(dirname(__FILE__)."/date_type_renderer.inc");
40 require_once realpath(dirname(__FILE__)."/datetime_type_renderer.inc");
41 require_once realpath(dirname(__FILE__)."/number_type_renderer.inc");
42 require_once realpath(dirname(__FILE__)."/phone_number_type_renderer.inc");
43 require_once realpath(dirname(__FILE__)."/string_type_renderer.inc");
44 require_once realpath(dirname(__FILE__)."/text_type_renderer.inc");
45 require_once realpath(dirname(__FILE__)."/time_type_renderer.inc");
46 require_once realpath(dirname(__FILE__)."/timestamp_type_renderer.inc");
47 require_once realpath(dirname(__FILE__)."/timezone_type_renderer.inc");
48 
50 {
52  {
53 
54  }
55 
56  static function format($value, $template = "")
57  {
58 
59  }
60 
61  /*
62  * Given a date formatting shorthand, translate into the
63  * format used by the php date function
64  *
65  * @author Janice Gallant
66  *
67  * 5/30/2011
68  *
69  * @param $template - the field format template provided
70  *
71  * @param $stripTime - whether any time component in the
72  * tempalte should be ignored/removed.
73  */
74  static function translationDateTemplate($template, $includeTime = true)
75  {
76  if($template == "short")
77  $template = ($includeTime) ? "m/d/Y g:ia" : "m/d/Y";
78  elseif($template == "daylong")
79  $template = ($includeTime) ? "l F j, Y g:ia" : "l F j, Y";
80  elseif($template == "long")
81  $template = ($includeTime) ? "F d, Y g:ia" : "F d, Y";
82 
83  return $template;
84  }
85 }
static translationDateTemplate($template, $includeTime=true)
static format($value, $template="")