Fixed image.php initialization and remove unsed code

This commit is contained in:
Benjamin Renard 2013-06-19 03:00:58 +02:00
parent a56b1636ab
commit 89a46b0c75
3 changed files with 2 additions and 18 deletions

View file

@ -21,7 +21,7 @@
******************************************************************************/
require_once 'core.php';
if(LSsession :: startLSsession()) {
if(LSsession :: initialize()) {
if (isset($_GET['i'])) {
$img_path=LStemplate :: getImagePath($_GET['i']);
if (is_file($img_path)) {

View file

@ -133,7 +133,7 @@ class LSsession {
*/
private static function startLStemplate() {
if ( self :: loadLSclass('LStemplate') ) {
$res = LStemplate :: start(
return LStemplate :: start(
array(
'smarty_path' => LSconfig :: get('Smarty'),
'template_dir' => LS_TEMPLATES_DIR,
@ -143,8 +143,6 @@ class LSsession {
'debug_smarty' => (isset($_REQUEST['LStemplate_debug'])),
)
);
self :: addJSconfigParam('LS_IMAGES_DIR',LStemplate :: getDefaultImageDirPath());
return $res;
}
return False;
}

View file

@ -117,7 +117,6 @@ class LStemplate {
}
self :: $_smarty -> assign('LS_CSS_DIR',LS_CSS_DIR);
self :: $_smarty -> assign('LS_IMAGES_DIR',self :: getDefaultImageDirPath());
return True;
}
@ -148,19 +147,6 @@ class LStemplate {
return $root_dir.'/'.$default_dir.'/'.$file;
}
/**
* Return the default path of images directory
*
* @retval string The path of the file
**/
public static function getDefaultImageDirPath() {
if (is_dir(self :: $config['image_dir'].'/'.LS_THEME)) {
return self :: $config['image_dir'].'/'.LS_THEME;
}
return self :: $config['image_dir'].'/default';
}
/**
* Return the path of the image file to use
*