Completed
Branch develop (a99e44)
by
unknown
15:19
created
install/doctemplates/websites/website_template-stellar/containers/menu.php 1 patch
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page
3 3
 global $dolibarr_main_data_root;
4
-if (empty($dolibarr_main_data_root)) require '../page24.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page24.tpl.php';
4
+if (empty($dolibarr_main_data_root)) {
5
+	require '../page24.tpl.php';
6
+} else {
7
+	require $dolibarr_main_data_root.'/website/'.$website->ref.'/page24.tpl.php';
8
+}
Please login to merge, or discard this patch.
doctemplates/websites/website_template-stellar/containers/master.inc.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 // File generated to link to the master file - DO NOT MODIFY - It is just an include
3 3
 if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {
4
-	if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1);
4
+	if (! defined('USEEXTERNALSERVER')) {
5
+		define('USEEXTERNALSERVER', 1);
6
+	}
5 7
 	require_once '/home/ldestailleur/git/dolibarr_dev/htdocs/master.inc.php';
6 8
 }
Please login to merge, or discard this patch.
websites/website_template-stellar/containers/this-is-a-blog-post.php 1 patch
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page
3 3
 global $dolibarr_main_data_root;
4
-if (empty($dolibarr_main_data_root)) require './page25.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page25.tpl.php';
4
+if (empty($dolibarr_main_data_root)) {
5
+	require './page25.tpl.php';
6
+} else {
7
+	require $dolibarr_main_data_root.'/website/'.$website->ref.'/page25.tpl.php';
8
+}
Please login to merge, or discard this patch.
doctemplates/websites/website_template-stellar/containers/wrapper.php 1 patch
Braces   +57 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,7 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // BEGIN PHP File wrapper.php - DO NOT MODIFY - It is just a copy of file website/samples/wrapper.php
3 3
 $websitekey = basename(__DIR__);
4
-if (strpos($_SERVER["PHP_SELF"], 'website/samples/wrapper.php')) die("Sample file for website module. Can be called directly.");
4
+if (strpos($_SERVER["PHP_SELF"], 'website/samples/wrapper.php')) {
5
+	die("Sample file for website module. Can be called directly.");
6
+}
5 7
 if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded
6 8
 include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
7 9
 
@@ -17,7 +19,9 @@  discard block
 block discarded – undo
17 19
 
18 20
 // Parameters for RSS
19 21
 $rss = GETPOST('rss', 'aZ09');
20
-if ($rss) $original_file = 'blog.rss';
22
+if ($rss) {
23
+	$original_file = 'blog.rss';
24
+}
21 25
 
22 26
 // If we have a hash public (hashp), we guess the original_file.
23 27
 if (!empty($hashp)) {
@@ -52,14 +56,23 @@  discard block
 block discarded – undo
52 56
 
53 57
 // Define attachment (attachment=true to force choice popup 'open'/'save as')
54 58
 $attachment = true;
55
-if (preg_match('/\.(html|htm)$/i', $original_file)) $attachment = false;
56
-if (isset($_GET["attachment"])) $attachment = (GETPOST("attachment", 'alphanohtml') ? true : false);
57
-if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS_WEBSITE)) $attachment = false;
59
+if (preg_match('/\.(html|htm)$/i', $original_file)) {
60
+	$attachment = false;
61
+}
62
+if (isset($_GET["attachment"])) {
63
+	$attachment = (GETPOST("attachment", 'alphanohtml') ? true : false);
64
+}
65
+if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS_WEBSITE)) {
66
+	$attachment = false;
67
+}
58 68
 
59 69
 // Define mime type
60 70
 $type = 'application/octet-stream';
61
-if (GETPOSTISSET('type')) $type = GETPOST('type', 'alpha');
62
-else $type = dol_mimetype($original_file);
71
+if (GETPOSTISSET('type')) {
72
+	$type = GETPOST('type', 'alpha');
73
+} else {
74
+	$type = dol_mimetype($original_file);
75
+}
63 76
 
