@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper. |
| 3 | -$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; |
|
| 4 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded |
|
| 5 | -if (! empty($_GET['pageref']) || ! empty($_GET['pagealiasalt']) || ! empty($_GET['pageid'])) { |
|
| 3 | +$websitekey = basename(__DIR__); if (empty($websitepagefile)) $websitepagefile = __FILE__; |
|
| 4 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded |
|
| 5 | +if (!empty($_GET['pageref']) || !empty($_GET['pagealiasalt']) || !empty($_GET['pageid'])) { |
|
| 6 | 6 | require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
| 7 | 7 | require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
| 8 | 8 | redirectToContainer($_GET['pageref'], $_GET['pagealiasalt'], $_GET['pageid']); |
@@ -1,6 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // BEGIN PHP File generated to provide an index.php as Home Page or alias redirector - DO NOT MODIFY - It is just a generated wrapper. |
| 3 | -$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; |
|
| 3 | +$websitekey=basename(__DIR__); if (empty($websitepagefile)) { |
|
| 4 | + $websitepagefile=__FILE__; |
|
| 5 | +} |
|
| 4 | 6 | if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once './master.inc.php'; } // Load master if not already loaded |
| 5 | 7 | if (! empty($_GET['pageref']) || ! empty($_GET['pagealiasalt']) || ! empty($_GET['pageid'])) { |
| 6 | 8 | require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
@@ -1,4 +1,8 @@ |
||
| 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 '../page22.tpl.php'; else require $dolibarr_main_data_root.'/website/'.$website->ref.'/page22.tpl.php'; |
|
| 4 | +if (empty($dolibarr_main_data_root)) { |
|
| 5 | + require '../page22.tpl.php'; |
|
| 6 | +} else { |
|
| 7 | + require $dolibarr_main_data_root.'/website/'.$website->ref.'/page22.tpl.php'; |
|
| 8 | +} |
|
@@ -1,4 +1,8 @@ |
||
| 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 | +} |
|
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
|
| 4 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
|
| 4 | + if (!defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 5 | 5 | require_once '/home/ldestailleur/git/dolibarr_dev/htdocs/master.inc.php'; |
| 6 | 6 | } |
@@ -1,6 +1,8 @@ |
||
| 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 | } |
@@ -1,4 +1,8 @@ |
||
| 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 | +} |
|
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | -$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; |
|
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
|
| 2 | +$websitekey = basename(__DIR__); if (empty($websitepagefile)) $websitepagefile = __FILE__; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
|
| 4 | 4 | $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; |
| 5 | 5 | require_once $pathdepth ? str_repeat('../', $pathdepth) : './'.'master.inc.php'; |
| 6 | 6 | } // Not already loaded |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | <div class="center"> |
| 65 | 65 | <?php |
| 66 | 66 | $keyword = ''; |
| 67 | - $weblangs->loadLangs(array("main","website")); |
|
| 67 | + $weblangs->loadLangs(array("main", "website")); |
|
| 68 | 68 | $fuser = new User($db); |
| 69 | - $arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', 5, 0, array('type_container'=>'blogpost', 'status'=>1, 'lang'=>'null,'.$websitepage->lang)); // , 'keywords'=>$keyword |
|
| 69 | + $arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', 5, 0, array('type_container'=>'blogpost', 'status'=>1, 'lang'=>'null,'.$websitepage->lang)); // , 'keywords'=>$keyword |
|
| 70 | 70 | if (is_numeric($arrayofblogs) && $arrayofblogs < 0) { |
| 71 | 71 | print '<div class="error">'.$weblangs->trans($websitepage->error).'</div>'; |
| 72 | - } elseif (is_array($arrayofblogs) && ! empty($arrayofblogs)) { |
|
| 72 | + } elseif (is_array($arrayofblogs) && !empty($arrayofblogs)) { |
|
| 73 | 73 | foreach ($arrayofblogs as $blog) { |
| 74 | 74 | print '<div class="row justify-content-sm-center row-40">'; |
| 75 | 75 | print '<div class="container blog-box centpercent" style="padding: 20px; transition: .3s all ease;">'; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | print '<ul class="list-inline list-inline-dashed text-uppercase">'; |
| 81 | 81 | print '<li>'.dol_print_date($blog->date_creation, 'daytext', 'tzserver', $weblangs).'</li>'; |
| 82 | 82 | $fuser->fetch($blog->fk_user_creat); |
| 83 | - print '<li><span>by<span> <span class="text-primary">'.($fuser->firstname?$fuser->firstname:$fuser->login).'</span></span></li>'; |
|
| 83 | + print '<li><span>by<span> <span class="text-primary">'.($fuser->firstname ? $fuser->firstname : $fuser->login).'</span></span></li>'; |
|
| 84 | 84 | print '</ul>'; |
| 85 | 85 | print '</div>'; |
| 86 | 86 | //includeContainer($blog->pageurl); |
@@ -1,5 +1,7 @@ discard block |
||
| 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 |
||
| 26 | 28 | <!-- Include link to JS file --> |
| 27 | 29 | <script 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> |
@@ -1,7 +1,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
@@ -1,5 +1,9 @@ |
||
| 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 | ?> |
@@ -71,32 +71,32 @@ |
||
| 71 | 71 | <br> |
| 72 | 72 | |
| 73 | 73 | <?php |
| 74 | - $weblangs->load("main"); |
|
| 74 | + $weblangs->load("main"); |
|
| 75 | 75 | |
| 76 | - if (function_exists('getPagesFromSearchCriterias')) |
|
| 77 | - { |
|
| 78 | - if (GETPOSTISSET('s')) |
|
| 79 | - { |
|
| 80 | - $listofpages = getPagesFromSearchCriterias('page', 'meta', GETPOST('s', 'alphanohtml')); |
|
| 81 | - if ($listofpages['code'] == 'OK') |
|
| 82 | - { |
|
| 83 | - foreach($listofpages['list'] as $websitepagefound) |
|
| 84 | - { |
|
| 85 | - print '<div class="rowsearchresult"><a href="'.$websitepagefound->ref.'.php">'.$websitepagefound->title.'</a> - '.$websitepagefound->description.'</div>'; |
|
| 86 | - } |
|
| 87 | - } |
|
| 88 | - else |
|
| 89 | - { |
|
| 90 | - // If error, show message |
|
| 91 | - print $listofpages['message']; |
|
| 92 | - } |
|
| 93 | - } |
|
| 94 | - } |
|
| 95 | - else |
|
| 96 | - { |
|
| 97 | - print $weblangs->trans("FeatureNotYetAvailable"); |
|
| 98 | - } |
|
| 99 | - ?> |
|
| 76 | + if (function_exists('getPagesFromSearchCriterias')) |
|
| 77 | + { |
|
| 78 | + if (GETPOSTISSET('s')) |
|
| 79 | + { |
|
| 80 | + $listofpages = getPagesFromSearchCriterias('page', 'meta', GETPOST('s', 'alphanohtml')); |
|
| 81 | + if ($listofpages['code'] == 'OK') |
|
| 82 | + { |
|
| 83 | + foreach($listofpages['list'] as $websitepagefound) |
|
| 84 | + { |
|
| 85 | + print '<div class="rowsearchresult"><a href="'.$websitepagefound->ref.'.php">'.$websitepagefound->title.'</a> - '.$websitepagefound->description.'</div>'; |
|
| 86 | + } |
|
| 87 | + } |
|
| 88 | + else |
|
| 89 | + { |
|
| 90 | + // If error, show message |
|
| 91 | + print $listofpages['message']; |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | + } |
|
| 95 | + else |
|
| 96 | + { |
|
| 97 | + print $weblangs->trans("FeatureNotYetAvailable"); |
|
| 98 | + } |
|
| 99 | + ?> |
|
| 100 | 100 | |
| 101 | 101 | <br><br><br><br><br><br> |
| 102 | 102 | </center> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | -$websitekey=basename(__DIR__); if (empty($websitepagefile)) $websitepagefile=__FILE__; |
|
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
|
| 2 | +$websitekey = basename(__DIR__); if (empty($websitepagefile)) $websitepagefile = __FILE__; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
|
| 4 | 4 | $pathdepth = count(explode('/', $_SERVER['SCRIPT_NAME'])) - 2; |
| 5 | 5 | require_once ($pathdepth ? str_repeat('../', $pathdepth) : './').'master.inc.php'; |
| 6 | 6 | } // Not already loaded |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $listofpages = getPagesFromSearchCriterias('page', 'meta', GETPOST('s', 'alphanohtml')); |
| 81 | 81 | if ($listofpages['code'] == 'OK') |
| 82 | 82 | { |
| 83 | - foreach($listofpages['list'] as $websitepagefound) |
|
| 83 | + foreach ($listofpages['list'] as $websitepagefound) |
|
| 84 | 84 | { |
| 85 | 85 | print '<div class="rowsearchresult"><a href="'.$websitepagefound->ref.'.php">'.$websitepagefound->title.'</a> - '.$websitepagefound->description.'</div>'; |
| 86 | 86 | } |
@@ -1,5 +1,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |