Browse Source

Files cleanup, preparation for 1.9 maintenance release

Janusz Tylek 6 months ago
parent
commit
a465e25df5
100 changed files with 1992 additions and 15968 deletions
  1. 0
    4
      .babelrc
  2. 0
    10
      .eslintrc.json
  3. 2
    2
      README.md
  4. 1
    0
      admin/modules/ConfigInfo.php
  5. 8
    9
      check.php
  6. 12
    10
      composer.json
  7. 1675
    904
      composer.lock
  8. 0
    1
      console.php
  9. 7
    7
      console/Develop/CreateModuleCommand.php
  10. 7
    7
      console/Develop/CreateTestModuleCommand.php
  11. 0
    32
      console/Modules/RebuildModulesDatabaseCommand.php
  12. 0
    6
      crowdin.yml
  13. 0
    0
      dist/.gitkeep
  14. 0
    12
      folder/nl/en.php.Dutch.old
  15. 0
    10
      folder/no/en.php.Norwegian.old
  16. 0
    2127
      folder/ro/en.php.Romanian.old
  17. BIN
      images/epesi_logo_RGB_Solid.png
  18. BIN
      images/epesi_logo_RGB_Solid_login.png
  19. BIN
      images/favicon.png
  20. BIN
      images/logo.png
  21. 0
    1
      include.php
  22. 1
    0
      include/config.php
  23. 3
    3
      include/epesi.php
  24. 2
    2
      include/error.php
  25. 0
    15
      include/fontawesome.php
  26. 133
    2
      include/misc.php
  27. 9
    9
      include/module.php
  28. 1
    1
      include/module_manager.php
  29. 0
    1
      include/session.php
  30. 2
    0
      include/simple_login.php
  31. 128
    180
      index.php
  32. 1
    1
      init_js.php
  33. 0
    5
      libs/bootstrap-datetimepicker.min.css
  34. 0
    2
      libs/bootstrap-datetimepicker.min.js
  35. BIN
      libs/images/ui-icons_444444_256x240.png
  36. BIN
      libs/images/ui-icons_555555_256x240.png
  37. BIN
      libs/images/ui-icons_777620_256x240.png
  38. BIN
      libs/images/ui-icons_777777_256x240.png
  39. BIN
      libs/images/ui-icons_cc0000_256x240.png
  40. BIN
      libs/images/ui-icons_ffffff_256x240.png
  41. 0
    117
      libs/jquery.clonePosition.js
  42. 0
    1216
      libs/moment-with-locales.min.js
  43. 0
    127
      libs/php-fontawesome.php
  44. 0
    4
      libs/quickform/.gitignore
  45. 0
    290
      libs/quickform/Common.php
  46. 0
    1712
      libs/quickform/QuickForm.php
  47. 0
    32
      libs/quickform/QuickForm/Error.php
  48. 0
    490
      libs/quickform/QuickForm/Field/Group/date.php
  49. 0
    556
      libs/quickform/QuickForm/Field/Group/hierselect.php
  50. 0
    213
      libs/quickform/QuickForm/Field/Input/advcheckbox.php
  51. 0
    32
      libs/quickform/QuickForm/Field/Input/autocomplete.php
  52. 0
    43
      libs/quickform/QuickForm/Field/Input/button.php
  53. 0
    185
      libs/quickform/QuickForm/Field/Input/checkbox.php
  54. 0
    272
      libs/quickform/QuickForm/Field/Input/file.php
  55. 0
    55
      libs/quickform/QuickForm/Field/Input/hidden.php
  56. 0
    72
      libs/quickform/QuickForm/Field/Input/image.php
  57. 0
    66
      libs/quickform/QuickForm/Field/Input/password.php
  58. 0
    171
      libs/quickform/QuickForm/Field/Input/radio.php
  59. 0
    42
      libs/quickform/QuickForm/Field/Input/reset.php
  60. 0
    50
      libs/quickform/QuickForm/Field/Input/submit.php
  61. 0
    55
      libs/quickform/QuickForm/Field/Input/text.php
  62. 0
    207
      libs/quickform/QuickForm/Field/Multi/automulti.php
  63. 0
    279
      libs/quickform/QuickForm/Field/Multi/multiselect.php
  64. 0
    193
      libs/quickform/QuickForm/Field/Select/autoselect.php
  65. 0
    79
      libs/quickform/QuickForm/Field/Select/hiddenselect.php
  66. 0
    39
      libs/quickform/QuickForm/Field/Static/header.php
  67. 0
    42
      libs/quickform/QuickForm/Field/Static/html.php
  68. 0
    97
      libs/quickform/QuickForm/Field/Static/link.php
  69. 0
    474
      libs/quickform/QuickForm/Field/group.php
  70. 0
    101
      libs/quickform/QuickForm/Field/input.php
  71. 0
    144
      libs/quickform/QuickForm/Field/multi.php
  72. 0
    438
      libs/quickform/QuickForm/Field/select.php
  73. 0
    114
      libs/quickform/QuickForm/Field/static.php
  74. 0
    120
      libs/quickform/QuickForm/Field/textarea.php
  75. 0
    13
      libs/quickform/QuickForm/Field/toHtml.php
  76. 0
    108
      libs/quickform/QuickForm/Field/xbutton.php
  77. 0
    84
      libs/quickform/QuickForm/Renderer.php
  78. 0
    321
      libs/quickform/QuickForm/Renderer/Array.php
  79. 0
    367
      libs/quickform/QuickForm/Renderer/ArraySmarty.php
  80. 0
    416
      libs/quickform/QuickForm/Renderer/Default.php
  81. 0
    159
      libs/quickform/QuickForm/Renderer/QuickHtml.php
  82. 0
    417
      libs/quickform/QuickForm/Renderer/TCMSArray.php
  83. 0
    401
      libs/quickform/QuickForm/Renderer/TCMSArraySmarty.php
  84. 0
    43
      libs/quickform/QuickForm/Renderer/TCMSDefault.js
  85. 0
    515
      libs/quickform/QuickForm/Renderer/TCMSDefault.php
  86. 0
    58
      libs/quickform/QuickForm/Rule.php
  87. 0
    99
      libs/quickform/QuickForm/Rule/Callback.php
  88. 0
    82
      libs/quickform/QuickForm/Rule/Compare.php
  89. 0
    93
      libs/quickform/QuickForm/Rule/CompareString.php
  90. 0
    49
      libs/quickform/QuickForm/Rule/Email.php
  91. 0
    47
      libs/quickform/QuickForm/Rule/Range.php
  92. 0
    80
      libs/quickform/QuickForm/Rule/Regex.php
  93. 0
    39
      libs/quickform/QuickForm/Rule/Required.php
  94. 0
    324
      libs/quickform/QuickForm/RuleRegistry.php
  95. 0
    398
      libs/quickform/QuickForm/element.php
  96. 0
    42
      libs/quickform/autocomplete_update.php
  97. 0
    155
      libs/quickform/docs/elements.php
  98. 0
    64
      libs/quickform/docs/filters.php
  99. 0
    104
      libs/quickform/docs/formrule.php
  100. 0
    0
      libs/quickform/docs/groups.php

+ 0
- 4
.babelrc View File

@@ -1,4 +0,0 @@
1
-{
2
-  "presets": ["env"],
3
-  "plugins": ["transform-runtime", "transform-function-bind", "transform-class-properties"]
4
-}

+ 0
- 10
.eslintrc.json View File

@@ -1,10 +0,0 @@
1
-{
2
-  "extends": "airbnb-base",
3
-  "parser": "babel-eslint",
4
-  "env": {
5
-    "browser": true
6
-  },
7
-  "globals": {
8
-    "jQuery": true
9
-  }
10
-}

+ 2
- 2
README.md View File

@@ -48,7 +48,7 @@ It requires properly configured HTTP server with PHP and MySQL or PostgreSQL dat
48 48
 
49 49
 EPESI is released under the MIT License
50 50
 
51
-Copyright © 2006-2016 Telaxus LLC
51
+Copyright © 2006-2018 Telaxus LLC
52 52
 
53 53
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/orsell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
54 54
 
@@ -63,7 +63,7 @@ Telaxus LLC http://telaxus.com/
63 63
 - Telaxus LLC is a technology company specializing in developoment of CRM and ERP solutions for small and medium size businesses utilizing our own platform - EPESI Business Information Manager.
64 64
 
65 65
 
66
-<i>Copyright © 2006-2016 Telaxus LLC</i>
66
+<i>Copyright © 2006-2018 Telaxus LLC</i>
67 67
 
68 68
 Enjoy,  
69 69
 <b>EPESI Team</b>

+ 1
- 0
admin/modules/ConfigInfo.php View File