64 77
 // Security: Delete string ../ into $original_file
65 78
 $original_file = str_replace("../", "/", $original_file);
@@ -90,7 +103,9 @@  discard block
 block discarded – undo
90 103
 	$website->fetch('', $websitekey);
91 104
 
92 105
 	$filters = array('type_container'=>'blogpost');
93
-	if ($l) $filters['lang'] = $l;
106
+	if ($l) {
107
+		$filters['lang'] = $l;
108
+	}
94 109
 
95 110
 	$MAXNEWS = ($limit ? $limit : 20);
96 111
 	$arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, $filters);
@@ -143,8 +158,9 @@  discard block
 block discarded – undo
143 158
 		$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
144 159
 
145 160
 		if ($result >= 0) {
146
-			if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) $result = 1;
147
-			else {
161
+			if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) {
162
+				$result = 1;
163
+			} else {
148 164
 				$error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile;
149 165
 				dol_syslog("build_exportfile ".$error, LOG_ERR);
150 166
 				dol_delete_file($outputfiletmp, 0, 1);
@@ -162,26 +178,39 @@  discard block
 block discarded – undo
162 178
 
163 179
 	if ($result >= 0) {
164 180
 		$attachment = false;
165
-		if (isset($_GET["attachment"])) $attachment = $_GET["attachment"];
181
+		if (isset($_GET["attachment"])) {
182
+			$attachment = $_GET["attachment"];
183
+		}
166 184
 		//$attachment = false;
167 185
 		$contenttype = 'application/rss+xml';
168
-		if (isset($_GET["contenttype"])) $contenttype = $_GET["contenttype"];
186
+		if (isset($_GET["contenttype"])) {
187
+			$contenttype = $_GET["contenttype"];
188
+		}
169 189
 		//$contenttype='text/plain';
170 190
 		$outputencoding = 'UTF-8';
171 191
 
172
-		if ($contenttype)       header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : ''));
173
-		if ($attachment) 		header('Content-Disposition: attachment; filename="'.$filename.'"');
192
+		if ($contenttype) {
193
+			header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : ''));
194
+		}
195
+		if ($attachment) {
196
+			header('Content-Disposition: attachment; filename="'.$filename.'"');
197
+		}
174 198
 
175 199
 		// Ajout directives pour resoudre bug IE
176 200
 		//header('Cache-Control: Public, must-revalidate');
177 201
 		//header('Pragma: public');
178
-		if ($cachedelay) header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate');
179
-		else header('Cache-Control: private, must-revalidate');
202
+		if ($cachedelay) {
203
+			header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate');
204
+		} else {
205
+			header('Cache-Control: private, must-revalidate');
206
+		}
180 207
 
181 208
 		// Clean parameters
182 209
 		$outputfile = $dir_temp.'/'.$filename;
183 210
 		$result = readfile($outputfile);
184
-		if (!$result) print 'File '.$outputfile.' was empty.';
211
+		if (!$result) {
212
+			print 'File '.$outputfile.' was empty.';
213
+		}
185 214
 
186 215
 		// header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
187 216
 		exit;
@@ -227,13 +256,20 @@  discard block
 block discarded – undo
227 256
 	//top_httphead($type);
228 257
 	header('Content-Type: '.$type);
229 258
 	header('Content-Description: File Transfer');
230
-	if ($encoding)   header('Content-Encoding: '.$encoding);
259
+	if ($encoding) {
260
+		header('Content-Encoding: '.$encoding);
261
+	}
231 262
 	// Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open)
232
-	if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"');
233
-	else header('Content-Disposition: inline; filename="'.$filename.'"');
263
+	if ($attachment) {
264
+		header('Content-Disposition: attachment; filename="'.$filename.'"');
265
+	} else {
266
+		header('Content-Disposition: inline; filename="'.$filename.'"');
267
+	}
234 268
 	header('Content-Length: '.dol_filesize($fullpath_original_file));
