Remove deprecated code. Now usage of smarty is simpler (no need to declare things in config file)

This commit is contained in:
Laurent Destailleur 2009-10-20 17:53:24 +00:00
parent 6e43cda408
commit 7d46652453
4 changed files with 9 additions and 11 deletions

View File

@ -58,7 +58,7 @@ class modDroitPret extends DolibarrModules
$this->special = 3;
// Dir
$this->dirs = array('/smarty/cache','/smarty/template');
$this->dirs = array('/smarty/cache/temp','/smarty/templates/temp');
// Dependances
$this->depends = array();

View File

@ -60,7 +60,7 @@ class modEditeur extends DolibarrModules
$this->picto='book';
// Data directories to create when module is enabled
$this->dirs = array('/smarty/cache','/smarty/template');
$this->dirs = array('/smarty/cache/temp','/smarty/templates/temp');
// Config pages
$this->config_page_url = array("editeur.php");

View File

@ -150,19 +150,18 @@ print $langs->trans("Examples").":<br>";
<?php echo $langs->trans("URLRoot"); ?>
</b></td><td valign="top" class="label"><input type="text" size="60" name="main_url" value="
<?php
if (isset($main_url) && $main_url)
$dolibarr_main_url_root=$main_url;
if (! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0)
if (! empty($main_url)) $dolibarr_main_url_root=$main_url;
if (empty($dolibarr_main_url_root))
{
# If defined (Ex: Apache sous Linux)
# If defined (Ie: Apache with Linux)
if (isset($_SERVER["SCRIPT_URI"])) {
$dolibarr_main_url_root=$_SERVER["SCRIPT_URI"];
}
# If defined (Ex: Apache sous Caudium)
# If defined (Ie: Apache with Caudium)
elseif (isset($_SERVER["SERVER_URL"]) && isset($_SERVER["DOCUMENT_URI"])) {
$dolibarr_main_url_root=$_SERVER["SERVER_URL"].$_SERVER["DOCUMENT_URI"];
}
# Si SCRIPT_URI, SERVER_URL, DOCUMENT_URI non d<>fini (Ex: Apache 2.0.44 pour Windows)
# If SCRIPT_URI, SERVER_URL, DOCUMENT_URI not defined (Ie: Apache 2.0.44 for Windows)
else
{
$proto='http';

View File

@ -83,10 +83,9 @@ if (empty($dolibarr_main_data_root))
// Define some constants
define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem pages php (htdocs)
define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem donnes (documents)
if ($dolibarr_main_url_root == 'auto')
if ($dolibarr_main_url_root == 'auto' && ! empty($_SERVER["SCRIPT_URL"]) && ! empty($_SERVER["SCRIPT_URI"]))
{
// TODO Try to define dolibarr_main_url_root with non root installation
$dolibarr_main_url_root=$_SERVER["SERVER_NAME"]; // This make possible to reach web site with different URLs (works only if dolibarr dir is virtual web root dir).
$dolibarr_main_url_root=eregi_replace($_SERVER["SCRIPT_URL"].'$','',$_SERVER["SCRIPT_URI"]);
}
define('DOL_MAIN_URL_ROOT', $dolibarr_main_url_root); // URL relative root
$uri=eregi_replace('^http(s?)://','',$dolibarr_main_url_root); // $suburi contains url without http*