@@ -78,6 +78,7 @@ class ConfigInfo extends AdminModule {
78 78
         $this->printTD('Set Session: ', (SET_SESSION ? 'YES' : 'NO'));
79 79
 
80 80
         $this->printTD('Read Only Session: ', (READ_ONLY_SESSION ? 'YES' : 'NO'));
81
+        $this->printTD('Mobile Device: ', (MOBILE_DEVICE ? 'YES' : 'NO'));
81 82
         $this->printTD('First Run: ', (FIRST_RUN ? 'YES' : 'NO'));
82 83
         $this->printTD('Hosting Mode: ', (HOSTING_MODE ? 'YES' : 'NO'));
83 84
         $this->printTD('Trial Mode: ', (TRIAL_MODE ? 'YES' : 'NO'));

+ 8
- 9
check.php View File

@@ -210,11 +210,11 @@ foreach ($checks as $c) {
210 210
 	$solution = false;
211 211
 	foreach ($c['tests'] as $t) {
212 212
 		switch ($t['severity']) {
213
-			case 0: $class = 'text-success'; break;
214
-			case 1: $class = 'text-warning'; $solution = true; break;
215
-			case 2: $class = 'text-danger'; $solution = true; break;
213
+			case 0: $color = '#00CC00'; break;
214
+			case 1: $color = '#CCAA00'; $solution = true; break;
215
+			case 2: $color = 'red'; $solution = true; break;
216 216
 		}
217
-		$html .= '<span style="font-weight:bold;float:right;" class="'.$class.'">'.$t['status'].'</span>';
217
+		$html .= '<span style="font-weight:bold;float:right;margin-right:100px;color:'.$color.'">'.$t['status'].'</span>';
218 218
 		$html .= '<span style="margin-left:40px;">'.$t['label'].'</span>';
219 219
 		$html .= '<br>';
220 220
 	}
@@ -228,12 +228,11 @@ foreach ($checks as $c) {
228 228
 $html .= '<br><br>';
229 229
 $html .= '<font size=-2>';
230 230
 $html .= 'Legend:<br>';
231
-$html .= '<div><span class="text-success">Green</span> - matches EPESI requirements</div>';
232
-$html .= '<div><span class="text-warning">Yellow</span> - shouldn\'t prevent EPESI from running, but it\'s recommended to change the settings</div>';
233
-$html .= '<div><span class="text-danger">Red</span> - check failed, it\'s necessary to change the settings</div>';
231
+$html .= '<span style="color:#00CC00;">Green</span> - matches EPESI requirements<br>';
232
+$html .= '<span style="color:#CCAA00;">Yellow</span> - shouldn\'t prevent EPESI from running, but it\'s recommended to change the settings<br>';
233
+$html .= '<span style="color:red;">Red</span> - check failed, it\'s necessary to change the settings<br>';
234 234
 $html .= '</font>';
235 235
 
236
-print('<div class="col-md-6 col-md-offset-3"><div class="panel panel-default"><div class="panel-body">');
237 236
 if ($fullscreen) {
238 237
 	if (class_exists('Utils_FrontPageCommon'))
239 238
 		Utils_FrontPageCommon::display('EPESI Compatibility check', $html);
@@ -242,5 +241,5 @@ if ($fullscreen) {
242 241
 } else {
243 242
 	print($html);
244 243
 }
245
-print('</div></div></div>');
244
+
246 245
 ?>

+ 12
- 10
composer.json View File

@@ -8,20 +8,23 @@
8 8
         "fzaninotto/faker": "^1.6",
9 9
         "phpFastCache/phpFastCache": "^5.0",
10 10
         "ifsnop/mysqldump-php": "dev-master",
11
-        "memio/memio": "^1.0",
12 11
         "psy/psysh": "@stable",
13
-        "anahkiasen/underscore-php": "^2.0",
14
-        "moneyphp/money": "^3.0",
15 12
         "enyo/dropzone": "@stable",
16 13
         "ezyang/htmlpurifier": "^4.9",
17
-        "moneyphp/money": "^3.0"
14
+        "moneyphp/money": "^3.0",
15
+        "tecnickcom/tcpdf": "^6.2",
16
+        "memio/memio": "^2.0"
18 17
     },
19 18
     "scripts": {
20 19
         "post-install-cmd": [
21
-            "@composer -d=\"modules/CRM/Mail\" install",
22
-            "@composer -d=\"modules/Libs/PHPExcel\" install",
23
-            "@composer -d=\"modules/Libs/TCPDF\" install"
24
-        ]
20
+            "@composer -d\"modules/CRM/Mail\" install",
21
+            "@composer -d\"modules/Libs/PHPExcel\" install",
22
+            "@composer -d\"vendor/tecnickcom/tcpdf\" install",
23
+            "@composer -d\"vendor/tecnickcom/tcpdf\" dump-autoload"
24
+        ],
25
+      "post-update-cmd": [
26
+        "@composer -d\"vendor/tecnickcom/tcpdf\" dump-autoload"
27
+      ]
25 28
     },
26 29
     "autoload": {
27 30
         "psr-4": {
@@ -30,8 +33,7 @@
30 33
         },
31 34
         "psr-0": {
32 35
             "": "modules/"
33
-        },
34
-        "classmap": ["libs/quickform"]
36
+        }
35 37
     },
36 38
     "require-dev": {
37 39
         "codeception/codeception": "*",

+ 1675
- 904
composer.lock
File diff suppressed because it is too large
View File


+ 0
- 1
console.php View File

@@ -27,7 +27,6 @@ $application->add(new \Epesi\Console\Modules\EnableModuleCommand());
27 27
 $application->add(new \Epesi\Console\Modules\InstallModuleCommand());
28 28
 $application->add(new \Epesi\Console\Modules\UninstallModuleCommand());
29 29
 $application->add(new \Epesi\Console\Modules\EnableAllModuleCommand());
30
-$application->add(new \Epesi\Console\Modules\RebuildModulesDatabaseCommand());
31 30
 $application->add(new \Epesi\Console\CacheRebuildCommand());
32 31
 $application->add(new \Epesi\Console\ThemeRebuildCommand());
33 32
 $application->add(new \Epesi\Console\Maintenance\MaintenanceStatusCommand());

+ 7
- 7
console/Develop/CreateModuleCommand.php View File

@@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface;
10 10
 
11 11
 use Memio\Memio\Config\Build;
12 12
 use Memio\Model\File;
13
-use Memio\Model\Object;
13
+use Memio\Model\Objekt;
14 14
 use Memio\Model\Method;
15 15
 use Memio\Model\Argument;
16 16
 
@@ -74,9 +74,9 @@ class CreateModuleCommand extends Command
74 74
         $file_main = $module_dir . '/' . $core_name . '_0.php';
75 75
         $myFile = File::make($file_main)
76 76
                       ->setStructure(
77
-                          Object::make($module_type)
77
+                          Objekt::make($module_type)
78 78
                                 ->extend(
79
-                                    Object::make('Module'))
79
+                                    Objekt::make('Module'))
80 80
                                 ->addMethod(
81 81
                                     Method::make('body')
82 82
                                 )
@@ -91,9 +91,9 @@ class CreateModuleCommand extends Command
91 91
         $file_common = $module_dir . '/' . $core_name . 'Common_0.php';
92 92
         $myFile = File::make($file_common)
93 93
                       ->setStructure(
94
-                          Object::make($module_type . 'Common')
94
+                          Objekt::make($module_type . 'Common')
95 95
                                 ->extend(
96
-                                    Object::make('ModuleCommon')
96
+                                    Objekt::make('ModuleCommon')
97 97
                                 )
98 98
                       );
99 99
 
@@ -112,9 +112,9 @@ class CreateModuleCommand extends Command
112 112
         $file_install = $module_dir . '/' . $core_name . 'Install.php';
113 113
         $myFile = File::make($file_install)
114 114
                       ->setStructure(
115
-                          Object::make($module_type . 'Install')
115
+                          Objekt::make($module_type . 'Install')
116 116
                                 ->extend(
117
-                                    Object::make('ModuleInstall'))
117
+                                    Objekt::make('ModuleInstall'))
118 118
                                 ->addMethod(
119 119
                                     Method::make('install')
120 120
                                           ->setBody("{$t}{$t}return true;"))

+ 7
- 7
console/Develop/CreateTestModuleCommand.php View File

@@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface;
10 10
 
11 11
 use Memio\Memio\Config\Build;
12 12
 use Memio\Model\File;
13
-use Memio\Model\Object;
13
+use Memio\Model\Objekt;
14 14
 use Memio\Model\Method;
15 15
 use Memio\Model\Argument;
16 16
 
@@ -66,9 +66,9 @@ class CreateTestModuleCommand extends Command
66 66
         $file_main = $module_dir . '/' . $module_name . '_0.php';
67 67
         $myFile = File::make($file_main)
68 68
                       ->setStructure(
69
-                          Object::make($module_type)
69
+                          Objekt::make($module_type)
70 70
                                 ->extend(
71
-                                    Object::make('Module'))
71
+                                    Objekt::make('Module'))
72 72
                                 ->addMethod(
73 73
                                     Method::make('body')
74 74
                                 )
@@ -84,9 +84,9 @@ class CreateTestModuleCommand extends Command
84 84
         $file_common = $module_dir . '/' . $module_name . 'Common_0.php';
85 85
         $myFile = File::make($file_common)
86 86
                       ->setStructure(
87
-                          Object::make($module_type . 'Common')
87
+                          Objekt::make($module_type . 'Common')
88 88
                                 ->extend(
89
-                                    Object::make('ModuleCommon')
89
+                                    Objekt::make('ModuleCommon')
90 90
                                 )
91 91
                                 ->addMethod(
92 92
                                     Method::make('menu')
@@ -108,9 +108,9 @@ class CreateTestModuleCommand extends Command
108 108
         $file_install = $module_dir . '/' . $module_name . 'Install.php';
109 109
         $myFile = File::make($file_install)
110 110
                       ->setStructure(
111
-                          Object::make($module_type . 'Install')
111
+                          Objekt::make($module_type . 'Install')
112 112
                                 ->extend(
113
-                                    Object::make('ModuleInstall'))
113
+                                    Objekt::make('ModuleInstall'))
114 114
                                 ->addMethod(
115 115
                                     Method::make('install')
116 116
                                           ->setBody("{$t}{$t}return true;"))

+ 0
- 32
console/Modules/RebuildModulesDatabaseCommand.php View File

@@ -1,32 +0,0 @@
1
-<?php
2
-
3
-namespace Epesi\Console\Modules;
4
-
5
-use Symfony\Component\Console\Command\Command;
6
-use Symfony\Component\Console\Helper\Table;
7
-use Symfony\Component\Console\Input\InputInterface;
8
-use Symfony\Component\Console\Output\OutputInterface;
9
-
10
-class RebuildModulesDatabaseCommand extends Command
11
-{
12
-    protected function configure()
13
-    {
14
-        $this
15
-            ->setName('module:rebuild')
16
-            ->setDescription('Rebuild modules database')
17
-        ;
18
-    }
19
-
20
-    protected function execute(InputInterface $input, OutputInterface $output)
21
-    {
22
-        $modules = \Base_SetupCommon::refresh_available_modules();
23
-
24
-        $table = new Table($output);
25
-        $table->setHeaders(array('<fg=white;options=bold>Name</fg=white;options=bold>', '<fg=white;options=bold>Version</fg=white;options=bold>'));
26
-        foreach ($modules as $name => $module) {
27
-            $table->addRow(array($name, $module[0]));
28
-        }
29
-
30
-        $table->render();
31
-    }
32
-}

+ 0
- 6
crowdin.yml View File

@@ -1,6 +0,0 @@
1
-files:
2
-  - source: '*/en.php'
3
-    translation: /folder/%two_letters_code%/%original_file_name%.%language%.old
4
-    languages_mapping:
5
-      two_letters_code:
6
-        en: .php

+ 0
- 0
dist/.gitkeep View File


+ 0
- 12
folder/nl/en.php.Dutch.old View File

@@ -1,12 +0,0 @@
1
-<?php
2
-/**
3
- * Translation file.
4
- * @package epesi-translations
5
- * @subpackage en
6
- */
7
-global $translations;
8
-$translations['Projects']='';
9
-$translations['Due Date']='';
10
-$translations['Project Name']='';
11
-$translations['Bugtrack']='';
12
-$translations['Bug (attachment) #%d, %s']='';

+ 0
- 10
folder/no/en.php.Norwegian.old View File

@@ -1,10 +0,0 @@
1
-<?php
2
-/**
3
- * Translation file.
4
- * @package epesi-translations
5
- * @subpackage en
6
- */
7
-global $translations;
8
-$translations['This text can be translated.']='';
9
-$translations['Here you can have some numbers: %d, %d, %d but you can still translate whole text.']='';
10
-$translations['Hello world!']='';

+ 0
- 2127
folder/ro/en.php.Romanian.old
File diff suppressed because it is too large
View File


BIN
images/epesi_logo_RGB_Solid.png View File


BIN
images/epesi_logo_RGB_Solid_login.png View File


BIN
images/favicon.png View File


BIN
images/logo.png View File


+ 0
- 1
include.php View File

@@ -37,7 +37,6 @@ try {
37 37
     require_once('include/history.php');
38 38
     require_once('include/patches.php');
39 39
     require_once('include/simple_login.php');
40
-    require_once('include/fontawesome.php');
41 40
 } catch (Exception $e) {
42 41
     die($e->getMessage());
43 42
 }

+ 1
- 0
include/config.php View File

@@ -45,6 +45,7 @@ if(!defined('TRACKING_CODE')) define('TRACKING_CODE','');
45 45
 if(!defined('JS_OUTPUT')) define('JS_OUTPUT',0);
46 46
 if(!defined('SET_SESSION')) define('SET_SESSION',1);
47 47
 if(!defined('READ_ONLY_SESSION')) define('READ_ONLY_SESSION',0);
48
+if(!defined('MOBILE_DEVICE')) define('MOBILE_DEVICE',0);
48 49
 if(!defined('DIRECTION_RTL')) define('DIRECTION_RTL',0);
49 50
 
50 51
 if(!defined('FIRST_RUN')) define('FIRST_RUN','FirstRun');

+ 3
- 3
include/epesi.php View File

@@ -326,8 +326,8 @@ class Epesi {
326 326
 			foreach($to_cleanup as $k) {
327 327
 				$mod = ModuleManager::get_instance($k);
328 328
 				if($mod === null) {
329
-					$xx = explode('__',$k);
330
-					$yy = explode('--',$xx[count($xx)-1]);
329
+					$xx = explode('/',$k);
330
+					$yy = explode('|',$xx[count($xx)-1]);
331 331
 					$mod = $yy[0];
332 332
 					if(is_callable(array($mod.'Common','destroy')))
333 333
 						call_user_func(array($mod.'Common','destroy'),$k,isset($_SESSION['client']['__module_vars__'][$k])?$_SESSION['client']['__module_vars__'][$k]:null);
@@ -434,7 +434,7 @@ class Epesi {
434 434
 		}
435 435
 		if(!isset($_SESSION['client']['custom_debug']) || $debug!=$_SESSION['client']['custom_debug']) {
436 436
 			self::text($debug,'debug');
437
-			if ($debug) Epesi::js("jq('#debug_content').show();");
437
+			if ($debug) Epesi::js("$('debug_content').style.display='block';");
438 438
 			$_SESSION['client']['custom_debug'] = $debug;
439 439
 		}
440 440
 

+ 2
- 2
include/error.php View File

@@ -27,8 +27,8 @@ class ErrorHandler {
27 27
 			chdir(dirname(dirname(__FILE__)));
28 28
 			Epesi::clean();
29 29
 			if(DISPLAY_ERRORS) {
30
-				Epesi::js("jq('#debug_content').show();");
31
-				Epesi::text('<pre>'.$buffer.'</pre><hr>','error_box','prepend');
30
+				Epesi::js("$('debug_content').style.display='block';");
31
+				Epesi::text('<pre>' . $buffer . '</pre><hr>','error_box','prepend');
32 32
 			}
33 33
 			Epesi::alert('There was an error in one of epesi modules.'.((DISPLAY_ERRORS)?' Details are displayed at the bottom of the page, please send this information to system administrator.':''));
34 34
 			return Epesi::get_output();

+ 0
- 15
include/fontawesome.php View File

@@ -1,15 +0,0 @@
1
-<?php
2
-/**
3
- * @author Paul Bukowski <pbukowski@telaxus.com>
4
- * @version 1.0
5
- * @copyright Copyright &copy; 2017, Telaxus LLC
6
- * @license SPL
7
- * @package epesi-base
8
- */
9
-defined("_VALID_ACCESS") || die('Direct access forbidden');
10
-require_once(EPESI_LOCAL_DIR.'/libs/php-fontawesome.php');
11
-class FontAwesome extends Smk_FontAwesome {
12
-    public static function get($class_prefix = 'fa-'){
13
-        return parent::getArray(EPESI_LOCAL_DIR.'/node_modules/font-awesome/css/font-awesome.css',$class_prefix);
14
-    }
15
-}

+ 133
- 2
include/misc.php View File

@@ -316,7 +316,7 @@ function recalculate_time($date,$time) {
316 316
 function escapeJS($str,$double=true,$single=true) {return Epesi::escapeJS($str,$double,$single);}
317 317
 
318 318
 function get_epesi_url() {
319
-    if(defined('EPESI_URL')) return rtrim(EPESI_URL,'/');
319
+    if(defined('EPESI_URL')) return rtrim(EPESI_URL,'/') . '/';
320 320
 	if(php_sapi_name() == 'cli')
321 321
 		return dirname(dirname(__FILE__));
322 322
 	$protocol = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])!== "off") ? 'https://' : 'http://';
@@ -327,7 +327,7 @@ function get_epesi_url() {
327 327
         $domain_name = $_SERVER['SERVER_NAME'];
328 328
     }
329 329
     $url = ($domain_name ? ($protocol . $domain_name) : '') . EPESI_DIR;
330
-    return trim($url);
330
+    return rtrim(trim($url), '/') . '/';
331 331
 }
332 332
 
333 333
 function get_client_ip_address()
@@ -386,6 +386,137 @@ function create_html_form(& $form_name, $action_url, $variables, $target = null,
386 386
     return $html;
387 387
 }
388 388
 
389
+////////////////////////////////////////////////////
390
+// mobile devices
391
+
392
+function detect_mobile_device(){
393
+  
394
+  // check if the user agent value claims to be windows but not windows mobile
395
+  if(stristr($_SERVER['HTTP_USER_AGENT'],'windows')&&!(stristr($_SERVER['HTTP_USER_AGENT'],'windows ce')||stristr($_SERVER['HTTP_USER_AGENT'],'windows mobile')||stristr($_SERVER['HTTP_USER_AGENT'],'palm'))){
396
+    return false;
397
+  }
398
+  // check if the user agent gives away any tell tale signs it's a mobile browser
399
+  if(preg_match('/up.browser|up.link|windows ce|iemobile|mini|mmp|symbian|midp|wap|phone|pocket|mobile|pda|psp|ppc|symbian/i',$_SERVER['HTTP_USER_AGENT'])){
400
+    return true;
401
+  }
402
+  // check the http accept header to see if wap.wml or wap.xhtml support is claimed
403
+  if(isset($_SERVER['HTTP_ACCEPT']) && (stristr($_SERVER['HTTP_ACCEPT'],'text/vnd.wap.wml')||stristr($_SERVER['HTTP_ACCEPT'],'application/vnd.wap.xhtml+xml'))){
404
+    return true;
405
+  }
406
+  // check if there are any tell tales signs it's a mobile device from the _server headers
407
+  if(isset($_SERVER['HTTP_X_WAP_PROFILE'])||isset($_SERVER['HTTP_PROFILE'])||isset($_SERVER['X-OperaMini-Features'])||isset($_SERVER['UA-pixels'])){
408
+    return true;
409
+  }
410
+  // build an array with the first four characters from the most common mobile user agents
411
+  $a = array(
412
+                    'acs-'=>'acs-',
413
+                    'alav'=>'alav',
414
+                    'alca'=>'alca',
415
+                    'amoi'=>'amoi',
416
+                    'audi'=>'audi',
417
+                    'aste'=>'aste',
418
+                    'avan'=>'avan',
419
+                    'benq'=>'benq',
420
+                    'bird'=>'bird',
421
+                    'blac'=>'blac',
422
+                    'blaz'=>'blaz',
423
+                    'brew'=>'brew',
424
+                    'cell'=>'cell',
425
+                    'cldc'=>'cldc',
426
+                    'cmd-'=>'cmd-',
427
+                    'dang'=>'dang',
428
+                    'doco'=>'doco',
429
+                    'eric'=>'eric',
430
+                    'hipt'=>'hipt',
431
+                    'inno'=>'inno',
432
+                    'ipaq'=>'ipaq',
433
+                    'java'=>'java',
434
+                    'jigs'=>'jigs',
435
+                    'kddi'=>'kddi',
436
+                    'keji'=>'keji',
437
+                    'leno'=>'leno',
438
+                    'lg-c'=>'lg-c',
439
+                    'lg-d'=>'lg-d',
440
+                    'lg-g'=>'lg-g',
441
+                    'lge-'=>'lge-',
442
+                    'maui'=>'maui',
443
+                    'maxo'=>'maxo',
444
+                    'midp'=>'midp',
445
+                    'mits'=>'mits',
446
+                    'mmef'=>'mmef',
447
+                    'mobi'=>'mobi',
448
+                    'mot-'=>'mot-',
449
+                    'moto'=>'moto',
450
+                    'mwbp'=>'mwbp',
451
+                    'nec-'=>'nec-',
452
+                    'newt'=>'newt',
453
+                    'noki'=>'noki',
454
+                    'opwv'=>'opwv',
455
+                    'palm'=>'palm',
456
+                    'pana'=>'pana',
457
+                    'pant'=>'pant',
458
+                    'pdxg'=>'pdxg',
459
+                    'phil'=>'phil',
460
+                    'play'=>'play',
461
+                    'pluc'=>'pluc',
462
+                    'port'=>'port',
463
+                    'prox'=>'prox',
464
+                    'qtek'=>'qtek',
465
+                    'qwap'=>'qwap',
466
+                    'sage'=>'sage',
467
+                    'sams'=>'sams',
468
+                    'sany'=>'sany',
469
+                    'sch-'=>'sch-',
470
+                    'sec-'=>'sec-',
471
+                    'send'=>'send',
472
+                    'seri'=>'seri',
473
+                    'sgh-'=>'sgh-',
474
+                    'shar'=>'shar',
475
+                    'sie-'=>'sie-',
476
+                    'siem'=>'siem',
477
+                    'smal'=>'smal',
478
+                    'smar'=>'smar',
479
+                    'sony'=>'sony',
480
+                    'sph-'=>'sph-',
481
+                    'symb'=>'symb',
482
+                    't-mo'=>'t-mo',
483
+                    'teli'=>'teli',
484
+                    'tim-'=>'tim-',
485
+                    'tosh'=>'tosh',
486
+                    'treo'=>'treo',
487
+                    'tsm-'=>'tsm-',
488
+                    'upg1'=>'upg1',
489
+                    'upsi'=>'upsi',
490
+                    'vk-v'=>'vk-v',
491
+                    'voda'=>'voda',
492
+                    'wap-'=>'wap-',
493
+                    'wapa'=>'wapa',
494
+                    'wapi'=>'wapi',
495
+                    'wapp'=>'wapp',
496
+                    'wapr'=>'wapr',
497
+                    'webc'=>'webc',
498
+                    'winw'=>'winw',
499
+                    'winw'=>'winw',
500
+                    'xda-'=>'xda-'
501
+                  );
502
+  // check if the first four characters of the current user agent are set as a key in the array
503
+  if(isset($a[substr($_SERVER['HTTP_USER_AGENT'],0,4)])){
504
+    return true;
505
+  }
506
+}
507
+
508
+function detect_iphone(){
509
+	if (!isset($_SERVER['HTTP_USER_AGENT'])) return false;
510
+  if(preg_match('/iphone/i',$_SERVER['HTTP_USER_AGENT'])||preg_match('/iPad/i',$_SERVER['HTTP_USER_AGENT'])||preg_match('/ipod/i',$_SERVER['HTTP_USER_AGENT'])||preg_match('/android/i',$_SERVER['HTTP_USER_AGENT'])||preg_match('/webOS/i',$_SERVER['HTTP_USER_AGENT'])){
511
+	return true;
512
+  }
513
+  return false;
514
+}
515
+
516
+if(detect_iphone())
517
+	define('IPHONE',1);
518
+else
519
+	define('IPHONE',0);
389 520
 
390 521
 ////////////////////////////
391 522
 // strip epesi invalid html code

+ 9
- 9
include/module.php View File

@@ -139,7 +139,7 @@ abstract class Module extends ModulePrimitive {
139 139
 			$this->children[$type] = array();
140 140
 		$this->children[$type][$instance] = & $ch;
141 141
 		if(DEBUG)
142
-			Epesi::debug('registering '.$this->get_path().'--'.$ch->get_node_id());
142
+			Epesi::debug('registering '.$this->get_path().'/'.$ch->get_node_id());
143 143
 	}
144 144
 
145 145
 	private final function get_new_child_instance_id($type) {
@@ -157,7 +157,7 @@ abstract class Module extends ModulePrimitive {
157 157
 			$x = false;
158 158
 			return $x;
159 159
 		}
160
-		$yy = explode('__',$id);
160
+		$yy = explode('|',$id);
161 161
 		return $this->children[$yy[0]][$yy[1]];
162 162
 	}
163 163
 
@@ -184,7 +184,7 @@ abstract class Module extends ModulePrimitive {
184 184
 		if($this->clear_child_vars) return;
185 185
 		$module_type = str_replace('/','_',$module_type);
186 186
 		if(!isset($name)) $name = $this->get_new_child_instance_id($module_type);
187
-		$this->frozen_modules[$module_type.'__'.$name] = 1;
187
+		$this->frozen_modules[$module_type.'|'.$name] = 1;
188 188
 	}
189 189
 
190 190
 	//endregion
@@ -840,7 +840,7 @@ abstract class Module extends ModulePrimitive {
840 840
 	 * @param string $function_name function to call (get output from), if user has enought privileges.
841 841
 	 * @return mixed if access denied returns false, else true
842 842
 	 */
843
-	public final function display_module(& $m, $args=null, $function_name = null, $template = null) {
843
+	public final function display_module(& $m, $args=null, $function_name = null) {
844 844
 		$ret = $this->get_html_of_module($m,$args,$function_name);
845 845
 		if($ret===false) return false;
846 846
 		print($ret);
@@ -873,7 +873,7 @@ abstract class Module extends ModulePrimitive {
873 873
 
874 874
 		if (!$m->check_access($function_name))
875 875
 			return false;
876
-			//we cannot trigger error here, because logout doesn't work
876
+			//we cannot trigger error here, couse logout doesn't work
877 877
 			//trigger_error('Method given as argument 2 for display_module inaccessible.<br>$'.$this->get_type().'->display_module(\''.$m->get_type().'\','.$args.',\''.$function_name.'\');',E_USER_ERROR);
878 878
 
879 879
 		$s = & $m->get_module_variable('__shared_unique_vars__',array());
@@ -887,7 +887,7 @@ abstract class Module extends ModulePrimitive {
887 887
 		$path = $m->get_path();
888 888
 		if($this->is_inline_display()) $m->set_inline_display();
889 889
 		if(!$m->is_inline_display()) {
890
-			Epesi::$content[$path]['span'] = $this_path.'__'.$this->children_count_display.'content';
890
+			Epesi::$content[$path]['span'] = $this_path.'|'.$this->children_count_display.'content';
891 891
 			$this->children_count_display++;
892 892
 		}
893 893
 		Epesi::$content[$path]['module'] = & $m;
@@ -1073,7 +1073,7 @@ abstract class Module extends ModulePrimitive {
1073 1073
 	 */
1074 1074
 	public final function get_node_id()
1075 1075
 	{
1076
-		return $this->type_with_submodule . '__' . $this->instance;
1076
+		return $this->type_with_submodule . '|' . $this->instance;
1077 1077
 	}
1078 1078
 
1079 1079
 	/**
@@ -1084,13 +1084,13 @@ abstract class Module extends ModulePrimitive {
1084 1084
 	 *
1085 1085
 	 * Example:
1086 1086
 	 * Module named Base/Box, instance 1, without parents:
1087
-	 * get_path returns '--Base_Box-1'
1087
+	 * get_path returns '/Base_Box|1'
1088 1088
 	 *
1089 1089
 	 * @return string unique module name
1090 1090
 	 */
1091 1091
 	public final function get_path() {
1092 1092
 		if(!isset($this->path))
1093
-			$this->path = $this->get_parent_path().'--'.$this->get_node_id();
1093
+			$this->path = $this->get_parent_path().'/'.$this->get_node_id();
1094 1094
 		return $this->path;
1095 1095
 	}
1096 1096
 

+ 1
- 1
include/module_manager.php View File

@@ -755,7 +755,7 @@ class ModuleManager {
755 755
 	 * @return bool null if module instance was not found, requested module object otherwise
756 756
 	 */
757 757
 	public static final function get_instance($path) {
758
-		$xx = explode('--',$path);
758
+		$xx = explode('/',$path);
759 759
 		$curr = self::$root;
760 760
 		if(is_object($curr) && $curr->get_node_id() != $xx[1]) {
761 761
 			$x = null;

+ 0
- 1
include/session.php View File

@@ -335,7 +335,6 @@ if(defined('EPESI_PROCESS')) {
335 335
 } else {
336 336
     ini_set('session.gc_probability', 0);
337 337
 }
338
-ini_set('session.save_handler', 'user');
339 338
 
340 339
 session_set_save_handler(array('DBSession','open'),
341 340
                              array('DBSession','close'),

+ 2
- 0
include/simple_login.php View File

@@ -15,6 +15,8 @@ class SimpleLogin {
15 15
             return self::t('You have exceeded the number of allowed login attempts.');
16 16
         }
17 17
 
18
+        require_once('modules/Libs/QuickForm/requires.php');
19
+
18 20
         if ((!Base_AclCommon::is_user()) && !$anonymous) {
19 21
             Base_User_LoginCommon::autologin();
20 22
         }

+ 128
- 180
index.php View File

@@ -7,7 +7,7 @@
7 7
  * @author Paul Bukowski <pbukowski@telaxus.com>
8 8
  * @copyright Copyright &copy; 2006, Telaxus LLC
9 9
  * @license MIT
10
- * @version 1.0
10
+ * @version 1.0 
11 11
  * @package epesi-base
12 12
  */
13 13
 if(version_compare(phpversion(), '5.5.0')==-1)
@@ -17,7 +17,10 @@ if(trim(ini_get("safe_mode")))
17 17
 	die('You cannot use EPESI with PHP safe mode turned on - please disable it. Please notice this feature is deprecated since PHP 5.3 and will be removed in PHP 7.0.');
18 18
 
19 19
 define('_VALID_ACCESS',1);
20
-require_once('include/data_dir.php');
20
+define('DATA_DIR','data'); // added by J. Tylek to remove map.php
21
+// Default /data directory location is epesidir/data
22
+// Must be defined here to read config.php
23
+
21 24
 if(!file_exists(DATA_DIR.'/config.php')) {
22 25
 	header('Location: setup.php');
23 26
 	exit();
@@ -37,15 +40,51 @@ if(epesi_requires_update()) {
37 40
     header('Location: update.php');
38 41
     exit();
39 42
 }
40
-
41
-
42
-
43 43
 $tables = DB::MetaTables();
44 44
 if(!in_array('modules',$tables) || !in_array('variables',$tables) || !in_array('session',$tables))
45 45
 	die('Database structure you are using is apparently out of date or damaged. If you didn\'t perform application update recently you should try to restore the database. Otherwise, please refer to EPESI documentation in order to perform database update.');
46 46
 
47 47
 ob_start();
48 48
 
49
+if(IPHONE) {
50
+	if(!isset($_GET['force_desktop'])) {
51
+?>
52
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
53
+<html xmlns="http://www.w3.org/1999/xhtml">
54
+<head>
55
+	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
56
+    <meta name="robots" content="NOINDEX, NOARCHIVE">
57
+	<meta id="viewport" name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
58
+	<title><?php print(EPESI);?></title>
59
+	<link rel="stylesheet" href="libs/UiUIKit/stylesheets/iphone.css" />
60
+	<link rel="apple-touch-icon" href="images/apple-touch-icon.png" />
61
+	<script type="text/javascript" charset="utf-8">
62
+		window.onload = function() {
63
+		  setTimeout(function(){window.scrollTo(0, 1);}, 100);
64
+		}
65
+	</script>
66
+</head>
67
+
68
+<body>
69
+<div id="header">
70
+		<h1><?php print(EPESI);?></h1>
71
+</div>
72
+
73
+Please choose <?php print(EPESI);?> version:<ul>
74
+<li><a href="mobile.php" class="white button">mobile</a><br>
75
+<li><a href="index.php?force_desktop=1" class="green button">desktop</a>
76
+</ul>
77
+
78
+</body>
79
+</html>
80
+<?php
81
+		exit();
82
+	}
83
+} elseif(detect_mobile_device()) {
84
+	header('Location: mobile.php');
85
+	exit();
86
+}
87
+
49 88
 ?>
50 89
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
51 90
 <html xmlns="http://www.w3.org/1999/xhtml">
@@ -56,195 +95,101 @@ ob_start();
56 95
 		<title><?php print(EPESI);?></title>
57 96
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
58 97
 		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
59
-        <meta name="viewport" content="width=device-width, initial-scale=1">
60
-        <meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
98
+		<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
61 99
         <meta name="robots" content="NOINDEX, NOARCHIVE">
62
-            <script type='text/javascript' src='dist/index.js'></script>
63
-            <link href='dist/styles.css' rel="stylesheet" type="text/css">
64
-            <style type="text/css">
65
-
66
-                #epesi_loader {
67
-                    font-weight: 300;
68
-                    font-size: 15px;
69
-                    background-color: white;
70
-                    position: fixed;
71
-                    left: 50%;
72
-                    top: 30%;
73
-                    margin-left: -180px;
74
-                    width: 360px;
75
-                    text-align: center;
76
-                    vertical-align: middle;
77
-                    z-index: 2002;
78
-                    overflow: hidden;
79
-                    padding-top: 20px;
80
-                }
81
-                #epesi_loader img {
82
-                    padding: 15px;
83
-                }
84
-
85
-                #epesi_loader .text {
86
-                    margin-top: 10px;
87
-                    margin-bottom: 25px;
88
-                    font-size: 22px;
89
-                }
90
-
91
-                #epesi_loader .spinner {
92
-                    margin: 20px auto 20px;
93
-                    text-align: center;
94
-                }
95
-
96
-                #epesi_loader .spinner > div {
97
-                    width: 18px;
98
-                    height: 18px;
99
-                    background-color: #333;
100
-
101
-                    border-radius: 100%;
102
-                    display: inline-block;
103
-                    -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
104
-                    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
105
-                }
106
-
107
-                #epesi_loader .spinner .bounce1 {
108
-                    -webkit-animation-delay: -0.32s;
109
-                    animation-delay: -0.32s;
110
-                }
111
-
112
-                #epesi_loader .spinner .bounce2 {
113
-                    -webkit-animation-delay: -0.16s;
114
-                    animation-delay: -0.16s;
115
-                }
116
-
117
-                @-webkit-keyframes sk-bouncedelay {
118
-                    0%, 80%, 100% { -webkit-transform: scale(0) }
119
-                    40% { -webkit-transform: scale(1.0) }
120
-                }
121
-
122
-                @keyframes sk-bouncedelay {
123
-                    0%, 80%, 100% {
124
-                        -webkit-transform: scale(0);
125
-                        transform: scale(0);
126
-                    } 40% {
127
-                          -webkit-transform: scale(1.0);
128
-                          transform: scale(1.0);
129
-                      }
130
-                }
131
-
132
-
133
-
134
-
135
-
136
-                .Base_StatusBar_background {
137
-                    z-index: 2001;
138
-                    position: fixed;
139
-                    top: 0px;
140
-                    left: 0px;
141
-                    width: 100%;
142
-                    height: 100%;
143
-                    text-align: center;
144
-                    vertical-align: middle;
145
-                    background-color: rgba(255, 255, 255, 0.5);
146
-                }
147
-
148
-                .Base_StatusBar {
149
-                    background-color: white;
150
-                    position: fixed;
151
-                    left: 50%;
152
-                    top: 30%;
153
-                    margin-left: -100px;
154
-                    width: 200px;
155
-                    text-align: center;
156
-                    vertical-align: middle;
157
-                    z-index: 2002;
158
-                    overflow: hidden;
159
-                    padding-top: 20px;
160
-                }
161
-
162
-                .Base_StatusBar .text {
163
-                    font-size: 22px;
164
-                }
165
-
166
-                .Base_StatusBar .spinner {
167
-                    margin: 20px auto 20px;
168
-                    text-align: center;
169
-                }
170
-
171
-                .Base_StatusBar .spinner > div {
172
-                    width: 18px;
173
-                    height: 18px;
174
-                    background-color: #333;
175
-
176
-                    border-radius: 100%;
177
-                    display: inline-block;
178
-                    -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
179
-                    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
180
-                }
181
-
182
-                .Base_StatusBar .spinner .bounce1 {
183
-                    -webkit-animation-delay: -0.32s;
184
-                    animation-delay: -0.32s;
185
-                }
186
-
187
-                .Base_StatusBar .spinner .bounce2 {
188
-                    -webkit-animation-delay: -0.16s;
189
-                    animation-delay: -0.16s;
190
-                }
191
-
192
-                @-webkit-keyframes sk-bouncedelay {
193
-                    0%, 80%, 100% { -webkit-transform: scale(0) }
194
-                    40% { -webkit-transform: scale(1.0) }
195
-                }
196
-
197
-                @keyframes sk-bouncedelay {
198
-                    0%, 80%, 100% {
199
-                        -webkit-transform: scale(0);
200
-                        transform: scale(0);
201
-                    } 40% {
202
-                          -webkit-transform: scale(1.0);
203
-                          transform: scale(1.0);
204
-                      }
205
-                }
206
-
207
-            </style>
100
+<?php
101
+		ini_set('include_path', 'libs/minify' . PATH_SEPARATOR . '.' . PATH_SEPARATOR . 'libs' . PATH_SEPARATOR . ini_get('include_path'));
102
+		require_once('Minify/Build.php');
103
+		$jquery = DEBUG_JS ? 'libs/jquery-1.11.3.js' : 'libs/jquery-1.11.3.min.js';
104
+		$jquery_migrate = DEBUG_JS ? 'libs/jquery-migrate-1.2.1.js' : 'libs/jquery-migrate-1.2.1.min.js';
105
+		$jses = array('libs/prototype.js', $jquery, $jquery_migrate, 'libs/jquery-ui-1.10.1.custom.min.js', 'libs/HistoryKeeper.js', 'include/epesi.js');
106
+	if(!DEBUG_JS) {
107
+		$jsses_build = new Minify_Build($jses);
108
+		$jsses_src = $jsses_build->uri('serve.php?' . http_build_query(array('f' => array_values($jses))));
109
+		echo("<script type='text/javascript' src='$jsses_src'></script>");
110
+	} else {
111
+		foreach($jses as $js)
112
+			print("<script type='text/javascript' src='$js'></script>");
113
+	}
114
+	$csses = array('libs/jquery-ui-1.10.1.custom.min.css');
115
+	$csses_build = new Minify_Build($csses);
116
+	$csses_src = $csses_build->uri('serve.php?'.http_build_query(array('f'=>array_values($csses))));
117
+?>
118
+		<link type="text/css" href="<?php print($csses_src)?>" rel="stylesheet"></link>
119
+
120
+		<style type="text/css">
121
+			<?php if (DIRECTION_RTL) print('body { direction: rtl; }'); ?>
122
+			#epesiStatus {
123
+  				/* Netscape 4, IE 4.x-5.0/Win and other lesser browsers will use this */
124
+  				position: fixed;
125
+  				left: 50%; top: 30%;
126
+                margin-left: -280px;
127
+  				/* all */
128
+  				/*background-color: #e6ecf2;*/
129
+  				background-color: white;
130
+				border: 5px solid #336699;
131
+				visibility: hidden;
132
+				width: 560px;
133
+				text-align: center;
134
+				vertical-align: middle;
135
+				z-index: 2002;
136
+                color: #336699;
137
+				overflow: hidden;
138
+				
139
+				/* css3 shadow border*/
140
+				-webkit-box-shadow: 1px 1px 15px black;
141
+				-moz-box-shadow: 1px 1px 15px black;
142
+				box-shadow: 1px 1px 15px black;
143
+				/* end css3 shadow border*/
144
+				
145
+				/* border radius */
146
+				-webkit-border-radius: 6px;
147
+				-moz-border-radius: 6px;
148
+				border-radius: 6px;
149
+				/* end border radius */
150
+			}
151
+			#epesiStatus table {
152
+				color: #336699;
153
+				font-weight: bold;
154
+				font-family: Tahoma, Verdana, Vera-Sans, DejaVu-Sans;
155
+				font-size: 11px;
156
+				border: 5px solid #FFFFFF;
157
+            }
158
+
159
+		</style>
208 160
 		<?php print(TRACKING_CODE); ?>
209 161
 	</head>
210
-	<body class="<?php if (DIRECTION_RTL) print(' epesi_rtl'); ?>" >
162
+	<body <?php if (DIRECTION_RTL) print('class="epesi_rtl"'); ?> >
211 163
 
212
-		<div id="body_content" class="page">
213
-			<div id="main_content" class="page-main" style="display:none;"></div>
164
+		<div id="body_content">
165
+			<div id="main_content" style="display:none;"></div>
214 166
 			<div id="debug_content" style="padding-top:97px;display:none;">
215
-				<div class="button" onclick="jq('#error_box').html('');jq('#debug_content').hide();">Hide</div>
167
+				<div class="button" onclick="$('error_box').innerHTML='';$('debug_content').style.display='none';">Hide</div>
216 168
 				<div id="debug"></div>
217 169
 				<div id="error_box"></div>
218 170
 			</div>
219
-
220
-            <div id="epesi_loader" class="panel panel-default">
221
-                <img src="images/epesi_logo_RGB_Solid.png">
222
-                <div class="lead text" id="epesiStatusText"><?php print(STARTING_MESSAGE);?></div>
223
-                <div class="spinner">
224
-                    <div class="bounce1"></div>
225
-                    <div class="bounce2"></div>
226
-                    <div class="bounce3"></div>
227
-                </div>
228
-            </div>
229
-            <div id="Base_StatusBar" class="Base_StatusBar_background">
230
-                <div class="Base_StatusBar panel panel-default">
231
-                    <p id="statusbar_text" class="lead">Loading...</p>
232
-                    <div class="spinner">
233
-                        <div class="bounce1"></div>
234
-                        <div class="bounce2"></div>
235
-                        <div class="bounce3"></div>
236
-                    </div>
237
-                    <div id="dismiss">Click anywhere to dismiss</div>
238
-                </div>
239
-            </div>
171
+			
172
+			<div id="epesiStatus">
173
+				<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
174
+					<tr>
175
+						<td><img src="images/logo.png" alt="logo" width="550" height="200" border="0"></td>
176
+					</tr>
177
+					<tr>
178
+						<td style="text-align: center; vertical-align: middle; height: 30px;"><span id="epesiStatusText"><?php print(STARTING_MESSAGE);?></span></td>
179
+					</tr>
180
+					<tr>
181
+						<td style="text-align: center; vertical-align: middle; height: 30px;"><img src="images/loader.gif" alt="loader" width="256" height="10" border="0"></td>
182
+					</tr>
183
+				</table>
184
+			</div>	
240 185
 		</div>
241
-        <?php
186
+        <?php 
242 187
         /*
243 188
          * init_js file allows only num_of_clients sessions. If there is image
244 189
          * with empty src="" browser will load index.php file, so we cannot
245 190
          * include init_js file directly because num_of_clients request will
246 191
          * reset our history and restart EPESI.
247
-         *
192
+         * 
248 193
          * Check here if request accepts html. If it does we can assume that
249 194
          * this is request for page and include init_js file which is faster.
250 195
          * If there is not 'html' in accept use script with src property.
@@ -255,6 +200,9 @@ ob_start();
255 200
 		<script type="text/javascript" src="init_js.php?<?php print(http_build_query($_GET));?>"></script>
256 201
         <?php } ?>
257 202
         <noscript>Please enable JavaScript in your browser and let <?php print(EPESI);?> work!</noscript>
203
+		<?php if(IPHONE) { ?>
204
+		<script type="text/javascript">var iphone=true;</script>
205
+		<?php } ?>
258 206
 	</body>
259 207
 </html>
260 208
 <?php

+ 1
- 1
init_js.php View File

@@ -35,4 +35,4 @@ if($client_id-5>=0) {
35 35
 }
36 36
 session_commit();
37 37
 
38
-?>window.Epesi = new EpesiClass(<?php print($client_id); ?>,'<?php print(rtrim(str_replace('\\','/',dirname($_SERVER['PHP_SELF'])),'/').'/process.php'); ?>','<?php print(http_build_query($_GET));?>');
38
+?>Epesi.init(<?php print($client_id); ?>,'<?php print(rtrim(str_replace('\\','/',dirname($_SERVER['PHP_SELF'])),'/').'/process.php'); ?>','<?php print(http_build_query($_GET));?>');

+ 0
- 5
libs/bootstrap-datetimepicker.min.css
File diff suppressed because it is too large
View File


+ 0
- 2
libs/bootstrap-datetimepicker.min.js
File diff suppressed because it is too large
View File


BIN
libs/images/ui-icons_444444_256x240.png View File


BIN
libs/images/ui-icons_555555_256x240.png View File


BIN
libs/images/ui-icons_777620_256x240.png View File


BIN
libs/images/ui-icons_777777_256x240.png View File


BIN
libs/images/ui-icons_cc0000_256x240.png View File


BIN
libs/images/ui-icons_ffffff_256x240.png View File


+ 0
- 117
libs/jquery.clonePosition.js View File

@@ -1,117 +0,0 @@
1
-(function($){
2
-
3
-	function setOffset(el, newOffset){
4
-		var $el = $(el);
5
-
6
-		// get the current css position of the element
7
-		var cssPosition = $el.css('position');
8
-
9
-		// whether or not element is hidden
10
-		var hidden = false;
11
-
12
-		// if element was hidden, show it
13
-		if($el.css('display') == 'none'){
14
-			hidden = true;
15
-			$el.show();
16
-		}
17
-
18
-		// get the current offset of the element
19
-		var curOffset = $el.offset();
20
-
21
-		// if there is no current jQuery offset, give up
22
-		if(!curOffset){
23
-			// if element was hidden, hide it again
24
-			if(hidden)
25
-				$el.hide();
26
-			return;
27
-		}
28
-
29
-		// set position to relative if it's static
30
-		if (cssPosition == 'static') {
31
-			$el.css('position', 'relative');
32
-			cssPosition = 'relative';
33
-		}
34
-
35
-		// get current 'left' and 'top' values from css
36
-		// this is not necessarily the same as the jQuery offset
37
-		var delta = {
38
-			left : parseInt($el.css('left'), 10),
39
-			top: parseInt($el.css('top'), 10)
40
-		};
41
-
42
-		// if the css left or top are 'auto', they aren't numbers
43
-		if (isNaN(delta.left)){
44
-			delta.left = (cssPosition == 'relative') ? 0 : el.offsetLeft;
45
-		}
46
-		if (isNaN(delta.top)){
47
-			delta.top = (cssPosition == 'relative') ? 0 : el.offsetTop;
48
-		}
49
-
50
-		if (newOffset.left || 0 === newOffset.left){
51
-			$el.css('left', newOffset.left - curOffset.left + delta.left + 'px');
52
-		}
53
-		if (newOffset.top || 0 === newOffset.top){
54
-			$el.css('top', newOffset.top - curOffset.top + delta.top + 'px');
55
-		}
56
-
57
-		// if element was hidden, hide it again
58
-		if(hidden)
59
-			$el.hide();
60
-	}
61
-
62
-	$.fn.extend({
63
-
64
-		/**
65
-		 * Store the original version of offset(), so that we don't lose it
66
-		 */
67
-		_offset : $.fn.offset,
68
-
69
-		/**
70
-		 * Set or get the specific left and top position of the matched
71
-		 * elements, relative the the browser window by calling setXY
72
-		 * @param {Object} newOffset
73
-		 */
74
-		offset : function(newOffset){
75
-			return !newOffset ? this._offset() : this.each(function(){
76
-				setOffset(this, newOffset);
77
-			});
78
-		}
79
-	});
80
-
81
-  $.fn.clonePosition = function(element, options){
82
-    var options = $.extend({
83
-      cloneWidth: true,
84
-      cloneHeight: true,
85
-      offsetLeft: 0,
86
-      offsetTop: 0
87
-    }, (options || {}));
88
-
89
-    var offsets = $(element).offset();
90
-
91
-    $(this).offset({top: (offsets.top + options.offsetTop),
92
-      left: (offsets.left + options.offsetLeft)});
93
-
94
-    if (options.cloneWidth) $(this).width($(element).width());
95
-    if (options.cloneHeight) $(this).height($(element).height());
96
-
97
-    return this;
98
-  }
99
-  
100
-  $.fn.absolutize = function() {
101
-    element = $(this);
102
-
103
-    if (element.css('position') == 'absolute') {
104
-        return element;
105
-    }
106
-
107
-    element.css({
108
-        position: 'absolute',
109
-        top:    element.offset().top + 'px',
110
-        left:   element.offset().left + 'px',
111
-        width:  element.width() + 'px',
112
-        height: element.height() + 'px'
113
-    });
114
-
115
-    return this;
116
-  }
117
-})(jQuery);

+ 0
- 1216
libs/moment-with-locales.min.js
File diff suppressed because it is too large
View File


+ 0
- 127
libs/php-fontawesome.php View File

@@ -1,127 +0,0 @@
1
-<?php
2
-/* 
3
- * SMK Font Awesome
4
- *
5
- * Get font awesome class names in an array or json format. 
6
- *
7
- * -------------------------------------------------------------------------------------
8
- * @Author: Smartik
9
- * @Author URI: http://smartik.ws/
10
- * @Copyright: (c) 2014 Smartik. All rights reserved
11
- * @License: MIT
12
- * -------------------------------------------------------------------------------------
13
- *
14
- *
15
- */
16
-if( ! class_exists('Smk_FontAwesome') ){
17
-    class Smk_FontAwesome{
18
-
19
-        /**
20
-         * Font Awesome
21
-         *
22
-         * @param string $path font awesome css file path
23
-         * @param string $class_prefix change this if the class names does not start with `fa-`
24
-         * @return array
25
-         */
26
-        public static function getArray($path, $class_prefix = 'fa-'){
27
-
28
-            if( ! file_exists($path) )
29
-                return false;//if path is incorect or file does not exist, stop.
30
-
31
-            $css = file_get_contents($path);
32
-            $pattern = '/\.('. $class_prefix .'(?:\w+(?:-)?)+):before\s+{\s*content:\s*"(.+)";\s+}/';
33
-
34
-            preg_match_all($pattern, $css, $matches, PREG_SET_ORDER);
35
-
36
-            $icons = array();
37
-            foreach ($matches as $match) {
38
-                $icons[$match[1]] = $match[2];
39
-            }
40
-            return $icons;
41
-
42
-        }
43
-
44
-        //------------------------------------//--------------------------------------//
45
-
46
-        /**
47
-         * Sort array by key name
48
-         *
49
-         * @param array $array font awesome array. Create it using `getArray` method
50
-         * @return array
51
-         */
52
-        public function sortByName($array){
53
-
54
-            if( ! is_array($array) )
55
-                return false;//Do not proceed if is not array
56
-
57
-            ksort( $array );
58
-            return $array;
59
-
60
-        }
61
-
62
-        //------------------------------------//--------------------------------------//
63
-
64
-        /**
65
-         * Get only HTML class key(class) => value(class)
66
-         *
67
-         * @param array $array font awesome array. Create it using `getArray` method
68
-         * @return array
69
-         */
70
-        public function onlyClass($array){
71
-
72
-            if( ! is_array($array) )
73
-                return false;//Do not proceed if is not array
74
-
75
-            $temp = array();
76
-            foreach ($array as $class => $unicode) {
77
-                $temp[$class] = $class;
78
-            }
79
-            return $temp;
80
-
81
-        }
82
-
83
-        //------------------------------------//--------------------------------------//
84
-
85
-        /**
86
-         * Get only the unicode key
87
-         *
88
-         * @param array $array font awesome array. Create it using `getArray` method
89
-         * @return array
90
-         */
91
-        public function onlyUnicode($array){
92
-
93
-            if( ! is_array($array) )
94
-                return false;//Do not proceed if is not array
95
-
96
-            $temp = array();
97
-            foreach ($array as $class => $unicode) {
98
-                $temp[$unicode] = $unicode;
99
-            }
100
-            return $temp;
101
-
102
-        }
103
-
104
-        //------------------------------------//--------------------------------------//
105
-
106
-        /**
107
-         * Readable class name. Ex: fa-video-camera => Video Camera
108
-         *
109
-         * @param array $array font awesome array. Create it using `getArray` method
110
-         * @param string $class_prefix change this if the class names does not start with `fa-`
111
-         * @return array
112
-         */
113
-        public function readableName($array, $class_prefix = 'fa-'){
114
-
115
-            if( ! is_array($array) )
116
-                return false;//Do not proceed if is not array
117
-
118
-            $temp = array();
119
-            foreach ($array as $class => $unicode) {
120
-                $temp[$class] = ucfirst( str_ireplace(array($class_prefix, '-'), array('', ' '), $class) );
121
-            }
122
-            return $temp;
123
-
124
-        }
125
-
126
-    }//class
127
-}//class_exists

+ 0
- 4
libs/quickform/.gitignore View File

@@ -1,4 +0,0 @@
1
-# composer related
2
-composer.lock
3
-composer.phar
4
-vendor

+ 0
- 290
libs/quickform/Common.php View File

@@ -1,290 +0,0 @@
1
-<?php
2
-/**
3
- * Base class for all HTML classes
4
- *
5
- * @package     HTML_Common
6
- * @author      Adam Daniel <adaniel1@eesus.jnj.com>
7
- * @copyright   2001-2009 The PHP Group
8
- * @license     http://www.php.net/license/3_01.txt PHP License 3.01
9
- */
10
-
11
-/**
12
- * Base class for all HTML classes
13
- *
14
- * @package     HTML_Common
15
- * @author      Adam Daniel <adaniel1@eesus.jnj.com>
16
- */
17
-abstract class HTML_Common
18
-{
19
-    /**
20
-     * Associative array of attributes
21
-     *
22
-     * @var     array
23
-     * @access  private
24
-     */
25
-    var $_attributes = array();
26
-
27
-    /**
28
-     * Class constructor
29
-     *
30
-     * @param    mixed   $attributes     Associative array of table tag attributes or HTML attributes name="value" pairs
31
-     */
32
-    public function __construct($attributes = null)
33
-    {
34
-        $this->setAttributes($attributes);
35
-    }
36
-
37
-    /**
38
-     * Returns the current API version
39
-     *
40
-     * @returns  double
41
-     */
42
-    public function apiVersion()
43
-    {
44
-        return 1.7;
45
-    }
46
-
47
-    /**
48
-     * Returns an HTML formatted attribute string
49
-     *
50
-     * @param    array   $attributes
51
-     * @return   string
52
-     * @access   private
53
-     */
54
-    function _getAttrString($attributes)
55
-    {
56
-        $strAttr = '';
57
-
58
-        if (is_array($attributes)) {
59
-            $charset = self::charset();
60
-            foreach ($attributes as $key => $value) {
61
-                $strAttr .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT, $charset) . '"';
62
-            }
63
-        }
64
-        return $strAttr;
65
-    }
66
-
67
-    /**
68
-     * Returns a valid atrributes array from either a string or array
69
-     *
70
-     * @param    mixed   $attributes     Either a typical HTML attribute string or an associative array
71
-     * @access   private
72
-     * @return   array
73
-     */
74
-    function _parseAttributes($attributes)
75
-    {
76
-        if (is_array($attributes)) {
77
-            $ret = array();
78
-            foreach ($attributes as $key => $value) {
79
-                if (is_int($key)) {
80
-                    $key = $value = strtolower($value);
81
-                } else {
82
-                    $key = strtolower($key);
83
-                }
84
-                $ret[$key] = $value;
85
-            }
86
-            return $ret;
87
-
88
-        } elseif (is_string($attributes)) {
89
-            $preg = "/(([A-Za-z_:]|[^\\x00-\\x7F])([A-Za-z0-9_:.-]|[^\\x00-\\x7F])*)" .
90
-                "([ \\n\\t\\r]+)?(=([ \\n\\t\\r]+)?(\"[^\"]*\"|'[^']*'|[^ \\n\\t\\r]*))?/";
91
-            if (preg_match_all($preg, $attributes, $regs)) {
92
-                for ($counter=0; $counter<count($regs[1]); $counter++) {
93
-                    $name  = $regs[1][$counter];
94
-                    $check = $regs[0][$counter];
95
-                    $value = $regs[7][$counter];
96
-                    if (trim($name) == trim($check)) {
97
-                        $arrAttr[strtolower(trim($name))] = strtolower(trim($name));
98
-                    } else {
99
-                        if (substr($value, 0, 1) == "\"" || substr($value, 0, 1) == "'") {
100
-                            $arrAttr[strtolower(trim($name))] = substr($value, 1, -1);
101
-                        } else {
102
-                            $arrAttr[strtolower(trim($name))] = trim($value);
103
-                        }
104
-                    }
105
-                }
106
-                return $arrAttr;
107
-            }
108
-        }
109
-    }
110
-
111
-    /**
112
-     * Returns the array key for the given non-name-value pair attribute
113
-     *
114
-     * @param     string    $attr         Attribute
115
-     * @param     array     $attributes   Array of attribute
116
-     * @since     1.0
117
-     * @access    private
118
-     * @return    bool
119
-     */
120
-    function _getAttrKey($attr, $attributes)
121
-    {
122
-        if (isset($attributes[strtolower($attr)])) {
123
-            return true;
124
-        } else {
125
-            return null;
126
-        }
127
-    }
128
-
129
-    /**
130
-     * Updates the attributes in $attr1 with the values in $attr2 without changing the other existing attributes
131
-     *
132
-     * @param    array $attr1 Original attributes array
133
-     * @param    array $attr2 New attributes array
134
-     * @access   private
135
-     * @return bool
136
-     */
137
-    function _updateAttrArray(&$attr1, $attr2)
138
-    {
139
-        if (!is_array($attr2)) {
140
-            return false;
141
-        }
142
-        foreach ($attr2 as $key => $value) {
143
-            $attr1[$key] = $value;
144
-        }
145
-    }
146
-
147
-    /**
148
-     * Removes the given attribute from the given array
149
-     *
150
-     * @param     string    $attr           Attribute name
151
-     * @param     array     $attributes     Attribute array
152
-     * @access    private
153
-     * @return    void
154
-     */
155
-    function _removeAttr($attr, &$attributes)
156
-    {
157
-        $attr = strtolower($attr);
158
-        if (isset($attributes[$attr])) {
159
-            unset($attributes[$attr]);
160
-        }
161
-    }
162
-
163
-    /**
164
-     * Returns the value of the given attribute
165
-     *
166
-     * @param     string    $attr   Attribute name
167
-     * @return    string|null   returns null if an attribute does not exist
168
-     */
169
-    public function getAttribute($attr)
170
-    {
171
-        $attr = strtolower($attr);
172
-        if (isset($this->_attributes[$attr])) {
173
-            return $this->_attributes[$attr];
174
-        }
175
-        return null;
176
-    }
177
-
178
-    /**
179
-     * Sets the value of the attribute
180
-     *
181
-     * @param   string  $name Attribute name
182
-     * @param   string  $value Attribute value (will be set to $name if omitted)
183
-     */
184
-    public function setAttribute($name, $value = null)
185
-    {
186
-        $name = strtolower($name);
187
-        if (is_null($value)) {
188
-            $value = $name;
189
-        }
190
-        $this->_attributes[$name] = $value;
191
-    }
192
-
193
-    /**
194
-     * Sets the HTML attributes
195
-     *
196
-     * @param    mixed   $attributes     Either a typical HTML attribute string or an associative array
197
-     */
198
-    public function setAttributes($attributes)
199
-    {
200
-        $this->_attributes = $this->_parseAttributes($attributes);
201
-    }
202
-
203
-    /**
204
-     * Returns the assoc array (default) or string of attributes
205
-     *
206
-     * @param     bool    $asString Whether to return the attributes as string
207
-     * @return    mixed   attributes
208
-     */
209
-    public function getAttributes($asString = false)
210
-    {
211
-        if ($asString) {
212
-            return $this->_getAttrString($this->_attributes);
213
-        } else {
214
-            return $this->_attributes;
215
-        }
216
-    }
217
-
218
-    /**
219
-     * Updates the passed attributes without changing the other existing attributes
220
-     *
221
-     * @param    mixed   $attributes     Either a typical HTML attribute string or an associative array
222
-     */
223
-    function updateAttributes($attributes)
224
-    {
225
-        $this->_updateAttrArray($this->_attributes, $this->_parseAttributes($attributes));
226
-    }
227
-
228
-    /**
229
-     * Removes an attribute
230
-     *
231
-     * @param     string    $attr   Attribute name
232
-     */
233
-    public function removeAttribute($attr)
234
-    {
235
-        $this->_removeAttr($attr, $this->_attributes);
236
-    }
237
-
238
-    /**
239
-     * Abstract method.  Must be extended to return the objects HTML
240
-     *
241
-     * @return    string
242
-     */
243
-    abstract function toHtml();
244
-
245
-    /**
246
-     * Displays the HTML to the screen
247
-     */
248
-    public function display()
249
-    {
250
-        print $this->toHtml();
251
-    }
252
-
253
-    /**
254
-     * Sets the charset to use by htmlspecialchars() function
255
-     *
256
-     * Since this parameter is expected to be global, the function is designed
257
-     * to be called statically:
258
-     * <code>
259
-     * HTML_Common::charset('utf-8');
260
-     * </code>
261
-     * or
262
-     * <code>
263
-     * $charset = HTML_Common::charset();
264
-     * </code>
265
-     *
266
-     * @param   string  $newCharset New charset to use. Omit if just getting the current value. Consult the htmlspecialchars() docs for a list of supported character sets.
267
-     * @return  string  Current charset
268
-     */
269
-    public static function charset($newCharset = null)
270
-    {
271
-        static $charset = 'ISO-8859-1';
272
-
273
-        if (!is_null($newCharset)) {
274
-            $charset = $newCharset;
275
-        }
276
-        return $charset;
277
-    }
278
-
279
-    public function addClass($addClass)
280
-    {
281
-        $class = $this->getAttribute('class');
282
-        if($class != null) {
283
-            $class = $class.' '.$addClass;
284
-        } else {
285
-            $class = $addClass;
286
-        }
287
-        $this->setAttribute('class', $class);
288
-    }
289
-}
290
-?>

+ 0
- 1712
libs/quickform/QuickForm.php
File diff suppressed because it is too large
View File


+ 0
- 32
libs/quickform/QuickForm/Error.php View File

@@ -1,32 +0,0 @@
1
-<?php
2
-/**
3
- * Class for errors thrown by HTML_QuickForm package
4
- *
5
- * @package     HTML_QuickForm
6
- * @author      Adam Daniel <adaniel1@eesus.jnj.com>
7
- * @author      Bertrand Mansion <bmansion@mamasam.com>
8
- */
9
-class HTML_QuickForm_Error extends Exception
10
-{
11
-    /**
12
-     * Prefix for all error messages
13
-     * @var string
14
-     */
15
-    var $error_message_prefix = 'QuickForm Error: ';
16
-
17
-    /**
18
-     * Creates a quickform error exception
19
-     *
20
-     * @param string $message The error message
21
-     * @param int $code The error code
22
-     * @throws self
23
-     */
24
-    function __construct($message, $code = QUICKFORM_ERROR)
25
-    {
26
-        if (is_int($code)) {
27
-            parent::__construct(HTML_QuickForm::errorMessage($code) . ': ' . $message, $code);
28
-        } else {
29
-            throw new self("Invalid error code: $code", QUICKFORM_ERROR, $this);
30
-        }
31
-    }
32
-}

+ 0
- 490
libs/quickform/QuickForm/Field/Group/date.php View File

@@ -1,490 +0,0 @@
1
-<?php
2
-/**
3
- * @package     HTML_QuickForm
4
- * @author      Alexey Borzov <avb@php.net>
5
- * @copyright   2001-2011 The PHP Group
6
- * @license     http://www.php.net/license/3_01.txt PHP License 3.01
7
- */
8
-
9
-/**
10
- * Class for a group of elements used to input dates (and times).
11
- *
12
- * Inspired by original 'date' element but reimplemented as a subclass
13
- * of HTML_QuickForm_group
14
- *
15
- * @package     HTML_QuickForm
16
- * @author      Alexey Borzov <avb@php.net>
17
- */
18
-class HTML_QuickForm_date extends HTML_QuickForm_group
19
-{
20
-   /**
21
-    * Various options to control the element's display.
22
-    *
23
-    * @access   private
24
-    * @var      array
25
-    */
26
-    var $_options = array(
27
-        'language'         => 'en',
28
-        'format'           => 'dMY',
29
-        'minYear'          => 2001,
30
-        'maxYear'          => null, // set in the constructor
31
-        'addEmptyOption'   => false,
32
-        'emptyOptionValue' => '',
33
-        'emptyOptionText'  => '&nbsp;',
34
-        'optionIncrement'  => array('i' => 1, 's' => 1)
35
-    );
36
-
37
-   /**
38
-    * These complement separators, they are appended to the resultant HTML
39
-    * @access   private
40
-    * @var      array
41
-    */
42
-    var $_wrap = array('', '');
43
-
44
-   /**
45
-    * Options in different languages
46
-    *
47
-    * Note to potential translators: to avoid encoding problems please send
48
-    * your translations with "weird" letters encoded as HTML Unicode entities
49
-    *
50
-    * @access   private
51
-    * @var      array
52
-    */
53
-    var $_locale = array(
54
-        'en'    => array (
55
-            'weekdays_short'=> array ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'),
56
-            'weekdays_long' => array ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'),
57
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'),
58
-            'months_long'   => array ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')
59
-        ),
60
-        'de'    => array (
61
-            'weekdays_short'=> array ('So', 'Mon', 'Di', 'Mi', 'Do', 'Fr', 'Sa'),
62
-            'weekdays_long' => array ('Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'),
63
-            'months_short'  => array ('Jan', 'Feb', 'M&#xe4;rz', 'April', 'Mai', 'Juni', 'Juli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dez'),
64
-            'months_long'   => array ('Januar', 'Februar', 'M&#xe4;rz', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember')
65
-        ),
66
-        'fr'    => array (
67
-            'weekdays_short'=> array ('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'),
68
-            'weekdays_long' => array ('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'),
69
-            'months_short'  => array ('Jan', 'F&#xe9;v', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Ao&#xfb;t', 'Sep', 'Oct', 'Nov', 'D&#xe9;c'),
70
-            'months_long'   => array ('Janvier', 'F&#xe9;vrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Ao&#xfb;t', 'Septembre', 'Octobre', 'Novembre', 'D&#xe9;cembre')
71
-        ),
72
-        'hu'    => array (
73
-            'weekdays_short'=> array ('V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'),
74
-            'weekdays_long' => array ('vas&#xe1;rnap', 'h&#xe9;tf&#x151;', 'kedd', 'szerda', 'cs&#xfc;t&#xf6;rt&#xf6;k', 'p&#xe9;ntek', 'szombat'),
75
-            'months_short'  => array ('jan', 'feb', 'm&#xe1;rc', '&#xe1;pr', 'm&#xe1;j', 'j&#xfa;n', 'j&#xfa;l', 'aug', 'szept', 'okt', 'nov', 'dec'),
76
-            'months_long'   => array ('janu&#xe1;r', 'febru&#xe1;r', 'm&#xe1;rcius', '&#xe1;prilis', 'm&#xe1;jus', 'j&#xfa;nius', 'j&#xfa;lius', 'augusztus', 'szeptember', 'okt&#xf3;ber', 'november', 'december')
77
-        ),
78
-        'pl'    => array (
79
-            'weekdays_short'=> array ('Nie', 'Pn', 'Wt', '&#x15a;r', 'Czw', 'Pt', 'Sob'),
80
-            'weekdays_long' => array ('Niedziela', 'Poniedzia&#x142;ek', 'Wtorek', '&#x15a;roda', 'Czwartek', 'Pi&#x105;tek', 'Sobota'),
81
-            'months_short'  => array ('Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Pa&#x17a;', 'Lis', 'Gru'),
82
-            'months_long'   => array ('Stycze&#x144;', 'Luty', 'Marzec', 'Kwiecie&#x144;', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpie&#x144;', 'Wrzesie&#x144;', 'Pa&#x17a;dziernik', 'Listopad', 'Grudzie&#x144;')
83
-        ),
84
-        'sl'    => array (
85
-            'weekdays_short'=> array ('Ned', 'Pon', 'Tor', 'Sre', 'Cet', 'Pet', 'Sob'),
86
-            'weekdays_long' => array ('Nedelja', 'Ponedeljek', 'Torek', 'Sreda', 'Cetrtek', 'Petek', 'Sobota'),
87
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'),
88
-            'months_long'   => array ('Januar', 'Februar', 'Marec', 'April', 'Maj', 'Junij', 'Julij', 'Avgust', 'September', 'Oktober', 'November', 'December')
89
-        ),
90
-        'ru'    => array (
91
-            'weekdays_short'=> array ('&#x412;&#x441;', '&#x41f;&#x43d;', '&#x412;&#x442;', '&#x421;&#x440;', '&#x427;&#x442;', '&#x41f;&#x442;', '&#x421;&#x431;'),
92
-            'weekdays_long' => array ('&#x412;&#x43e;&#x441;&#x43a;&#x440;&#x435;&#x441;&#x435;&#x43d;&#x44c;&#x435;', '&#x41f;&#x43e;&#x43d;&#x435;&#x434;&#x435;&#x43b;&#x44c;&#x43d;&#x438;&#x43a;', '&#x412;&#x442;&#x43e;&#x440;&#x43d;&#x438;&#x43a;', '&#x421;&#x440;&#x435;&#x434;&#x430;', '&#x427;&#x435;&#x442;&#x432;&#x435;&#x440;&#x433;', '&#x41f;&#x44f;&#x442;&#x43d;&#x438;&#x446;&#x430;', '&#x421;&#x443;&#x431;&#x431;&#x43e;&#x442;&#x430;'),
93
-            'months_short'  => array ('&#x42f;&#x43d;&#x432;', '&#x424;&#x435;&#x432;', '&#x41c;&#x430;&#x440;', '&#x410;&#x43f;&#x440;', '&#x41c;&#x430;&#x439;', '&#x418;&#x44e;&#x43d;', '&#x418;&#x44e;&#x43b;', '&#x410;&#x432;&#x433;', '&#x421;&#x435;&#x43d;', '&#x41e;&#x43a;&#x442;', '&#x41d;&#x43e;&#x44f;', '&#x414;&#x435;&#x43a;'),
94
-            'months_long'   => array ('&#x42f;&#x43d;&#x432;&#x430;&#x440;&#x44c;', '&#x424;&#x435;&#x432;&#x440;&#x430;&#x43b;&#x44c;', '&#x41c;&#x430;&#x440;&#x442;', '&#x410;&#x43f;&#x440;&#x435;&#x43b;&#x44c;', '&#x41c;&#x430;&#x439;', '&#x418;&#x44e;&#x43d;&#x44c;', '&#x418;&#x44e;&#x43b;&#x44c;', '&#x410;&#x432;&#x433;&#x443;&#x441;&#x442;', '&#x421;&#x435;&#x43d;&#x442;&#x44f;&#x431;&#x440;&#x44c;', '&#x41e;&#x43a;&#x442;&#x44f;&#x431;&#x440;&#x44c;', '&#x41d;&#x43e;&#x44f;&#x431;&#x440;&#x44c;', '&#x414;&#x435;&#x43a;&#x430;&#x431;&#x440;&#x44c;')
95
-        ),
96
-        'es'    => array (
97
-            'weekdays_short'=> array ('Dom', 'Lun', 'Mar', 'Mi&#xe9;', 'Jue', 'Vie', 'S&#xe1;b'),
98
-            'weekdays_long' => array ('Domingo', 'Lunes', 'Martes', 'Mi&#xe9;rcoles', 'Jueves', 'Viernes', 'S&#xe1;bado'),
99
-            'months_short'  => array ('Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'),
100
-            'months_long'   => array ('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre')
101
-        ),
102
-        'da'    => array (
103
-            'weekdays_short'=> array ('S&#xf8;n', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'L&#xf8;r'),
104
-            'weekdays_long' => array ('S&#xf8;ndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'L&#xf8;rdag'),
105
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
106
-            'months_long'   => array ('Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'December')
107
-        ),
108
-        'is'    => array (
109
-            'weekdays_short'=> array ('Sun', 'M&#xe1;n', '&#xde;ri', 'Mi&#xf0;', 'Fim', 'F&#xf6;s', 'Lau'),
110
-            'weekdays_long' => array ('Sunnudagur', 'M&#xe1;nudagur', '&#xde;ri&#xf0;judagur', 'Mi&#xf0;vikudagur', 'Fimmtudagur', 'F&#xf6;studagur', 'Laugardagur'),
111
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'Ma&#xed;', 'J&#xfa;n', 'J&#xfa;l', '&#xc1;g&#xfa;', 'Sep', 'Okt', 'N&#xf3;v', 'Des'),
112
-            'months_long'   => array ('Jan&#xfa;ar', 'Febr&#xfa;ar', 'Mars', 'Apr&#xed;l', 'Ma&#xed;', 'J&#xfa;n&#xed;', 'J&#xfa;l&#xed;', '&#xc1;g&#xfa;st', 'September', 'Okt&#xf3;ber', 'N&#xf3;vember', 'Desember')
113
-        ),
114
-        'it'    => array (
115
-            'weekdays_short'=> array ('Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'),
116
-            'weekdays_long' => array ('Domenica', 'Luned&#xec;', 'Marted&#xec;', 'Mercoled&#xec;', 'Gioved&#xec;', 'Venerd&#xec;', 'Sabato'),
117
-            'months_short'  => array ('Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'),
118
-            'months_long'   => array ('Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre')
119
-        ),
120
-        'sk'    => array (
121
-            'weekdays_short'=> array ('Ned', 'Pon', 'Uto', 'Str', '&#x8a;tv', 'Pia', 'Sob'),
122
-            'weekdays_long' => array ('Nede&#x17e;a', 'Pondelok', 'Utorok', 'Streda', '&#x8a;tvrtok', 'Piatok', 'Sobota'),
123
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'M&#xe1;j', 'J&#xfa;n', 'J&#xfa;l', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
124
-            'months_long'   => array ('Janu&#xe1;r', 'Febru&#xe1;r', 'Marec', 'Apr&#xed;l', 'M&#xe1;j', 'J&#xfa;n', 'J&#xfa;l', 'August', 'September', 'Okt&#xf3;ber', 'November', 'December')
125
-        ),
126
-        'cs'    => array (
127
-            'weekdays_short'=> array ('Ne', 'Po', '&#xda;t', 'St', '&#x10c;t', 'P&#xe1;', 'So'),
128
-            'weekdays_long' => array ('Ned&#x11b;le', 'Pond&#x11b;l&#xed;', '&#xda;ter&#xfd;', 'St&#x159;eda', '&#x10c;tvrtek', 'P&#xe1;tek', 'Sobota'),
129
-            'months_short'  => array ('Led', '&#xda;no', 'B&#x159;e', 'Dub', 'Kv&#x11b;', '&#x10c;en', '&#x10c;ec', 'Srp', 'Z&#xe1;&#x159;', '&#x158;&#xed;j', 'Lis', 'Pro'),
130
-            'months_long'   => array ('Leden', '&#xda;nor', 'B&#x159;ezen', 'Duben', 'Kv&#x11b;ten', '&#x10c;erven', '&#x10c;ervenec', 'Srpen', 'Z&#xe1;&#x159;&#xed;', '&#x158;&#xed;jen', 'Listopad', 'Prosinec')
131
-        ),
132
-        'hy'    => array (
133
-            'weekdays_short'=> array ('&#x53f;&#x580;&#x56f;', '&#x535;&#x580;&#x56f;', '&#x535;&#x580;&#x584;', '&#x549;&#x580;&#x584;', '&#x540;&#x576;&#x563;', '&#x548;&#x582;&#x580;', '&#x547;&#x562;&#x569;'),
134
-            'weekdays_long' => array ('&#x53f;&#x56b;&#x580;&#x561;&#x56f;&#x56b;', '&#x535;&#x580;&#x56f;&#x578;&#x582;&#x577;&#x561;&#x562;&#x569;&#x56b;', '&#x535;&#x580;&#x565;&#x584;&#x577;&#x561;&#x562;&#x569;&#x56b;', '&#x549;&#x578;&#x580;&#x565;&#x584;&#x577;&#x561;&#x562;&#x569;&#x56b;', '&#x540;&#x56b;&#x576;&#x563;&#x577;&#x561;&#x562;&#x569;&#x56b;', '&#x548;&#x582;&#x580;&#x562;&#x561;&#x569;', '&#x547;&#x561;&#x562;&#x561;&#x569;'),
135
-            'months_short'  => array ('&#x540;&#x576;&#x57e;', '&#x553;&#x57f;&#x580;', '&#x544;&#x580;&#x57f;', '&#x531;&#x57a;&#x580;', '&#x544;&#x575;&#x57d;', '&#x540;&#x576;&#x57d;', '&#x540;&#x56c;&#x57d;', '&#x555;&#x563;&#x57d;', '&#x54d;&#x57a;&#x57f;', '&#x540;&#x56f;&#x57f;', '&#x546;&#x575;&#x574;', '&#x534;&#x56f;&#x57f;'),
136
-            'months_long'   => array ('&#x540;&#x578;&#x582;&#x576;&#x57e;&#x561;&#x580;', '&#x553;&#x565;&#x57f;&#x580;&#x57e;&#x561;&#x580;', '&#x544;&#x561;&#x580;&#x57f;', '&#x531;&#x57a;&#x580;&#x56b;&#x56c;', '&#x544;&#x561;&#x575;&#x56b;&#x57d;', '&#x540;&#x578;&#x582;&#x576;&#x56b;&#x57d;', '&#x540;&#x578;&#x582;&#x56c;&#x56b;&#x57d;', '&#x555;&#x563;&#x578;&#x57d;&#x57f;&#x578;&#x57d;', '&#x54d;&#x565;&#x57a;&#x57f;&#x565;&#x574;&#x562;&#x565;&#x580;', '&#x540;&#x578;&#x56f;&#x57f;&#x565;&#x574;&#x562;&#x565;&#x580;', '&#x546;&#x578;&#x575;&#x565;&#x574;&#x562;&#x565;&#x580;', '&#x534;&#x565;&#x56f;&#x57f;&#x565;&#x574;&#x562;&#x565;&#x580;')
137
-        ),
138
-        'nl'    => array (
139
-            'weekdays_short'=> array ('Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'),
140
-            'weekdays_long' => array ('Zondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag'),
141
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
142
-            'months_long'   => array ('Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December')
143
-        ),
144
-        'et'    => array (
145
-            'weekdays_short'=> array ('P', 'E', 'T', 'K', 'N', 'R', 'L'),
146
-            'weekdays_long' => array ('P&#xfc;hap&#xe4;ev', 'Esmasp&#xe4;ev', 'Teisip&#xe4;ev', 'Kolmap&#xe4;ev', 'Neljap&#xe4;ev', 'Reede', 'Laup&#xe4;ev'),
147
-            'months_short'  => array ('Jaan', 'Veebr', 'M&#xe4;rts', 'Aprill', 'Mai', 'Juuni', 'Juuli', 'Aug', 'Sept', 'Okt', 'Nov', 'Dets'),
148
-            'months_long'   => array ('Jaanuar', 'Veebruar', 'M&#xe4;rts', 'Aprill', 'Mai', 'Juuni', 'Juuli', 'August', 'September', 'Oktoober', 'November', 'Detsember')
149
-        ),
150
-        'tr'    => array (
151
-            'weekdays_short'=> array ('Paz', 'Pzt', 'Sal', '&#xc7;ar', 'Per', 'Cum', 'Cts'),
152
-            'weekdays_long' => array ('Pazar', 'Pazartesi', 'Sal&#x131;', '&#xc7;ar&#x15f;amba', 'Per&#x15f;embe', 'Cuma', 'Cumartesi'),
153
-            'months_short'  => array ('Ock', '&#x15e;bt', 'Mrt', 'Nsn', 'Mys', 'Hzrn', 'Tmmz', 'A&#x11f;st', 'Eyl', 'Ekm', 'Ksm', 'Arlk'),
154
-            'months_long'   => array ('Ocak', '&#x15e;ubat', 'Mart', 'Nisan', 'May&#x131;s', 'Haziran', 'Temmuz', 'A&#x11f;ustos', 'Eyl&#xfc;l', 'Ekim', 'Kas&#x131;m', 'Aral&#x131;k')
155
-        ),
156
-        'no'    => array (
157
-            'weekdays_short'=> array ('S&#xf8;n', 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'L&#xf8;r'),
158
-            'weekdays_long' => array ('S&#xf8;ndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'L&#xf8;rdag'),
159
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'),
160
-            'months_long'   => array ('Januar', 'Februar', 'Mars', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember')
161
-        ),
162
-        'eo'    => array (
163
-            'weekdays_short'=> array ('Dim', 'Lun', 'Mar', 'Mer', '&#x134;a&#x16D;', 'Ven', 'Sab'),
164
-            'weekdays_long' => array ('Diman&#x109;o', 'Lundo', 'Mardo', 'Merkredo', '&#x134;a&#x16D;do', 'Vendredo', 'Sabato'),
165
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'A&#x16D;g', 'Sep', 'Okt', 'Nov', 'Dec'),
166
-            'months_long'   => array ('Januaro', 'Februaro', 'Marto', 'Aprilo', 'Majo', 'Junio', 'Julio', 'A&#x16D;gusto', 'Septembro', 'Oktobro', 'Novembro', 'Decembro')
167
-        ),
168
-        'ua'    => array (
169
-            'weekdays_short'=> array('&#x41d;&#x434;&#x43b;', '&#x41f;&#x43d;&#x434;', '&#x412;&#x442;&#x440;', '&#x421;&#x440;&#x434;', '&#x427;&#x442;&#x432;', '&#x41f;&#x442;&#x43d;', '&#x421;&#x431;&#x442;'),
170
-            'weekdays_long' => array('&#x41d;&#x435;&#x434;&#x456;&#x43b;&#x44f;', '&#x41f;&#x43e;&#x43d;&#x435;&#x434;&#x456;&#x43b;&#x43e;&#x43a;', '&#x412;&#x456;&#x432;&#x442;&#x43e;&#x440;&#x43e;&#x43a;', '&#x421;&#x435;&#x440;&#x435;&#x434;&#x430;', '&#x427;&#x435;&#x442;&#x432;&#x435;&#x440;', '&#x41f;\'&#x44f;&#x442;&#x43d;&#x438;&#x446;&#x44f;', '&#x421;&#x443;&#x431;&#x43e;&#x442;&#x430;'),
171
-            'months_short'  => array('&#x421;&#x456;&#x447;', '&#x41b;&#x44e;&#x442;', '&#x411;&#x435;&#x440;', '&#x41a;&#x432;&#x456;', '&#x422;&#x440;&#x430;', '&#x427;&#x435;&#x440;', '&#x41b;&#x438;&#x43f;', '&#x421;&#x435;&#x440;', '&#x412;&#x435;&#x440;', '&#x416;&#x43e;&#x432;', '&#x41b;&#x438;&#x441;', '&#x413;&#x440;&#x443;'),
172
-            'months_long'   => array('&#x421;&#x456;&#x447;&#x435;&#x43d;&#x44c;', '&#x41b;&#x44e;&#x442;&#x438;&#x439;', '&#x411;&#x435;&#x440;&#x435;&#x437;&#x435;&#x43d;&#x44c;', '&#x41a;&#x432;&#x456;&#x442;&#x435;&#x43d;&#x44c;', '&#x422;&#x440;&#x430;&#x432;&#x435;&#x43d;&#x44c;', '&#x427;&#x435;&#x440;&#x432;&#x435;&#x43d;&#x44c;', '&#x41b;&#x438;&#x43f;&#x435;&#x43d;&#x44c;', '&#x421;&#x435;&#x440;&#x43f;&#x435;&#x43d;&#x44c;', '&#x412;&#x435;&#x440;&#x435;&#x441;&#x435;&#x43d;&#x44c;', '&#x416;&#x43e;&#x432;&#x442;&#x435;&#x43d;&#x44c;', '&#x41b;&#x438;&#x441;&#x442;&#x43e;&#x43f;&#x430;&#x434;', '&#x413;&#x440;&#x443;&#x434;&#x435;&#x43d;&#x44c;')
173
-        ),
174
-        'ro'    => array (
175
-            'weekdays_short'=> array ('Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'),
176
-            'weekdays_long' => array ('Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'),
177
-            'months_short'  => array ('Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Iun', 'Iul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'),
178
-            'months_long'   => array ('Ianuarie', 'Februarie', 'Martie', 'Aprilie', 'Mai', 'Iunie', 'Iulie', 'August', 'Septembrie', 'Octombrie', 'Noiembrie', 'Decembrie')
179
-        ),
180
-        'he'    => array (
181
-            'weekdays_short'=> array ('&#1512;&#1488;&#1513;&#1493;&#1503;', '&#1513;&#1504;&#1497;', '&#1513;&#1500;&#1497;&#1513;&#1497;', '&#1512;&#1489;&#1497;&#1506;&#1497;', '&#1495;&#1502;&#1497;&#1513;&#1497;', '&#1513;&#1497;&#1513;&#1497;', '&#1513;&#1489;&#1514;'),
182
-            'weekdays_long' => array ('&#1497;&#1493;&#1501; &#1512;&#1488;&#1513;&#1493;&#1503;', '&#1497;&#1493;&#1501; &#1513;&#1504;&#1497;', '&#1497;&#1493;&#1501; &#1513;&#1500;&#1497;&#1513;&#1497;', '&#1497;&#1493;&#1501; &#1512;&#1489;&#1497;&#1506;&#1497;', '&#1497;&#1493;&#1501; &#1495;&#1502;&#1497;&#1513;&#1497;', '&#1497;&#1493;&#1501; &#1513;&#1497;&#1513;&#1497;', '&#1513;&#1489;&#1514;'),
183
-            'months_short'  => array ('&#1497;&#1504;&#1493;&#1488;&#1512;', '&#1508;&#1489;&#1512;&#1493;&#1488;&#1512;', '&#1502;&#1512;&#1509;', '&#1488;&#1508;&#1512;&#1497;&#1500;', '&#1502;&#1488;&#1497;', '&#1497;&#1493;&#1504;&#1497;', '&#1497;&#1493;&#1500;&#1497;', '&#1488;&#1493;&#1490;&#1493;&#1505;&#1496;', '&#1505;&#1508;&#1496;&#1502;&#1489;&#1512;', '&#1488;&#1493;&#1511;&#1496;&#1493;&#1489;&#1512;', '&#1504;&#1493;&#1489;&#1502;&#1489;&#1512;', '&#1491;&#1510;&#1502;&#1489;&#1512;'),
184
-            'months_long'   => array ('&#1497;&#1504;&#1493;&#1488;&#1512;', '&#1508;&#1489;&#1512;&#1493;&#1488;&#1512;', '&#1502;&#1512;&#1509;', '&#1488;&#1508;&#1512;&#1497;&#1500;', '&#1502;&#1488;&#1497;', '&#1497;&#1493;&#1504;&#1497;', '&#1497;&#1493;&#1500;&#1497;', '&#1488;&#1493;&#1490;&#1493;&#1505;&#1496;', '&#1505;&#1508;&#1496;&#1502;&#1489;&#1512;', '&#1488;&#1493;&#1511;&#1496;&#1493;&#1489;&#1512;', '&#1504;&#1493;&#1489;&#1502;&#1489;&#1512;', '&#1491;&#1510;&#1502;&#1489;&#1512;')
185
-        ),
186
-        'sv'    => array (
187
-            'weekdays_short'=> array ('S&#xf6;n', 'M&#xe5;n', 'Tis', 'Ons', 'Tor', 'Fre', 'L&#xf6;r'),
188
-            'weekdays_long' => array ('S&#xf6;ndag', 'M&#xe5;ndag', 'Tisdag', 'Onsdag', 'Torsdag', 'Fredag', 'L&#xf6;rdag'),
189
-            'months_short'  => array ('Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'),
190
-            'months_long'   => array ('Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli', 'Augusti', 'September', 'Oktober', 'November', 'December')
191
-        ),
192
-        'pt'    => array (
193
-            'weekdays_short'=> array ('Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'S&aacute;b'),
194
-            'weekdays_long' => array ('Domingo', 'Segunda-feira', 'Ter&ccedil;a-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'S&aacute;bado'),
195
-            'months_short'  => array ('Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'),
196
-            'months_long'   => array ('Janeiro', 'Fevereiro', 'Mar&ccedil;o', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro')
197
-        ),
198
-        'tw'    => array (
199
-            'weekdays_short'=> array ('&#36913;&#26085;','&#36913;&#19968;', '&#36913;&#20108;','&#36913;&#19977;', '&#36913;&#22235;','&#36913;&#20116;', '&#36913;&#20845;'),
200
-            'weekdays_long' => array ('&#26143;&#26399;&#26085;', '&#26143;&#26399;&#19968;', '&#26143;&#26399;&#20108;', '&#26143;&#26399;&#19977;', '&#26143;&#26399;&#22235;', '&#26143;&#26399;&#20116;', '&#26143;&#26399;&#20845;'),
201
-            'months_short'  => array ('&#19968;&#26376;', '&#20108;&#26376;', '&#19977;&#26376;', '&#22235;&#26376;', '&#20116;&#26376;', '&#20845;&#26376;', '&#19971;&#26376;', '&#20843;&#26376;', '&#20061;&#26376;', '&#21313;&#26376;', '&#21313;&#19968;&#26376;', '&#21313;&#20108;&#26376;'),
202
-            'months_long'   => array ('&#19968;&#26376;', '&#20108;&#26376;', '&#19977;&#26376;', '&#22235;&#26376;', '&#20116;&#26376;', '&#20845;&#26376;', '&#19971;&#26376;', '&#20843;&#26376;', '&#20061;&#26376;', '&#21313;&#26376;', '&#21313;&#19968;&#26376;', '&#21313;&#20108;&#26376;')
203
-        ),
204
-        'pt-br' => array (
205
-            'weekdays_short'=> array ('Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'S&aacute;b'),
206
-            'weekdays_long' => array ('Domingo', 'Segunda', 'Ter&ccedil;a', 'Quarta', 'Quinta', 'Sexta', 'S&aacute;bado'),
207
-            'months_short'  => array ('Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'),
208
-            'months_long'   => array ('Janeiro', 'Fevereiro', 'Mar&ccedil;o', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro')
209
-        ),
210
-        'sr'    => array (
211
-            'weekdays_short'=> array ('&#1053;&#1077;&#1076;', '&#1055;&#1086;&#1085;', '&#1059;&#1090;&#1086;', '&#1057;&#1088;&#1077;', '&#1063;&#1077;&#1090;', '&#1055;&#1077;&#1090;', '&#1057;&#1091;&#1073;'),
212
-            'weekdays_long' => array ('&#1053;&#1077;&#1076;&#1077;&#1113;&#1072;', '&#1055;&#1086;&#1085;&#1077;&#1076;&#1077;&#1113;&#1072;&#1082;', '&#1059;&#1090;&#1086;&#1088;&#1072;&#1082;', '&#1057;&#1088;&#1077;&#1076;&#1072;', '&#1063;&#1077;&#1090;&#1074;&#1088;&#1090;&#1072;&#1082;', '&#1055;&#1077;&#1090;&#1072;&#1082;', '&#1057;&#1091;&#1073;&#1086;&#1090;&#1072;'),
213
-            'months_short'  => array ('&#1032;&#1072;&#1085;', '&#1060;&#1077;&#1073;', '&#1052;&#1072;&#1088;', '&#1040;&#1087;&#1088;', '&#1052;&#1072;&#1112;', '&#1032;&#1091;&#1085;', '&#1032;&#1091;&#1083;', '&#1040;&#1074;&#1075;', '&#1057;&#1077;&#1087;', '&#1054;&#1082;&#1090;', '&#1053;&#1086;&#1074;', '&#1044;&#1077;&#1094;'),
214
-            'months_long'   => array ('&#1032;&#1072;&#1085;&#1091;&#1072;&#1088;', '&#1060;&#1077;&#1073;&#1088;&#1091;&#1072;&#1088;', '&#1052;&#1072;&#1088;&#1090;', '&#1040;&#1087;&#1088;&#1080;&#1083;', '&#1052;&#1072;&#1112;', '&#1032;&#1091;&#1085;', '&#1032;&#1091;&#1083;', '&#1040;&#1074;&#1075;&#1091;&#1089;&#1090;', '&#1057;&#1077;&#1087;&#1090;&#1077;&#1084;&#1073;&#1072;&#1088;', '&#1054;&#1082;&#1090;&#1086;&#1073;&#1072;&#1088;', '&#1053;&#1086;&#1074;&#1077;&#1084;&#1073;&#1072;&#1088;', '&#1044;&#1077;&#1094;&#1077;&#1084;&#1073;&#1072;&#1088;')
215
-        ),
216
-        'el' => array (
217
-            'weekdays_short'=> array ('&#916;&#949;&#965;', '&#932;&#961;&#943;', '&#932;&#949;&#964;', '&#928;&#941;&#956;', '&#928;&#945;&#961;', '&#931;&#940;&#946;', '&#922;&#965;&#961;'),
218
-            'weekdays_long' => array ('&#916;&#949;&#965;&#964;&#941;&#961;&#945;', '&#932;&#961;&#943;&#964;&#951;', '&#932;&#949;&#964;&#940;&#961;&#964;&#951;', '&#928;&#941;&#956;&#960;&#964;&#951;', '&#928;&#945;&#961;&#945;&#963;&#954;&#949;&#965;&#942;', '&#931;&#940;&#946;&#946;&#945;&#964;&#959;', '&#922;&#965;&#961;&#953;&#945;&#954;&#942;'),
219
-            'months_short'  => array ('&#921;&#945;&#957;', '&#934;&#949;&#946;', '&#924;&#940;&#961;', '&#913;&#960;&#961;', '&#924;&#940;&#970;', 'Io&#973;&#957;', '&#921;&#959;&#973;&#955;', '&#913;&#973;&#947;', '&#931;&#949;&#960;', '&#927;&#954;&#964;', '&#925;&#959;&#941;', '&#916;&#949;&#954;'),
220
-            'months_long'   => array ('&#921;&#945;&#957;&#959;&#965;&#940;&#961;&#953;&#959;&#962;', '&#934;&#949;&#946;&#961;&#959;&#965;&#940;&#961;&#953;&#959;&#962;', '&#924;&#940;&#961;&#964;&#953;&#959;&#962;', '&#913;&#960;&#961;&#943;&#955;&#953;&#959;&#962;', '&#924;&#940;&#970;&#959;&#962;', '&#921;&#959;&#973;&#957;&#953;&#959;&#962;', 'Io&#973;&#955;&#953;&#959;&#962;', '&#913;&#973;&#947;&#959;&#965;&#963;&#964;&#959;&#962;', '&#931;&#949;&#960;&#964;&#941;&#956;&#946;&#961;&#953;&#959;&#962;', '&#927;&#954;&#964;&#974;&#946;&#961;&#953;&#959;&#962;', '&#925;&#959;&#941;&#956;&#946;&#961;&#953;&#959;&#962;', '&#916;&#949;&#954;&#941;&#956;&#946;&#961;&#953;&#959;&#962;')
221
-        )
222
-    );
223
-
224
-   /**
225
-    * Class constructor
226
-    *
227
-    * The following keys may appear in $options array:
228
-    * - 'language': date language
229
-    * - 'format': Format of the date, based on PHP's date() function.
230
-    *   The following characters are currently recognised in format string:
231
-    *   <pre>
232
-    *       D => Short names of days
233
-    *       l => Long names of days
234
-    *       d => Day numbers
235
-    *       M => Short names of months
236
-    *       F => Long names of months
237
-    *       m => Month numbers
238
-    *       Y => Four digit year
239
-    *       y => Two digit year
240
-    *       h => 12 hour format
241
-    *       H => 23 hour  format
242
-    *       i => Minutes
243
-    *       s => Seconds
244
-    *       a => am/pm
245
-    *       A => AM/PM
246
-    *   </pre>
247
-    * - 'minYear': Minimum year in year select
248
-    * - 'maxYear': Maximum year in year select
249
-    * - 'addEmptyOption': Should an empty option be added to the top of
250
-    *    each select box?
251
-    * - 'emptyOptionValue': The value passed by the empty option.
252
-    * - 'emptyOptionText': The text displayed for the empty option.
253
-    * - 'optionIncrement': Step to increase the option values by (works for 'i' and 's')
254
-    *
255
-    * @param    string $elementName Element's name
256
-    * @param    mixed  $elementLabel Label(s) for an element
257
-    * @param    array  $options Options to control the element's display
258
-    * @param    mixed  $attributes Either a typical HTML attribute string or an associative array
259
-    */
260
-    public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
261
-    {
262
-        parent::__construct($elementName, $elementLabel);
263
-        $this->setAttributes($attributes);
264
-        $this->_persistantFreeze = true;
265
-        $this->_appendName = true;
266
-        $this->_type = 'date';
267
-
268
-        // http://pear.php.net/bugs/bug.php?id=18171
269
-        $this->_options['maxYear'] = date('Y');
270
-
271
-        // set the options, do not bother setting bogus ones
272
-        if (is_array($options)) {
273
-            foreach ($options as $name => $value) {
274
-                if ('language' == $name) {
275
-                    $this->_options['language'] = isset($this->_locale[$value])? $value: 'en';
276
-                } elseif (isset($this->_options[$name])) {
277
-                    if (is_array($value) && is_array($this->_options[$name])) {
278
-                        $this->_options[$name] = @array_merge($this->_options[$name], $value);
279
-                    } else {
280
-                        $this->_options[$name] = $value;
281
-                    }
282
-                }
283
-            }
284
-        }
285
-
286
-        $this->addClass('form-datefield');
287
-    }
288
-
289
-    function _createElements()
290
-    {
291
-        $this->_separator = $this->_elements = array();
292
-        $separator =  '';
293
-        $locale    =& $this->_locale[$this->_options['language']];
294
-        $backslash =  false;
295
-        for ($i = 0, $length = strlen($this->_options['format']); $i < $length; $i++) {
296
-            $sign = $this->_options['format']{$i};
297
-            if ($backslash) {
298
-                $backslash  = false;
299
-                $separator .= $sign;
300
-            } else {
301
-                $loadSelect = true;
302
-                switch ($sign) {
303
-                    case 'D':
304
-                        // Sunday is 0 like with 'w' in date()
305
-                        $options = $locale['weekdays_short'];
306
-                        break;
307
-                    case 'l':
308
-                        $options = $locale['weekdays_long'];
309
-                        break;
310
-                    case 'd':
311
-                        $options = $this->_createOptionList(1, 31);
312
-                        break;
313
-                    case 'M':
314
-                        $options = $locale['months_short'];
315
-                        array_unshift($options , '');
316
-                        unset($options[0]);
317
-                        break;
318
-                    case 'm':
319
-                        $options = $this->_createOptionList(1, 12);
320
-                        break;
321
-                    case 'F':
322
-                        $options = $locale['months_long'];
323
-                        array_unshift($options , '');
324
-                        unset($options[0]);
325
-                        break;
326
-                    case 'Y':
327
-                        $options = $this->_createOptionList(
328
-                            $this->_options['minYear'],
329
-                            $this->_options['maxYear'],
330
-                            $this->_options['minYear'] > $this->_options['maxYear']? -1: 1
331
-                        );
332
-                        break;
333
-                    case 'y':
334
-                        $options = $this->_createOptionList(
335
-                            $this->_options['minYear'],
336
-                            $this->_options['maxYear'],
337
-                            $this->_options['minYear'] > $this->_options['maxYear']? -1: 1
338
-                        );
339
-                        array_walk($options, create_function('&$v,$k','$v = substr($v,-2);'));
340
-                        break;
341
-                    case 'h':
342
-                        $options = $this->_createOptionList(1, 12);
343
-                        break;
344
-                    case 'g':
345
-                        $options = $this->_createOptionList(1, 12);
346
-                        array_walk($options, create_function('&$v,$k', '$v = intval($v);'));
347
-                        break;
348
-                    case 'H':
349
-                        $options = $this->_createOptionList(0, 23);
350
-                        break;
351
-                    case 'i':
352
-                        $options = $this->_createOptionList(0, 59, $this->_options['optionIncrement']['i']);
353
-                        break;
354
-                    case 's':
355
-                        $options = $this->_createOptionList(0, 59, $this->_options['optionIncrement']['s']);
356
-                        break;
357
-                    case 'a':
358
-                        $options = array('am' => 'am', 'pm' => 'pm');
359
-                        break;
360
-                    case 'A':
361
-                        $options = array('AM' => 'AM', 'PM' => 'PM');
362
-                        break;
363
-                    case 'W':
364
-                        $options = $this->_createOptionList(1, 53);
365
-                        break;
366
-                    case '\\':
367
-                        $backslash  = true;
368
-                        $loadSelect = false;
369
-                        break;
370
-                    default:
371
-                        $separator .= (' ' == $sign? '&nbsp;': $sign);
372
-                        $loadSelect = false;
373
-                }
374
-
375
-                if ($loadSelect) {
376
-                    if (0 < count($this->_elements)) {
377
-                        $this->_separator[] = $separator;
378
-                    } else {
379
-                        $this->_wrap[0] = $separator;
380
-                    }
381
-                    $separator = '';
382
-                    // Should we add an empty option to the top of the select?
383
-                    if (!is_array($this->_options['addEmptyOption']) && $this->_options['addEmptyOption'] ||
384
-                        is_array($this->_options['addEmptyOption']) && !empty($this->_options['addEmptyOption'][$sign])) {
385
-
386
-                        // Using '+' array operator to preserve the keys
387
-                        if (is_array($this->_options['emptyOptionText']) && !empty($this->_options['emptyOptionText'][$sign])) {
388
-                            $options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText'][$sign]) + $options;
389
-                        } else {
390
-                            $options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText']) + $options;
391
-                        }
392
-                    }
393
-                    $this->_elements[] = new HTML_QuickForm_select($sign, null, $options, $this->getAttributes());
394
-                }
395
-            }
396
-        }
397
-        $this->_wrap[1] = $separator . ($backslash? '\\': '');
398
-    }
399
-
400
-   /**
401
-    * Creates an option list containing the numbers from the start number to the end, inclusive
402
-    *
403
-    * @param    int    $start The start number
404
-    * @param    int    $end The end number
405
-    * @param    int    $step Increment by this value
406
-    * @access   private
407
-    * @return   array   An array of numeric options.
408
-    */
409
-    function _createOptionList($start, $end, $step = 1)
410
-    {
411
-        for ($i = $start, $options = array(); $start > $end? $i >= $end: $i <= $end; $i += $step) {
412
-            $options[$i] = sprintf('%02d', $i);
413
-        }
414
-        return $options;
415
-    }
416
-
417
-   /**
418
-    * Trims leading zeros from the (numeric) string
419
-    *
420
-    * @param    string $str A numeric string, possibly with leading zeros
421
-    * @return   string  String with leading zeros removed
422
-    */
423
-    function _trimLeadingZeros($str)
424
-    {
425
-        if (0 == strcmp($str, $this->_options['emptyOptionValue'])) {
426
-            return $str;
427
-        }
428
-        $trimmed = ltrim($str, '0');
429
-        return strlen($trimmed)? $trimmed: '0';
430
-    }
431
-
432
-    function setValue($value)
433
-    {
434
-        if (empty($value)) {
435
-            $value = array();
436
-        } elseif (is_scalar($value)) {
437
-            if (!is_numeric($value)) {
438
-                $value = strtotime($value);
439
-            }
440
-            // might be a unix epoch, then we fill all possible values
441
-            $arr = explode('-', date('w-j-n-Y-g-G-i-s-a-A-W', (int)$value));
442
-            $value = array(
443
-                'D' => $arr[0],
444
-                'l' => $arr[0],
445
-                'd' => $arr[1],
446
-                'M' => $arr[2],
447
-                'm' => $arr[2],
448
-                'F' => $arr[2],
449
-                'Y' => $arr[3],
450
-                'y' => $arr[3],
451
-                'h' => $arr[4],
452
-                'g' => $arr[4],
453
-                'H' => $arr[5],
454
-                'i' => $this->_trimLeadingZeros($arr[6]),
455
-                's' => $this->_trimLeadingZeros($arr[7]),
456
-                'a' => $arr[8],
457
-                'A' => $arr[9],
458
-                'W' => $this->_trimLeadingZeros($arr[10])
459
-            );
460
-        } else {
461
-            $value = array_map(array($this, '_trimLeadingZeros'), $value);
462
-        }
463
-        parent::setValue($value);
464
-    }
465
-
466
-    function toHtml()
467
-    {
468
-        $renderer = new HTML_QuickForm_Renderer_Default();
469
-        $renderer->setElementTemplate('{element}');
470
-        parent::accept($renderer);
471
-        return $this->_wrap[0] . $renderer->toHtml() . $this->_wrap[1];
472
-    }
473
-
474
-    public function accept(HTML_QuickForm_Renderer &$renderer, $required = false, $error = null)
475
-    {
476
-        $renderer->renderElement($this, $required, $error);
477
-    }
478
-
479
-    function onQuickFormEvent($event, $arg, &$caller)
480
-    {
481
-        if ('updateValue' == $event) {
482
-            // we need to call setValue(), 'cause the default/constant value
483
-            // may be in fact a timestamp, not an array
484
-            return HTML_QuickForm_element::onQuickFormEvent($event, $arg, $caller);
485
-        } else {
486
-            return parent::onQuickFormEvent($event, $arg, $caller);
487
-        }
488
-    }
489
-}
490
-?>

+ 0
- 556
libs/quickform/QuickForm/Field/Group/hierselect.php View File

@@ -1,556 +0,0 @@
1
-<?php
2
-/**
3
- * @package     HTML_QuickForm
4
- * @author      Herim Vasquez <vasquezh@iro.umontreal.ca>
5
- * @author      Bertrand Mansion <bmansion@mamasam.com>
6
- * @author      Alexey Borzov <avb@php.net>
7
- * @copyright   2001-2011 The PHP Group
8
- * @license     http://www.php.net/license/3_01.txt PHP License 3.01
9
- */
10
-
11
-/**
12
- * Hierarchical select element
13
- *
14
- * Class to dynamically create two or more HTML Select elements
15
- * The first select changes the content of the second select and so on.
16
- * This element is considered as a group. Selects will be named
17
- * groupName[0], groupName[1], groupName[2]...
18
- *
19
- * @package     HTML_QuickForm
20
- * @author      Herim Vasquez <vasquezh@iro.umontreal.ca>
21
- * @author      Bertrand Mansion <bmansion@mamasam.com>
22
- * @author      Alexey Borzov <avb@php.net>
23
- * @property HTML_QuickForm_select[] $_elements
24
- */
25
-class HTML_QuickForm_hierselect extends HTML_QuickForm_group
26
-{
27
-    /**
28
-     * Options for all the select elements
29
-     *
30
-     * @see       setOptions()
31
-     * @var       array
32
-     * @access    private
33
-     */
34
-    var $_options = array();
35
-
36
-    /**
37
-     * Number of select elements on this group
38
-     *
39
-     * @var       int
40
-     * @access    private
41
-     */
42
-    var $_nbElements = 0;
43
-
44
-    /**
45
-     * The javascript used to set and change the options
46
-     *
47
-     * @var       string
48
-     * @access    private
49
-     */
50
-    var $_js = '';
51
-
52
-    /**
53
-     * Class constructor
54
-     *
55
-     * @param     string    $elementName    (optional)Input field name attribute
56
-     * @param     string    $elementLabel   (optional)Input field label in form
57
-     * @param     mixed     $attributes     (optional)Either a typical HTML attribute string
58
-     *                                      or an associative array. Date format is passed along the attributes.
59
-     * @param     mixed     $separator      (optional)Use a string for one separator,
60
-     *                                      use an array to alternate the separators.
61
-     */
62
-    function __construct($elementName=null, $elementLabel=null, $attributes=null, $separator=null)
63
-    {
64
-        parent::__construct($elementName, $elementLabel);
65
-        $this->setAttributes($attributes);
66
-        $this->_persistantFreeze = true;
67
-        if (isset($separator)) {
68
-            $this->_separator = $separator;
69
-        }
70
-        $this->_type = 'hierselect';
71
-        $this->_appendName = true;
72
-    }
73
-
74
-    /**
75
-     * Initialize the array structure containing the options for each select element.
76
-     * Call the functions that actually do the magic.
77
-     *
78
-     * Format is a bit more complex than for a simple select as we need to know
79
-     * which options are related to the ones in the previous select:
80
-     *
81
-     * Ex:
82
-     * <code>
83
-     * // first select
84
-     * $select1[0] = 'Pop';
85
-     * $select1[1] = 'Classical';
86
-     * $select1[2] = 'Funeral doom';
87
-     *
88
-     * // second select
89
-     * $select2[0][0] = 'Red Hot Chil Peppers';
90
-     * $select2[0][1] = 'The Pixies';
91
-     * $select2[1][0] = 'Wagner';
92
-     * $select2[1][1] = 'Strauss';
93
-     * $select2[2][0] = 'Pantheist';
94
-     * $select2[2][1] = 'Skepticism';
95
-     *
96
-     * // If only need two selects
97
-     * //     - and using the deprecated functions
98
-     * $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
99
-     * $sel->setMainOptions($select1);
100
-     * $sel->setSecOptions($select2);
101
-     *
102
-     * //     - and using the new setOptions function
103
-     * $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
104
-     * $sel->setOptions(array($select1, $select2));
105
-     *
106
-     * // If you have a third select with prices for the cds
107
-     * $select3[0][0][0] = '15.00$';
108
-     * $select3[0][0][1] = '17.00$';
109
-     * // etc
110
-     *
111
-     * // You can now use
112
-     * $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
113
-     * $sel->setOptions(array($select1, $select2, $select3));
114
-     * </code>
115
-     *
116
-     * @param     array    $options    Array of options defining each element
117
-     */
118
-    public function setOptions($options)
119
-    {
120
-        $this->_options = $options;
121
-
122
-        if (empty($this->_elements)) {
123
-            $this->_nbElements = count($this->_options);
124
-            $this->_createElements();
125
-        } else {
126
-            // setDefaults has probably been called before this function
127
-            // check if all elements have been created
128
-            $totalNbElements = count($this->_options);
129
-            for ($i = $this->_nbElements; $i < $totalNbElements; $i ++) {
130
-                $this->_elements[] = new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
131
-                $this->_nbElements++;
132
-            }
133
-        }
134
-
135
-        $this->_setOptions();
136
-    }
137
-
138
-    /**
139
-     * Sets the options for the first select element. Deprecated. setOptions() should be used.
140
-     *
141
-     * @param     array     $array    Options for the first select element
142
-     *
143
-     * @deprecated          Deprecated since release 3.2.2
144
-     */
145
-    public function setMainOptions($array)
146
-    {
147
-        $this->_options[0] = $array;
148
-
149
-        if (empty($this->_elements)) {
150
-            $this->_nbElements = 2;
151
-            $this->_createElements();
152
-        }
153
-    }
154
-
155
-    /**
156
-     * Sets the options for the second select element. Deprecated. setOptions() should be used.
157
-     * The main _options array is initialized and the _setOptions function is called.
158
-     *
159
-     * @param     array     $array    Options for the second select element
160
-     *
161
-     * @deprecated          Deprecated since release 3.2.2
162
-     */
163
-    public function setSecOptions($array)
164
-    {
165
-        $this->_options[1] = $array;
166
-
167
-        if (empty($this->_elements)) {
168
-            $this->_nbElements = 2;
169
-            $this->_createElements();
170
-        } else {
171
-            // setDefaults has probably been called before this function
172
-            // check if all elements have been created
173
-            $totalNbElements = 2;
174
-            for ($i = $this->_nbElements; $i < $totalNbElements; $i ++) {
175
-                $this->_elements[] = new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
176
-                $this->_nbElements++;
177
-            }
178
-        }
179
-
180
-        $this->_setOptions();
181
-    }
182
-
183
-    /**
184
-     * Sets the options for each select element
185
-     *
186