235 269
 
236 270
 	readfile($fullpath_original_file_osencoded);
237 271
 }
238
-if (is_object($db)) $db->close();
272
+if (is_object($db)) {
273
+	$db->close();
274
+}
239 275
 // END PHP
Please login to merge, or discard this patch.
doctemplates/websites/website_template-corporate/containers/home.php 1 patch
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page
3 3
 global $dolibarr_main_data_root;
4
-if (empty($dolibarr_main_data_root)) require './page189.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page189.tpl.php';
4
+if (empty($dolibarr_main_data_root)) {
5
+	require './page189.tpl.php';
6
+} else {
7
+	require $dolibarr_main_data_root.'/website/'.$website->ref.'/page189.tpl.php';
8
+}
5 9
 ?>
Please login to merge, or discard this patch.
doctemplates/websites/website_template-corporate/containers/page195.tpl.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php // BEGIN PHP
2
-$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__;
2
+$websitekey=basename(__DIR__); if (empty($websitepagefile)) {
3
+	$websitepagefile=__FILE__;
4
+}
3 5
 if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {
4 6
 	$pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2;
5 7
 	require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php';
@@ -26,7 +28,10 @@  discard block
 block discarded – undo
26 28
 <!-- Include link to JS file -->
27 29
 <script async src="/javascript.js.php"></script>
28 30
 <!-- Include HTML header from common file -->
29
-<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; ?>
31
+<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) {
32
+	include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html";
33
+}
34
+?>
30 35
 <!-- Include HTML header from page header block -->
31 36
 
32 37
 </head>
@@ -84,15 +89,13 @@  discard block
 block discarded – undo
84 89
                  {
85 90
                     print '<div class="rowsearchresult"><a href="'.$websitepagefound->ref.'.php">'.$websitepagefound->title.'</a> - '.$websitepagefound->description.'</div>';
86 91
                  }
87
-             }
88
-             else
92
+             } else
89 93
              {
90 94
                  // If error, show message
91 95
                  print $listofpages['message'];
92 96
              }
93 97
          }
94
-     }
95
-     else
98
+     } else
96 99
      {
97 100
          print $weblangs->trans("FeatureNotYetAvailable");
98 101
      }
Please login to merge, or discard this patch.
doctemplates/websites/website_template-corporate/containers/contact.php 1 patch
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page
3 3
 global $dolibarr_main_data_root;
4
-if (empty($dolibarr_main_data_root)) require './page185.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page185.tpl.php';
4
+if (empty($dolibarr_main_data_root)) {
5
+	require './page185.tpl.php';
6
+} else {
7
+	require $dolibarr_main_data_root.'/website/'.$website->ref.'/page185.tpl.php';
8
+}
5 9
 ?>
Please login to merge, or discard this patch.
containers/blog-our-new-web-site-has-been-launched.php 1 patch
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page
3 3
 global $dolibarr_main_data_root;
4
-if (empty($dolibarr_main_data_root)) require './page181.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page181.tpl.php';
4
+if (empty($dolibarr_main_data_root)) {
5
+	require './page181.tpl.php';
6
+} else {
7
+	require $dolibarr_main_data_root.'/website/'.$website->ref.'/page181.tpl.php';
8
+}
5 9
 ?>
Please login to merge, or discard this patch.
doctemplates/websites/website_template-corporate/containers/footer.php 1 patch
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 // File generated to wrap the alias page - DO NOT MODIFY - It is just a wrapper to real page
3 3
 global $dolibarr_main_data_root;
4
-if (empty($dolibarr_main_data_root)) require './page187.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page187.tpl.php';
4
+if (empty($dolibarr_main_data_root)) {
5
+	require './page187.tpl.php';
6
+} else {
7
+	require $dolibarr_main_data_root.'/website/'.$website->ref.'/page187.tpl.php';
8
+}
5 9
 ?>
Please login to merge, or discard this patch.