Duplicator – WordPress Migration Plugin - Version 1.1.30

Version Description

Download this release

Release Info

Developer cory@lamle.org
Plugin Icon 128x128 Duplicator – WordPress Migration Plugin
Version 1.1.30
Comparing to
See all releases

Code changes from version 1.1.28 to 1.1.30

classes/package.php CHANGED
@@ -477,6 +477,25 @@ class DUP_Package {
477
  }
478
  }
479
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
480
  private function buildCleanup() {
481
 
482
  $files = DUP_Util::ListFiles(DUPLICATOR_SSDIR_PATH_TMP);
477
  }
478
  }
479
 
480
+ /**
481
+ * Provides various date formats
482
+ *
483
+ * @param $date The date to format
484
+ * @param $format Various date formats to apply
485
+ *
486
+ * @return a formated date
487
+ */
488
+ public static function FormatCreatedDate($date, $format = 1)
489
+ {
490
+ $date = new DateTime($date);
491
+ switch ($format) {
492
+ case 1: return $date->format('Y-m-d H:i'); break;
493
+ case 2: return $date->format('Y-m-d H:i:s'); break;
494
+ case 3: return $date->format('m-d-y H:i'); break;
495
+ case 4: return $date->format('m-d-y H:i:s'); break;
496
+ }
497
+ }
498
+
499
  private function buildCleanup() {
500
 
501
  $files = DUP_Util::ListFiles(DUPLICATOR_SSDIR_PATH_TMP);
classes/utility.php CHANGED
@@ -19,7 +19,7 @@ class DUP_Util
19
  * PHP_SAPI for fcgi requires a data flush of at least 256
20
  * bytes every 40 seconds or else it forces a script hault
21
  */
22
- static public function FcgiFlush() {
23
  echo(str_repeat(' ', 300));
24
  @flush();
25
  }
@@ -27,7 +27,7 @@ class DUP_Util
27
  /**
28
  * returns the snapshot url
29
  */
30
- static public function SSDirURL() {
31
  return get_site_url(null, '', is_ssl() ? 'https' : 'http') . '/' . DUPLICATOR_SSDIR_NAME . '/';
32
  }
33
 
@@ -35,7 +35,7 @@ class DUP_Util
35
  * Returns the last N lines of a file
36
  * Equivelent to tail command
37
  */
38
- static public function TailFile($filepath, $lines = 2) {
39
 
40
  // Open file
41
  $f = @fopen($filepath, "rb");
@@ -84,7 +84,7 @@ class DUP_Util
84
  * Runs the APC cache to pre-cache the php files
85
  * returns true if all files where cached
86
  */
87
- static public function RunAPC() {
88
  if(function_exists('apc_compile_file')){
89
  $file01 = @apc_compile_file(DUPLICATOR_PLUGIN_PATH . "duplicator.php");
90
  return ($file01);
@@ -97,7 +97,7 @@ class DUP_Util
97
  * Display human readable byte sizes
98
  * @param string $size The size in bytes
99
  */
100
- static public function ByteSize($size) {
101
  try {
102
  $units = array('B', 'KB', 'MB', 'GB', 'TB');
103
  for ($i = 0; $size >= 1024 && $i < 4; $i++)
@@ -115,21 +115,21 @@ class DUP_Util
115
  * win: D:/home/path/file.txt
116
  * @param string $path The path to make safe
117
  */
118
- static public function SafePath($path) {
119
  return str_replace("\\", "/", $path);
120
  }
121
 
122
  /**
123
  * Get current microtime as a float. Can be used for simple profiling.
124
  */
125
- static public function GetMicrotime() {
126
  return microtime(true);
127
  }
128
 
129
  /**
130
  * Append the value to the string if it doesn't already exist
131
  */
132
- static public function StringAppend($string, $value ) {
133
  return $string . (substr($string, -1) == $value ? '' : $value);
134
  }
135
 
@@ -137,7 +137,7 @@ class DUP_Util
137
  * Return a string with the elapsed time.
138
  * Order of $end and $start can be switched.
139
  */
140
- static public function ElapsedTime($end, $start) {
141
  return sprintf("%.2f sec.", abs($end - $start));
142
  }
143
 
@@ -146,7 +146,7 @@ class DUP_Util
146
  * @param conn $dbh Database connection handle
147
  * @return string the server variable to query for
148
  */
149
- static public function MysqlVariableValue($variable) {
150
  global $wpdb;
151
  $row = $wpdb->get_row("SHOW VARIABLES LIKE '{$variable}'", ARRAY_N);
152
  return isset($row[1]) ? $row[1] : null;
@@ -161,7 +161,7 @@ class DUP_Util
161
  * - Avoid using glob() as GLOB_BRACE is not an option on some operating systems
162
  * - Pre PHP 5.3 DirectoryIterator will crash on unreadable files
163
  */
164
- static public function ListFiles($path = '.')
165
  {
166
  $files = array();
167
  foreach (new DirectoryIterator($path) as $file)
@@ -176,7 +176,7 @@ class DUP_Util
176
  * @path path to a system directory
177
  * @return array of all directories in that path
178
  */
179
- static public function ListDirs($path = '.') {
180
  $dirs = array();
181
 
182
  foreach (new DirectoryIterator($path) as $file) {
@@ -190,7 +190,7 @@ class DUP_Util
190
  /**
191
  * Does the directory have content
192
  */
193
- static public function IsDirectoryEmpty($dir) {
194
  if (!is_readable($dir)) return NULL;
195
  return (count(scandir($dir)) == 2);
196
  }
@@ -198,7 +198,7 @@ class DUP_Util
198
  /**
199
  * Size of the directory recuresivly in bytes
200
  */
201
- static public function GetDirectorySize($dir) {
202
  if(!file_exists($dir))
203
  return 0;
204
  if(is_file($dir))
19
  * PHP_SAPI for fcgi requires a data flush of at least 256
20
  * bytes every 40 seconds or else it forces a script hault
21
  */
22
+ public static function FcgiFlush() {
23
  echo(str_repeat(' ', 300));
24
  @flush();
25
  }
27
  /**
28
  * returns the snapshot url
29
  */
30
+ public static function SSDirURL() {
31
  return get_site_url(null, '', is_ssl() ? 'https' : 'http') . '/' . DUPLICATOR_SSDIR_NAME . '/';
32
  }
33
 
35
  * Returns the last N lines of a file
36
  * Equivelent to tail command
37
  */
38
+ public static function TailFile($filepath, $lines = 2) {
39
 
40
  // Open file
41
  $f = @fopen($filepath, "rb");
84
  * Runs the APC cache to pre-cache the php files
85
  * returns true if all files where cached
86
  */
87
+ public static function RunAPC() {
88
  if(function_exists('apc_compile_file')){
89
  $file01 = @apc_compile_file(DUPLICATOR_PLUGIN_PATH . "duplicator.php");
90
  return ($file01);
97
  * Display human readable byte sizes
98
  * @param string $size The size in bytes
99
  */
100
+ public static function ByteSize($size) {
101
  try {
102
  $units = array('B', 'KB', 'MB', 'GB', 'TB');
103
  for ($i = 0; $size >= 1024 && $i < 4; $i++)
115
  * win: D:/home/path/file.txt
116
  * @param string $path The path to make safe
117
  */
118
+ public static function SafePath($path) {
119
  return str_replace("\\", "/", $path);
120
  }
121
 
122
  /**
123
  * Get current microtime as a float. Can be used for simple profiling.
124
  */
125
+ public static function GetMicrotime() {
126
  return microtime(true);
127
  }
128
 
129
  /**
130
  * Append the value to the string if it doesn't already exist
131
  */
132
+ public static function StringAppend($string, $value ) {
133
  return $string . (substr($string, -1) == $value ? '' : $value);
134
  }
135
 
137
  * Return a string with the elapsed time.
138
  * Order of $end and $start can be switched.
139
  */
140
+ public static function ElapsedTime($end, $start) {
141
  return sprintf("%.2f sec.", abs($end - $start));
142
  }
143
 
146
  * @param conn $dbh Database connection handle
147
  * @return string the server variable to query for
148
  */
149
+ public static function MysqlVariableValue($variable) {
150
  global $wpdb;
151
  $row = $wpdb->get_row("SHOW VARIABLES LIKE '{$variable}'", ARRAY_N);
152
  return isset($row[1]) ? $row[1] : null;
161
  * - Avoid using glob() as GLOB_BRACE is not an option on some operating systems
162
  * - Pre PHP 5.3 DirectoryIterator will crash on unreadable files
163
  */
164
+ public static function ListFiles($path = '.')
165
  {
166
  $files = array();
167
  foreach (new DirectoryIterator($path) as $file)
176
  * @path path to a system directory
177
  * @return array of all directories in that path
178
  */
179
+ public static function ListDirs($path = '.') {
180
  $dirs = array();
181
 
182
  foreach (new DirectoryIterator($path) as $file) {
190
  /**
191
  * Does the directory have content
192
  */
193
+ public static function IsDirectoryEmpty($dir) {
194
  if (!is_readable($dir)) return NULL;
195
  return (count(scandir($dir)) == 2);
196
  }
198
  /**
199
  * Size of the directory recuresivly in bytes
200
  */
201
+ public static function GetDirectorySize($dir) {
202
  if(!file_exists($dir))
203
  return 0;
204
  if(is_file($dir))
define.php CHANGED
@@ -2,7 +2,7 @@
2
  //Prevent directly browsing to the file
3
  if (function_exists('plugin_dir_url'))
4
  {
5
- define('DUPLICATOR_VERSION', '1.1.28');
6
  define('DUPLICATOR_HOMEPAGE', 'http://lifeinthegrid.com/labs/duplicator');
7
  define('DUPLICATOR_PLUGIN_URL', plugin_dir_url(__FILE__));
8
  define('DUPLICATOR_SITE_URL', get_site_url());
2
  //Prevent directly browsing to the file
3
  if (function_exists('plugin_dir_url'))
4
  {
5
+ define('DUPLICATOR_VERSION', '1.1.30');
6
  define('DUPLICATOR_HOMEPAGE', 'http://lifeinthegrid.com/labs/duplicator');
7
  define('DUPLICATOR_PLUGIN_URL', plugin_dir_url(__FILE__));
8
  define('DUPLICATOR_SITE_URL', get_site_url());
duplicator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Duplicator
4
  Plugin URI: http://www.lifeinthegrid.com/duplicator/
5
  Description: Create a backup of your WordPress files and database. Duplicate and move an entire site from one location to another in a few steps. Create a full snapshot of your site at any point in time.
6
- Version: 1.1.28
7
  Author: Snap Creek
8
  Author URI: http://www.snapcreek.com/duplicator/
9
  Text Domain: duplicator
3
  Plugin Name: Duplicator
4
  Plugin URI: http://www.lifeinthegrid.com/duplicator/
5
  Description: Create a backup of your WordPress files and database. Duplicate and move an entire site from one location to another in a few steps. Create a full snapshot of your site at any point in time.
6
+ Version: 1.1.30
7
  Author: Snap Creek
8
  Author URI: http://www.snapcreek.com/duplicator/
9
  Text Domain: duplicator
installer/build/ajax.step1.php CHANGED
@@ -16,6 +16,7 @@ $_POST['cache_wp'] = (isset($_POST['cache_wp'])) ? true : false;
16
  $_POST['cache_path'] = (isset($_POST['cache_path'])) ? true : false;
17
  $_POST['package_name'] = isset($_POST['package_name']) ? $_POST['package_name'] : null;
18
  $_POST['zip_manual'] = (isset($_POST['zip_manual']) && $_POST['zip_manual'] == '1') ? true : false;
 
19
 
20
  //LOGGING
21
  $POST_LOG = $_POST;
@@ -52,7 +53,7 @@ if (isset($_GET['dbtest']))
52
  $tstSrv = ($dbConn) ? "<div class='dup-pass'>Success</div>" : "<div class='dup-fail'>Fail</div>";
53
  $tstDB = ($dbFound) ? "<div class='dup-pass'>Success</div>" : "<div class='dup-fail'>Fail</div>";
54
 
55
- $dbvar_version = DUPX_Util::mysql_version($dbConn);
56
  $dbvar_version = ($dbvar_version == 0) ? 'no connection' : $dbvar_version;
57
  $dbvar_version_fail = version_compare($dbvar_version, $GLOBALS['FW_VERSION_DB']) < 0;
58
  $tstCompat = ($dbvar_version_fail)
@@ -159,6 +160,7 @@ DUPX_Log::Info('NOTICE: Do NOT post to public sites or forums');
159
  DUPX_Log::Info("********************************************************************************");
160
  DUPX_Log::Info("VERSION:\t{$GLOBALS['FW_DUPLICATOR_VERSION']}");
161
  DUPX_Log::Info("PHP:\t\t" . phpversion() . ' | SAPI: ' . php_sapi_name());
 
162
  DUPX_Log::Info("SERVER:\t\t{$_SERVER['SERVER_SOFTWARE']}");
163
  DUPX_Log::Info("DOC ROOT:\t{$root_path}");
164
  DUPX_Log::Info("DOC ROOT 755:\t" . var_export($GLOBALS['CHOWN_ROOT_PATH'], true));
@@ -186,9 +188,12 @@ DUPX_Log::Info($log);
186
 
187
  $zip_start = DUPX_Util::get_microtime();
188
 
189
- if ($_POST['zip_manual']) {
 
190
  DUPX_Log::Info("\n** PACKAGE EXTRACTION IS IN MANUAL MODE ** \n");
191
- } else {
 
 
192
  if ($GLOBALS['FW_PACKAGE_NAME'] != $_POST['package_name']) {
193
  $log = "\n--------------------------------------\n";
194
  $log .= "WARNING: This package set may be incompatible! \nBelow is a summary of the package this installer was built with and the package used. \n";
@@ -205,12 +210,28 @@ if ($_POST['zip_manual']) {
205
 
206
  $target = $root_path;
207
  $zip = new ZipArchive();
208
- if ($zip->open($_POST['package_name']) === TRUE) {
209
- DUPX_Log::Info("EXTRACTING");
 
210
  if (! $zip->extractTo($target)) {
211
  DUPX_Log::Error(ERR_ZIPEXTRACTION);
212
  }
213
  $log = print_r($zip, true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  $close_response = $zip->close();
215
  $log .= "COMPLETE: " . var_export($close_response, true);
216
  DUPX_Log::Info($log);
@@ -222,6 +243,7 @@ if ($_POST['zip_manual']) {
222
 
223
 
224
  //CONFIG FILE RESETS
 
225
  DUPX_WPConfig::UpdateStep1();
226
  DUPX_ServerConfig::Reset();
227
 
@@ -229,22 +251,42 @@ DUPX_ServerConfig::Reset();
229
  //====================================================================================================
230
  //DATABASE ROUTINES
231
  //====================================================================================================
232
- @chmod("{$root_path}/database.sql", 0777);
233
- if (filesize("{$root_path}/database.sql") > 100000000) {
234
- DUPX_Log::Info("\nWARNING: Database Script is larger than 100MB this may lead to PHP memory allocation issues on some budget hosts.");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  }
236
 
 
237
  $sql_file = file_get_contents('database.sql', true);
238
- if ($sql_file == false || strlen($sql_file) < 10)
 
 
239
  {
240
- $sql_file = file_get_contents($GLOBALS['SQL_FILE_NAME'], true);
241
- if ($sql_file == false || strlen($sql_file) < 10) {
242
- DUPX_Log::Info("ERROR: Unable to read from the extracted database.sql file .\nValidate the permissions and/or group-owner rights on directory '{$root_path}'\n");
243
- }
 
 
 
244
  }
245
 
246
- //Complex Subject See: http://webcollab.sourceforge.net/unicode.html
247
  //Removes invalid space characters
 
248
  if ($_POST['dbnbsp'])
249
  {
250
  DUPX_Log::Info("NOTICE: Ran fix non-breaking space characters\n");
@@ -252,34 +294,37 @@ if ($_POST['dbnbsp'])
252
  }
253
 
254
  //Write new contents to install-data.sql
255
- file_put_contents($GLOBALS['SQL_FILE_NAME'], $sql_file);
256
-
257
  $sql_result_file_data = explode(";\n", $sql_file);
258
  $sql_result_file_length = count($sql_result_file_data);
259
  $sql_result_file_path = "{$root_path}/{$GLOBALS['SQL_FILE_NAME']}";
260
- @chmod($sql_result_file_path, 0777);
261
  $sql_file = null;
262
 
263
- if (!is_readable($sql_result_file_path) || filesize($sql_result_file_path) == 0) {
264
- DUPX_Log::Info("ERROR: Unable to create new sql file {$GLOBALS['SQL_FILE_NAME']}.\nValidate the permissions and/or group-owner rights on directory '{$root_path}' and file '{$GLOBALS['SQL_FILE_NAME']}'\n");
 
 
 
 
 
 
265
  }
266
 
267
  DUPX_Log::Info("\nUPDATED FILES:");
268
  DUPX_Log::Info("- SQL FILE: '{$sql_result_file_path}'");
269
  DUPX_Log::Info("- WP-CONFIG: '{$root_path}/wp-config.php' (if present)");
270
- $zip_end = DUPX_Util::get_microtime();
271
- DUPX_Log::Info("\nARCHIVE RUNTIME: " . DUPX_Util::elapsed_time($zip_end, $zip_start));
272
- DUPX_Log::Info("\n");
273
  DUPX_Util::fcgi_flush();
274
 
275
  //=================================
276
  //START DB RUN
277
  @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
278
  @mysqli_query($dbh, "SET max_allowed_packet = {$GLOBALS['DB_MAX_PACKETS']}");
279
- DUPX_Util::mysql_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
280
 
281
  //Will set mode to null only for this db handle session
282
  //sql_mode can cause db create issues on some systems
 
283
  switch ($_POST['dbmysqlmode']) {
284
  case 'DISABLE':
285
  @mysqli_query($dbh, "SET SESSION sql_mode = ''");
@@ -297,13 +342,16 @@ switch ($_POST['dbmysqlmode']) {
297
  }
298
 
299
  //Set defaults in-case the variable could not be read
300
- $dbvar_maxtime = DUPX_Util::mysql_variable_value($dbh, 'wait_timeout');
301
- $dbvar_maxpacks = DUPX_Util::mysql_variable_value($dbh, 'max_allowed_packet');
302
- $dbvar_sqlmode = DUPX_Util::mysql_variable_value($dbh, 'sql_mode');
303
  $dbvar_maxtime = is_null($dbvar_maxtime) ? 300 : $dbvar_maxtime;
304
  $dbvar_maxpacks = is_null($dbvar_maxpacks) ? 1048576 : $dbvar_maxpacks;
305
  $dbvar_sqlmode = empty($dbvar_sqlmode) ? 'NOT_SET' : $dbvar_sqlmode;
306
- $dbvar_version = DUPX_Util::mysql_version($dbh);
 
 
 
307
 
308
  DUPX_Log::Info("{$GLOBALS['SEPERATOR1']}");
309
  DUPX_Log::Info('DATABASE-ROUTINES');
@@ -312,6 +360,7 @@ DUPX_Log::Info("--------------------------------------");
312
  DUPX_Log::Info("SERVER ENVIRONMENT");
313
  DUPX_Log::Info("--------------------------------------");
314
  DUPX_Log::Info("MYSQL VERSION:\tThis Server: {$dbvar_version} -- Build Server: {$GLOBALS['FW_VERSION_DB']}");
 
315
  DUPX_Log::Info("TIMEOUT:\t{$dbvar_maxtime}");
316
  DUPX_Log::Info("MAXPACK:\t{$dbvar_maxpacks}");
317
  DUPX_Log::Info("SQLMODE:\t{$dbvar_sqlmode}");
@@ -380,7 +429,7 @@ while ($counter < $sql_result_file_length) {
380
  $dbh = DUPX_Util::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname'], $_POST['dbport'] );
381
  // Reset session setup
382
  @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
383
- DUPX_Util::mysql_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
384
  }
385
  DUPX_Log::Info("**ERROR** database error write '{$err}' - [sql=" . substr($sql_result_file_data[$counter], 0, 75) . "...]");
386
  $dbquery_errs++;
@@ -415,8 +464,8 @@ if ($result = mysqli_query($dbh, "SHOW TABLES")) {
415
  }
416
 
417
  if ($dbtable_count == 0) {
418
- DUPX_Log::Error("No tables where created during step 1 of the install. Please review the installer-log.txt file for sql error messages.
419
- You may have to manually run the installer-data.sql with a tool like phpmyadmin to validate the data input. If you have enabled compatibility mode
420
  during the package creation process then the database server version your using may not be compatible with this script.\n");
421
  }
422
 
16
  $_POST['cache_path'] = (isset($_POST['cache_path'])) ? true : false;
17
  $_POST['package_name'] = isset($_POST['package_name']) ? $_POST['package_name'] : null;
18
  $_POST['zip_manual'] = (isset($_POST['zip_manual']) && $_POST['zip_manual'] == '1') ? true : false;
19
+ $_POST['zip_filetime'] = (isset($_POST['zip_filetime'])) ? $_POST['zip_filetime'] : 'current';
20
 
21
  //LOGGING
22
  $POST_LOG = $_POST;
53
  $tstSrv = ($dbConn) ? "<div class='dup-pass'>Success</div>" : "<div class='dup-fail'>Fail</div>";
54
  $tstDB = ($dbFound) ? "<div class='dup-pass'>Success</div>" : "<div class='dup-fail'>Fail</div>";
55
 
56
+ $dbvar_version = DUPX_Util::mysqldb_version($dbConn);
57
  $dbvar_version = ($dbvar_version == 0) ? 'no connection' : $dbvar_version;
58
  $dbvar_version_fail = version_compare($dbvar_version, $GLOBALS['FW_VERSION_DB']) < 0;
59
  $tstCompat = ($dbvar_version_fail)
160
  DUPX_Log::Info("********************************************************************************");
161
  DUPX_Log::Info("VERSION:\t{$GLOBALS['FW_DUPLICATOR_VERSION']}");
162
  DUPX_Log::Info("PHP:\t\t" . phpversion() . ' | SAPI: ' . php_sapi_name());
163
+ DUPX_Log::Info("PHP MEMORY:\t" . $GLOBALS['PHP_MEMORY_LIMIT'] . ' | SUHOSIN: ' . $GLOBALS['PHP_SUHOSIN_ON'] );
164
  DUPX_Log::Info("SERVER:\t\t{$_SERVER['SERVER_SOFTWARE']}");
165
  DUPX_Log::Info("DOC ROOT:\t{$root_path}");
166
  DUPX_Log::Info("DOC ROOT 755:\t" . var_export($GLOBALS['CHOWN_ROOT_PATH'], true));
188
 
189
  $zip_start = DUPX_Util::get_microtime();
190
 
191
+ if ($_POST['zip_manual'])
192
+ {
193
  DUPX_Log::Info("\n** PACKAGE EXTRACTION IS IN MANUAL MODE ** \n");
194
+ }
195
+ else
196
+ {
197
  if ($GLOBALS['FW_PACKAGE_NAME'] != $_POST['package_name']) {
198
  $log = "\n--------------------------------------\n";
199
  $log .= "WARNING: This package set may be incompatible! \nBelow is a summary of the package this installer was built with and the package used. \n";
210
 
211
  $target = $root_path;
212
  $zip = new ZipArchive();
213
+ if ($zip->open($_POST['package_name']) === TRUE)
214
+ {
215
+ DUPX_Log::Info("\nEXTRACTING");
216
  if (! $zip->extractTo($target)) {
217
  DUPX_Log::Error(ERR_ZIPEXTRACTION);
218
  }
219
  $log = print_r($zip, true);
220
+
221
+ //Keep original timestamp on the file
222
+ if ($_POST['zip_filetime'] == 'original')
223
+ {
224
+ $log .= "File timestamp set to Original\n";
225
+ for ($idx = 0; $s = $zip->statIndex($idx); $idx++) {
226
+ touch( $target . DIRECTORY_SEPARATOR . $s['name'], $s['mtime'] );
227
+ }
228
+ }
229
+ else
230
+ {
231
+ $now = date("Y-m-d H:i:s");
232
+ $log .= "File timestamp set to Current: {$now}\n";
233
+ }
234
+
235
  $close_response = $zip->close();
236
  $log .= "COMPLETE: " . var_export($close_response, true);
237
  DUPX_Log::Info($log);
243
 
244
 
245
  //CONFIG FILE RESETS
246
+ $log = '';
247
  DUPX_WPConfig::UpdateStep1();
248
  DUPX_ServerConfig::Reset();
249
 
251
  //====================================================================================================
252
  //DATABASE ROUTINES
253
  //====================================================================================================
254
+ $faq_url = $GLOBALS['FAQ_URL'];
255
+ $db_file_size = filesize('database.sql');
256
+ $php_mem = $GLOBALS['PHP_MEMORY_LIMIT'];
257
+ $php_mem_range = DUPX_Util::return_bytes($GLOBALS['PHP_MEMORY_LIMIT']);
258
+ $php_mem_range = $php_mem_range == null ? 0 : $php_mem_range - 5000000; //5 MB Buffer
259
+
260
+ //Fatal Memory errors from file_get_contents is not catchable.
261
+ //Try to warn ahead of time with a buffer in memory difference
262
+ if ($db_file_size >= $php_mem_range && $php_mem_range != 0)
263
+ {
264
+ $db_file_size = DUPX_Util::readable_bytesize($db_file_size);
265
+ $msg = "\nWARNING: The database script is '{$db_file_size}' in size. The PHP memory allocation is set\n";
266
+ $msg .= "at '{$php_mem}'. There is a high possibility that the installer script will fail with\n";
267
+ $msg .= "a memory allocation error when trying to load the database.sql file. It is\n";
268
+ $msg .= "recommended to increase the 'memory_limit' setting in the php.ini config file.\n";
269
+ $msg .= "see: {$faq_url}#faq-trouble-056-q \n";
270
+ DUPX_Log::Info($msg);
271
  }
272
 
273
+ @chmod("{$root_path}/database.sql", 0777);
274
  $sql_file = file_get_contents('database.sql', true);
275
+
276
+ //ERROR: Reading database.sql file
277
+ if ($sql_file === FALSE || strlen($sql_file) < 10)
278
  {
279
+ $msg = "<b>Unable to read the database.sql file from the archive. Please check these items:</b> <br/>";
280
+ $msg .= "1. Validate permissions and/or group-owner rights on these items: <br/>";
281
+ $msg .= " - File: database.sql <br/> - Directory: [{$root_path}] <br/>";
282
+ $msg .= "<i>see: <a href='{$faq_url}#faq-trouble-055-q' target='_blank'>{$faq_url}#faq-trouble-055-q</a></i> <br/>";
283
+ $msg .= "2. Validate the database.sql file exists and is in the root of the archive.zip file <br/>";
284
+ $msg .= "<i>see: <a href='{$faq_url}#faq-installer-020-q' target='_blank'>{$faq_url}#faq-installer-020-q</a></i> <br/>";
285
+ DUPX_Log::Error($msg);
286
  }
287
 
 
288
  //Removes invalid space characters
289
+ //Complex Subject See: http://webcollab.sourceforge.net/unicode.html
290
  if ($_POST['dbnbsp'])
291
  {
292
  DUPX_Log::Info("NOTICE: Ran fix non-breaking space characters\n");
294
  }
295
 
296
  //Write new contents to install-data.sql
297
+ $sql_file_copy_status = file_put_contents($GLOBALS['SQL_FILE_NAME'], $sql_file);
 
298
  $sql_result_file_data = explode(";\n", $sql_file);
299
  $sql_result_file_length = count($sql_result_file_data);
300
  $sql_result_file_path = "{$root_path}/{$GLOBALS['SQL_FILE_NAME']}";
 
301
  $sql_file = null;
302
 
303
+ //WARNING: Create installer-data.sql failed
304
+ if ($sql_file_copy_status === FALSE || filesize($sql_result_file_path) == 0 || !is_readable($sql_result_file_path))
305
+ {
306
+ $sql_file_size = DUPX_Util::readable_bytesize(filesize('database.sql'));
307
+ $msg = "\nWARNING: Unable to properly copy database.sql ({$sql_file_size}) to {$GLOBALS['SQL_FILE_NAME']}. Please check these items:\n";
308
+ $msg .= "- Validate permissions and/or group-owner rights on database.sql and directory [{$root_path}] \n";
309
+ $msg .= "- see: {$faq_url}#faq-trouble-055-q \n";
310
+ DUPX_Log::Info($msg);
311
  }
312
 
313
  DUPX_Log::Info("\nUPDATED FILES:");
314
  DUPX_Log::Info("- SQL FILE: '{$sql_result_file_path}'");
315
  DUPX_Log::Info("- WP-CONFIG: '{$root_path}/wp-config.php' (if present)");
316
+ DUPX_Log::Info("\nARCHIVE RUNTIME: " . DUPX_Util::elapsed_time(DUPX_Util::get_microtime(), $zip_start) . "\n");
 
 
317
  DUPX_Util::fcgi_flush();
318
 
319
  //=================================
320
  //START DB RUN
321
  @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
322
  @mysqli_query($dbh, "SET max_allowed_packet = {$GLOBALS['DB_MAX_PACKETS']}");
323
+ DUPX_Util::mysqldb_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
324
 
325
  //Will set mode to null only for this db handle session
326
  //sql_mode can cause db create issues on some systems
327
+ $qry_session_custom = true;
328
  switch ($_POST['dbmysqlmode']) {
329
  case 'DISABLE':
330
  @mysqli_query($dbh, "SET SESSION sql_mode = ''");
342
  }
343
 
344
  //Set defaults in-case the variable could not be read
345
+ $dbvar_maxtime = DUPX_Util::mysqldb_variable_value($dbh, 'wait_timeout');
346
+ $dbvar_maxpacks = DUPX_Util::mysqldb_variable_value($dbh, 'max_allowed_packet');
347
+ $dbvar_sqlmode = DUPX_Util::mysqldb_variable_value($dbh, 'sql_mode');
348
  $dbvar_maxtime = is_null($dbvar_maxtime) ? 300 : $dbvar_maxtime;
349
  $dbvar_maxpacks = is_null($dbvar_maxpacks) ? 1048576 : $dbvar_maxpacks;
350
  $dbvar_sqlmode = empty($dbvar_sqlmode) ? 'NOT_SET' : $dbvar_sqlmode;
351
+ $dbvar_version = DUPX_Util::mysqldb_version($dbh);
352
+ $sql_file_size1 = DUPX_Util::readable_bytesize(@filesize("database.sql"));
353
+ $sql_file_size2 = DUPX_Util::readable_bytesize(@filesize("{$GLOBALS['SQL_FILE_NAME']}"));
354
+
355
 
356
  DUPX_Log::Info("{$GLOBALS['SEPERATOR1']}");
357
  DUPX_Log::Info('DATABASE-ROUTINES');
360
  DUPX_Log::Info("SERVER ENVIRONMENT");
361
  DUPX_Log::Info("--------------------------------------");
362
  DUPX_Log::Info("MYSQL VERSION:\tThis Server: {$dbvar_version} -- Build Server: {$GLOBALS['FW_VERSION_DB']}");
363
+ DUPX_Log::Info("FILE SIZE:\tdatabase.sql ({$sql_file_size1}) - installer-data.sql ({$sql_file_size2})");
364
  DUPX_Log::Info("TIMEOUT:\t{$dbvar_maxtime}");
365
  DUPX_Log::Info("MAXPACK:\t{$dbvar_maxpacks}");
366
  DUPX_Log::Info("SQLMODE:\t{$dbvar_sqlmode}");
429
  $dbh = DUPX_Util::db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname'], $_POST['dbport'] );
430
  // Reset session setup
431
  @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
432
+ DUPX_Util::mysqldb_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
433
  }
434
  DUPX_Log::Info("**ERROR** database error write '{$err}' - [sql=" . substr($sql_result_file_data[$counter], 0, 75) . "...]");
435
  $dbquery_errs++;
464
  }
465
 
466
  if ($dbtable_count == 0) {
467
+ DUPX_Log::Error("No tables where created during step 1 of the install. Please review the <a href='installer-log.txt' target='_blank'>installer-log.txt</a> file for
468
+ ERROR messages. You may have to manually run the installer-data.sql with a tool like phpmyadmin to validate the data input. If you have enabled compatibility mode
469
  during the package creation process then the database server version your using may not be compatible with this script.\n");
470
  }
471
 
installer/build/ajax.step2.php CHANGED
@@ -22,7 +22,7 @@ $ajax2_start = DUPX_Util::get_microtime();
22
  $dbh = DUPX_Util::db_connect($_POST['dbhost'], $_POST['dbuser'], html_entity_decode($_POST['dbpass']), $_POST['dbname'], $_POST['dbport']);
23
  $charset_server = @mysqli_character_set_name($dbh);
24
  @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
25
- DUPX_Util::mysql_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
26
 
27
  //POST PARAMS
28
  $_POST['blogname'] = mysqli_real_escape_string($dbh, $_POST['blogname']);
22
  $dbh = DUPX_Util::db_connect($_POST['dbhost'], $_POST['dbuser'], html_entity_decode($_POST['dbpass']), $_POST['dbname'], $_POST['dbport']);
23
  $charset_server = @mysqli_character_set_name($dbh);
24
  @mysqli_query($dbh, "SET wait_timeout = {$GLOBALS['DB_MAX_TIME']}");
25
+ DUPX_Util::mysqldb_set_charset($dbh, $_POST['dbcharset'], $_POST['dbcollate']);
26
 
27
  //POST PARAMS
28
  $_POST['blogname'] = mysqli_real_escape_string($dbh, $_POST['blogname']);
installer/build/assets/inc.css.php CHANGED
@@ -53,7 +53,7 @@
53
  div#dup-main-help h3 {background-color:#dfdfdf; border:1px solid silver; border-radius:5px; padding:3px; margin-bottom:8px;}
54
 
55
  div#progress-area {padding:5px; margin:150px 0 0 0px; text-align:center;}
56
- div#ajaxerr-data {padding:5px; height:350px; width:99%; border:1px solid silver; border-radius:5px; background-color:#efefef; font-size:12px; overflow-y:scroll}
57
  div.hdr-main {font-size:18px; padding:0 0 5px 0; border-bottom:1px solid #999; font-weight:bold; margin:5px 0 10px 0;}
58
  div.hdr-sub {font-size:15px; padding:2px 2px 2px 0; border-bottom:1px solid #dfdfdf; font-weight:bold; margin-bottom:5px;}
59
 
@@ -66,6 +66,7 @@
66
 
67
  /* ============================
68
  STEP 1 VIEW */
 
69
  table.s1-opts {width:100%; border:0px;}
70
  table.s1-opts td{white-space:nowrap; padding:3px;}
71
  table.s1-opts td:first-child{width:125px;}
@@ -77,7 +78,7 @@
77
  div.circle-fail {background:#9A0D1D !important;}
78
  select#logging {font-size:11px}
79
  div.s1-modes {padding:0px 15px 0 0px;}
80
- div#s1-dbconn {margin:auto; text-align:center; margin:15px 0 20px 0px}
81
 
82
  input.s1-small-btn {font-size:11px; height:20px; border:1px solid gray; border-radius:3px; cursor:pointer}
83
  input#s1-dbport-btn { width:80px}
@@ -93,10 +94,11 @@
93
  div.s1-advopts-section {margin:15px 0 25px 0}
94
  div.s1-advopts-section label {cursor: pointer}
95
  div.s1-advopts-help {text-align: center; margin:10px}
96
- div.dup-s1-gopro {color: black;font-style: italic;margin-top: 11px; text-align:center;margin-top:30px; padding:5px}
97
- div#dup-s1-warning {padding:5px;font-size:11px; color:gray; line-height:12px;font-style:italic; overflow-y:scroll; height:75px; border:1px solid #dfdfdf; background-color:#fff; border-radius:3px}
98
  div#dup-s1-warning-check {padding:5px; font-size:12px; font-weight:normal; font-style:italic;}
99
  div#dup-s1-warning-emptydb {display:none; color:#AF2222; margin:0px 0 0 20px}
 
100
 
101
  /*Dialog*/
102
  div#dup-s1-dialog-data {height:90%; font-size:11px; padding:5px; line-height:16px; }
@@ -107,7 +109,7 @@
107
  .dup-fail {display:inline-block; color:#AF0000;}
108
  .dup-notice {display:inline-block; color:#000;}
109
  hr.dup-dots { border:none; border-top:1px dotted silver; height:1px; width:100%;}
110
- div.dup-ui-error {padding-top:2px; font-size:14px}
111
  div.help {color:#555; font-style:italic; font-size:11px}
112
 
113
  /* ============================
53
  div#dup-main-help h3 {background-color:#dfdfdf; border:1px solid silver; border-radius:5px; padding:3px; margin-bottom:8px;}
54
 
55
  div#progress-area {padding:5px; margin:150px 0 0 0px; text-align:center;}
56
+ div#ajaxerr-data {padding:5px; height:350px; width:99%; border:1px solid silver; border-radius:5px; background-color:#efefef; font-size:14px; overflow-y:scroll}
57
  div.hdr-main {font-size:18px; padding:0 0 5px 0; border-bottom:1px solid #999; font-weight:bold; margin:5px 0 10px 0;}
58
  div.hdr-sub {font-size:15px; padding:2px 2px 2px 0; border-bottom:1px solid #dfdfdf; font-weight:bold; margin-bottom:5px;}
59
 
66
 
67
  /* ============================
68
  STEP 1 VIEW */
69
+ div#dup-s1-warning-check label {cursor: pointer}
70
  table.s1-opts {width:100%; border:0px;}
71
  table.s1-opts td{white-space:nowrap; padding:3px;}
72
  table.s1-opts td:first-child{width:125px;}
78
  div.circle-fail {background:#9A0D1D !important;}
79
  select#logging {font-size:11px}
80
  div.s1-modes {padding:0px 15px 0 0px;}
81
+ div#s1-dbconn {margin:auto; text-align:center; margin:15px 0 10px 0px}
82
 
83
  input.s1-small-btn {font-size:11px; height:20px; border:1px solid gray; border-radius:3px; cursor:pointer}
84
  input#s1-dbport-btn { width:80px}
94
  div.s1-advopts-section {margin:15px 0 25px 0}
95
  div.s1-advopts-section label {cursor: pointer}
96
  div.s1-advopts-help {text-align: center; margin:10px}
97
+ div.dup-s1-gopro {color: black;font-style: italic;margin-top: 11px; text-align:center;margin-top:20px; padding:5px}
98
+ div#dup-s1-warning {padding:5px;font-size:12px; color:gray; line-height:12px;font-style:italic; overflow-y:scroll; height:150px; border:1px solid #dfdfdf; background-color:#fff; border-radius:3px}
99
  div#dup-s1-warning-check {padding:5px; font-size:12px; font-weight:normal; font-style:italic;}
100
  div#dup-s1-warning-emptydb {display:none; color:#AF2222; margin:0px 0 0 20px}
101
+ table.s1-advopts label.radio {width:50px; display:inline-block}
102
 
103
  /*Dialog*/
104
  div#dup-s1-dialog-data {height:90%; font-size:11px; padding:5px; line-height:16px; }
109
  .dup-fail {display:inline-block; color:#AF0000;}
110
  .dup-notice {display:inline-block; color:#000;}
111
  hr.dup-dots { border:none; border-top:1px dotted silver; height:1px; width:100%;}
112
+ div.dup-ui-error {padding-top:2px; font-size:14px; line-height: 20px}
113
  div.help {color:#555; font-style:italic; font-size:11px}
114
 
115
  /* ============================
installer/build/assets/inc.libs.css.php CHANGED
@@ -19,4 +19,17 @@
19
 
20
  .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
21
  </style>
22
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
21
  </style>
22
+ <?php endif; ?>
23
+
24
+
25
+ <style type="text/css">
26
+ /*! * CSS Modal
27
+ * Copyright (c) 2015 CreativeDream
28
+ * Website https://github.com/CreativeDream/jquery.modal
29
+ * Version: 1.2.3 (10-04-2015)
30
+ */
31
+ #modal-window{background-color:rgba(0,0,0,.35)}#modal-window>*{margin:0;padding:0;border:0;font:inherit;line-height:normal;vertical-align:baseline}#modal-window .modal-box{position:absolute;margin-bottom:10px;top:40%!important;background-color:#fff;font-family:sans-serif;color:#444;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 0 7px rgba(0,0,0,.3);-moz-box-shadow:0 0 7px rgba(0,0,0,.3);box-shadow:0 0 7px rgba(0,0,0,.3);outline:0;overflow:hidden}#modal-window .modal-box.modal-size-normal{width:560px}#modal-window .modal-box.modal-size-small{width:350px}#modal-window .modal-box.modal-size-large{width:1000px}@media only screen and (max-width :580px){#modal-window .modal-box.modal-size-normal{width:96%;left:0!important;margin-left:2%!important;margin-right:2%}}@media only screen and (max-width :1020px){#modal-window .modal-box.modal-size-large{width:96%;left:0!important;margin-left:2%!important;margin-right:2%}}@media only screen and (max-width :370px){#modal-window .modal-box.modal-size-small{width:96%;left:0!important;margin-left:2%!important;margin-right:2%}}#modal-window .modal-box .modal-title{position:relative;padding:12px 15px;border-bottom:1px solid #e5e5e5;font-size:20px;overflow:hidden}#modal-window .modal-box .modal-title h3{font-size:20px;font-weight:400;line-height:normal;display:inline-block;margin:0;padding:0}#modal-window .modal-box .modal-title .modal-close-btn{position:absolute;display:block;width:14px;height:14px;right:20px;top:50%;margin-top:-7px;cursor:pointer;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGNzdGMTE3NDA3MjA2ODExOEMxNDkyODc0N0NBMUEwNCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3N0ZBOTUxNzNERkIxMUUyQUZGMEFDRjY0RjNFODlDOCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3N0ZBOTUxNjNERkIxMUUyQUZGMEFDRjY0RjNFODlDOCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkY3N0YxMTc0MDcyMDY4MTE4MDgzRkQyMTE2MTM0QUNBIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkY3N0YxMTc0MDcyMDY4MTE4QzE0OTI4NzQ3Q0ExQTA0Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+5Ke+4QAAAMlJREFUeNqkk90KwyAMha0dvp/ghfthsFcb67YLYe83EBdZlCxL3KCFU0nM+WqjTqUUs+bZ1Nd2d6jDDDqDHqCk1AeQBx1B+Xa9vAFovmNBwFwSzAvIoWKFWJxciNGxmJtp3FeQMDkziCEfcCTObYUUEPE3JAg3xwawZKJBMsm5kZkDNIhqlgC0+J/cFyAIDTOD3fkABKXbeQSxP8xRaWyHNIAfdFvbHU8BJ9JdqdscktDTD9ITtCcnTLpMDRLwMlWPmdZe55cAAwD+1kOdnSr5eQAAAABJRU5ErkJggg==) center no-repeat;background-size:14px,14px;opacity:.5;filter:alpha(opacity=50)}#modal-window .modal-box .modal-title .modal-close-btn:hover{opacity:1;filter:alpha(opacity=100)}#modal-window .modal-box .modal-text{font-size:14px;padding:18px 15px;overflow-y:auto}#modal-window .modal-box img{height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#modal-window .modal-box .modal-text input.modal-prompt-input{width:97%;width:-webkit-calc(100% - 14px);width:-moz-calc(100% - 14px);width:calc(100% - 14px);display:block;outline:0;border:1px solid #ddd;border-top:1px solid #ccc;margin:10px 0;padding:6px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 2px #eee;-moz-box-shadow:inset 0 0 2px #eee;box-shadow:inset 0 0 2px #eee;-webkit-transition:all .1s linear;transition:all .1s linear}#modal-window .modal-box .modal-text input.modal-prompt-input:hover{border:1px solid #bbb;border-top:1px solid #aaa}#modal-window .modal-box .modal-text input.modal-prompt-input:active,#modal-window .modal-box .modal-text input.modal-prompt-input:focus{border-color:rgba(82,168,236,.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.3);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.3);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.3)}#modal-window .modal-box .modal-buttons{padding:10px 15px;text-align:right;background-color:#f9f9f9;border-top:1px solid #ddd}#modal-window .modal-box .modal-buttons a.modal-btn{display:inline-block;padding:8px 12px;outline:0;border:1px solid transparent;cursor:pointer;text-decoration:none;text-align:center;white-space:nowrap;font-size:12px;font-weight:700;line-height:normal;color:#555;vertical-align:middle}#modal-window .modal-box .modal-buttons a.modal-btn:active,a.modal-btn:focus{outline:0!important}#modal-window .modal-box .modal-buttons a.modal-btn:active,a.modal-btn.active{-webkit-box-shadow:inset 0 0 7px rgba(0,0,0,.2);-moz-box-shadow:inset 0 0 7px rgba(0,0,0,.2);box-shadow:inset 0 0 7px rgba(0,0,0,.2)}#modal-window .modal-box .modal-buttons a.modal-btn+a.modal-btn{margin-left:5px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-disabled{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65)}#modal-window .modal-box .modal-buttons a.modal-btn.btn-large{padding:8px 14px;font-size:16px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-small{padding:6px 8px;font-size:10px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-rounded{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-circle{-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}#modal-window .modal-box .modal-buttons a.modal-btn.btn-square{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}#modal-window .modal-box .modal-buttons a.modal-btn i,#modal-window .modal-box .modal-buttons a.modal-btn img{vertical-align:middle;display:inline-block;float:left;max-height:16px;margin-right:5px}#modal-window .modal-box .modal-buttons a.modal-btn{background-color:#fcfcfc;border-color:#c9c9c9;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.08);-moz-box-shadow:0 1px 1px rgba(0,0,0,.08);box-shadow:0 1px 1px rgba(0,0,0,.08)}#modal-window .modal-box .modal-buttons a.modal-btn.btn-green{background-color:#5cb85c;border-color:#4cae4c;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-green:hover{background-color:#449d44;border-color:#398439;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-purple{background-color:#8149B4;border-color:#6922AD;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-purple:hover{background-color:#6f32a8;border-color:#5b149e;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-orange{background-color:#f7aa47;border-color:#eea236;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-orange:hover{background-color:#f69f2f;border-color:#d58512;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-pink{background-color:#ff6264;border-color:#eb5b5c;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-pink:hover{background-color:#ff484b;border-color:#e53a3d;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-turquoise{background-color:#00b19d;border-color:#11a594;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-turquoise:hover{background-color:#009886;border-color:#0b8173;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-green{background-color:#8dc63f;border-color:#7db432;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-green:hover{background-color:#82b838;border-color:#75a336;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-blue{background-color:#428bca;border-color:#357ebd;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-blue:hover{background-color:#3071a9;border-color:#285e8e;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-blue{background-color:#0e62c7;border-color:#0D54AA;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-blue:hover{background-color:#0c56af;border-color:#0B4992;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-red{background-color:#cc3f44;border-color:#bd1b21;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-red:hover{background-color:#ab2d32;border-color:#96050b;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-red{background-color:#d9534f;border-color:#d43f3a;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-light-red:hover{background-color:#c9302c;border-color:#ac2925;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-yellow{background-color:#ffba00;border-color:#e4a703;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-yellow:hover{background-color:#f0bb2e;border-color:#dba71a;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-black{background-color:#444;border-color:#313131;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-black:hover{background-color:#333;border-color:#222;color:#fff}#modal-window .modal-box .modal-buttons a.modal-btn.btn-white{background-color:#fff;color:#555;border:1px solid #ddd}#modal-window .modal-box .modal-buttons a.modal-btn.btn-white:hover{background-color:#f7f7f7;border:1px solid #ccc}#modal-window .modal-box .modal-buttons a.modal-btn.btn-white:active,#modal-window .modal-box .modal-buttons a.modal-btn.btn-white:focus{-webkit-box-shadow:inset 0 0 10px rgba(0,0,0,.1);-moz-box-shadow:inset 0 0 10px rgba(0,0,0,.1);box-shadow:inset 0 0 10px rgba(0,0,0,.1)}#modal-window .modal-box.modal-type-success .modal-title{background-color:#61b832}#modal-window .modal-box.modal-type-warning .modal-title{background-color:#f1b40e}#modal-window .modal-box.modal-type-error .modal-title{background-color:#de4343}#modal-window .modal-box.modal-type-info .modal-title{background-color:#4ea5cd}#modal-window .modal-box.modal-type-inverted .modal-title{background-color:#232B31}#modal-window .modal-box.modal-type-primary .modal-title{background-color:#428bca}#modal-window .modal-box.modal-type-error .modal-title,#modal-window .modal-box.modal-type-info .modal-title,#modal-window .modal-box.modal-type-inverted .modal-title,#modal-window .modal-box.modal-type-primary .modal-title,#modal-window .modal-box.modal-type-success .modal-title,#modal-window .modal-box.modal-type-warning .modal-title{color:#FFF;text-shadow:0 1px 3px rgba(0,0,0,.25);border-bottom-color:transparent}#modal-window .modal-box.modal-type-error .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-info .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-inverted .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-primary .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-success .modal-title .modal-close-btn,#modal-window .modal-box.modal-type-warning .modal-title .modal-close-btn{background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBoj k8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKNJREFUeNqkk9EKwyAMRdMKfqG/WBD2hYWMs4epZBLjoBcEibnHNokHIE90mn0SkUtESpBfWk4aEUCABLz46gZKi9tV2hktNwEDUPnVDLHmrmoBBdAFxDNrv2D+RA+yNM+AFWRp9gARRL3inot2vf+MSdQqT3f0C6tqawTZmcumxQNwbQrmQS4LyGaUNRhlNaOc5xrkNp6e2UJqNwNyPH3OnwEACDCs273A8sIAAAAASUVORK5CYII=') center no-repeat}#modal-window .modal-box.modal-theme-reseted{background:0 0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}#modal-window .modal-box.modal-theme-reseted .modal-title{border-bottom:0;padding:0}#modal-window .modal-box.modal-theme-reseted .modal-title .modal-close-btn{right:0}#modal-window .modal-box.modal-theme-reseted .modal-text{padding:0}#modal-window .modal-box.modal-theme-reseted .modal-buttons{border-top:0;background:0 0;padding:0}
32
+
33
+ </style>
34
+
35
+
installer/build/assets/inc.libs.js.php CHANGED
@@ -175,4 +175,15 @@ for(var c=0;c<f.length;c++){var e=true;for(var b=0;b<a&&(b+c+a)<f.length;b++){e=
175
  */
176
  function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var _slice=Array.prototype.slice;!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):e.parsley=t(e.jQuery)}(this,function(e){"use strict";function t(e,t){return e.parsleyAdaptedCallback||(e.parsleyAdaptedCallback=function(){var i=Array.prototype.slice.call(arguments,0);i.unshift(this),e.apply(t||A,i)}),e.parsleyAdaptedCallback}function i(e){return 0===e.lastIndexOf(D,0)?e.substr(D.length):e}var n=1,r={},s={attr:function(e,t,i){var n,r,s,a=new RegExp("^"+t,"i");if("undefined"==typeof i)i={};else for(n in i)i.hasOwnProperty(n)&&delete i[n];if("undefined"==typeof e||"undefined"==typeof e[0])return i;for(s=e[0].attributes,n=s.length;n--;)r=s[n],r&&r.specified&&a.test(r.name)&&(i[this.camelize(r.name.slice(t.length))]=this.deserializeValue(r.value));return i},checkAttr:function(e,t,i){return e.is("["+t+i+"]")},setAttr:function(e,t,i,n){e[0].setAttribute(this.dasherize(t+i),String(n))},generateID:function(){return""+n++},deserializeValue:function(t){var i;try{return t?"true"==t||("false"==t?!1:"null"==t?null:isNaN(i=Number(t))?/^[\[\{]/.test(t)?e.parseJSON(t):t:i):t}catch(n){return t}},camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},dasherize:function(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},warn:function(){var e;window.console&&"function"==typeof window.console.warn&&(e=window.console).warn.apply(e,arguments)},warnOnce:function(e){r[e]||(r[e]=!0,this.warn.apply(this,arguments))},_resetWarnings:function(){r={}},trimString:function(e){return e.replace(/^\s+|\s+$/g,"")},namespaceEvents:function(t,i){return t=this.trimString(t||"").split(/\s+/),t[0]?e.map(t,function(e){return e+"."+i}).join(" "):""},objectCreate:Object.create||function(){var e=function(){};return function(t){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var i=new e;return e.prototype=null,i}}()},a=s,o={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(e){},errorsContainer:function(e){},errorsWrapper:'<ul class="parsley-errors-list"></ul>',errorTemplate:"<li></li>"},l=function(){};l.prototype={asyncSupport:!0,actualizeOptions:function(){return a.attr(this.$element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(e){this.domOptions=a.objectCreate(this.parent.options),this.options=a.objectCreate(this.domOptions);for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.actualizeOptions()},_listeners:null,on:function(e,t){this._listeners=this._listeners||{};var i=this._listeners[e]=this._listeners[e]||[];return i.push(t),this},subscribe:function(t,i){e.listenTo(this,t.toLowerCase(),i)},off:function(e,t){var i=this._listeners&&this._listeners[e];if(i)if(t)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1);else delete this._listeners[e];return this},unsubscribe:function(t,i){e.unsubscribeTo(this,t.toLowerCase())},trigger:function(e,t,i){t=t||this;var n,r=this._listeners&&this._listeners[e];if(r)for(var s=r.length;s--;)if(n=r[s].call(t,t,i),n===!1)return n;return this.parent?this.parent.trigger(e,t,i):!0},reset:function(){if("ParsleyForm"!==this.__class__)return this._resetUI(),this._trigger("reset");for(var e=0;e<this.fields.length;e++)this.fields[e].reset();this._trigger("reset")},destroy:function(){if(this._destroyUI(),"ParsleyForm"!==this.__class__)return this.$element.removeData("Parsley"),this.$element.removeData("ParsleyFieldMultiple"),void this._trigger("destroy");for(var e=0;e<this.fields.length;e++)this.fields[e].destroy();this.$element.removeData("Parsley"),this._trigger("destroy")},asyncIsValid:function(e,t){return a.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:e,force:t})},_findRelated:function(){return this.options.multiple?this.parent.$element.find("["+this.options.namespace+'multiple="'+this.options.multiple+'"]'):this.$element}};var u={string:function(e){return e},integer:function(e){if(isNaN(e))throw'Requirement is not an integer: "'+e+'"';return parseInt(e,10)},number:function(e){if(isNaN(e))throw'Requirement is not a number: "'+e+'"';return parseFloat(e)},reference:function(t){var i=e(t);if(0===i.length)throw'No such reference: "'+t+'"';return i},"boolean":function(e){return"false"!==e},object:function(e){return a.deserializeValue(e)},regexp:function(e){var t="";return/^\/.*\/(?:[gimy]*)$/.test(e)?(t=e.replace(/.*\/([gimy]*)$/,"$1"),e=e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1")):e="^"+e+"$",new RegExp(e,t)}},d=function(e,t){var i=e.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+e+'"';var n=i[1].split(",").map(a.trimString);if(n.length!==t)throw"Requirement has "+n.length+" values when "+t+" are needed";return n},h=function(e,t){var i=u[e||"string"];if(!i)throw'Unknown requirement specification: "'+e+'"';return i(t)},p=function(e,t,i){var n=null,r={};for(var s in e)if(s){var a=i(s);"string"==typeof a&&(a=h(e[s],a)),r[s]=a}else n=h(e[s],t);return[n,r]},f=function(t){e.extend(!0,this,t)};f.prototype={validate:function(t,i){if(this.fn)return arguments.length>3&&(i=[].slice.call(arguments,1,-1)),this.fn.call(this,t,i);if(e.isArray(t)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}if(this.validateNumber)return isNaN(t)?!1:(arguments[0]=parseFloat(arguments[0]),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values"},parseRequirements:function(t,i){if("string"!=typeof t)return e.isArray(t)?t:[t];var n=this.requirementType;if(e.isArray(n)){for(var r=d(t,n.length),s=0;s<r.length;s++)r[s]=h(n[s],r[s]);return r}return e.isPlainObject(n)?p(n,t,i):[h(n,t)]},requirementType:"string",priority:2};var c=function(e,t){this.__class__="ParsleyValidatorRegistry",this.locale="en",this.init(e||{},t||{})},m={email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,number:/^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,integer:/^-?\d+$/,digits:/^\d+$/,alphanum:/^\w+$/i,url:new RegExp("^(?:(?:https?|ftp)://)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/\\S*)?$","i")};m.range=m.number;var g=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0};c.prototype={init:function(t,i){this.catalog=i,this.validators=e.extend({},this.validators);for(var n in t)this.addValidator(n,t[n].fn,t[n].priority);window.Parsley.trigger("parsley:validator:init")},setLocale:function(e){if("undefined"==typeof this.catalog[e])throw new Error(e+" is not available in the catalog");return this.locale=e,this},addCatalog:function(e,t,i){return"object"==typeof t&&(this.catalog[e]=t),!0===i?this.setLocale(e):this},addMessage:function(e,t,i){return"undefined"==typeof this.catalog[e]&&(this.catalog[e]={}),this.catalog[e][t]=i,this},addMessages:function(e,t){for(var i in t)this.addMessage(e,i,t[i]);return this},addValidator:function(e,t,i){if(this.validators[e])a.warn('Validator "'+e+'" is already defined.');else if(o.hasOwnProperty(e))return void a.warn('"'+e+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)},updateValidator:function(e,t,i){return this.validators[e]?this._setValidator(this,arguments):(a.warn('Validator "'+e+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(e){return this.validators[e]||a.warn('Validator "'+e+'" is not defined.'),delete this.validators[e],this},_setValidator:function(e,t,i){"object"!=typeof t&&(t={fn:t,priority:i}),t.validate||(t=new f(t)),this.validators[e]=t;for(var n in t.messages||{})this.addMessage(n,e,t.messages[n]);return this},getErrorMessage:function(e){var t;if("type"===e.name){var i=this.catalog[this.locale][e.name]||{};t=i[e.requirements]}else t=this.formatMessage(this.catalog[this.locale][e.name],e.requirements);return t||this.catalog[this.locale].defaultMessage||this.catalog.en.defaultMessage},formatMessage:function(e,t){if("object"==typeof t){for(var i in t)e=this.formatMessage(e,t[i]);return e}return"string"==typeof e?e.replace(/%s/i,t):""},validators:{notblank:{validateString:function(e){return/\S/.test(e)},priority:2},required:{validateMultiple:function(e){return e.length>0},validateString:function(e){return/\S/.test(e)},priority:512},type:{validateString:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=i.step,r=void 0===n?"1":n,s=i.base,a=void 0===s?0:s,o=m[t];if(!o)throw new Error("validator type `"+t+"` is not supported");if(!o.test(e))return!1;if("number"===t&&!/^any$/i.test(r||"")){var l=Number(e),u=Math.max(g(r),g(a));if(g(l)>u)return!1;var d=function(e){return Math.round(e*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(e,t){return t.test(e)},requirementType:"regexp",priority:64},minlength:{validateString:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxlength:{validateString:function(e,t){return e.length<=t},requirementType:"integer",priority:30},length:{validateString:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(e,t){return e.length<=t},requirementType:"integer",priority:30},check:{validateMultiple:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},min:{validateNumber:function(e,t){return e>=t},requirementType:"number",priority:30},max:{validateNumber:function(e,t){return t>=e},requirementType:"number",priority:30},range:{validateNumber:function(e,t,i){return e>=t&&i>=e},requirementType:["number","number"],priority:30},equalto:{validateString:function(t,i){var n=e(i);return n.length?t===n.val():t===i},priority:256}}};var y={},v=function T(e,t,i){for(var n=[],r=[],s=0;s<e.length;s++){for(var a=!1,o=0;o<t.length;o++)if(e[s].assert.name===t[o].assert.name){a=!0;break}a?r.push(e[s]):n.push(e[s])}return{kept:r,added:n,removed:i?[]:T(t,e,!0).added}};y.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",'input[type="submit"], button[type="submit"]',function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.$element.attr("novalidate","")},focus:function(){if(this._focusedField=null,!0===this.validationResult||"none"===this.options.focus)return null;for(var e=0;e<this.fields.length;e++){var t=this.fields[e];if(!0!==t.validationResult&&t.validationResult.length>0&&"undefined"==typeof t.options.noFocus&&(this._focusedField=t.$element,"first"===this.options.focus))break}return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},y.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var e=v(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult,this._manageStatusClass(),this._manageErrorsMessages(e),this._actualizeTriggers(),!e.kept.length&&!e.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var e=[],t=0;t<this.validationResult.length;t++)e.push(this.validationResult[t].errorMessage||this._getErrorMessage(this.validationResult[t].assert));return e},addError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r?!0:r;this._buildUI(),this._addError(e,{message:i,assert:n}),s&&this._errorClass()},updateError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r?!0:r;this._buildUI(),this._updateError(e,{message:i,assert:n}),s&&this._errorClass()},removeError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.updateClass,n=void 0===i?!0:i;this._buildUI(),this._removeError(e),n&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&!0===this.validationResult?this._successClass():this.validationResult.length>0?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if("undefined"==typeof this.options.errorsMessagesDisabled){if("undefined"!=typeof this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(e(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var i=0;i<t.removed.length;i++)this._removeError(t.removed[i].assert.name);for(i=0;i<t.added.length;i++)this._addError(t.added[i].assert.name,{message:t.added[i].errorMessage,assert:t.added[i].assert});for(i=0;i<t.kept.length;i++)this._updateError(t.kept[i].assert.name,{message:t.kept[i].errorMessage,assert:t.kept[i].assert})}},_addError:function(t,i){var n=i.message,r=i.assert;this._insertErrorWrapper(),this._ui.$errorsWrapper.addClass("filled").append(e(this.options.errorTemplate).addClass("parsley-"+t).html(n||this._getErrorMessage(r)))},_updateError:function(e,t){var i=t.message,n=t.assert;this._ui.$errorsWrapper.addClass("filled").find(".parsley-"+e).html(i||this._getErrorMessage(n))},_removeError:function(e){this._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+e).remove()},_getErrorMessage:function(e){var t=e.name+"Message";return"undefined"!=typeof this.options[t]?window.Parsley.formatMessage(this.options[t],e.requirements):window.Parsley.getErrorMessage(e)},_buildUI:function(){if(!this._ui&&!1!==this.options.uiEnabled){var t={};this.$element.attr(this.options.namespace+"id",this.__id__),t.$errorClassHandler=this._manageClassHandler(),t.errorsWrapperId="parsley-id-"+(this.options.multiple?"multiple-"+this.options.multiple:this.__id__),t.$errorsWrapper=e(this.options.errorsWrapper).attr("id",t.errorsWrapperId),t.lastValidationResult=[],t.validationInformationVisible=!1,this._ui=t}},_manageClassHandler:function(){if("string"==typeof this.options.classHandler&&e(this.options.classHandler).length)return e(this.options.classHandler);var t=this.options.classHandler.call(this,this);return"undefined"!=typeof t&&t.length?t:!this.options.multiple||this.$element.is("select")?this.$element:this.$element.parent()},_insertErrorWrapper:function(){var t;if(0!==this._ui.$errorsWrapper.parent().length)return this._ui.$errorsWrapper.parent();if("string"==typeof this.options.errorsContainer){if(e(this.options.errorsContainer).length)return e(this.options.errorsContainer).append(this._ui.$errorsWrapper);a.warn("The errors container `"+this.options.errorsContainer+"` does not exist in DOM")}else"function"==typeof this.options.errorsContainer&&(t=this.options.errorsContainer.call(this,this));if("undefined"!=typeof t&&t.length)return t.append(this._ui.$errorsWrapper);var i=this.$element;return this.options.multiple&&(i=i.parent()),i.after(this._ui.$errorsWrapper)},_actualizeTriggers:function(){var e=this,t=this._findRelated();t.off(".Parsley"),this._failedOnce?t.on(a.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){e.validate()}):t.on(a.namespaceEvents(this.options.trigger,"Parsley"),function(t){e._eventValidate(t)})},_eventValidate:function(e){(!/key|input/.test(e.type)||this._ui&&this._ui.validationInformationVisible||!(this.getValue().length<=this.options.validationThreshold))&&this.validate()},_resetUI:function(){this._failedOnce=!1,this._actualizeTriggers(),"undefined"!=typeof this._ui&&(this._ui.$errorsWrapper.removeClass("filled").children().remove(),this._resetClass(),this._ui.lastValidationResult=[],this._ui.validationInformationVisible=!1)},_destroyUI:function(){this._resetUI(),"undefined"!=typeof this._ui&&this._ui.$errorsWrapper.remove(),delete this._ui},_successClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass)},_errorClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass)},_resetClass:function(){this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass)}};var _=function(t,i,n){this.__class__="ParsleyForm",this.__id__=a.generateID(),this.$element=e(t),this.domOptions=i,this.options=n,this.parent=window.Parsley,this.fields=[],this.validationResult=null},w={pending:null,resolved:!0,rejected:!1};_.prototype={onSubmitValidate:function(e){var t=this;if(!0!==e.parsley){var i=this._$submitSource||this.$element.find('input[type="submit"], button[type="submit"]').first();if(this._$submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),!i.is("[formnovalidate]")){var n=this.whenValidate({event:e});"resolved"===n.state()&&!1!==this._trigger("submit")||(e.stopImmediatePropagation(),e.preventDefault(),"pending"===n.state()&&n.done(function(){t._submit(i)}))}}},onSubmitButton:function(t){this._$submitSource=e(t.target)},_submit:function(t){if(!1!==this._trigger("submit")){if(t){var i=this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!1);0===i.length&&(i=e('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element)),i.attr({name:t.attr("name"),value:t.attr("value")})}this.$element.trigger(e.extend(e.Event("submit"),{parsley:!0}))}},validate:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1],s=i[2];t={group:n,force:r,event:s}}return w[this.whenValidate(t).state()]},whenValidate:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force,s=i.event;this.submitEvent=s,s&&(this.submitEvent=e.extend({},s,{preventDefault:function(){a.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`"),t.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields();var o=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValidate({force:r,group:n})})}),l=function(){var i=e.Deferred();return!1===t.validationResult&&i.reject(),i.resolve().promise()};return e.when.apply(e,_toConsumableArray(o)).done(function(){t._trigger("success")}).fail(function(){t.validationResult=!1,t.focus(),t._trigger("error")}).always(function(){t._trigger("validated")}).pipe(l,l)},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={group:n,force:r}}return w[this.whenValid(t).state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force;this._refreshFields();var s=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValid({group:n,force:r})})});return e.when.apply(e,_toConsumableArray(s))},_refreshFields:function(){return this.actualizeOptions()._bindFields()},_bindFields:function(){var t=this,i=this.fields;return this.fields=[],this.fieldsMappedById={},this._withoutReactualizingFormOptions(function(){t.$element.find(t.options.inputs).not(t.options.excluded).each(function(e,i){var n=new window.Parsley.Factory(i,{},t);"ParsleyField"!==n.__class__&&"ParsleyFieldMultiple"!==n.__class__||!0===n.options.excluded||"undefined"==typeof t.fieldsMappedById[n.__class__+"-"+n.__id__]&&(t.fieldsMappedById[n.__class__+"-"+n.__id__]=n,t.fields.push(n))}),e(i).not(t.fields).each(function(e,t){t._trigger("reset")})}),this},_withoutReactualizingFormOptions:function(e){var t=this.actualizeOptions;this.actualizeOptions=function(){return this};var i=e();return this.actualizeOptions=t,i},_trigger:function(e){return this.trigger("form:"+e)}};var b=function(t,i,n,r,s){if(!/ParsleyField/.test(t.__class__))throw new Error("ParsleyField or ParsleyFieldMultiple instance expected");var a=window.Parsley._validatorRegistry.validators[i],o=new f(a);e.extend(this,{validator:o,name:i,requirements:n,priority:r||t.options[i+"Priority"]||o.priority,isDomConstraint:!0===s}),this._parseRequirements(t.options)},F=function(e){var t=e[0].toUpperCase();return t+e.slice(1)};b.prototype={validate:function(e,t){var i=this.requirementList.slice(0);return i.unshift(e),i.push(t),this.validator.validate.apply(this.validator,i)},_parseRequirements:function(e){var t=this;this.requirementList=this.validator.parseRequirements(this.requirements,function(i){return e[t.name+F(i)]})}};var C=function(t,i,n,r){this.__class__="ParsleyField",this.__id__=a.generateID(),this.$element=e(t),"undefined"!=typeof r&&(this.parent=r),this.options=n,this.domOptions=i,this.constraints=[],this.constraintsByName={},this.validationResult=[],this._bindConstraints()},$={pending:null,resolved:!0,rejected:!1};C.prototype={validate:function(t){arguments.length>=1&&!e.isPlainObject(t)&&(a.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),t={options:t});var i=this.whenValidate(t);if(!i)return!0;switch(i.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=t.force,n=t.group;return this.refreshConstraints(),!n||this._isInGroup(n)?(this.value=this.getValue(),this._trigger("validate"),this.whenValid({force:i,value:this.value,_refreshed:!0}).always(function(){e._reflowUI()}).done(function(){e._trigger("success")}).fail(function(){e._trigger("error")}).always(function(){e._trigger("validated")})):void 0},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(e){return"undefined"==typeof e&&(e=this.getValue()),e.length||this._isRequired()||"undefined"!=typeof this.options.validateIfEmpty?!0:!1},_isInGroup:function(t){return e.isArray(this.options.group)?-1!==e.inArray(t,this.options.group):this.options.group===t},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={force:n,value:r}}var s=this.whenValid(t);return s?$[s.state()]:!0},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=void 0===n?!1:n,s=i.value,a=i.group,o=i._refreshed;if(o||this.refreshConstraints(),!a||this._isInGroup(a)){if(this.validationResult=!0,!this.hasConstraints())return e.when();if(("undefined"==typeof s||null===s)&&(s=this.getValue()),!this.needsValidation(s)&&!0!==r)return e.when();var l=this._getGroupedConstraints(),u=[];return e.each(l,function(i,n){var r=e.when.apply(e,_toConsumableArray(e.map(n,function(e){return t._validateConstraint(s,e)})));return u.push(r),"rejected"===r.state()?!1:void 0}),e.when.apply(e,u)}},_validateConstraint:function(t,i){var n=this,r=i.validate(t,this);return!1===r&&(r=e.Deferred().reject()),e.when(r).fail(function(e){!0===n.validationResult&&(n.validationResult=[]),n.validationResult.push({assert:i,errorMessage:"string"==typeof e&&e})})},getValue:function(){var e;return e="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof e||null===e?"":this._handleWhitespace(e)},refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},addConstraint:function(e,t,i,n){if(window.Parsley._validatorRegistry.validators[e]){var r=new b(this,e,t,i,n);"undefined"!==this.constraintsByName[r.name]&&this.removeConstraint(r.name),this.constraints.push(r),this.constraintsByName[r.name]=r}return this},removeConstraint:function(e){for(var t=0;t<this.constraints.length;t++)if(e===this.constraints[t].name){this.constraints.splice(t,1);break}return delete this.constraintsByName[e],this},updateConstraint:function(e,t,i){return this.removeConstraint(e).addConstraint(e,t,i)},_bindConstraints:function(){for(var e=[],t={},i=0;i<this.constraints.length;i++)!1===this.constraints[i].isDomConstraint&&(e.push(this.constraints[i]),t[this.constraints[i].name]=this.constraints[i]);this.constraints=e,this.constraintsByName=t;for(var n in this.options)this.addConstraint(n,this.options[n],void 0,!0);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){(this.$element.hasClass("required")||this.$element.attr("required"))&&this.addConstraint("required",!0,void 0,!0),"string"==typeof this.$element.attr("pattern")&&this.addConstraint("pattern",this.$element.attr("pattern"),void 0,!0),"undefined"!=typeof this.$element.attr("min")&&"undefined"!=typeof this.$element.attr("max")?this.addConstraint("range",[this.$element.attr("min"),this.$element.attr("max")],void 0,!0):"undefined"!=typeof this.$element.attr("min")?this.addConstraint("min",this.$element.attr("min"),void 0,!0):"undefined"!=typeof this.$element.attr("max")&&this.addConstraint("max",this.$element.attr("max"),void 0,!0),"undefined"!=typeof this.$element.attr("minlength")&&"undefined"!=typeof this.$element.attr("maxlength")?this.addConstraint("length",[this.$element.attr("minlength"),this.$element.attr("maxlength")],void 0,!0):"undefined"!=typeof this.$element.attr("minlength")?this.addConstraint("minlength",this.$element.attr("minlength"),void 0,!0):"undefined"!=typeof this.$element.attr("maxlength")&&this.addConstraint("maxlength",this.$element.attr("maxlength"),void 0,!0);var e=this.$element.attr("type");return"undefined"==typeof e?this:"number"===e?this.addConstraint("type",["number",{step:this.$element.attr("step"),base:this.$element.attr("min")||this.$element.attr("value")}],void 0,!0):/^(email|url|range)$/i.test(e)?this.addConstraint("type",e,void 0,!0):this},_isRequired:function(){return"undefined"==typeof this.constraintsByName.required?!1:!1!==this.constraintsByName.required.requirements},_trigger:function(e){return this.trigger("field:"+e)},_handleWhitespace:function(e){return!0===this.options.trimValue&&a.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(e=e.replace(/\s{2,}/g," ")),("trim"===this.options.whitespace||"squish"===this.options.whitespace||!0===this.options.trimValue)&&(e=a.trimString(e)),e},_getGroupedConstraints:function(){if(!1===this.options.priorityEnabled)return[this.constraints];for(var e=[],t={},i=0;i<this.constraints.length;i++){var n=this.constraints[i].priority;t[n]||e.push(t[n]=[]),t[n].push(this.constraints[i])}return e.sort(function(e,t){return t[0].priority-e[0].priority}),e}};var x=C,P=function(){this.__class__="ParsleyFieldMultiple"};P.prototype={addElement:function(e){return this.$elements.push(e),this},refreshConstraints:function(){var t;if(this.constraints=[],this.$element.is("select"))return this.actualizeOptions()._bindConstraints(),this;for(var i=0;i<this.$elements.length;i++)if(e("html").has(this.$elements[i]).length){t=this.$elements[i].data("ParsleyFieldMultiple").refreshConstraints().constraints;for(var n=0;n<t.length;n++)this.addConstraint(t[n].name,t[n].requirements,t[n].priority,t[n].isDomConstraint)}else this.$elements.splice(i,1);return this},getValue:function(){if("function"==typeof this.options.value)value=this.options.value(this);else if("undefined"!=typeof this.options.value)return this.options.value;if(this.$element.is("input[type=radio]"))return this._findRelated().filter(":checked").val()||"";if(this.$element.is("input[type=checkbox]")){var t=[];return this._findRelated().filter(":checked").each(function(){t.push(e(this).val())}),t}return this.$element.is("select")&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var E=function(t,i,n){this.$element=e(t);var r=this.$element.data("Parsley");if(r)return"undefined"!=typeof n&&r.parent===window.Parsley&&(r.parent=n,r._resetOptions(r.options)),r;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof n&&"ParsleyForm"!==n.__class__)throw new Error("Parent instance must be a ParsleyForm instance");return this.parent=n||window.Parsley,this.init(i)};E.prototype={init:function(e){return this.__class__="Parsley",this.__version__="2.3.5",this.__id__=a.generateID(),this._resetOptions(e),this.$element.is("form")||a.checkAttr(this.$element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){return this.$element.is("input[type=radio], input[type=checkbox]")||this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple")},handleMultiple:function(){var t,i,n=this;if(this.options.multiple||("undefined"!=typeof this.$element.attr("name")&&this.$element.attr("name").length?this.options.multiple=t=this.$element.attr("name"):"undefined"!=typeof this.$element.attr("id")&&this.$element.attr("id").length&&(this.options.multiple=this.$element.attr("id"))),this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return a.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),
177
  "undefined"!=typeof t&&e('input[name="'+t+'"]').each(function(t,i){e(i).is("input[type=radio], input[type=checkbox]")&&e(i).attr(n.options.namespace+"multiple",n.options.multiple)});for(var r=this._findRelated(),s=0;s<r.length;s++)if(i=e(r.get(s)).data("Parsley"),"undefined"!=typeof i){this.$element.data("ParsleyFieldMultiple")||i.addElement(this.$element);break}return this.bind("parsleyField",!0),i||this.bind("parsleyFieldMultiple")},bind:function(t,i){var n;switch(t){case"parsleyForm":n=e.extend(new _(this.$element,this.domOptions,this.options),window.ParsleyExtend)._bindFields();break;case"parsleyField":n=e.extend(new x(this.$element,this.domOptions,this.options,this.parent),window.ParsleyExtend);break;case"parsleyFieldMultiple":n=e.extend(new x(this.$element,this.domOptions,this.options,this.parent),new P,window.ParsleyExtend)._init();break;default:throw new Error(t+"is not a supported Parsley type")}return this.options.multiple&&a.setAttr(this.$element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof i?(this.$element.data("ParsleyFieldMultiple",n),n):(this.$element.data("Parsley",n),n._actualizeTriggers(),n._trigger("init"),n)}};var V=e.fn.jquery.split(".");if(parseInt(V[0])<=1&&parseInt(V[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";V.forEach||a.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");var M=e.extend(new l,{$element:e(document),actualizeOptions:null,_resetOptions:null,Factory:E,version:"2.3.5"});e.extend(x.prototype,y.Field,l.prototype),e.extend(_.prototype,y.Form,l.prototype),e.extend(E.prototype,l.prototype),e.fn.parsley=e.fn.psly=function(t){if(this.length>1){var i=[];return this.each(function(){i.push(e(this).parsley(t))}),i}return e(this).length?new E(this,t):void a.warn("You must bind Parsley on an existing element.")},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),M.options=e.extend(a.objectCreate(o),window.ParsleyConfig),window.ParsleyConfig=M.options,window.Parsley=window.psly=M,window.ParsleyUtils=a;var O=window.Parsley._validatorRegistry=new c(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},e.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator".split(" "),function(t,i){window.Parsley[i]=e.proxy(O,i),window.ParsleyValidator[i]=function(){var e;return a.warnOnce("Accessing the method '"+i+"' through ParsleyValidator is deprecated. Simply call 'window.Parsley."+i+"(...)'"),(e=window.Parsley)[i].apply(e,arguments)}}),window.Parsley.UI=y,window.ParsleyUI={removeError:function(e,t,i){var n=!0!==i;return a.warnOnce("Accessing ParsleyUI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e.removeError(t,{updateClass:n})},getErrorsMessages:function(e){return a.warnOnce("Accessing ParsleyUI is deprecated. Call 'getErrorsMessages' on the instance directly."),e.getErrorsMessages()}},e.each("addError updateError".split(" "),function(e,t){window.ParsleyUI[t]=function(e,i,n,r,s){var o=!0!==s;return a.warnOnce("Accessing ParsleyUI is deprecated. Call '"+t+"' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e[t](i,{message:n,assert:r,updateClass:o})}}),/firefox/i.test(navigator.userAgent)&&e(document).on("change","select",function(t){e(t.target).trigger("input")}),!1!==window.ParsleyConfig.autoBind&&e(function(){e("[data-parsley-validate]").length&&e("[data-parsley-validate]").parsley()});var A=e({}),R=function(){a.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},D="parsley:";e.listen=function(e,n){var r;if(R(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(r=arguments[1],n=arguments[2]),"function"!=typeof n)throw new Error("Wrong parameters");window.Parsley.on(i(e),t(n,r))},e.listenTo=function(e,n,r){if(R(),!(e instanceof x||e instanceof _))throw new Error("Must give Parsley instance");if("string"!=typeof n||"function"!=typeof r)throw new Error("Wrong parameters");e.on(i(n),t(r))},e.unsubscribe=function(e,t){if(R(),"string"!=typeof e||"function"!=typeof t)throw new Error("Wrong arguments");window.Parsley.off(i(e),t.parsleyAdaptedCallback)},e.unsubscribeTo=function(e,t){if(R(),!(e instanceof x||e instanceof _))throw new Error("Must give Parsley instance");e.off(i(t))},e.unsubscribeAll=function(t){R(),window.Parsley.off(i(t)),e("form,input,textarea,select").each(function(){var n=e(this).data("Parsley");n&&n.off(i(t))})},e.emit=function(e,t){var n;R();var r=t instanceof x||t instanceof _,s=Array.prototype.slice.call(arguments,r?2:1);s.unshift(i(e)),r||(t=window.Parsley),(n=t).trigger.apply(n,_toConsumableArray(s))};e.extend(!0,M,{asyncValidators:{"default":{fn:function(e){return e.status>=200&&e.status<300},url:!1},reverse:{fn:function(e){return e.status<200||e.status>=300},url:!1}},addAsyncValidator:function(e,t,i,n){return M.asyncValidators[e]={fn:t,url:i||!1,options:n||{}},this}}),M.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,i,n,r){var s,a,o={},l=n.validator||(!0===n.reverse?"reverse":"default");if("undefined"==typeof M.asyncValidators[l])throw new Error("Calling an undefined async validator: `"+l+"`");i=M.asyncValidators[l].url||i,i.indexOf("{value}")>-1?i=i.replace("{value}",encodeURIComponent(t)):o[r.$element.attr("name")||r.$element.attr("id")]=t;var u=e.extend(!0,n.options||{},M.asyncValidators[l].options);s=e.extend(!0,{},{url:i,data:o,type:"GET"},u),r.trigger("field:ajaxoptions",r,s),a=e.param(s),"undefined"==typeof M._remoteCache&&(M._remoteCache={});var d=M._remoteCache[a]=M._remoteCache[a]||e.ajax(s),h=function(){var t=M.asyncValidators[l].fn.call(r,d,i,n);return t||(t=e.Deferred().reject()),e.when(t)};return d.then(h,h)},priority:-1}),M.on("form:submit",function(){M._remoteCache={}}),window.ParsleyExtend.addAsyncValidator=function(){return ParsleyUtils.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),M.addAsyncValidator.apply(M,arguments)},M.addMessages("en",{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same."}),M.setLocale("en");var q=M;return q});
 
 
 
 
 
 
 
 
 
 
 
178
  </script>
175
  */
176
  function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var _slice=Array.prototype.slice;!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):e.parsley=t(e.jQuery)}(this,function(e){"use strict";function t(e,t){return e.parsleyAdaptedCallback||(e.parsleyAdaptedCallback=function(){var i=Array.prototype.slice.call(arguments,0);i.unshift(this),e.apply(t||A,i)}),e.parsleyAdaptedCallback}function i(e){return 0===e.lastIndexOf(D,0)?e.substr(D.length):e}var n=1,r={},s={attr:function(e,t,i){var n,r,s,a=new RegExp("^"+t,"i");if("undefined"==typeof i)i={};else for(n in i)i.hasOwnProperty(n)&&delete i[n];if("undefined"==typeof e||"undefined"==typeof e[0])return i;for(s=e[0].attributes,n=s.length;n--;)r=s[n],r&&r.specified&&a.test(r.name)&&(i[this.camelize(r.name.slice(t.length))]=this.deserializeValue(r.value));return i},checkAttr:function(e,t,i){return e.is("["+t+i+"]")},setAttr:function(e,t,i,n){e[0].setAttribute(this.dasherize(t+i),String(n))},generateID:function(){return""+n++},deserializeValue:function(t){var i;try{return t?"true"==t||("false"==t?!1:"null"==t?null:isNaN(i=Number(t))?/^[\[\{]/.test(t)?e.parseJSON(t):t:i):t}catch(n){return t}},camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},dasherize:function(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},warn:function(){var e;window.console&&"function"==typeof window.console.warn&&(e=window.console).warn.apply(e,arguments)},warnOnce:function(e){r[e]||(r[e]=!0,this.warn.apply(this,arguments))},_resetWarnings:function(){r={}},trimString:function(e){return e.replace(/^\s+|\s+$/g,"")},namespaceEvents:function(t,i){return t=this.trimString(t||"").split(/\s+/),t[0]?e.map(t,function(e){return e+"."+i}).join(" "):""},objectCreate:Object.create||function(){var e=function(){};return function(t){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var i=new e;return e.prototype=null,i}}()},a=s,o={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(e){},errorsContainer:function(e){},errorsWrapper:'<ul class="parsley-errors-list"></ul>',errorTemplate:"<li></li>"},l=function(){};l.prototype={asyncSupport:!0,actualizeOptions:function(){return a.attr(this.$element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(e){this.domOptions=a.objectCreate(this.parent.options),this.options=a.objectCreate(this.domOptions);for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.actualizeOptions()},_listeners:null,on:function(e,t){this._listeners=this._listeners||{};var i=this._listeners[e]=this._listeners[e]||[];return i.push(t),this},subscribe:function(t,i){e.listenTo(this,t.toLowerCase(),i)},off:function(e,t){var i=this._listeners&&this._listeners[e];if(i)if(t)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1);else delete this._listeners[e];return this},unsubscribe:function(t,i){e.unsubscribeTo(this,t.toLowerCase())},trigger:function(e,t,i){t=t||this;var n,r=this._listeners&&this._listeners[e];if(r)for(var s=r.length;s--;)if(n=r[s].call(t,t,i),n===!1)return n;return this.parent?this.parent.trigger(e,t,i):!0},reset:function(){if("ParsleyForm"!==this.__class__)return this._resetUI(),this._trigger("reset");for(var e=0;e<this.fields.length;e++)this.fields[e].reset();this._trigger("reset")},destroy:function(){if(this._destroyUI(),"ParsleyForm"!==this.__class__)return this.$element.removeData("Parsley"),this.$element.removeData("ParsleyFieldMultiple"),void this._trigger("destroy");for(var e=0;e<this.fields.length;e++)this.fields[e].destroy();this.$element.removeData("Parsley"),this._trigger("destroy")},asyncIsValid:function(e,t){return a.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:e,force:t})},_findRelated:function(){return this.options.multiple?this.parent.$element.find("["+this.options.namespace+'multiple="'+this.options.multiple+'"]'):this.$element}};var u={string:function(e){return e},integer:function(e){if(isNaN(e))throw'Requirement is not an integer: "'+e+'"';return parseInt(e,10)},number:function(e){if(isNaN(e))throw'Requirement is not a number: "'+e+'"';return parseFloat(e)},reference:function(t){var i=e(t);if(0===i.length)throw'No such reference: "'+t+'"';return i},"boolean":function(e){return"false"!==e},object:function(e){return a.deserializeValue(e)},regexp:function(e){var t="";return/^\/.*\/(?:[gimy]*)$/.test(e)?(t=e.replace(/.*\/([gimy]*)$/,"$1"),e=e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1")):e="^"+e+"$",new RegExp(e,t)}},d=function(e,t){var i=e.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+e+'"';var n=i[1].split(",").map(a.trimString);if(n.length!==t)throw"Requirement has "+n.length+" values when "+t+" are needed";return n},h=function(e,t){var i=u[e||"string"];if(!i)throw'Unknown requirement specification: "'+e+'"';return i(t)},p=function(e,t,i){var n=null,r={};for(var s in e)if(s){var a=i(s);"string"==typeof a&&(a=h(e[s],a)),r[s]=a}else n=h(e[s],t);return[n,r]},f=function(t){e.extend(!0,this,t)};f.prototype={validate:function(t,i){if(this.fn)return arguments.length>3&&(i=[].slice.call(arguments,1,-1)),this.fn.call(this,t,i);if(e.isArray(t)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}if(this.validateNumber)return isNaN(t)?!1:(arguments[0]=parseFloat(arguments[0]),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values"},parseRequirements:function(t,i){if("string"!=typeof t)return e.isArray(t)?t:[t];var n=this.requirementType;if(e.isArray(n)){for(var r=d(t,n.length),s=0;s<r.length;s++)r[s]=h(n[s],r[s]);return r}return e.isPlainObject(n)?p(n,t,i):[h(n,t)]},requirementType:"string",priority:2};var c=function(e,t){this.__class__="ParsleyValidatorRegistry",this.locale="en",this.init(e||{},t||{})},m={email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,number:/^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,integer:/^-?\d+$/,digits:/^\d+$/,alphanum:/^\w+$/i,url:new RegExp("^(?:(?:https?|ftp)://)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/\\S*)?$","i")};m.range=m.number;var g=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0};c.prototype={init:function(t,i){this.catalog=i,this.validators=e.extend({},this.validators);for(var n in t)this.addValidator(n,t[n].fn,t[n].priority);window.Parsley.trigger("parsley:validator:init")},setLocale:function(e){if("undefined"==typeof this.catalog[e])throw new Error(e+" is not available in the catalog");return this.locale=e,this},addCatalog:function(e,t,i){return"object"==typeof t&&(this.catalog[e]=t),!0===i?this.setLocale(e):this},addMessage:function(e,t,i){return"undefined"==typeof this.catalog[e]&&(this.catalog[e]={}),this.catalog[e][t]=i,this},addMessages:function(e,t){for(var i in t)this.addMessage(e,i,t[i]);return this},addValidator:function(e,t,i){if(this.validators[e])a.warn('Validator "'+e+'" is already defined.');else if(o.hasOwnProperty(e))return void a.warn('"'+e+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)},updateValidator:function(e,t,i){return this.validators[e]?this._setValidator(this,arguments):(a.warn('Validator "'+e+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(e){return this.validators[e]||a.warn('Validator "'+e+'" is not defined.'),delete this.validators[e],this},_setValidator:function(e,t,i){"object"!=typeof t&&(t={fn:t,priority:i}),t.validate||(t=new f(t)),this.validators[e]=t;for(var n in t.messages||{})this.addMessage(n,e,t.messages[n]);return this},getErrorMessage:function(e){var t;if("type"===e.name){var i=this.catalog[this.locale][e.name]||{};t=i[e.requirements]}else t=this.formatMessage(this.catalog[this.locale][e.name],e.requirements);return t||this.catalog[this.locale].defaultMessage||this.catalog.en.defaultMessage},formatMessage:function(e,t){if("object"==typeof t){for(var i in t)e=this.formatMessage(e,t[i]);return e}return"string"==typeof e?e.replace(/%s/i,t):""},validators:{notblank:{validateString:function(e){return/\S/.test(e)},priority:2},required:{validateMultiple:function(e){return e.length>0},validateString:function(e){return/\S/.test(e)},priority:512},type:{validateString:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=i.step,r=void 0===n?"1":n,s=i.base,a=void 0===s?0:s,o=m[t];if(!o)throw new Error("validator type `"+t+"` is not supported");if(!o.test(e))return!1;if("number"===t&&!/^any$/i.test(r||"")){var l=Number(e),u=Math.max(g(r),g(a));if(g(l)>u)return!1;var d=function(e){return Math.round(e*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(e,t){return t.test(e)},requirementType:"regexp",priority:64},minlength:{validateString:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxlength:{validateString:function(e,t){return e.length<=t},requirementType:"integer",priority:30},length:{validateString:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(e,t){return e.length<=t},requirementType:"integer",priority:30},check:{validateMultiple:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},min:{validateNumber:function(e,t){return e>=t},requirementType:"number",priority:30},max:{validateNumber:function(e,t){return t>=e},requirementType:"number",priority:30},range:{validateNumber:function(e,t,i){return e>=t&&i>=e},requirementType:["number","number"],priority:30},equalto:{validateString:function(t,i){var n=e(i);return n.length?t===n.val():t===i},priority:256}}};var y={},v=function T(e,t,i){for(var n=[],r=[],s=0;s<e.length;s++){for(var a=!1,o=0;o<t.length;o++)if(e[s].assert.name===t[o].assert.name){a=!0;break}a?r.push(e[s]):n.push(e[s])}return{kept:r,added:n,removed:i?[]:T(t,e,!0).added}};y.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",'input[type="submit"], button[type="submit"]',function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.$element.attr("novalidate","")},focus:function(){if(this._focusedField=null,!0===this.validationResult||"none"===this.options.focus)return null;for(var e=0;e<this.fields.length;e++){var t=this.fields[e];if(!0!==t.validationResult&&t.validationResult.length>0&&"undefined"==typeof t.options.noFocus&&(this._focusedField=t.$element,"first"===this.options.focus))break}return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},y.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var e=v(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult,this._manageStatusClass(),this._manageErrorsMessages(e),this._actualizeTriggers(),!e.kept.length&&!e.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var e=[],t=0;t<this.validationResult.length;t++)e.push(this.validationResult[t].errorMessage||this._getErrorMessage(this.validationResult[t].assert));return e},addError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r?!0:r;this._buildUI(),this._addError(e,{message:i,assert:n}),s&&this._errorClass()},updateError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r?!0:r;this._buildUI(),this._updateError(e,{message:i,assert:n}),s&&this._errorClass()},removeError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.updateClass,n=void 0===i?!0:i;this._buildUI(),this._removeError(e),n&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&!0===this.validationResult?this._successClass():this.validationResult.length>0?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if("undefined"==typeof this.options.errorsMessagesDisabled){if("undefined"!=typeof this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(e(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var i=0;i<t.removed.length;i++)this._removeError(t.removed[i].assert.name);for(i=0;i<t.added.length;i++)this._addError(t.added[i].assert.name,{message:t.added[i].errorMessage,assert:t.added[i].assert});for(i=0;i<t.kept.length;i++)this._updateError(t.kept[i].assert.name,{message:t.kept[i].errorMessage,assert:t.kept[i].assert})}},_addError:function(t,i){var n=i.message,r=i.assert;this._insertErrorWrapper(),this._ui.$errorsWrapper.addClass("filled").append(e(this.options.errorTemplate).addClass("parsley-"+t).html(n||this._getErrorMessage(r)))},_updateError:function(e,t){var i=t.message,n=t.assert;this._ui.$errorsWrapper.addClass("filled").find(".parsley-"+e).html(i||this._getErrorMessage(n))},_removeError:function(e){this._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+e).remove()},_getErrorMessage:function(e){var t=e.name+"Message";return"undefined"!=typeof this.options[t]?window.Parsley.formatMessage(this.options[t],e.requirements):window.Parsley.getErrorMessage(e)},_buildUI:function(){if(!this._ui&&!1!==this.options.uiEnabled){var t={};this.$element.attr(this.options.namespace+"id",this.__id__),t.$errorClassHandler=this._manageClassHandler(),t.errorsWrapperId="parsley-id-"+(this.options.multiple?"multiple-"+this.options.multiple:this.__id__),t.$errorsWrapper=e(this.options.errorsWrapper).attr("id",t.errorsWrapperId),t.lastValidationResult=[],t.validationInformationVisible=!1,this._ui=t}},_manageClassHandler:function(){if("string"==typeof this.options.classHandler&&e(this.options.classHandler).length)return e(this.options.classHandler);var t=this.options.classHandler.call(this,this);return"undefined"!=typeof t&&t.length?t:!this.options.multiple||this.$element.is("select")?this.$element:this.$element.parent()},_insertErrorWrapper:function(){var t;if(0!==this._ui.$errorsWrapper.parent().length)return this._ui.$errorsWrapper.parent();if("string"==typeof this.options.errorsContainer){if(e(this.options.errorsContainer).length)return e(this.options.errorsContainer).append(this._ui.$errorsWrapper);a.warn("The errors container `"+this.options.errorsContainer+"` does not exist in DOM")}else"function"==typeof this.options.errorsContainer&&(t=this.options.errorsContainer.call(this,this));if("undefined"!=typeof t&&t.length)return t.append(this._ui.$errorsWrapper);var i=this.$element;return this.options.multiple&&(i=i.parent()),i.after(this._ui.$errorsWrapper)},_actualizeTriggers:function(){var e=this,t=this._findRelated();t.off(".Parsley"),this._failedOnce?t.on(a.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){e.validate()}):t.on(a.namespaceEvents(this.options.trigger,"Parsley"),function(t){e._eventValidate(t)})},_eventValidate:function(e){(!/key|input/.test(e.type)||this._ui&&this._ui.validationInformationVisible||!(this.getValue().length<=this.options.validationThreshold))&&this.validate()},_resetUI:function(){this._failedOnce=!1,this._actualizeTriggers(),"undefined"!=typeof this._ui&&(this._ui.$errorsWrapper.removeClass("filled").children().remove(),this._resetClass(),this._ui.lastValidationResult=[],this._ui.validationInformationVisible=!1)},_destroyUI:function(){this._resetUI(),"undefined"!=typeof this._ui&&this._ui.$errorsWrapper.remove(),delete this._ui},_successClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass)},_errorClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass)},_resetClass:function(){this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass)}};var _=function(t,i,n){this.__class__="ParsleyForm",this.__id__=a.generateID(),this.$element=e(t),this.domOptions=i,this.options=n,this.parent=window.Parsley,this.fields=[],this.validationResult=null},w={pending:null,resolved:!0,rejected:!1};_.prototype={onSubmitValidate:function(e){var t=this;if(!0!==e.parsley){var i=this._$submitSource||this.$element.find('input[type="submit"], button[type="submit"]').first();if(this._$submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),!i.is("[formnovalidate]")){var n=this.whenValidate({event:e});"resolved"===n.state()&&!1!==this._trigger("submit")||(e.stopImmediatePropagation(),e.preventDefault(),"pending"===n.state()&&n.done(function(){t._submit(i)}))}}},onSubmitButton:function(t){this._$submitSource=e(t.target)},_submit:function(t){if(!1!==this._trigger("submit")){if(t){var i=this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!1);0===i.length&&(i=e('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element)),i.attr({name:t.attr("name"),value:t.attr("value")})}this.$element.trigger(e.extend(e.Event("submit"),{parsley:!0}))}},validate:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1],s=i[2];t={group:n,force:r,event:s}}return w[this.whenValidate(t).state()]},whenValidate:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force,s=i.event;this.submitEvent=s,s&&(this.submitEvent=e.extend({},s,{preventDefault:function(){a.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`"),t.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields();var o=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValidate({force:r,group:n})})}),l=function(){var i=e.Deferred();return!1===t.validationResult&&i.reject(),i.resolve().promise()};return e.when.apply(e,_toConsumableArray(o)).done(function(){t._trigger("success")}).fail(function(){t.validationResult=!1,t.focus(),t._trigger("error")}).always(function(){t._trigger("validated")}).pipe(l,l)},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={group:n,force:r}}return w[this.whenValid(t).state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force;this._refreshFields();var s=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValid({group:n,force:r})})});return e.when.apply(e,_toConsumableArray(s))},_refreshFields:function(){return this.actualizeOptions()._bindFields()},_bindFields:function(){var t=this,i=this.fields;return this.fields=[],this.fieldsMappedById={},this._withoutReactualizingFormOptions(function(){t.$element.find(t.options.inputs).not(t.options.excluded).each(function(e,i){var n=new window.Parsley.Factory(i,{},t);"ParsleyField"!==n.__class__&&"ParsleyFieldMultiple"!==n.__class__||!0===n.options.excluded||"undefined"==typeof t.fieldsMappedById[n.__class__+"-"+n.__id__]&&(t.fieldsMappedById[n.__class__+"-"+n.__id__]=n,t.fields.push(n))}),e(i).not(t.fields).each(function(e,t){t._trigger("reset")})}),this},_withoutReactualizingFormOptions:function(e){var t=this.actualizeOptions;this.actualizeOptions=function(){return this};var i=e();return this.actualizeOptions=t,i},_trigger:function(e){return this.trigger("form:"+e)}};var b=function(t,i,n,r,s){if(!/ParsleyField/.test(t.__class__))throw new Error("ParsleyField or ParsleyFieldMultiple instance expected");var a=window.Parsley._validatorRegistry.validators[i],o=new f(a);e.extend(this,{validator:o,name:i,requirements:n,priority:r||t.options[i+"Priority"]||o.priority,isDomConstraint:!0===s}),this._parseRequirements(t.options)},F=function(e){var t=e[0].toUpperCase();return t+e.slice(1)};b.prototype={validate:function(e,t){var i=this.requirementList.slice(0);return i.unshift(e),i.push(t),this.validator.validate.apply(this.validator,i)},_parseRequirements:function(e){var t=this;this.requirementList=this.validator.parseRequirements(this.requirements,function(i){return e[t.name+F(i)]})}};var C=function(t,i,n,r){this.__class__="ParsleyField",this.__id__=a.generateID(),this.$element=e(t),"undefined"!=typeof r&&(this.parent=r),this.options=n,this.domOptions=i,this.constraints=[],this.constraintsByName={},this.validationResult=[],this._bindConstraints()},$={pending:null,resolved:!0,rejected:!1};C.prototype={validate:function(t){arguments.length>=1&&!e.isPlainObject(t)&&(a.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),t={options:t});var i=this.whenValidate(t);if(!i)return!0;switch(i.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=t.force,n=t.group;return this.refreshConstraints(),!n||this._isInGroup(n)?(this.value=this.getValue(),this._trigger("validate"),this.whenValid({force:i,value:this.value,_refreshed:!0}).always(function(){e._reflowUI()}).done(function(){e._trigger("success")}).fail(function(){e._trigger("error")}).always(function(){e._trigger("validated")})):void 0},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(e){return"undefined"==typeof e&&(e=this.getValue()),e.length||this._isRequired()||"undefined"!=typeof this.options.validateIfEmpty?!0:!1},_isInGroup:function(t){return e.isArray(this.options.group)?-1!==e.inArray(t,this.options.group):this.options.group===t},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={force:n,value:r}}var s=this.whenValid(t);return s?$[s.state()]:!0},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=void 0===n?!1:n,s=i.value,a=i.group,o=i._refreshed;if(o||this.refreshConstraints(),!a||this._isInGroup(a)){if(this.validationResult=!0,!this.hasConstraints())return e.when();if(("undefined"==typeof s||null===s)&&(s=this.getValue()),!this.needsValidation(s)&&!0!==r)return e.when();var l=this._getGroupedConstraints(),u=[];return e.each(l,function(i,n){var r=e.when.apply(e,_toConsumableArray(e.map(n,function(e){return t._validateConstraint(s,e)})));return u.push(r),"rejected"===r.state()?!1:void 0}),e.when.apply(e,u)}},_validateConstraint:function(t,i){var n=this,r=i.validate(t,this);return!1===r&&(r=e.Deferred().reject()),e.when(r).fail(function(e){!0===n.validationResult&&(n.validationResult=[]),n.validationResult.push({assert:i,errorMessage:"string"==typeof e&&e})})},getValue:function(){var e;return e="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof e||null===e?"":this._handleWhitespace(e)},refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},addConstraint:function(e,t,i,n){if(window.Parsley._validatorRegistry.validators[e]){var r=new b(this,e,t,i,n);"undefined"!==this.constraintsByName[r.name]&&this.removeConstraint(r.name),this.constraints.push(r),this.constraintsByName[r.name]=r}return this},removeConstraint:function(e){for(var t=0;t<this.constraints.length;t++)if(e===this.constraints[t].name){this.constraints.splice(t,1);break}return delete this.constraintsByName[e],this},updateConstraint:function(e,t,i){return this.removeConstraint(e).addConstraint(e,t,i)},_bindConstraints:function(){for(var e=[],t={},i=0;i<this.constraints.length;i++)!1===this.constraints[i].isDomConstraint&&(e.push(this.constraints[i]),t[this.constraints[i].name]=this.constraints[i]);this.constraints=e,this.constraintsByName=t;for(var n in this.options)this.addConstraint(n,this.options[n],void 0,!0);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){(this.$element.hasClass("required")||this.$element.attr("required"))&&this.addConstraint("required",!0,void 0,!0),"string"==typeof this.$element.attr("pattern")&&this.addConstraint("pattern",this.$element.attr("pattern"),void 0,!0),"undefined"!=typeof this.$element.attr("min")&&"undefined"!=typeof this.$element.attr("max")?this.addConstraint("range",[this.$element.attr("min"),this.$element.attr("max")],void 0,!0):"undefined"!=typeof this.$element.attr("min")?this.addConstraint("min",this.$element.attr("min"),void 0,!0):"undefined"!=typeof this.$element.attr("max")&&this.addConstraint("max",this.$element.attr("max"),void 0,!0),"undefined"!=typeof this.$element.attr("minlength")&&"undefined"!=typeof this.$element.attr("maxlength")?this.addConstraint("length",[this.$element.attr("minlength"),this.$element.attr("maxlength")],void 0,!0):"undefined"!=typeof this.$element.attr("minlength")?this.addConstraint("minlength",this.$element.attr("minlength"),void 0,!0):"undefined"!=typeof this.$element.attr("maxlength")&&this.addConstraint("maxlength",this.$element.attr("maxlength"),void 0,!0);var e=this.$element.attr("type");return"undefined"==typeof e?this:"number"===e?this.addConstraint("type",["number",{step:this.$element.attr("step"),base:this.$element.attr("min")||this.$element.attr("value")}],void 0,!0):/^(email|url|range)$/i.test(e)?this.addConstraint("type",e,void 0,!0):this},_isRequired:function(){return"undefined"==typeof this.constraintsByName.required?!1:!1!==this.constraintsByName.required.requirements},_trigger:function(e){return this.trigger("field:"+e)},_handleWhitespace:function(e){return!0===this.options.trimValue&&a.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(e=e.replace(/\s{2,}/g," ")),("trim"===this.options.whitespace||"squish"===this.options.whitespace||!0===this.options.trimValue)&&(e=a.trimString(e)),e},_getGroupedConstraints:function(){if(!1===this.options.priorityEnabled)return[this.constraints];for(var e=[],t={},i=0;i<this.constraints.length;i++){var n=this.constraints[i].priority;t[n]||e.push(t[n]=[]),t[n].push(this.constraints[i])}return e.sort(function(e,t){return t[0].priority-e[0].priority}),e}};var x=C,P=function(){this.__class__="ParsleyFieldMultiple"};P.prototype={addElement:function(e){return this.$elements.push(e),this},refreshConstraints:function(){var t;if(this.constraints=[],this.$element.is("select"))return this.actualizeOptions()._bindConstraints(),this;for(var i=0;i<this.$elements.length;i++)if(e("html").has(this.$elements[i]).length){t=this.$elements[i].data("ParsleyFieldMultiple").refreshConstraints().constraints;for(var n=0;n<t.length;n++)this.addConstraint(t[n].name,t[n].requirements,t[n].priority,t[n].isDomConstraint)}else this.$elements.splice(i,1);return this},getValue:function(){if("function"==typeof this.options.value)value=this.options.value(this);else if("undefined"!=typeof this.options.value)return this.options.value;if(this.$element.is("input[type=radio]"))return this._findRelated().filter(":checked").val()||"";if(this.$element.is("input[type=checkbox]")){var t=[];return this._findRelated().filter(":checked").each(function(){t.push(e(this).val())}),t}return this.$element.is("select")&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var E=function(t,i,n){this.$element=e(t);var r=this.$element.data("Parsley");if(r)return"undefined"!=typeof n&&r.parent===window.Parsley&&(r.parent=n,r._resetOptions(r.options)),r;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof n&&"ParsleyForm"!==n.__class__)throw new Error("Parent instance must be a ParsleyForm instance");return this.parent=n||window.Parsley,this.init(i)};E.prototype={init:function(e){return this.__class__="Parsley",this.__version__="2.3.5",this.__id__=a.generateID(),this._resetOptions(e),this.$element.is("form")||a.checkAttr(this.$element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){return this.$element.is("input[type=radio], input[type=checkbox]")||this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple")},handleMultiple:function(){var t,i,n=this;if(this.options.multiple||("undefined"!=typeof this.$element.attr("name")&&this.$element.attr("name").length?this.options.multiple=t=this.$element.attr("name"):"undefined"!=typeof this.$element.attr("id")&&this.$element.attr("id").length&&(this.options.multiple=this.$element.attr("id"))),this.$element.is("select")&&"undefined"!=typeof this.$element.attr("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return a.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),
177
  "undefined"!=typeof t&&e('input[name="'+t+'"]').each(function(t,i){e(i).is("input[type=radio], input[type=checkbox]")&&e(i).attr(n.options.namespace+"multiple",n.options.multiple)});for(var r=this._findRelated(),s=0;s<r.length;s++)if(i=e(r.get(s)).data("Parsley"),"undefined"!=typeof i){this.$element.data("ParsleyFieldMultiple")||i.addElement(this.$element);break}return this.bind("parsleyField",!0),i||this.bind("parsleyFieldMultiple")},bind:function(t,i){var n;switch(t){case"parsleyForm":n=e.extend(new _(this.$element,this.domOptions,this.options),window.ParsleyExtend)._bindFields();break;case"parsleyField":n=e.extend(new x(this.$element,this.domOptions,this.options,this.parent),window.ParsleyExtend);break;case"parsleyFieldMultiple":n=e.extend(new x(this.$element,this.domOptions,this.options,this.parent),new P,window.ParsleyExtend)._init();break;default:throw new Error(t+"is not a supported Parsley type")}return this.options.multiple&&a.setAttr(this.$element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof i?(this.$element.data("ParsleyFieldMultiple",n),n):(this.$element.data("Parsley",n),n._actualizeTriggers(),n._trigger("init"),n)}};var V=e.fn.jquery.split(".");if(parseInt(V[0])<=1&&parseInt(V[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";V.forEach||a.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");var M=e.extend(new l,{$element:e(document),actualizeOptions:null,_resetOptions:null,Factory:E,version:"2.3.5"});e.extend(x.prototype,y.Field,l.prototype),e.extend(_.prototype,y.Form,l.prototype),e.extend(E.prototype,l.prototype),e.fn.parsley=e.fn.psly=function(t){if(this.length>1){var i=[];return this.each(function(){i.push(e(this).parsley(t))}),i}return e(this).length?new E(this,t):void a.warn("You must bind Parsley on an existing element.")},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),M.options=e.extend(a.objectCreate(o),window.ParsleyConfig),window.ParsleyConfig=M.options,window.Parsley=window.psly=M,window.ParsleyUtils=a;var O=window.Parsley._validatorRegistry=new c(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},e.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator".split(" "),function(t,i){window.Parsley[i]=e.proxy(O,i),window.ParsleyValidator[i]=function(){var e;return a.warnOnce("Accessing the method '"+i+"' through ParsleyValidator is deprecated. Simply call 'window.Parsley."+i+"(...)'"),(e=window.Parsley)[i].apply(e,arguments)}}),window.Parsley.UI=y,window.ParsleyUI={removeError:function(e,t,i){var n=!0!==i;return a.warnOnce("Accessing ParsleyUI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e.removeError(t,{updateClass:n})},getErrorsMessages:function(e){return a.warnOnce("Accessing ParsleyUI is deprecated. Call 'getErrorsMessages' on the instance directly."),e.getErrorsMessages()}},e.each("addError updateError".split(" "),function(e,t){window.ParsleyUI[t]=function(e,i,n,r,s){var o=!0!==s;return a.warnOnce("Accessing ParsleyUI is deprecated. Call '"+t+"' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e[t](i,{message:n,assert:r,updateClass:o})}}),/firefox/i.test(navigator.userAgent)&&e(document).on("change","select",function(t){e(t.target).trigger("input")}),!1!==window.ParsleyConfig.autoBind&&e(function(){e("[data-parsley-validate]").length&&e("[data-parsley-validate]").parsley()});var A=e({}),R=function(){a.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},D="parsley:";e.listen=function(e,n){var r;if(R(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(r=arguments[1],n=arguments[2]),"function"!=typeof n)throw new Error("Wrong parameters");window.Parsley.on(i(e),t(n,r))},e.listenTo=function(e,n,r){if(R(),!(e instanceof x||e instanceof _))throw new Error("Must give Parsley instance");if("string"!=typeof n||"function"!=typeof r)throw new Error("Wrong parameters");e.on(i(n),t(r))},e.unsubscribe=function(e,t){if(R(),"string"!=typeof e||"function"!=typeof t)throw new Error("Wrong arguments");window.Parsley.off(i(e),t.parsleyAdaptedCallback)},e.unsubscribeTo=function(e,t){if(R(),!(e instanceof x||e instanceof _))throw new Error("Must give Parsley instance");e.off(i(t))},e.unsubscribeAll=function(t){R(),window.Parsley.off(i(t)),e("form,input,textarea,select").each(function(){var n=e(this).data("Parsley");n&&n.off(i(t))})},e.emit=function(e,t){var n;R();var r=t instanceof x||t instanceof _,s=Array.prototype.slice.call(arguments,r?2:1);s.unshift(i(e)),r||(t=window.Parsley),(n=t).trigger.apply(n,_toConsumableArray(s))};e.extend(!0,M,{asyncValidators:{"default":{fn:function(e){return e.status>=200&&e.status<300},url:!1},reverse:{fn:function(e){return e.status<200||e.status>=300},url:!1}},addAsyncValidator:function(e,t,i,n){return M.asyncValidators[e]={fn:t,url:i||!1,options:n||{}},this}}),M.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,i,n,r){var s,a,o={},l=n.validator||(!0===n.reverse?"reverse":"default");if("undefined"==typeof M.asyncValidators[l])throw new Error("Calling an undefined async validator: `"+l+"`");i=M.asyncValidators[l].url||i,i.indexOf("{value}")>-1?i=i.replace("{value}",encodeURIComponent(t)):o[r.$element.attr("name")||r.$element.attr("id")]=t;var u=e.extend(!0,n.options||{},M.asyncValidators[l].options);s=e.extend(!0,{},{url:i,data:o,type:"GET"},u),r.trigger("field:ajaxoptions",r,s),a=e.param(s),"undefined"==typeof M._remoteCache&&(M._remoteCache={});var d=M._remoteCache[a]=M._remoteCache[a]||e.ajax(s),h=function(){var t=M.asyncValidators[l].fn.call(r,d,i,n);return t||(t=e.Deferred().reject()),e.when(t)};return d.then(h,h)},priority:-1}),M.on("form:submit",function(){M._remoteCache={}}),window.ParsleyExtend.addAsyncValidator=function(){return ParsleyUtils.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),M.addAsyncValidator.apply(M,arguments)},M.addMessages("en",{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same."}),M.setLocale("en");var q=M;return q});
178
+ </script>
179
+
180
+ <script type="text/javascript">
181
+ /*!
182
+ * jQuery Modal (minified)
183
+ * Copyright (c) 2015 CreativeDream
184
+ * Website http://creativedream.net/plugins
185
+ * Version: 1.2.3 (10-04-2015)
186
+ * Requires: jQuery v1.7.1 or later
187
+ */
188
+ function modal(t){return $.cModal(t)}!function(t){t.cModal=function(n){var e,o={type:"default",title:null,text:null,size:"normal",buttons:[{text:"OK",val:!0,onClick:function(){return!0}}],center:!0,autoclose:!1,callback:null,onShow:null,animate:!0,closeClick:!0,closable:!0,theme:"default",background:null,zIndex:1050,buttonText:{ok:"OK",yes:"Yes",cancel:"Cancel"},template:'<div class="modal-box"><div class="modal-inner"><div class="modal-title"><a class="modal-close-btn"></a></div><div class="modal-text"></div><div class="modal-buttons"></div></div></div>',_classes:{box:".modal-box",boxInner:".modal-inner",title:".modal-title",content:".modal-text",buttons:".modal-buttons",closebtn:".modal-close-btn"}},n=t.extend({},o,n),a=t("<div id='modal-window' />").hide(),l=n._classes.box,s=a.append(n.template),i={init:function(){t("#modal-window").remove(),i._setStyle(),i._modalShow(),i._modalConent(),a.on("click","a.modal-btn",function(){i._modalBtn(t(this))}).on("click",n._classes.closebtn,function(){e=!1,i._modalHide()}).click(function(t){n.closeClick&&"modal-window"==t.target.id&&(e=!1,i._modalHide())}),t(window).bind("keyup",i._keyUpF).resize(function(){var t=n.animate;n.animate=!1,i._position(),n.animate=t})},_setStyle:function(){a.css({position:"fixed",width:"100%",height:"100%",top:"0",left:"0","z-index":n.zIndex,overflow:"auto"}),a.find(n._classes.box).css({position:"absolute"})},_keyUpF:function(t){switch(t.keyCode){case 13:if(s.find("input:not(.modal-prompt-input),textarea").is(":focus"))return!1;i._modalBtn(a.find(n._classes.buttons+" a.modal-btn"+("undefined"!=typeof i.btnForEKey&&a.find(n._classes.buttons+" a.modal-btn:eq("+i.btnForEKey+")").size()>0?":eq("+i.btnForEKey+")":":last-child")));break;case 27:i._modalHide()}},_modalShow:function(){t("body").css({overflow:"hidden",width:t("body").innerWidth()}).append(s)},_modalHide:function(o){if(n.closable===!1)return!1;e="undefined"==typeof e?!1:e;var s=function(){if(null!=n.callback&&"function"==typeof n.callback&&0==n.callback(e,a,i.actions)?!1:!0){a.fadeOut(200,function(){t(this).remove(),t("body").css({overflow:"",width:""})});var o=100*parseFloat(t(l).css("top"))/parseFloat(t(l).parent().css("height"));t(l).stop(!0,!0).animate({top:o+(n.animate?3:0)+"%"},"fast")}};o?setTimeout(function(){s()},o):s(),t(window).unbind("keyup",i._keyUpF)},_modalConent:function(){var e=n._classes.title,o=n._classes.content,s=n._classes.buttons,d=n.buttonText,c=["alert","confirm","prompt"],u=["xenon","atlant","reseted"];if(-1==t.inArray(n.type,c)&&"default"!=n.type&&t(l).addClass("modal-type-"+n.type),t(l).addClass(n.size&&null!=n.size?"modal-size-"+n.size:"modal-size-normal"),n.theme&&null!=n.theme&&"default"!=n.theme&&t(l).addClass((-1==t.inArray(n.theme,u)?"":"modal-theme-")+n.theme),n.background&&null!=n.background&&a.css("background-color",n.background),n.title||null!=n.title?t(e).prepend("<h3>"+n.title+"</h3>"):t(e).remove(),"prompt"==n.type?n.text=(null!=n.text?n.text:"")+'<input type="text" name="modal-prompt-input" class="modal-prompt-input" autocomplete="off" autofocus="on" />':"",t(o).html(n.text),n.buttons||null!=n.buttons){var r="";switch(n.type){case"alert":r='<a class="modal-btn'+(n.buttons[0].addClass?" "+n.buttons[0].addClass:"")+'">'+d.ok+"</a>";break;case"confirm":r='<a class="modal-btn'+(n.buttons[0].addClass?" "+n.buttons[0].addClass:"")+'">'+d.cancel+'</a><a class="modal-btn '+(n.buttons[1]&&n.buttons[1].addClass?" "+n.buttons[1].addClass:"btn-light-blue")+'">'+d.yes+"</a>";break;case"prompt":r='<a class="modal-btn'+(n.buttons[0].addClass?" "+n.buttons[0].addClass:"")+'">'+d.cancel+'</a><a class="modal-btn '+(n.buttons[1]&&n.buttons[1].addClass?" "+n.buttons[1].addClass:"btn-light-blue")+'">'+d.ok+"</a>";break;default:n.buttons.length>0&&t.isArray(n.buttons)?t.each(n.buttons,function(t,n){var e=n.addClass&&"undefined"!=typeof n.addClass?" "+n.addClass:"";r+='<a class="modal-btn'+e+'">'+n.text+"</a>",n.eKey&&(i.btnForEKey=t)}):r+='<a class="modal-btn">'+d.ok+"</a>"}t(s).html(r)}else t(s).remove();if("prompt"==n.type&&$(".modal-prompt-input").focus(),n.autoclose){var m=n.buttons||null!=n.buttons?32*t(o).text().length:900;i._modalHide(900>m?900:m)}a.fadeIn(200,function(){null!=n.onShow?n.onShow(i.actions):null}),i._position()},_position:function(){var e,o,a;n.center?(e={top:t(window).height()<t(l).outerHeight()?1:50,left:50,marginTop:t(window).height()<t(l).outerHeight()?0:-t(l).outerHeight()/2,marginLeft:-t(l).outerWidth()/2},o={top:e.top-(n.animate?3:0)+"%",left:e.left+"%","margin-top":e.marginTop,"margin-left":e.marginLeft},a={top:e.top+"%"}):(e={top:t(window).height()<t(l).outerHeight()?1:10,left:50,marginTop:0,marginLeft:-t(l).outerWidth()/2},o={top:e.top-(n.animate?3:0)+"%",left:e.left+"%","margin-top":e.marginTop,"margin-left":e.marginLeft},a={top:e.top+"%"}),t(l).css(o).stop(!0,!0).animate(a,"fast")},_modalBtn:function(o){var l=!1,s=n.type,d=o.index(),c=n.buttons[d];if(t.inArray(s,["alert","confirm","prompt"])>-1)e=l=1==d?!0:!1,"prompt"==s&&(e=l=l&&a.find("input.modal-prompt-input").size()>0!=0?a.find("input.modal-prompt-input").val():!1),i._modalHide();else{if(o.hasClass("btn-disabled"))return!1;e=l=c&&c.val?c.val:!0,(!c.onClick||c.onClick(t.extend({val:l,bObj:o,bOpts:c},i.actions)))&&i._modalHide()}e=l},actions:{html:a,close:function(){i._modalHide()},getModal:function(){return a},getBox:function(){return a.find(n._classes.box)},getInner:function(){return a.find(n._classes.boxInner)},getTitle:function(){return a.find(n._classes.title)},getContet:function(){return a.find(n._classes.content)},getButtons:function(){return a.find(n._classes.buttons).find("a")},setTitle:function(t){return a.find(n._classes.title+" h3").html(t),a.find(n._classes.title+" h3").size()>0},setContent:function(t){return a.find(n._classes.content).html(t),a.find(n._classes.content).size()>0}}};return i.init(),i.actions}}(jQuery);
189
  </script>
installer/build/classes/class.logging.php CHANGED
@@ -27,27 +27,28 @@ define('ERR_TESTDB_VERSION', 'In order to avoid database incompatibility issues
27
  * DUPX_Log
28
  * Class used to log information */
29
 
30
- class DUPX_Log {
 
31
 
32
  /** METHOD: LOG
33
  * Used to write debug info to the text log file
34
  * @param string $msg Any text data
35
  * @param int $loglevel Log level
36
  */
37
- static public function Info($msg, $logging = 1) {
 
38
  if ($logging <= $GLOBALS["LOGGING"]) {
39
  @fwrite($GLOBALS["LOG_FILE_HANDLE"], "{$msg}\n");
40
  }
41
  }
42
-
43
- static public function Error($errorMessage) {
44
- if ($logging <= $GLOBALS["LOGGING"]) {
45
- $breaks = array("<br />","<br>","<br/>");
46
- $msg = str_ireplace($breaks, "\r\n", $errorMessage);
47
- @fwrite($GLOBALS["LOG_FILE_HANDLE"], "\nINSTALLER ERROR:\n{$msg}\n");
48
- @fclose($GLOBALS["LOG_FILE_HANDLE"]);
49
- }
50
- die("<div class='dup-ui-error'><b style='color:#B80000;'>INSTALL ERROR!</b><br/>{$errorMessage}</div><br/>");
51
  }
52
  }
53
  ?>
27
  * DUPX_Log
28
  * Class used to log information */
29
 
30
+ class DUPX_Log
31
+ {
32
 
33
  /** METHOD: LOG
34
  * Used to write debug info to the text log file
35
  * @param string $msg Any text data
36
  * @param int $loglevel Log level
37
  */
38
+ public static function Info($msg, $logging = 1)
39
+ {
40
  if ($logging <= $GLOBALS["LOGGING"]) {
41
  @fwrite($GLOBALS["LOG_FILE_HANDLE"], "{$msg}\n");
42
  }
43
  }
44
+ public static function Error($errorMessage)
45
+ {
46
+ $breaks = array("<br />","<br>","<br/>");
47
+ $log_msg = str_ireplace($breaks, "\r\n", $errorMessage);
48
+ $log_msg = strip_tags($log_msg);
49
+ @fwrite($GLOBALS["LOG_FILE_HANDLE"], "\nINSTALLER ERROR:\n{$log_msg}\n");
50
+ @fclose($GLOBALS["LOG_FILE_HANDLE"]);
51
+ die("<div class='dup-ui-error'><hr size='1' /><b style='color:#B80000;'>INSTALL ERROR!</b><br/>{$errorMessage}</div><br/>");
 
52
  }
53
  }
54
  ?>
installer/build/classes/class.utils.php CHANGED
@@ -15,7 +15,7 @@ class DUPX_Util
15
  /**
16
  * Get current microtime as a float. Can be used for simple profiling.
17
  */
18
- static public function get_microtime() {
19
  return microtime(true);
20
  }
21
 
@@ -23,7 +23,7 @@ class DUPX_Util
23
  * Return a string with the elapsed time.
24
  * Order of $end and $start can be switched.
25
  */
26
- static public function elapsed_time($end, $start) {
27
  return sprintf("%.4f sec.", abs($end - $start));
28
  }
29
 
@@ -32,7 +32,7 @@ class DUPX_Util
32
  * @param bool $echo Do we echo or return?
33
  * @return string Escaped string.
34
  */
35
- static public function esc_html_attr($string = '', $echo = false) {
36
  $output = htmlentities($string, ENT_QUOTES, 'UTF-8');
37
  if ($echo)
38
  echo $output;
@@ -44,7 +44,7 @@ class DUPX_Util
44
  * Count the tables in a given database
45
  * @param string $_POST['dbname'] Database to count tables in
46
  */
47
- static public function dbtable_count($conn, $dbname) {
48
  $res = mysqli_query($conn, "SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = '{$dbname}' ");
49
  $row = mysqli_fetch_row($res);
50
  return is_null($row) ? 0 : $row[0];
@@ -55,7 +55,7 @@ class DUPX_Util
55
  * @param string $conn A valid link resource
56
  * @param string $table_name A valid table name
57
  */
58
- static public function table_row_count($conn, $table_name) {
59
  $total = mysqli_query($conn, "SELECT COUNT(*) FROM `$table_name`");
60
  if ($total) {
61
  $total = @mysqli_fetch_array($total);
@@ -69,7 +69,7 @@ class DUPX_Util
69
  * Adds a slash to the end of a path
70
  * @param string $path A path
71
  */
72
- static public function add_slash($path) {
73
  $last_char = substr($path, strlen($path) - 1, 1);
74
  if ($last_char != '/') {
75
  $path .= '/';
@@ -84,11 +84,11 @@ class DUPX_Util
84
  * win: D:/home/path/file.txt
85
  * @param string $path The path to make safe
86
  */
87
- static public function set_safe_path($path) {
88
  return str_replace("\\", "/", $path);
89
  }
90
 
91
- static public function unset_safe_path($path) {
92
  return str_replace("/", "\\", $path);
93
  }
94
 
@@ -96,7 +96,7 @@ class DUPX_Util
96
  * PHP_SAPI for fcgi requires a data flush of at least 256
97
  * bytes every 40 seconds or else it forces a script hault
98
  */
99
- static public function fcgi_flush() {
100
  echo(str_repeat(' ', 256));
101
  @flush();
102
  }
@@ -106,7 +106,7 @@ class DUPX_Util
106
  * @param string $source The path to the file being copied
107
  * @param string $destination The path to the file being made
108
  */
109
- static public function copy_file($source, $destination) {
110
  $sp = fopen($source, 'r');
111
  $op = fopen($destination, 'w');
112
 
@@ -124,7 +124,7 @@ class DUPX_Util
124
  * @param array $list A list of strings to search for
125
  * @param string $haystack The string to search in
126
  */
127
- static public function search_list_values($list, $haystack) {
128
  $found = array();
129
  foreach ($list as $var) {
130
  if (strstr($haystack, $var) !== false) {
@@ -139,7 +139,7 @@ class DUPX_Util
139
  * @param conn $dbh A database connection handle
140
  * @return array $list A list of active plugins
141
  */
142
- static public function get_active_plugins($dbh) {
143
  $query = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name = 'active_plugins' ");
144
  if ($query) {
145
  $row = @mysqli_fetch_array($query);
@@ -156,7 +156,7 @@ class DUPX_Util
156
  * @param conn $dbh A database connection handle
157
  * @return array $list A list of all table names
158
  */
159
- static public function get_database_tables($dbh) {
160
  $query = @mysqli_query($dbh, 'SHOW TABLES');
161
  if ($query) {
162
  while ($table = @mysqli_fetch_array($query)) {
@@ -174,7 +174,7 @@ class DUPX_Util
174
  * @param same as mysqli_connect
175
  * @return database connection handle
176
  */
177
- static public function db_connect( $host, $username, $password, $dbname = '', $port = null ) {
178
 
179
  //sock connections
180
  if ( 'sock' === substr( $host, -4 ) )
@@ -189,13 +189,12 @@ class DUPX_Util
189
  return $dbh;
190
  }
191
 
192
-
193
  /**
194
  * MySQL database version number
195
  * @param conn $dbh Database connection handle
196
  * @return false|string false on failure, version number on success
197
  */
198
- static public function mysql_version($dbh) {
199
  if (function_exists('mysqli_get_server_info')) {
200
  return preg_replace('/[^0-9.].*/', '', mysqli_get_server_info($dbh));
201
  } else {
@@ -208,7 +207,7 @@ class DUPX_Util
208
  * @param conn $dbh Database connection handle
209
  * @return string the server variable to query for
210
  */
211
- static public function mysql_variable_value($dbh, $variable) {
212
  $result = @mysqli_query($dbh, "SHOW VARIABLES LIKE '{$variable}'");
213
  $row = @mysqli_fetch_array($result);
214
  @mysqli_free_result($result);
@@ -221,8 +220,8 @@ class DUPX_Util
221
  * @param string $feature the feature to check for
222
  * @return bool
223
  */
224
- static public function mysql_has_ability($dbh, $feature) {
225
- $version = self::mysql_version($dbh);
226
 
227
  switch (strtolower($feature)) {
228
  case 'collation' :
@@ -241,13 +240,13 @@ class DUPX_Util
241
  * @param string $charset The character set (optional)
242
  * @param string $collate The collation (optional)
243
  */
244
- static public function mysql_set_charset($dbh, $charset = null, $collate = null) {
245
 
246
  $charset = (!isset($charset) ) ? $GLOBALS['DBCHARSET_DEFAULT'] : $charset;
247
  $collate = (!isset($collate) ) ? $GLOBALS['DBCOLLATE_DEFAULT'] : $collate;
248
 
249
- if (self::mysql_has_ability($dbh, 'collation') && !empty($charset)) {
250
- if (function_exists('mysqli_set_charset') && self::mysql_has_ability($dbh, 'set_charset')) {
251
  return mysqli_set_charset($dbh, $charset);
252
  } else {
253
  $sql = " SET NAMES {$charset}";
@@ -262,7 +261,7 @@ class DUPX_Util
262
  * Display human readable byte sizes
263
  * @param string $size The size in bytes
264
  */
265
- static public function readable_bytesize($size) {
266
  try {
267
  $units = array('B', 'KB', 'MB', 'GB', 'TB');
268
  for ($i = 0; $size >= 1024 && $i < 4; $i++)
@@ -273,12 +272,37 @@ class DUPX_Util
273
  }
274
  }
275
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  /**
277
  * The characters that are special in the replacement value of preg_replace are not the
278
  * same characters that are special in the pattern
279
  * @param string $str The string to replace on
280
  */
281
- static public function preg_replacement_quote($str) {
282
  return preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', $str);
283
  }
284
 
@@ -312,7 +336,7 @@ class DUPX_Util
312
  * Returns an array of zip files found in the current directory
313
  * @return array of zip files
314
  */
315
- static public function get_zip_files() {
316
 
317
  $files = array();
318
  foreach (glob("*.zip") as $name) {
15
  /**
16
  * Get current microtime as a float. Can be used for simple profiling.
17
  */
18
+ public static function get_microtime() {
19
  return microtime(true);
20
  }
21
 
23
  * Return a string with the elapsed time.
24
  * Order of $end and $start can be switched.
25
  */
26
+ public static function elapsed_time($end, $start) {
27
  return sprintf("%.4f sec.", abs($end - $start));
28
  }
29
 
32
  * @param bool $echo Do we echo or return?
33
  * @return string Escaped string.
34
  */
35
+ public static function esc_html_attr($string = '', $echo = false) {
36
  $output = htmlentities($string, ENT_QUOTES, 'UTF-8');
37
  if ($echo)
38
  echo $output;
44
  * Count the tables in a given database
45
  * @param string $_POST['dbname'] Database to count tables in
46
  */
47
+ public static function dbtable_count($conn, $dbname) {
48
  $res = mysqli_query($conn, "SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = '{$dbname}' ");
49
  $row = mysqli_fetch_row($res);
50
  return is_null($row) ? 0 : $row[0];
55
  * @param string $conn A valid link resource
56
  * @param string $table_name A valid table name
57
  */
58
+ public static function table_row_count($conn, $table_name) {
59
  $total = mysqli_query($conn, "SELECT COUNT(*) FROM `$table_name`");
60
  if ($total) {
61
  $total = @mysqli_fetch_array($total);
69
  * Adds a slash to the end of a path
70
  * @param string $path A path
71
  */
72
+ public static function add_slash($path) {
73
  $last_char = substr($path, strlen($path) - 1, 1);
74
  if ($last_char != '/') {
75
  $path .= '/';
84
  * win: D:/home/path/file.txt
85
  * @param string $path The path to make safe
86
  */
87
+ public static function set_safe_path($path) {
88
  return str_replace("\\", "/", $path);
89
  }
90
 
91
+ public static function unset_safe_path($path) {
92
  return str_replace("/", "\\", $path);
93
  }
94
 
96
  * PHP_SAPI for fcgi requires a data flush of at least 256
97
  * bytes every 40 seconds or else it forces a script hault
98
  */
99
+ public static function fcgi_flush() {
100
  echo(str_repeat(' ', 256));
101
  @flush();
102
  }
106
  * @param string $source The path to the file being copied
107
  * @param string $destination The path to the file being made
108
  */
109
+ public static function copy_file($source, $destination) {
110
  $sp = fopen($source, 'r');
111
  $op = fopen($destination, 'w');
112
 
124
  * @param array $list A list of strings to search for
125
  * @param string $haystack The string to search in
126
  */
127
+ public static function search_list_values($list, $haystack) {
128
  $found = array();
129
  foreach ($list as $var) {
130
  if (strstr($haystack, $var) !== false) {
139
  * @param conn $dbh A database connection handle
140
  * @return array $list A list of active plugins
141
  */
142
+ public static function get_active_plugins($dbh) {
143
  $query = @mysqli_query($dbh, "SELECT option_value FROM `{$GLOBALS['FW_TABLEPREFIX']}options` WHERE option_name = 'active_plugins' ");
144
  if ($query) {
145
  $row = @mysqli_fetch_array($query);
156
  * @param conn $dbh A database connection handle
157
  * @return array $list A list of all table names
158
  */
159
+ public static function get_database_tables($dbh) {
160
  $query = @mysqli_query($dbh, 'SHOW TABLES');
161
  if ($query) {
162
  while ($table = @mysqli_fetch_array($query)) {
174
  * @param same as mysqli_connect
175
  * @return database connection handle
176
  */
177
+ public static function db_connect( $host, $username, $password, $dbname = '', $port = null ) {
178
 
179
  //sock connections
180
  if ( 'sock' === substr( $host, -4 ) )
189
  return $dbh;
190
  }
191
 
 
192
  /**
193
  * MySQL database version number
194
  * @param conn $dbh Database connection handle
195
  * @return false|string false on failure, version number on success
196
  */
197
+ public static function mysqldb_version($dbh) {
198
  if (function_exists('mysqli_get_server_info')) {
199
  return preg_replace('/[^0-9.].*/', '', mysqli_get_server_info($dbh));
200
  } else {
207
  * @param conn $dbh Database connection handle
208
  * @return string the server variable to query for
209
  */
210
+ public static function mysqldb_variable_value($dbh, $variable) {
211
  $result = @mysqli_query($dbh, "SHOW VARIABLES LIKE '{$variable}'");
212
  $row = @mysqli_fetch_array($result);
213
  @mysqli_free_result($result);
220
  * @param string $feature the feature to check for
221
  * @return bool
222
  */
223
+ public static function mysqldb_has_ability($dbh, $feature) {
224
+ $version = self::mysqldb_version($dbh);
225
 
226
  switch (strtolower($feature)) {
227
  case 'collation' :
240
  * @param string $charset The character set (optional)
241
  * @param string $collate The collation (optional)
242
  */
243
+ public static function mysqldb_set_charset($dbh, $charset = null, $collate = null) {
244
 
245
  $charset = (!isset($charset) ) ? $GLOBALS['DBCHARSET_DEFAULT'] : $charset;
246
  $collate = (!isset($collate) ) ? $GLOBALS['DBCOLLATE_DEFAULT'] : $collate;
247
 
248
+ if (self::mysqldb_has_ability($dbh, 'collation') && !empty($charset)) {
249
+ if (function_exists('mysqli_set_charset') && self::mysqldb_has_ability($dbh, 'set_charset')) {
250
  return mysqli_set_charset($dbh, $charset);
251
  } else {
252
  $sql = " SET NAMES {$charset}";
261
  * Display human readable byte sizes
262
  * @param string $size The size in bytes
263
  */
264
+ public static function readable_bytesize($size) {
265
  try {
266
  $units = array('B', 'KB', 'MB', 'GB', 'TB');
267
  for ($i = 0; $size >= 1024 && $i < 4; $i++)
272
  }
273
  }
274
 
275
+ /**
276
+ * Converts shorthand memory notation value to bytes
277
+ * From http://php.net/manual/en/function.ini-get.php
278
+ *
279
+ * @param $val Memory size shorthand notation string
280
+ */
281
+ public static function return_bytes($val)
282
+ {
283
+ $val = trim($val);
284
+ $last = strtolower($val[strlen($val)-1]);
285
+ switch($last) {
286
+ // The 'G' modifier is available since PHP 5.1.0
287
+ case 'g':
288
+ $val *= 1024;
289
+ case 'm':
290
+ $val *= 1024;
291
+ case 'k':
292
+ $val *= 1024;
293
+ break;
294
+ default :
295
+ $val = null;
296
+ }
297
+ return $val;
298
+ }
299
+
300
  /**
301
  * The characters that are special in the replacement value of preg_replace are not the
302
  * same characters that are special in the pattern
303
  * @param string $str The string to replace on
304
  */
305
+ public static function preg_replacement_quote($str) {
306
  return preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', $str);
307
  }
308
 
336
  * Returns an array of zip files found in the current directory
337
  * @return array of zip files
338
  */
339
+ public static function get_zip_files() {
340
 
341
  $files = array();
342
  foreach (glob("*.zip") as $name) {
installer/build/main.installer.php CHANGED
@@ -42,10 +42,6 @@ if (file_exists('dtoken.php')) {
42
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
43
  header('Pragma: public');
44
  header('Content-Length: ' . filesize($filename));
45
- //FIXME: We should consider removing all error supression like this
46
- //as it makes troubleshooting a wild goose chase for times that the
47
- //script failes on such a line. The same can and should be accomplished
48
- //at the server level by turning off displaying errors in PHP.
49
  @ob_clean();
50
  @flush();
51
  if (@readfile($filename) == false) {
@@ -139,6 +135,7 @@ ini_set('default_socket_timeout', '5000');
139
 
140
  $GLOBALS['DBCHARSET_DEFAULT'] = 'utf8';
141
  $GLOBALS['DBCOLLATE_DEFAULT'] = 'utf8_general_ci';
 
142
 
143
  //UPDATE TABLE SETTINGS
144
  $GLOBALS['REPLACE_LIST'] = array();
@@ -175,9 +172,8 @@ $GLOBALS['CHOWN_ROOT_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}", 0755);
175
  $GLOBALS['CHOWN_LOG_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}/{$GLOBALS['LOG_FILE_NAME']}", 0644);
176
  $GLOBALS['URL_SSL'] = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? true : false;
177
  $GLOBALS['URL_PATH'] = ($GLOBALS['URL_SSL']) ? "https://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}" : "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
178
-
179
-
180
-
181
 
182
  //Restart log if user starts from step 1
183
  if ($_POST['action_step'] == 1) {
@@ -239,7 +235,7 @@ if (isset($_POST['action_ajax'])) {
239
  </td>
240
  <td style="white-space:nowrap; text-align:right">
241
  <select id="dup-hlp-lnk">
242
- <option value="null"> - Online Resources -</option>
243
  <option value="https://snapcreek.com/duplicator/docs/">&raquo; Knowledge Base</option>
244
  <option value="https://snapcreek.com/duplicator/docs/guide/">&raquo; User Guide</option>
245
  <option value="https://snapcreek.com/duplicator/docs/faqs-tech/">&raquo; Common FAQs</option>
@@ -278,7 +274,7 @@ if (isset($_POST['action_ajax'])) {
278
  <td style="white-space:nowrap">
279
 
280
  <i style='font-size:11px; color:#999'>
281
- version: <?php echo $GLOBALS['FW_DUPLICATOR_VERSION'] ?>&nbsp;&nbsp;<a href="?help=1" target="_blank">[Help]</a>
282
  </i> &nbsp;
283
 
284
  </td>
42
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
43
  header('Pragma: public');
44
  header('Content-Length: ' . filesize($filename));
 
 
 
 
45
  @ob_clean();
46
  @flush();
47
  if (@readfile($filename) == false) {
135
 
136
  $GLOBALS['DBCHARSET_DEFAULT'] = 'utf8';
137
  $GLOBALS['DBCOLLATE_DEFAULT'] = 'utf8_general_ci';
138
+ $GLOBALS['FAQ_URL'] = 'https://snapcreek.com/duplicator/docs/faqs-tech';
139
 
140
  //UPDATE TABLE SETTINGS
141
  $GLOBALS['REPLACE_LIST'] = array();
172
  $GLOBALS['CHOWN_LOG_PATH'] = @chmod("{$GLOBALS['CURRENT_ROOT_PATH']}/{$GLOBALS['LOG_FILE_NAME']}", 0644);
173
  $GLOBALS['URL_SSL'] = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? true : false;
174
  $GLOBALS['URL_PATH'] = ($GLOBALS['URL_SSL']) ? "https://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}" : "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
175
+ $GLOBALS['PHP_MEMORY_LIMIT'] = ini_get('memory_limit') === false ? 'n/a' : ini_get('memory_limit');
176
+ $GLOBALS['PHP_SUHOSIN_ON'] = extension_loaded('suhosin') ? 'enabled' : 'disabled';
 
177
 
178
  //Restart log if user starts from step 1
179
  if ($_POST['action_step'] == 1) {
235
  </td>
236
  <td style="white-space:nowrap; text-align:right">
237
  <select id="dup-hlp-lnk">
238
+ <option value="null"> - Resources -</option>
239
  <option value="https://snapcreek.com/duplicator/docs/">&raquo; Knowledge Base</option>
240
  <option value="https://snapcreek.com/duplicator/docs/guide/">&raquo; User Guide</option>
241
  <option value="https://snapcreek.com/duplicator/docs/faqs-tech/">&raquo; Common FAQs</option>
274
  <td style="white-space:nowrap">
275
 
276
  <i style='font-size:11px; color:#999'>
277
+ version: <?php echo $GLOBALS['FW_DUPLICATOR_VERSION'] ?> &raquo; <a href="?help=1" target="_blank">help</a>
278
  </i> &nbsp;
279
 
280
  </td>
installer/build/view.help.php CHANGED
@@ -68,6 +68,11 @@ HELP FORM -->
68
  <legend><b>Advanced Options</b></legend>
69
  <b>Manual Package Extraction:</b><br/>
70
  This allows you to manually extract the zip archive on your own. This can be useful if your system does not have the ZipArchive support enabled.
 
 
 
 
 
71
  <br/><br/>
72
 
73
  <b>Enforce SSL on Admin:</b><br/>
68
  <legend><b>Advanced Options</b></legend>
69
  <b>Manual Package Extraction:</b><br/>
70
  This allows you to manually extract the zip archive on your own. This can be useful if your system does not have the ZipArchive support enabled.
71
+ <br/><br/>
72
+
73
+ <b>File Timestamp:</b><br/>
74
+ Choose 'Current' to set each file and directory to the current date-time on the server where it is being extracted. Choose 'Original' to retain the file date-time
75
+ in the archive file. This option will not be applied if the 'Manual package extraction' option is checked.
76
  <br/><br/>
77
 
78
  <b>Enforce SSL on Admin:</b><br/>
installer/build/view.step1.php CHANGED
@@ -36,135 +36,6 @@
36
  $total_req = ($req01 == 'Pass' && $req02 == 'Pass' && $req03 == 'Pass' && $req04 == 'Pass') ? 'Pass' : 'Fail';
37
  ?>
38
 
39
- <script type="text/javascript">
40
- /** **********************************************
41
- * METHOD: Performs Ajax post to extract files and create db
42
- * Timeout (10000000 = 166 minutes) */
43
- Duplicator.runDeployment = function() {
44
-
45
- var $form = $('#dup-step1-input-form');
46
- $form.parsley().validate();
47
- if (!$form.parsley().isValid()) {
48
- return;
49
- }
50
-
51
-
52
- var msg = "Continue installation with the following settings?\n\n";
53
- msg += "Server: " + $("#dbhost").val() + "\nDatabase: " + $("#dbname").val() + "\n\n";
54
- msg += "WARNING: Be sure these database parameters are correct!\n";
55
- msg += "Entering the wrong information WILL overwrite an existing database.\n";
56
- msg += "Make sure to have backups of all your data before proceeding.\n\n";
57
-
58
- var answer = confirm(msg);
59
- if (answer) {
60
- $.ajax({
61
- type: "POST",
62
- timeout: 10000000,
63
- dataType: "json",
64
- url: window.location.href,
65
- data: $form.serialize(),
66
- beforeSend: function() {
67
- Duplicator.showProgressBar();
68
- $form.hide();
69
- $('#dup-step1-result-form').show();
70
- },
71
- success: function(data, textStatus, xhr){
72
- if (typeof(data) != 'undefined' && data.pass == 1) {
73
- $("#ajax-dbhost").val($("#dbhost").val());
74
- $("#ajax-dbport").val($("#dbport").val());
75
- $("#ajax-dbuser").val($("#dbuser").val());
76
- $("#ajax-dbpass").val($("#dbpass").val());
77
- $("#ajax-dbname").val($("#dbname").val());
78
- $("#ajax-dbcharset").val($("#dbcharset").val());
79
- $("#ajax-dbcollate").val($("#dbcollate").val());
80
- $("#ajax-logging").val($("input:radio[name=logging]:checked").val());
81
- $("#ajax-json").val(escape(JSON.stringify(data)));
82
- setTimeout(function() {$('#dup-step1-result-form').submit();}, 1000);
83
- $('#progress-area').fadeOut(700);
84
- } else {
85
- Duplicator.hideProgressBar();
86
- }
87
- },
88
- error: function(xhr) {
89
- var status = "<b>server code:</b> " + xhr.status + "<br/><b>status:</b> " + xhr.statusText + "<br/><b>response:</b> " + xhr.responseText;
90
- $('#ajaxerr-data').html(status);
91
- Duplicator.hideProgressBar();
92
- }
93
- });
94
- }
95
- };
96
-
97
- /** **********************************************
98
- * METHOD: Accetps Useage Warning */
99
- Duplicator.acceptWarning = function() {
100
- if ($("#accept-warnings").is(':checked')) {
101
- $("#dup-step1-deploy-btn").removeAttr("disabled");
102
- } else {
103
- $("#dup-step1-deploy-btn").attr("disabled", "true");
104
- }
105
- };
106
-
107
- /** **********************************************
108
- * METHOD: Go back on AJAX result view */
109
- Duplicator.hideErrorResult = function() {
110
- $('#dup-step1-result-form').hide();
111
- $('#dup-step1-input-form').show(200);
112
- };
113
-
114
- /** **********************************************
115
- * METHOD: Shows results of database connection
116
- * Timeout (45000 = 45 secs) */
117
- Duplicator.dlgTestDB = function () {
118
- $.ajax({
119
- type: "POST",
120
- timeout: 45000,
121
- url: window.location.href + '?' + 'dbtest=1',
122
- data: $('#dup-step1-input-form').serialize(),
123
- success: function(data){ $('#dbconn-test-msg').html(data); },
124
- error: function(data){ alert('An error occurred while testing the database connection! Contact your server admin to make sure the connection inputs are correct!'); }
125
- });
126
-
127
- $('#dbconn-test-msg').html("Attempting Connection. Please wait...");
128
- $("#s1-dbconn-status").show(500);
129
-
130
- };
131
-
132
- Duplicator.showDeleteWarning = function () {
133
- ($('#dbaction-empty').prop('checked'))
134
- ? $('#dup-s1-warning-emptydb').show(300)
135
- : $('#dup-s1-warning-emptydb').hide(300);
136
- };
137
-
138
- Duplicator.togglePort = function () {
139
-
140
- $('#s1-dbport-btn').hide();
141
- $('#dbport').show();
142
- }
143
-
144
-
145
- //DOCUMENT LOAD
146
- $(document).ready(function() {
147
- $('#dup-s1-dialog-data').appendTo('#dup-s1-result-container');
148
- $( "input[name='dbaction']").click(Duplicator.showDeleteWarning);
149
- Duplicator.acceptWarning();
150
- Duplicator.showDeleteWarning();
151
-
152
- //MySQL Mode
153
- $("input[name=dbmysqlmode]").click(function() {
154
- if ($(this).val() == 'CUSTOM') {
155
- $('#dbmysqlmode_3_view').show();
156
- } else {
157
- $('#dbmysqlmode_3_view').hide();
158
- }
159
- });
160
-
161
- if ($("input[name=dbmysqlmode]:checked").val() == 'CUSTOM') {
162
- $('#dbmysqlmode_3_view').show();
163
- }
164
-
165
- });
166
- </script>
167
-
168
 
169
  <!-- =========================================
170
  VIEW: STEP 1- INPUT -->
@@ -247,7 +118,7 @@ VIEW: STEP 1- INPUT -->
247
  </td>
248
  </tr>
249
  <tr>
250
- <td>Name</td>
251
  <td><input type="text" name="dbname" id="dbname" required="true" value="<?php echo htmlspecialchars($GLOBALS['FW_DBNAME']); ?>" placeholder="new or existing database name" /></td>
252
  </tr>
253
  <tr>
@@ -272,18 +143,13 @@ VIEW: STEP 1- INPUT -->
272
  <small><input type="button" onclick="$('#s1-dbconn-status').hide(500)" class="s1-small-btn" value="Hide Message" /></small>
273
  </div>
274
  </div>
275
-
276
- <!-- !!DO NOT CHANGE/EDIT OR REMOVE THIS SECTION!!
277
- If your interested in Private Label Rights please contact us at the URL below to discuss
278
- customizations to product labeling: http://snapcreek.com -->
279
- <a href="javascript:void(0)" onclick="$('#dup-step1-cpanel').toggle(250)"><b style="font-size: 14px">Need Setup Help...</b></a>
280
- <div id='dup-step1-cpanel' style="display:none">
281
- <div style="padding:10px 0px 0px 10px;line-height:22px">
282
- &raquo; Check out the <a href="https://snapcreek.com/duplicator/docs/faqs-tech/#faq-resource-070-q" target="_blank">video tutorials &amp; guides</a> <br/>
283
- &raquo; Get help from our <a href="https://snapcreek.com/duplicator/docs/faqs-tech/" target="_blank">resources section</a>
284
- </div>
285
- </div><br/><br/>
286
-
287
  <a href="javascript:void(0)" onclick="$('#dup-step1-adv-opts').toggle(250)"><b style="font-size:14px">Advanced Options...</b></a>
288
  <div id='dup-step1-adv-opts' style="display:none">
289
 
@@ -294,15 +160,22 @@ VIEW: STEP 1- INPUT -->
294
  <tr>
295
  <td>Extraction</td>
296
  <td colspan="2">
297
- <input type="checkbox" name="zip_manual" id="zip_manual" value="1" /> <label for="zip_manual">Manual package extraction</label><br/>
298
  </td>
299
  </tr>
 
 
 
 
 
 
 
300
  <tr>
301
  <td>Logging</td>
302
  <td colspan="2">
303
- <input type="radio" name="logging" id="logging-light" value="1" checked="true"> <label for="logging-light">Light</label> &nbsp;
304
- <input type="radio" name="logging" id="logging-detailed" value="2"> <label for="logging-detailed">Detailed</label> &nbsp;
305
- <input type="radio" name="logging" id="logging-debug" value="3"> <label for="logging-debug">Debug</label>
306
  </td>
307
  </tr>
308
  <tr>
@@ -350,52 +223,130 @@ VIEW: STEP 1- INPUT -->
350
  <small><i>For an overview of these settings see the <a href="?help=1" target="_blank">help page</a></i></small>
351
  </div>
352
  </div>
 
353
 
354
-
355
- <div class="dup-s1-gopro">
356
- *Create the database and users <b>from the installer</b> with <a target="_blank" href="https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_install_step1&utm_campaign=duplicator_pro">Duplicator Pro!</a> - Requires cPanel.
357
- </div>
 
 
 
 
 
 
358
 
359
  <!-- NOTICES -->
360
- <div id="dup-s1-warning">
361
- <b>WARNINGS &amp; NOTICES</b>
362
- <p>
363
- <b>Disclaimer:</b>
364
- This plugin require above average technical knowledge. Please use it at your own risk and always back up your database and files beforehand using another backup
365
- system besides the Duplicator. If you're not sure about how to use this tool then please enlist the guidance of a technical professional. <u>Always</u> test
366
- this installer in a sandbox environment before trying to deploy into a production setting.
367
- </p>
368
- <p>
369
- <b>Database:</b>
370
- Do not connect to an existing database unless you are 100% sure you want to remove all of it's data. Connecting to a database
371
- that already exists will permanently DELETE all data in that database. This tool is designed to populate and fill a database with NEW data from a duplicated
372
- database using the SQL script in the package name above.
373
- </p>
374
- <p>
375
- <b>Setup:</b>
376
- Only the archive and installer.php file should be in the install directory, unless you have manually extracted the package and checked the
377
- 'Manual Package Extraction' checkbox. All other files will be OVERWRITTEN during install. Make sure you have full backups of all your databases and files
378
- before continuing with an installation.</p>
379
- <p>
380
- <b>Manual Extraction:</b>
381
- Manual extraction requires that all contents in the package are extracted to the same directory as the installer.php file.
382
- Manual extraction is only needed when your server does not support the ZipArchive extension. Please see the online help for more details.
383
- </p>
384
- <p>
385
- <b>After Install:</b>When you are done with the installation remove the installer.php, installer-data.sql and the installer-log.txt files from your directory.
386
- These files contain sensitive information and should not remain on a production system.
387
- </p><br/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  </div>
389
 
390
  <div id="dup-s1-warning-check">
391
- <input id="accept-warnings" name="accpet-warnings" type="checkbox" onclick="Duplicator.acceptWarning()" /> <label for="accept-warnings">I have read all warnings &amp; notices</label><br/>
 
392
  <div id="dup-s1-warning-emptydb">
393
- The remove action will delete <u>all</u> tables and data from the database!
394
  </div>
395
  </div><br/><br/>
396
 
397
  <div class="dup-footer-buttons">
398
- <input id="dup-step1-deploy-btn" type="button" value=" Run Deployment " onclick="Duplicator.runDeployment()" />
399
  </div>
400
 
401
  <?php endif; ?>
@@ -552,7 +503,7 @@ PANEL: SERVER CHECKS -->
552
 
553
  <hr class='dup-dots' />
554
  <!-- SAPI -->
555
- <b>PHP MAX MEMORY:</b> <?php echo @ini_get('memory_limit') ?><br/>
556
  <b>PHP SAPI:</b> <?php echo php_sapi_name(); ?><br/>
557
  <b>PHP ZIP Archive:</b> <?php echo class_exists('ZipArchive') ? 'Is Installed' : 'Not Installed'; ?> <br/>
558
  <b>CDN Accessible:</b> <?php echo ( DUPX_Util::is_url_active("ajax.aspnetcdn.com", 443) && DUPX_Util::is_url_active("ajax.googleapis.com", 443)) ? 'Yes' : 'No'; ?>
@@ -563,4 +514,176 @@ PANEL: SERVER CHECKS -->
563
  </div>
564
 
565
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
566
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  $total_req = ($req01 == 'Pass' && $req02 == 'Pass' && $req03 == 'Pass' && $req04 == 'Pass') ? 'Pass' : 'Fail';
37
  ?>
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  <!-- =========================================
41
  VIEW: STEP 1- INPUT -->
118
  </td>
119
  </tr>
120
  <tr>
121
+ <td>Database</td>
122
  <td><input type="text" name="dbname" id="dbname" required="true" value="<?php echo htmlspecialchars($GLOBALS['FW_DBNAME']); ?>" placeholder="new or existing database name" /></td>
123
  </tr>
124
  <tr>
143
  <small><input type="button" onclick="$('#s1-dbconn-status').hide(500)" class="s1-small-btn" value="Hide Message" /></small>
144
  </div>
145
  </div>
146
+
147
+ <div class="dup-s1-gopro">
148
+ Create the database and users <b>from the installer</b> <br/> with <a target="_blank" href="https://snapcreek.com/duplicator/?utm_source=duplicator_free&utm_medium=wordpress_plugin&utm_content=free_install_step1&utm_campaign=duplicator_pro">Duplicator Pro!</a> - Requires cPanel.
149
+ </div>
150
+ <br/>
151
+
152
+ <!-- ADVANCED OPTIONS -->
 
 
 
 
 
153
  <a href="javascript:void(0)" onclick="$('#dup-step1-adv-opts').toggle(250)"><b style="font-size:14px">Advanced Options...</b></a>
154
  <div id='dup-step1-adv-opts' style="display:none">
155
 
160
  <tr>
161
  <td>Extraction</td>
162
  <td colspan="2">
163
+ <input type="checkbox" name="zip_manual" id="zip_manual" value="1" /> <label for="zip_manual">Manual package extraction</label><br/>
164
  </td>
165
  </tr>
166
+ <tr>
167
+ <td>File Timestamp</td>
168
+ <td colspan="2">
169
+ <input type="radio" name="zip_filetime" id="zip_filetime_now" value="current" checked="checked" /> <label class="radio" for="zip_filetime_now" title='Set the files current date time to now'>Current</label>
170
+ <input type="radio" name="zip_filetime" id="zip_filetime_orginal" value="original" /> <label class="radio" for="zip_filetime_orginal" title="Keep the files date time the same">Original</label>
171
+ </td>
172
+ </tr>
173
  <tr>
174
  <td>Logging</td>
175
  <td colspan="2">
176
+ <input type="radio" name="logging" id="logging-light" value="1" checked="true"> <label class="radio" for="logging-light">Light</label>
177
+ <input type="radio" name="logging" id="logging-detailed" value="2"> <label class="radio" for="logging-detailed">Detailed</label>
178
+ <input type="radio" name="logging" id="logging-debug" value="3"> <label class="radio" for="logging-debug">Debug</label>
179
  </td>
180
  </tr>
181
  <tr>
223
  <small><i>For an overview of these settings see the <a href="?help=1" target="_blank">help page</a></i></small>
224
  </div>
225
  </div>
226
+ <br/><br/>
227
 
228
+ <!-- SETUP HELP -->
229
+ <a href="javascript:void(0)" onclick="$('#dup-step1-cpanel').toggle(250)"><b style="font-size: 14px">Need Setup Help...</b></a>
230
+ <div id='dup-step1-cpanel' style="display:none">
231
+ <div style="padding:10px 0px 0px 10px;line-height:22px">
232
+ &raquo; View the <a href="https://snapcreek.com/duplicator/docs/faqs-tech/#faq-resource-070-q" target="_blank">video tutorials</a> <br/>
233
+ &raquo; Read helpful <a href="https://snapcreek.com/duplicator/docs/faqs-tech/" target="_blank">articles</a> <br/>
234
+ &raquo; Visit the <a href="https://snapcreek.com/duplicator/docs/quick-start/" target="_blank">quick start guides</a>
235
+ </div>
236
+ </div>
237
+ <br/><br/>
238
 
239
  <!-- NOTICES -->
240
+ <a href="javascript:void(0)" onclick="$('#dup-s1-warning').toggle(250)"><b style="font-size:14px">Warnings &amp; Notices...</b></a>
241
+ <div id="dup-s1-warning" style="display: none"><pre>Duplicator
242
+ Copyright (c) 2017 Snapcreek LLC
243
+
244
+ *** WARNINGS &amp; NOTICES ***
245
+
246
+ DISCLAIMER:
247
+ This plugin require above average technical knowledge. Please use it at your own risk and always back up your database and files beforehand using another backup
248
+ system besides the Duplicator. If you're not sure about how to use this tool then please enlist the guidance of a technical professional. Always test this installer
249
+ in a sandbox environment before trying to deploy into a production setting.
250
+
251
+ DATABASE:
252
+ Do not connect to an existing database unless you are 100% sure you want to remove all of it's data. Connecting to a database that already exists will permanently
253
+ DELETE all data in that database. This tool is designed to populate and fill a database with NEW data from a duplicated database using the SQL script in the package name above.
254
+
255
+ SETUP:
256
+ Only the archive and installer.php file should be in the install directory, unless you have manually extracted the package and checked the 'Manual Package Extraction' checkbox.
257
+ All other files will be OVERWRITTEN during install. Make sure you have full backups of all your databases and files before continuing with an installation.
258
+
259
+ MANUAL EXTRACTION:
260
+ Manual extraction requires that all contents in the package are extracted to the same directory as the installer.php file. Manual extraction is only needed when your server
261
+ does not support the ZipArchive extension. Please see the online help for more details.
262
+
263
+ AFTER INSTALL:
264
+ When you are done with the installation remove the installer.php, installer-data.sql and the installer-log.txt files from your directory. These files contain sensitive information
265
+ and should not remain on a production system.
266
+
267
+
268
+ *** END USER LICENSE AGREEMENT ***
269
+
270
+ IMPORTANT: PLEASE READ THIS LICENSE CAREFULLY BEFORE USING THIS SOFTWARE.
271
+
272
+ 1. LICENSE
273
+
274
+ By receiving, opening the file package, and/or using Duplicator("Software") containing this software, you agree that this End User User License Agreement(EULA) is
275
+ a legally binding and valid contract and agree to be bound by it. You agree to abide by the intellectual property laws and all of the terms and conditions of this Agreement.
276
+
277
+ Unless you have a different license agreement signed by Snapcreek LLC your use of Duplicator indicates your acceptance of this license agreement and warranty.
278
+
279
+ Subject to the terms of this Agreement, Snapcreek LLC grants to you a limited, non-exclusive, non-transferable free license, without right to sub-license, to use Duplicator
280
+ in accordance with this Agreement and any other written agreement with Snapcreek LLC. Snapcreek LLC does not transfer the title of Duplicator to you; the license granted
281
+ to you is not a sale the plugin is given free and as is. This agreement is a binding legal agreement between Snapcreek LLC and the purchasers or users of Duplicator.
282
+
283
+ If you do not agree to be bound by this agreement, remove Duplicator from your computer now and, if applicable, promptly all related documentation and files relating to
284
+ Duplicator in your possession.
285
+
286
+
287
+ 2. DISTRIBUTION
288
+
289
+ Duplicator and the license herein granted shall not be sold, offered for re-sale, transferred or sub-licensed in whole. For information about redistribution of Duplicator
290
+ contact Snapcreek LLC.
291
+
292
+
293
+ 3. USER AGREEMENT
294
+
295
+ 3.1 Use
296
+
297
+ Duplicator is a free plugin offered for download at https://wordpress.org/plugins/duplicator and https://github.com/lifeinthegrid/duplicator
298
+
299
+ 3.2 USE RESTRICTIONS
300
+
301
+ You shall use Duplicator in compliance with all applicable laws and not for any unlawful purpose.
302
+
303
+
304
+ 3.3 LIMITATION OF RESPONSIBILITY
305
+
306
+ You will indemnify, hold harmless, and defend Snapcreek LLC , its employees, agents and distributors against any and all claims, proceedings, demand and costs resulting from or in
307
+ any way connected with your use of Snapcreek LLC's Software.
308
+
309
+ In no event (including, without limitation, in the event of negligence) will Snapcreek LLC , its employees, agents or distributors be liable for any consequential, incidental,
310
+ indirect, special or punitive damages whatsoever (including, without limitation, damages for loss of profits, loss of use, business interruption, loss of information or data,
311
+ or pecuniary loss), in connection with or arising out of or related to this Agreement, Duplicator or the use or inability to use Duplicator or the furnishing, performance or use
312
+ of any other matters hereunder whether based upon contract, tort or any other theory including negligence.
313
+
314
+ Snapcreek LLC's entire liability, without exception, is limited to no monetary or financial costs
315
+
316
+ 3.4 WARRANTIES
317
+
318
+ Except as expressly stated in writing, Snapcreek LLC makes no representation or warranties in respect of this Software and expressly excludes all other warranties, expressed or implied,
319
+ oral or written, including, without limitation, any implied warranties of merchantable quality or fitness for a particular purpose.
320
+
321
+ 3.5 GOVERNING LAW
322
+
323
+ This Agreement shall be governed by the law of the United States applicable therein. You hereby irrevocably attorn and submit to the non-exclusive jurisdiction of the courts of
324
+ United States therefrom. If any provision shall be considered unlawful, void or otherwise unenforceable, then that provision shall be deemed severable from this License and not
325
+ affect the validity and enforceability of any other provisions.
326
+
327
+ 3.6 TERMINATION
328
+
329
+ Any failure to comply with the terms and conditions of this Agreement will result in automatic and immediate termination of this license. Upon termination of this license granted
330
+ herein for any reason, you agree to immediately cease use of Duplicator and destroy all copies of Duplicator supplied under this Agreement. The financial obligations incurred by you
331
+ shall survive the expiration or termination of this license.
332
+
333
+ 4. DISCLAIMER OF WARRANTY
334
+
335
+ THIS SOFTWARE AND THE ACCOMPANYING FILES ARE FREE AND OFFERED "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.
336
+ THIS DISCLAIMER CONCERNS ALL FILES GENERATED AND EDITED BY Duplicator AS WELL.
337
+ </pre>
338
  </div>
339
 
340
  <div id="dup-s1-warning-check">
341
+ <input id="accept-warnings" name="accpet-warnings" type="checkbox" onclick="Duplicator.acceptWarning()" style='vertical-align: bottom' />
342
+ <label for="accept-warnings">I have read and accept all warnings &amp; notices <small>(required to run deployment)</small></label><br/>
343
  <div id="dup-s1-warning-emptydb">
344
+ <label for="accept-warnings">The 'Connect and Remove All Data' action will delete <u>all</u> tables and data from the database!</label>
345
  </div>
346
  </div><br/><br/>
347
 
348
  <div class="dup-footer-buttons">
349
+ <input id="dup-step1-deploy-btn" type="button" value=" Run Deployment " onclick="Duplicator.confirmDeployment()" />
350
  </div>
351
 
352
  <?php endif; ?>
503
 
504
  <hr class='dup-dots' />
505
  <!-- SAPI -->
506
+ <b>PHP MAX MEMORY:</b> <?php echo $GLOBALS['PHP_MEMORY_LIMIT'] ?><br/>
507
  <b>PHP SAPI:</b> <?php echo php_sapi_name(); ?><br/>
508
  <b>PHP ZIP Archive:</b> <?php echo class_exists('ZipArchive') ? 'Is Installed' : 'Not Installed'; ?> <br/>
509
  <b>CDN Accessible:</b> <?php echo ( DUPX_Util::is_url_active("ajax.aspnetcdn.com", 443) && DUPX_Util::is_url_active("ajax.googleapis.com", 443)) ? 'Yes' : 'No'; ?>
514
  </div>
515
 
516
 
517
+ <!-- CONFIRM DIALOG -->
518
+ <div id="dialog-confirm-content" style="display:none">
519
+ <div style="padding:0 0 25px 0">
520
+ <b>Run installer with these settings?</b>
521
+ </div>
522
+
523
+ <b>Database Settings:</b><br/>
524
+ <table style="margin-left:20px">
525
+ <tr>
526
+ <td><b>Server:</b></td>
527
+ <td><i id="dlg-dbhost"></i></td>
528
+ </tr>
529
+ <tr>
530
+ <td><b>Name:</b></td>
531
+ <td><i id="dlg-dbname"></i></td>
532
+ </tr>
533
+ <tr>
534
+ <td><b>User:</b></td>
535
+ <td><i id="dlg-dbuser"></i></td>
536
+ </tr>
537
+ </table>
538
+ <br/><br/>
539
+
540
+ <small> WARNING: Be sure these database parameters are correct! Entering the wrong information WILL overwrite an existing database.
541
+ Make sure to have backups of all your data before proceeding.</small><br/>
542
+ </div>
543
+
544
 
545
+ <script type="text/javascript">
546
+
547
+ /* Confirm Dialog to validate run */
548
+ Duplicator.confirmDeployment = function()
549
+ {
550
+ var $form = $('#dup-step1-input-form');
551
+ $form.parsley().validate();
552
+ if (!$form.parsley().isValid()) {
553
+ return;
554
+ }
555
+
556
+ $('#dlg-dbhost').html($("#dbhost").val());
557
+ $('#dlg-dbname').html($("#dbname").val());
558
+ $('#dlg-dbuser').html($("#dbuser").val());
559
+
560
+ modal({
561
+ type: 'confirm',
562
+ title: 'Install Confirmation',
563
+ text: $('#dialog-confirm-content').html(),
564
+ callback: function(result)
565
+ {
566
+ if (result == true) {
567
+ Duplicator.runDeployment();
568
+ }
569
+ }
570
+ });
571
+ }
572
+
573
+ /* Performs Ajax post to extract files and create db
574
+ * Timeout (10000000 = 166 minutes) */
575
+ Duplicator.runDeployment = function()
576
+ {
577
+ var $form = $('#dup-step1-input-form');
578
+ var dbhost = $("#dbhost").val();
579
+ var dbname = $("#dbname").val();
580
+ var dbuser = $("#dbuser").val();
581
+
582
+ $.ajax({
583
+ type: "POST",
584
+ timeout: 10000000,
585
+ dataType: "json",
586
+ url: window.location.href,
587
+ data: $form.serialize(),
588
+ beforeSend: function() {
589
+ Duplicator.showProgressBar();
590
+ $form.hide();
591
+ $('#dup-step1-result-form').show();
592
+ },
593
+ success: function(data, textStatus, xhr){
594
+ if (typeof(data) != 'undefined' && data.pass == 1) {
595
+ $("#ajax-dbhost").val($("#dbhost").val());
596
+ $("#ajax-dbport").val($("#dbport").val());
597
+ $("#ajax-dbuser").val($("#dbuser").val());
598
+ $("#ajax-dbpass").val($("#dbpass").val());
599
+ $("#ajax-dbname").val($("#dbname").val());
600
+ $("#ajax-dbcharset").val($("#dbcharset").val());
601
+ $("#ajax-dbcollate").val($("#dbcollate").val());
602
+ $("#ajax-logging").val($("input:radio[name=logging]:checked").val());
603
+ $("#ajax-json").val(escape(JSON.stringify(data)));
604
+ setTimeout(function() {$('#dup-step1-result-form').submit();}, 1000);
605
+ $('#progress-area').fadeOut(700);
606
+ } else {
607
+ Duplicator.hideProgressBar();
608
+ }
609
+ },
610
+ error: function(xhr) {
611
+ var status = "<b>server code:</b> " + xhr.status + "<br/><b>status:</b> " + xhr.statusText + "<br/><b>response:</b> " + xhr.responseText;
612
+ $('#ajaxerr-data').html(status);
613
+ Duplicator.hideProgressBar();
614
+ }
615
+ });
616
+
617
+ };
618
+
619
+ /** **********************************************
620
+ * METHOD: Accetps Useage Warning */
621
+ Duplicator.acceptWarning = function() {
622
+ if ($("#accept-warnings").is(':checked')) {
623
+ $("#dup-step1-deploy-btn").removeAttr("disabled");
624
+ } else {
625
+ $("#dup-step1-deploy-btn").attr("disabled", "true");
626
+ }
627
+ };
628
+
629
+ /** **********************************************
630
+ * METHOD: Go back on AJAX result view */
631
+ Duplicator.hideErrorResult = function() {
632
+ $('#dup-step1-result-form').hide();
633
+ $('#dup-step1-input-form').show(200);
634
+ };
635
+
636
+ /** **********************************************
637
+ * METHOD: Shows results of database connection
638
+ * Timeout (45000 = 45 secs) */
639
+ Duplicator.dlgTestDB = function () {
640
+ $.ajax({
641
+ type: "POST",
642
+ timeout: 45000,
643
+ url: window.location.href + '?' + 'dbtest=1',
644
+ data: $('#dup-step1-input-form').serialize(),
645
+ success: function(data){ $('#dbconn-test-msg').html(data); },
646
+ error: function(data){ alert('An error occurred while testing the database connection! Contact your server admin to make sure the connection inputs are correct!'); }
647
+ });
648
+
649
+ $('#dbconn-test-msg').html("Attempting Connection. Please wait...");
650
+ $("#s1-dbconn-status").show(500);
651
+
652
+ };
653
+
654
+ Duplicator.showDeleteWarning = function () {
655
+ ($('#dbaction-empty').prop('checked'))
656
+ ? $('#dup-s1-warning-emptydb').show(300)
657
+ : $('#dup-s1-warning-emptydb').hide(300);
658
+ };
659
+
660
+ Duplicator.togglePort = function () {
661
+
662
+ $('#s1-dbport-btn').hide();
663
+ $('#dbport').show();
664
+ }
665
+
666
+
667
+ //DOCUMENT LOAD
668
+ $(document).ready(function() {
669
+ $('#dup-s1-dialog-data').appendTo('#dup-s1-result-container');
670
+ $( "input[name='dbaction']").click(Duplicator.showDeleteWarning);
671
+ Duplicator.acceptWarning();
672
+ Duplicator.showDeleteWarning();
673
+
674
+ //MySQL Mode
675
+ $("input[name=dbmysqlmode]").click(function() {
676
+ if ($(this).val() == 'CUSTOM') {
677
+ $('#dbmysqlmode_3_view').show();
678
+ } else {
679
+ $('#dbmysqlmode_3_view').hide();
680
+ }
681
+ });
682
+
683
+ if ($("input[name=dbmysqlmode]:checked").val() == 'CUSTOM') {
684
+ $('#dbmysqlmode_3_view').show();
685
+ }
686
+
687
+
688
+ });
689
+ </script>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: www.lifeinthegrid.com/partner
4
  Tags: backup, restore, move, migrate, localhost, synchronize, duplicate, clone, automate, niche site
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
- Stable tag: 1.1.28
8
  License: GPLv2
9
 
10
  Duplicate, clone, backup, move and transfer an entire site from one location to another.
@@ -83,7 +83,7 @@ Yes. Please see the [video section](https://snapcreek.com/duplicator/docs/faqs-
83
 
84
  = Is this plugin compatible with WordPress Multi-Site (MU)? =
85
 
86
- No. However the Pro version can duplicate entire Multisite networks.
87
 
88
  = Where can I get more help and support for this plugin? =
89
 
4
  Tags: backup, restore, move, migrate, localhost, synchronize, duplicate, clone, automate, niche site
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
+ Stable tag: 1.1.30
8
  License: GPLv2
9
 
10
  Duplicate, clone, backup, move and transfer an entire site from one location to another.
83
 
84
  = Is this plugin compatible with WordPress Multi-Site (MU)? =
85
 
86
+ No. However the Pro version does have minor support for MU
87
 
88
  = Where can I get more help and support for this plugin? =
89
 
views/help/about.php CHANGED
@@ -24,12 +24,20 @@ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
24
  div.dup-support-hlp-txt{padding:10px 4px 4px 4px; text-align:center}
25
  div.dup-support-give-area {width:400px; height:185px; float:left; border:1px solid #dfdfdf; border-radius:4px; margin:10px; line-height:18px;box-shadow: 0 8px 6px -6px #ccc;}
26
  div.dup-spread-word {display:inline-block; border:1px solid red; text-align:center}
27
-
28
  img#dup-support-approved { -webkit-animation:approve-keyframe 12s 1s infinite alternate backwards}
29
  form#dup-donate-form input {opacity:0.7;}
30
  form#dup-donate-form input:hover {opacity:1.0;}
31
  img#dup-img-5stars {opacity:0.7;}
32
  img#dup-img-5stars:hover {opacity:1.0;}
 
 
 
 
 
 
 
 
33
  </style>
34
 
35
  <script type="text/javascript">var switchTo5x = true;</script>
@@ -82,7 +90,6 @@ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
82
  </table>
83
  </div>
84
 
85
-
86
  <!-- SPREAD THE WORD -->
87
  <div class="dup-support-give-area">
88
  <table class="dup-support-hlp-hdrs">
@@ -109,6 +116,58 @@ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
109
  </div>
110
  <br style="clear:both" /><br/>
111
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  <!--div style='margin: auto; text-align: center; margin-top: 20px'>
114
  <a href="http://lifeinthegrid.com/tools" target="_blank" class="button button-large button-primary">
@@ -116,5 +175,6 @@ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
116
  </a>
117
  </div-->
118
 
 
119
  </div>
120
  </div><br/><br/><br/><br/>
24
  div.dup-support-hlp-txt{padding:10px 4px 4px 4px; text-align:center}
25
  div.dup-support-give-area {width:400px; height:185px; float:left; border:1px solid #dfdfdf; border-radius:4px; margin:10px; line-height:18px;box-shadow: 0 8px 6px -6px #ccc;}
26
  div.dup-spread-word {display:inline-block; border:1px solid red; text-align:center}
27
+
28
  img#dup-support-approved { -webkit-animation:approve-keyframe 12s 1s infinite alternate backwards}
29
  form#dup-donate-form input {opacity:0.7;}
30
  form#dup-donate-form input:hover {opacity:1.0;}
31
  img#dup-img-5stars {opacity:0.7;}
32
  img#dup-img-5stars:hover {opacity:1.0;}
33
+
34
+ /* EMAIL AREA */
35
+ div.dup-support-email-area {width:825px; height:250px; border:1px solid #dfdfdf; border-radius:4px; margin:10px; line-height:18px;box-shadow: 0 8px 6px -6px #ccc;}
36
+ #mce-EMAIL {font-size:20px; height:40px; width:500px}
37
+ #mce-responses {width:300px}
38
+ #mc-embedded-subscribe { height: 35px; font-size: 16px; font-weight: bold}
39
+ div.mce_inline_error {width:300px; margin: auto !important}
40
+ div#mce-responses {margin: auto; padding: 10px; width:500px}
41
  </style>
42
 
43
  <script type="text/javascript">var switchTo5x = true;</script>
90
  </table>
91
  </div>
92
 
 
93
  <!-- SPREAD THE WORD -->
94
  <div class="dup-support-give-area">
95
  <table class="dup-support-hlp-hdrs">
116
  </div>
117
  <br style="clear:both" /><br/>
118
 
119
+ <!-- STAY IN THE LOOP -->
120
+ <div class="dup-support-email-area">
121
+ <table class="dup-support-hlp-hdrs">
122
+ <tr>
123
+ <td style="height:30px; text-align: center;">
124
+ <span style="display: inline-block; margin-top: 5px"><?php _e('Stay in the Loop', 'duplicator') ?></span>
125
+ </td>
126
+ </tr>
127
+ </table>
128
+ <div class="dup-support-hlp-txt">
129
+ <div class="email-box">
130
+ <div class="email-area">
131
+ <!-- Begin MailChimp Signup Form -->
132
+ <div class="email-form">
133
+ <div style="font-size:18px; width: 525px; padding: 5px 0 15px 0; text-align: center; font-style: italic; margin: auto">
134
+ <?php _e('Subscribe to the Duplicator newsletter and stay on top of great ideas, tutorials, and better ways to improve your workflows', 'duplicator') ?>...
135
+ </div>
136
+
137
+
138
+ <div id="mc_embed_signup">
139
+ <form action="//snapcreek.us11.list-manage.com/subscribe/post?u=e2a9a514bfefa439bf2b7cf16&amp;id=1270a169c1" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
140
+ <div id="mc_embed_signup_scroll">
141
+ <div class="mc-field-group">
142
+ <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Your Best Email *">
143
+ </div>
144
+ <div id="mce-responses" class="clear">
145
+ <div class="response" id="mce-error-response" style="display:none"></div>
146
+ <div class="response" id="mce-success-response" style="display:none"></div>
147
+ </div>
148
+ <div style="position:absolute; left:-5000px;"><input type="text" name="b_e2a9a514bfefa439bf2b7cf16_1270a169c1" tabindex="-1" value=""></div>
149
+ <div style="margin: auto; text-align: center">
150
+ <input type="submit" class="button-primary button-large" value="Sign me up!" name="subscribe" id="mc-embedded-subscribe" >
151
+ </div>
152
+ <!-- Forces the submission to use Duplicator group -->
153
+ <input style="display:none" checked="checked" type="checkbox" value="1" name="group[15741][1]" id="mce-group[15741]-15741-0">
154
+ </div>
155
+ </form>
156
+ </div>
157
+ </div>
158
+
159
+ <script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
160
+ <script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
161
+ <!--End mc_embed_signup-->
162
+ </div>
163
+ </div>
164
+
165
+
166
+
167
+ </div>
168
+ </div>
169
+ <br style="clear:both" /><br/>
170
+
171
 
172
  <!--div style='margin: auto; text-align: center; margin-top: 20px'>
173
  <a href="http://lifeinthegrid.com/tools" target="_blank" class="button button-large button-primary">
175
  </a>
176
  </div-->
177
 
178
+
179
  </div>
180
  </div><br/><br/><br/><br/>
views/packages/main/packages.php CHANGED
@@ -5,6 +5,7 @@
5
  $statusCount = count($qryStatus);
6
  $package_debug = DUP_Settings::Get('package_debug');
7
  $ajax_nonce = wp_create_nonce('package_list');
 
8
  ?>
9
 
10
  <style>
@@ -130,7 +131,7 @@ TOOL-BAR -->
130
  <?php if ($row['status'] >= 100) : ?>
131
  <tr class="dup-pack-info <?php echo $css_alt ?>">
132
  <td class="pass"><input name="delete_confirm" type="checkbox" id="<?php echo $row['id'] ;?>" /></td>
133
- <td><?php echo date( "m-d-y G:i", strtotime($row['created']));?></td>
134
  <td><?php echo DUP_Util::ByteSize($pack_archive_size); ?></td>
135
  <td class='pack-name'><?php echo $pack_name ;?></td>
136
  <td class="get-btns">
@@ -161,7 +162,7 @@ TOOL-BAR -->
161
  ?>
162
  <tr class="dup-pack-info <?php echo $css_alt ?>">
163
  <td class="fail"><input name="delete_confirm" type="checkbox" id="<?php echo $row['id'] ;?>" /></td>
164
- <td><?php echo date( "m-d-y G:i", strtotime($row['created']));?></td>
165
  <td><?php echo DUP_Util::ByteSize($size); ?></td>
166
  <td class='pack-name'><?php echo $pack_name ;?></td>
167
  <td class="get-btns error-msg" colspan="2">
5
  $statusCount = count($qryStatus);
6
  $package_debug = DUP_Settings::Get('package_debug');
7
  $ajax_nonce = wp_create_nonce('package_list');
8
+ $ui_create_frmt = is_numeric(DUP_Settings::Get('package_ui_created')) ? DUP_Settings::Get('package_ui_created') : 1;
9
  ?>
10
 
11
  <style>
131
  <?php if ($row['status'] >= 100) : ?>
132
  <tr class="dup-pack-info <?php echo $css_alt ?>">
133
  <td class="pass"><input name="delete_confirm" type="checkbox" id="<?php echo $row['id'] ;?>" /></td>
134
+ <td><?php echo DUP_Package::FormatCreatedDate($row['created'], $ui_create_frmt);?></td>
135
  <td><?php echo DUP_Util::ByteSize($pack_archive_size); ?></td>
136
  <td class='pack-name'><?php echo $pack_name ;?></td>
137
  <td class="get-btns">
162
  ?>
163
  <tr class="dup-pack-info <?php echo $css_alt ?>">
164
  <td class="fail"><input name="delete_confirm" type="checkbox" id="<?php echo $row['id'] ;?>" /></td>
165
+ <td><?php echo DUP_Package::FormatCreatedDate($row['created'], $ui_create_frmt);?></td>
166
  <td><?php echo DUP_Util::ByteSize($size); ?></td>
167
  <td class='pack-name'><?php echo $pack_name ;?></td>
168
  <td class="get-btns error-msg" colspan="2">
views/settings/general.php CHANGED
@@ -28,6 +28,7 @@ if (isset($_POST['action']) && $_POST['action'] == 'save') {
28
  DUP_Settings::Set('package_mysqldump', $enable_mysqldump ? "1" : "0");
29
  DUP_Settings::Set('package_phpdump_qrylimit', isset($_POST['package_phpdump_qrylimit']) ? $_POST['package_phpdump_qrylimit'] : "100");
30
  DUP_Settings::Set('package_mysqldump_path', trim(esc_sql(strip_tags($_POST['package_mysqldump_path']))));
 
31
 
32
  //WPFront
33
  DUP_Settings::Set('wpfront_integrate', isset($_POST['wpfront_integrate']) ? "1" : "0");
@@ -49,6 +50,7 @@ $phpdump_chunkopts = array("20", "100", "500", "1000", "2000");
49
  $package_phpdump_qrylimit = DUP_Settings::Get('package_phpdump_qrylimit');
50
  $package_mysqldump = DUP_Settings::Get('package_mysqldump');
51
  $package_mysqldump_path = trim(DUP_Settings::Get('package_mysqldump_path'));
 
52
 
53
  $wpfront_integrate = DUP_Settings::Get('wpfront_integrate');
54
  $wpfront_ready = apply_filters('wpfront_user_role_editor_duplicator_integration_ready', false);
@@ -63,7 +65,8 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
63
  form#dup-settings-form input[type=text] {width: 400px; }
64
  input#package_mysqldump_path_found {margin-top:5px}
65
  div.dup-feature-found {padding:3px; border:1px solid silver; background: #f7fcfe; border-radius: 3px; width:400px; font-size: 12px}
66
- div.dup-feature-notfound {padding:3px; border:1px solid silver; background: #fcf3ef; border-radius: 3px; width:400px; font-size: 12px}
 
67
  </style>
68
 
69
  <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=general'); ?>" method="post">
@@ -118,42 +121,29 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
118
  <hr size="1" />
119
  <table class="form-table">
120
  <tr>
121
- <th scope="row"><label><?php _e("Archive Flush", 'duplicator'); ?></label></th>
122
  <td>
123
- <input type="checkbox" name="package_zip_flush" id="package_zip_flush" <?php echo ($package_zip_flush) ? 'checked="checked"' : ''; ?> />
124
- <label for="package_zip_flush"><?php _e("Attempt Network Keep Alive", 'duplicator'); ?></label>
125
- <i style="font-size:12px">(<?php _e("recommended only for large archives", 'duplicator'); ?>)</i>
 
 
 
126
  <p class="description">
127
- <?php _e("This will attempt to keep a network connection established for large archives.", 'duplicator'); ?>
128
  </p>
129
  </td>
130
- </tr>
131
  <tr>
132
- <th scope="row"><label><?php _e("Database Build", 'duplicator'); ?></label></th>
133
  <td>
134
- <input type="radio" name="package_dbmode" id="package_phpdump" value="php" <?php echo (! $package_mysqldump) ? 'checked="checked"' : ''; ?> />
135
- <label for="package_phpdump"><?php _e("Use PHP", 'duplicator'); ?></label> &nbsp;
136
-
137
- <div style="margin:5px 0px 0px 25px">
138
- <label for="package_phpdump_qrylimit"><?php _e("Query Limit Size", 'duplicator'); ?></label> &nbsp;
139
- <select name="package_phpdump_qrylimit" id="package_phpdump_qrylimit">
140
- <?php
141
- foreach($phpdump_chunkopts as $value) {
142
- $selected = ( $package_phpdump_qrylimit == $value ? "selected='selected'" : '' );
143
- echo "<option {$selected} value='{$value}'>" . number_format($value) . '</option>';
144
- }
145
- ?>
146
- </select>
147
- <i style="font-size:12px">(<?php _e("higher values speed up build times but uses more memory", 'duplicator'); ?>)</i>
148
-
149
- </div><br/>
150
-
151
  <?php if (!DUP_Util::IsShellExecAvailable()) : ?>
152
- <p class="description">
 
 
153
  <?php
154
- _e("This server does not have shell_exec configured to run.", 'duplicator');
155
- echo '<br/>';
156
- _e("Contact the server administrator to enable this feature.", 'duplicator');
157
  ?>
158
  <br/>
159
  <small>
@@ -169,28 +159,14 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
169
  ?>
170
  </i>
171
  </small>
 
172
  </p>
173
  <?php else : ?>
174
  <input type="radio" name="package_dbmode" value="mysql" id="package_mysqldump" <?php echo ($package_mysqldump) ? 'checked="checked"' : ''; ?> />
175
- <label for="package_mysqldump"><?php _e("Use mysqldump", 'duplicator'); ?></label> &nbsp;
176
- <i style="font-size:12px">(<?php _e("recommended for large databases", 'duplicator'); ?>)</i> <br/>
177
 
178
- <div style="padding:2px 0 0 40px">
179
- <small>
180
- <i style="cursor: pointer"
181
- data-tooltip-title="<?php _e("Host Recommendation:", 'duplicator'); ?>"
182
- data-tooltip="<?php _e('Duplicator recommends going with the high performance pro plan or better from our recommended list', 'duplicator'); ?>">
183
- <i class="fa fa-lightbulb-o" aria-hidden="true"></i>
184
- <?php
185
- printf("%s <a target='_blank' href='//snapcreek.com/wordpress-hosting/'>%s</a> %s",
186
- __("Please visit our recommended", 'duplicator'),
187
- __("host list", 'duplicator'),
188
- __("for reliable access to mysqldump", 'duplicator'));
189
- ?>
190
- </i>
191
- </small>
192
- </div>
193
- <br/>
194
 
195
  <div style="margin:5px 0px 0px 25px">
196
  <?php if ($mysqlDumpFound) : ?>
@@ -203,26 +179,59 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
203
  <?php
204
  _e('Mysqldump was not found at its default location or the location provided. Please enter a path to a valid location where mysqldump can run. If the problem persist contact your server administrator.', 'duplicator');
205
  ?>
 
 
 
 
 
 
 
206
  </div><br/>
 
207
  <?php endif; ?>
208
 
209
- <label><?php _e("Add Custom Path:", 'duplicator'); ?></label><br/>
 
 
 
210
  <input type="text" name="package_mysqldump_path" id="package_mysqldump_path" value="<?php echo $package_mysqldump_path; ?> " />
211
- <p class="description"><?php _e("This is the path to your mysqldump program.", 'duplicator'); ?></p>
212
  </div>
213
 
214
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  </td>
216
- </tr>
217
  <tr>
218
- <th scope="row"><label><?php _e("Debugging", 'duplicator'); ?></label></th>
219
  <td>
220
- <input type="checkbox" name="package_debug" id="package_debug" <?php echo ($package_debug) ? 'checked="checked"' : ''; ?> />
221
- <label for="package_debug"><?php _e("Enable debug options throughout user interface", 'duplicator'); ?></label>
222
- <p class="description"><?php _e("Refresh page after saving to show/hide Debug menu", 'duplicator'); ?></p>
 
 
 
223
  </td>
224
- </tr>
225
-
226
  </table>
227
 
228
  <!-- ===============================
@@ -236,8 +245,6 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
236
  <td>
237
  <input type="checkbox" name="wpfront_integrate" id="wpfront_integrate" <?php echo ($wpfront_integrate) ? 'checked="checked"' : ''; ?> <?php echo $wpfront_ready ? '' : 'disabled'; ?> />
238
  <label for="wpfront_integrate"><?php _e("Enable User Role Editor Plugin Integration", 'duplicator'); ?></label>
239
-
240
- <div style="margin:15px 0px 0px 25px">
241
  <p class="description">
242
  <?php printf('%s <a href="https://wordpress.org/plugins/wpfront-user-role-editor/" target="_blank">%s</a> %s'
243
  . ' <a href="https://wpfront.com/user-role-editor-pro/?ref=3" target="_blank">%s</a> %s '
@@ -251,10 +258,16 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
251
  );
252
  ?>
253
  </p>
254
- </div>
255
  </td>
256
  </tr>
257
-
 
 
 
 
 
 
 
258
  </table><br/>
259
 
260
  <p class="submit" style="margin: 20px 0px 0xp 5px;">
@@ -262,4 +275,11 @@ $mysqlDumpFound = ($mysqlDumpPath) ? true : false;
262
  <input type="submit" name="submit" id="submit" class="button-primary" value="<?php _e("Save Settings", 'duplicator') ?>" style="display: inline-block;" />
263
  </p>
264
 
265
- </form>
 
 
 
 
 
 
 
28
  DUP_Settings::Set('package_mysqldump', $enable_mysqldump ? "1" : "0");
29
  DUP_Settings::Set('package_phpdump_qrylimit', isset($_POST['package_phpdump_qrylimit']) ? $_POST['package_phpdump_qrylimit'] : "100");
30
  DUP_Settings::Set('package_mysqldump_path', trim(esc_sql(strip_tags($_POST['package_mysqldump_path']))));
31
+ DUP_Settings::Set('package_ui_created', $_POST['package_ui_created']);
32
 
33
  //WPFront
34
  DUP_Settings::Set('wpfront_integrate', isset($_POST['wpfront_integrate']) ? "1" : "0");
50
  $package_phpdump_qrylimit = DUP_Settings::Get('package_phpdump_qrylimit');
51
  $package_mysqldump = DUP_Settings::Get('package_mysqldump');
52
  $package_mysqldump_path = trim(DUP_Settings::Get('package_mysqldump_path'));
53
+ $package_ui_created = is_numeric(DUP_Settings::Get('package_ui_created')) ? DUP_Settings::Get('package_ui_created') : 1;
54
 
55
  $wpfront_integrate = DUP_Settings::Get('wpfront_integrate');
56
  $wpfront_ready = apply_filters('wpfront_user_role_editor_duplicator_integration_ready', false);
65
  form#dup-settings-form input[type=text] {width: 400px; }
66
  input#package_mysqldump_path_found {margin-top:5px}
67
  div.dup-feature-found {padding:3px; border:1px solid silver; background: #f7fcfe; border-radius: 3px; width:400px; font-size: 12px}
68
+ div.dup-feature-notfound {padding:5px; border:1px solid silver; background: #fcf3ef; border-radius: 3px; width:500px; font-size: 13px; line-height: 18px}
69
+ select#package_ui_created {font-family: monospace}
70
  </style>
71
 
72
  <form id="dup-settings-form" action="<?php echo admin_url('admin.php?page=duplicator-settings&tab=general'); ?>" method="post">
121
  <hr size="1" />
122
  <table class="form-table">
123
  <tr>
124
+ <th scope="row"><label><?php _e("Created Format", 'duplicator'); ?></label></th>
125
  <td>
126
+ <select name="package_ui_created" id="package_ui_created">
127
+ <option value="1">Y-m-d H:i &nbsp; [2000-01-05 12:00]</option>
128
+ <option value="2">Y-m-d H:i:s [2000-01-05 12:00:01]</option>
129
+ <option value="3">m-d-y H:i &nbsp; [01-05-00 12:00]</option>
130
+ <option value="4">m-d-y H:i:s [01-05-00 12:00:01]</option>
131
+ </select>
132
  <p class="description">
133
+ <?php _e("The date format shown in the 'Created' column on the Packages screen.", 'duplicator'); ?>
134
  </p>
135
  </td>
136
+ </tr>
137
  <tr>
138
+ <th scope="row"><label><?php _e("Database Script", 'duplicator'); ?></label></th>
139
  <td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  <?php if (!DUP_Util::IsShellExecAvailable()) : ?>
141
+ <input type="radio" disabled="true" />
142
+ <label><?php _e("Use mysqldump", 'duplicator'); ?></label>
143
+ <p class="description" style="width:550px; margin:5px 0 0 20px">
144
  <?php
145
+ _e("This server does not support the PHP shell_exec function which is requred for mysqldump to run. ", 'duplicator');
146
+ _e("Please contact the host or server administrator to enable this feature.", 'duplicator');
 
147
  ?>
148
  <br/>
149
  <small>
159
  ?>
160
  </i>
161
  </small>
162
+ <br/><br/>
163
  </p>
164
  <?php else : ?>
165
  <input type="radio" name="package_dbmode" value="mysql" id="package_mysqldump" <?php echo ($package_mysqldump) ? 'checked="checked"' : ''; ?> />
166
+ <label for="package_mysqldump"><?php _e("Use mysqldump", 'duplicator'); ?></label>
167
+ <i style="font-size:12px">(<?php _e("recommended", 'duplicator'); ?>)</i> <br/>
168
 
169
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
  <div style="margin:5px 0px 0px 25px">
172
  <?php if ($mysqlDumpFound) : ?>
179
  <?php
180
  _e('Mysqldump was not found at its default location or the location provided. Please enter a path to a valid location where mysqldump can run. If the problem persist contact your server administrator.', 'duplicator');
181
  ?>
182
+
183
+ <?php
184
+ printf("%s <a target='_blank' href='//snapcreek.com/wordpress-hosting/'>%s</a> %s",
185
+ __("See the", 'duplicator'),
186
+ __("host list", 'duplicator'),
187
+ __("for reliable access to mysqldump", 'duplicator'));
188
+ ?>
189
  </div><br/>
190
+
191
  <?php endif; ?>
192
 
193
+ <i class="fa fa-question-circle"
194
+ data-tooltip-title="<?php _e("mysqldump", 'duplicator'); ?>"
195
+ data-tooltip="<?php _e('An optional path to the mysqldump program. Add a custom path if the path to mysqldump is not properly detected or needs to be changed.', 'duplicator'); ?>"></i>
196
+ <label><?php _e("Custom Path:", 'duplicator'); ?></label><br/>
197
  <input type="text" name="package_mysqldump_path" id="package_mysqldump_path" value="<?php echo $package_mysqldump_path; ?> " />
198
+ <br/><br/>
199
  </div>
200
 
201
  <?php endif; ?>
202
+
203
+ <!-- PHP MODE -->
204
+ <input type="radio" name="package_dbmode" id="package_phpdump" value="php" <?php echo (! $package_mysqldump) ? 'checked="checked"' : ''; ?> />
205
+ <label for="package_phpdump"><?php _e("Use PHP Code", 'duplicator'); ?></label> &nbsp;
206
+
207
+ <div style="margin:5px 0px 0px 25px">
208
+ <i class="fa fa-question-circle"
209
+ data-tooltip-title="<?php _e("PHP Query Limit Size", 'duplicator'); ?>"
210
+ data-tooltip="<?php _e('A higher limit size will speed up the database build time, however it will use more memory. If your host has memory caps start off low.', 'duplicator'); ?>"></i>
211
+ <label for="package_phpdump_qrylimit"><?php _e("Query Limit Size", 'duplicator'); ?></label> &nbsp;
212
+ <select name="package_phpdump_qrylimit" id="package_phpdump_qrylimit">
213
+ <?php
214
+ foreach($phpdump_chunkopts as $value) {
215
+ $selected = ( $package_phpdump_qrylimit == $value ? "selected='selected'" : '' );
216
+ echo "<option {$selected} value='{$value}'>" . number_format($value) . '</option>';
217
+ }
218
+ ?>
219
+ </select>
220
+ </div><br/>
221
+
222
  </td>
223
+ </tr>
224
  <tr>
225
+ <th scope="row"><label><?php _e("Archive Flush", 'duplicator'); ?></label></th>
226
  <td>
227
+ <input type="checkbox" name="package_zip_flush" id="package_zip_flush" <?php echo ($package_zip_flush) ? 'checked="checked"' : ''; ?> />
228
+ <label for="package_zip_flush"><?php _e("Attempt Network Keep Alive", 'duplicator'); ?></label>
229
+ <i style="font-size:12px">(<?php _e("enable only for large archives", 'duplicator'); ?>)</i>
230
+ <p class="description">
231
+ <?php _e("This will attempt to keep a network connection established for large archives.", 'duplicator'); ?>
232
+ </p>
233
  </td>
234
+ </tr>
 
235
  </table>
236
 
237
  <!-- ===============================
245
  <td>
246
  <input type="checkbox" name="wpfront_integrate" id="wpfront_integrate" <?php echo ($wpfront_integrate) ? 'checked="checked"' : ''; ?> <?php echo $wpfront_ready ? '' : 'disabled'; ?> />
247
  <label for="wpfront_integrate"><?php _e("Enable User Role Editor Plugin Integration", 'duplicator'); ?></label>
 
 
248
  <p class="description">
249
  <?php printf('%s <a href="https://wordpress.org/plugins/wpfront-user-role-editor/" target="_blank">%s</a> %s'
250
  . ' <a href="https://wpfront.com/user-role-editor-pro/?ref=3" target="_blank">%s</a> %s '
258
  );
259
  ?>
260
  </p>
 
261
  </td>
262
  </tr>
263
+ <tr>
264
+ <th scope="row"><label><?php _e("Debugging", 'duplicator'); ?></label></th>
265
+ <td>
266
+ <input type="checkbox" name="package_debug" id="package_debug" <?php echo ($package_debug) ? 'checked="checked"' : ''; ?> />
267
+ <label for="package_debug"><?php _e("Enable debug options throughout user interface", 'duplicator'); ?></label>
268
+ <p class="description"><?php _e("Refresh page after saving to show/hide Debug menu", 'duplicator'); ?></p>
269
+ </td>
270
+ </tr>
271
  </table><br/>
272
 
273
  <p class="submit" style="margin: 20px 0px 0xp 5px;">
275
  <input type="submit" name="submit" id="submit" class="button-primary" value="<?php _e("Save Settings", 'duplicator') ?>" style="display: inline-block;" />
276
  </p>
277
 
278
+ </form>
279
+
280
+ <script type="text/javascript">
281
+ jQuery(document).ready(function($)
282
+ {
283
+ $('#package_ui_created').val(<?php echo $package_ui_created ?> );
284
+ });
285
+ </script>
views/tools/logging.php CHANGED
@@ -1,35 +1,34 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- require_once(DUPLICATOR_PLUGIN_PATH . '/assets/js/javascript.php');
4
- require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
5
-
6
- $logs = glob(DUPLICATOR_SSDIR_PATH . '/*.log') ;
7
- if ($logs != false && count($logs)) {
8
- usort($logs, create_function('$a,$b', 'return filemtime($b) - filemtime($a);'));
9
- @chmod(DUP_Util::SafePath($logs[0]), 0644);
10
- }
11
-
12
- $logname = (isset($_GET['logname'])) ? trim(sanitize_text_field($_GET['logname'])) : "";
13
-
14
- $refresh = (isset($_POST['refresh']) && $_POST['refresh'] == 1) ? 1 : 0;
15
- $auto = (isset($_POST['auto']) && $_POST['auto'] == 1) ? 1 : 0;
16
 
17
- //Check for invalid file
18
- if (!empty($logname)) {
19
- $validFiles = array_map('basename', $logs);
20
- if (validate_file($logname, $validFiles) > 0) {
21
- unset($logname);
22
- }
23
- unset($validFiles);
24
- }
25
-
26
- if (!isset($logname) || !$logname) {
27
- $logname = (count($logs) > 0) ? basename($logs[0]) : "";
28
- }
29
-
30
- $logurl = get_site_url(null, '', is_ssl() ? 'https' : 'http') . '/' . DUPLICATOR_SSDIR_NAME . '/' . $logname;
31
- $logfound = (strlen($logname) > 0) ? true :false;
32
-
33
  ?>
34
 
35
  <style>
@@ -39,19 +38,21 @@
39
  td#dup-log-panel-left div.name {float:left; margin: 0px 0px 5px 5px;}
40
  td#dup-log-panel-left div.opts {float:right;}
41
  td#dup-log-panel-right {vertical-align: top; padding-left:15px; max-width: 375px}
 
42
 
43
- div.dup-log-file-list a, span.dup-log{display: inline-block; white-space: nowrap; text-overflow: ellipsis; max-width: 375px; line-height:20px; overflow:hidden}
44
- div.dup-log-file-list span {font-weight: bold}
45
-
 
 
 
46
  div.dup-opts-items {border:1px solid silver; background: #efefef; padding: 5px; border-radius: 4px; margin:2px 0px 10px -2px;}
47
  label#dup-auto-refresh-lbl {display: inline-block;}
48
- iframe#dup-log-content {padding:5px; background: #fff; min-height:500px; width:99%; border:1px solid silver}
49
-
50
  </style>
51
 
52
  <script type="text/javascript">
53
- jQuery(document).ready(function($) {
54
-
55
  Duplicator.Tools.FullLog = function() {
56
  var $panelL = $('#dup-log-panel-left');
57
  var $panelR = $('#dup-log-panel-right');
@@ -88,7 +89,6 @@ jQuery(document).ready(function($) {
88
  $("#dup-log-content").css({height: height + 'px'});
89
  }
90
 
91
-
92
  var duration = 10;
93
  var count = duration;
94
  var timerInterval;
@@ -130,29 +130,24 @@ jQuery(document).ready(function($) {
130
  $("#dup-auto-refresh").prop('checked', true);
131
  Duplicator.Tools.RefreshAuto();
132
  <?php endif; ?>
133
- <?php endif; ?>
134
-
135
  });
136
-
137
  </script>
138
 
139
  <form id="dup-form-logs" method="post" action="">
140
  <input type="hidden" id="refresh" name="refresh" value="<?php echo ($refresh) ? 1 : 0 ?>" />
141
  <input type="hidden" id="auto" name="auto" value="<?php echo ($auto) ? 1 : 0 ?>" />
 
142
  <?php if (! $logfound) : ?>
143
  <div style="padding:20px">
144
  <h2><?php _e("Log file not found or unreadable", 'duplicator') ?>.</h2>
145
-
146
  <?php _e("Try to create a package, since no log files were found in the snapshots directory with the extension *.log", 'duplicator') ?>.<br/><br/>
147
-
148
  <?php _e("Reasons for log file not showing", 'duplicator') ?>: <br/>
149
  - <?php _e("The web server does not support returning .log file extentions", 'duplicator') ?>. <br/>
150
  - <?php _e("The snapshots directory does not have the correct permissions to write files. Try setting the permissions to 755", 'duplicator') ?>. <br/>
151
  - <?php _e("The process that PHP runs under does not have enough permissions to create files. Please contact your hosting provider for more details", 'duplicator') ?>. <br/>
152
  </div>
153
-
154
  <?php else: ?>
155
-
156
  <table id="dup-log-panels">
157
  <tr>
158
  <td id="dup-log-panel-left">
@@ -177,38 +172,37 @@ jQuery(document).ready(function($) {
177
  <td id="dup-log-panel-right">
178
  <h2><?php _e("Options", 'duplicator') ?> </h2>
179
  <div class="dup-opts-items">
180
- <input type="button" class="button" id="dup-refresh" value="<?php _e("Refresh", 'duplicator') ?>" /> &nbsp;
181
- <div style="display:inline-block; margin-top:5px">
182
- <input type='checkbox' id="dup-auto-refresh" style="margin-top:1px" />
183
- <label id="dup-auto-refresh-lbl" for="dup-auto-refresh">
184
-
185
- <?php _e("Auto Refresh", 'duplicator') ?>
186
- [<div id="dup-refresh-count"></div>]
187
- </label>
188
- </div>
189
  </div>
190
 
191
- <b><?php _e("Last 20 Logs", 'duplicator') ?> </b><br/>
 
 
 
192
 
193
  <div class="dup-log-file-list">
194
  <?php
195
  $count=0;
196
  $active = basename($logurl);
197
  foreach ($logs as $log) {
198
- $time = date('h:i:s m/d/y', filemtime($log));
199
  $name = esc_html(basename($log));
200
  $url = '?page=duplicator-tools&logname=' . $name;
201
  echo ($active == $name)
202
- ? "<span class='dup-log' title='{$name}'>{$time} - {$name}</span><br/>"
203
- : "<a href='javascript:void(0)' title='{$name}' onclick='Duplicator.Tools.GetLog(\"{$url}\")'>{$time} - {$name}</a><br/>";
204
  if ($count > 20) break;
205
  }
206
  ?>
207
  </div>
208
  </td>
209
  </tr>
210
- </table>
211
-
212
  <?php endif; ?>
213
  </form>
214
 
1
  <?php
2
+ require_once(DUPLICATOR_PLUGIN_PATH . '/assets/js/javascript.php');
3
+ require_once(DUPLICATOR_PLUGIN_PATH . '/views/inc.header.php');
4
+
5
+ $logs = glob(DUPLICATOR_SSDIR_PATH . '/*.log') ;
6
+ if ($logs != false && count($logs))
7
+ {
8
+ usort($logs, create_function('$a,$b', 'return filemtime($b) - filemtime($a);'));
9
+ @chmod(DUP_Util::SafePath($logs[0]), 0644);
10
+ }
11
+
12
+ $logname = (isset($_GET['logname'])) ? trim(sanitize_text_field($_GET['logname'])) : "";
13
+ $refresh = (isset($_POST['refresh']) && $_POST['refresh'] == 1) ? 1 : 0;
14
+ $auto = (isset($_POST['auto']) && $_POST['auto'] == 1) ? 1 : 0;
15
+
16
+ //Check for invalid file
17
+ if (!empty($logname))
18
+ {
19
+ $validFiles = array_map('basename', $logs);
20
+ if (validate_file($logname, $validFiles) > 0) {
21
+ unset($logname);
22
+ }
23
+ unset($validFiles);
24
+ }
25
 
26
+ if (!isset($logname) || !$logname) {
27
+ $logname = (count($logs) > 0) ? basename($logs[0]) : "";
28
+ }
 
 
 
 
 
 
 
 
 
 
29
 
30
+ $logurl = get_site_url(null, '', is_ssl() ? 'https' : 'http') . '/' . DUPLICATOR_SSDIR_NAME . '/' . $logname;
31
+ $logfound = (strlen($logname) > 0) ? true :false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  ?>
33
 
34
  <style>
38
  td#dup-log-panel-left div.name {float:left; margin: 0px 0px 5px 5px;}
39
  td#dup-log-panel-left div.opts {float:right;}
40
  td#dup-log-panel-right {vertical-align: top; padding-left:15px; max-width: 375px}
41
+ iframe#dup-log-content {padding:5px; background: #fff; min-height:500px; width:99%; border:1px solid silver}
42
 
43
+ /* OPTIONS */
44
+ div.dup-log-hdr {font-weight: bold; font-size:16px; padding:2px; }
45
+ div.dup-log-hdr small{font-weight:normal; font-style: italic}
46
+ div.dup-log-file-list {font-family:monospace;}
47
+ div.dup-log-file-list a, span.dup-log{display: inline-block; white-space: nowrap; text-overflow: ellipsis; max-width: 375px; overflow:hidden}
48
+ div.dup-log-file-list span {color:green}
49
  div.dup-opts-items {border:1px solid silver; background: #efefef; padding: 5px; border-radius: 4px; margin:2px 0px 10px -2px;}
50
  label#dup-auto-refresh-lbl {display: inline-block;}
 
 
51
  </style>
52
 
53
  <script type="text/javascript">
54
+ jQuery(document).ready(function($)
55
+ {
56
  Duplicator.Tools.FullLog = function() {
57
  var $panelL = $('#dup-log-panel-left');
58
  var $panelR = $('#dup-log-panel-right');
89
  $("#dup-log-content").css({height: height + 'px'});
90
  }
91
 
 
92
  var duration = 10;
93
  var count = duration;
94
  var timerInterval;
130
  $("#dup-auto-refresh").prop('checked', true);
131
  Duplicator.Tools.RefreshAuto();
132
  <?php endif; ?>
133
+ <?php endif; ?>
 
134
  });
 
135
  </script>
136
 
137
  <form id="dup-form-logs" method="post" action="">
138
  <input type="hidden" id="refresh" name="refresh" value="<?php echo ($refresh) ? 1 : 0 ?>" />
139
  <input type="hidden" id="auto" name="auto" value="<?php echo ($auto) ? 1 : 0 ?>" />
140
+
141
  <?php if (! $logfound) : ?>
142
  <div style="padding:20px">
143
  <h2><?php _e("Log file not found or unreadable", 'duplicator') ?>.</h2>
 
144
  <?php _e("Try to create a package, since no log files were found in the snapshots directory with the extension *.log", 'duplicator') ?>.<br/><br/>
 
145
  <?php _e("Reasons for log file not showing", 'duplicator') ?>: <br/>
146
  - <?php _e("The web server does not support returning .log file extentions", 'duplicator') ?>. <br/>
147
  - <?php _e("The snapshots directory does not have the correct permissions to write files. Try setting the permissions to 755", 'duplicator') ?>. <br/>
148
  - <?php _e("The process that PHP runs under does not have enough permissions to create files. Please contact your hosting provider for more details", 'duplicator') ?>. <br/>
149
  </div>
 
150
  <?php else: ?>
 
151
  <table id="dup-log-panels">
152
  <tr>
153
  <td id="dup-log-panel-left">
172
  <td id="dup-log-panel-right">
173
  <h2><?php _e("Options", 'duplicator') ?> </h2>
174
  <div class="dup-opts-items">
175
+ <input type="button" class="button button-small" id="dup-refresh" value="<?php _e("Refresh", 'duplicator') ?>" /> &nbsp;
176
+ <input type='checkbox' id="dup-auto-refresh" style="margin-top:1px" />
177
+ <label id="dup-auto-refresh-lbl" for="dup-auto-refresh">
178
+ <?php _e("Auto Refresh", 'duplicator') ?>
179
+ [<div id="dup-refresh-count"></div>]
180
+ </label>
 
 
 
181
  </div>
182
 
183
+ <div class="dup-log-hdr">
184
+ <?php _e("Package Logs", 'duplicator') ?>
185
+ <small><?php _e("Top 20", 'duplicator') ?></small>
186
+ </div>
187
 
188
  <div class="dup-log-file-list">
189
  <?php
190
  $count=0;
191
  $active = basename($logurl);
192
  foreach ($logs as $log) {
193
+ $time = date('m/d/y h:i:s', filemtime($log));
194
  $name = esc_html(basename($log));
195
  $url = '?page=duplicator-tools&logname=' . $name;
196
  echo ($active == $name)
197
+ ? "<span class='dup-log' title='{$name}'>{$time}-{$name}</span>"
198
+ : "<a href='javascript:void(0)' title='{$name}' onclick='Duplicator.Tools.GetLog(\"{$url}\")'>{$time}-{$name}</a>";
199
  if ($count > 20) break;
200
  }
201
  ?>
202
  </div>
203
  </td>
204
  </tr>
205
+ </table>
 
206
  <?php endif; ?>
207
  </form>
208