Skip to content

Commit

Permalink
Merge branch 'CM/theme' into constantMurphy
Browse files Browse the repository at this point in the history
Conflicts:
	Plugin.class.php
	common.php
	install.php
  • Loading branch information
Sbgodin committed Mar 25, 2014
2 parents d575fcc + 033a580 commit 39d57a0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function __construct(){
}

public static function includeAll(){
global $i18n, $i18n_js, $language;
global $i18n, $i18n_js, $language, $theme;
$pluginFiles = Plugin::getFiles(true);
if(is_array($pluginFiles)) {
foreach($pluginFiles as $pluginFile) {
Expand All @@ -24,7 +24,7 @@ public static function includeAll(){
// Inclusion du coeur de plugin
include $pluginFile;
// Gestion des css du plugin en fonction du thème actif
$cssTheme = glob(dirname($pluginFile).'/*/'.DEFAULT_THEME.'.css');
$cssTheme = glob(dirname($pluginFile).'/*/'.$theme.'.css');
$cssDefault = glob(dirname($pluginFile).'/*/default.css');
if(isset($cssTheme[0])){
$GLOBALS['hooks']['css_files'][] = Functions::relativePath(str_replace('\\','/',dirname(__FILE__)),str_replace('\\','/',$cssTheme[0]));
Expand Down Expand Up @@ -363,4 +363,4 @@ function setType($type){

}

?>
?>
6 changes: 3 additions & 3 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
if (!$commandLine)
echo '<html>
<head>
<link rel="stylesheet" href="./templates/'.DEFAULT_THEME.'/css/style.css">
<link rel="stylesheet" href="./templates/'.$theme.'/css/style.css">
</head>
<body>
<div class="sync">';
Expand Down Expand Up @@ -252,7 +252,7 @@

case 'importForm':
if($myUser==false) exit(_t('YOU_MUST_BE_CONNECTED_ACTION'));
echo '<html style="height:auto;"><link rel="stylesheet" href="templates/'.DEFAULT_THEME.'/css/style.css">
echo '<html style="height:auto;"><link rel="stylesheet" href="templates/'.$theme.'/css/style.css">
<body style="height:auto;">
<form action="action.php?action=importFeed" method="POST" enctype="multipart/form-data">
<p>'._t('OPML_FILE').' : <input name="newImport" type="file"/> <button name="importButton">'._t('IMPORT').'</button></p>
Expand All @@ -266,7 +266,7 @@

case 'synchronizeForm':
if(isset($myUser) && $myUser!=false){
echo '<link rel="stylesheet" href="templates/'.DEFAULT_THEME.'/css/style.css">
echo '<link rel="stylesheet" href="templates/'.$theme.'/css/style.css">
<a class="button" href="action.php?action=synchronize">'._t('SYNCHRONIZE_NOW').'</a>
<p>'._t('SYNCHRONIZE_COFFEE_TIME').'</p>
Expand Down
3 changes: 2 additions & 1 deletion common.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ class_exists('Opml') or require_once('Opml.class.php');
}
// Faut-il supprimer la variable /langu?age/ de 'constant.php'?
$theme = $configurationManager->get('theme');

//Instanciation du template
$tpl = new RainTPL();
//Definition des dossiers de template
raintpl::configure("base_url", null );
raintpl::configure("tpl_dir", './templates/'.DEFAULT_THEME.'/' );
raintpl::configure("tpl_dir", './templates/'.$theme.'/' );
raintpl::configure("cache_dir", "./cache/tmp/" );

i18n_init($language);
Expand Down
5 changes: 2 additions & 3 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@
define('MYSQL_BDD','{$mysqlBase}');
//Prefix des noms des tables leed pour les bases de données uniques
define('MYSQL_PREFIX','{$mysqlPrefix}');
//Theme graphique
define('DEFAULT_THEME','marigolds');
?>";

file_put_contents('constant.php', $constant);
Expand Down Expand Up @@ -196,11 +194,12 @@ class_exists('Update') or require_once('Update.class.php');
$configurationManager->add('language', $_POST['install_changeLngLeed']);
$configurationManager->add('optionFeedIsVerbose',1);
$configurationManager->add('paginationScale',5);
$configurationManager->add('syncGradCount','10');
$configurationManager->add('synchronisationCode',$synchronisationCode);
$configurationManager->add('synchronisationEnableCache','0');
$configurationManager->add('synchronisationForceFeed','0');
$configurationManager->add('synchronisationType','auto');
$configurationManager->add('syncGradCount','10');
$configurationManager->add('theme','marigolds');
$configurationManager->add('root',$root);

$install_terminee=true;
Expand Down
15 changes: 15 additions & 0 deletions updates/00004-variableTheme-20140309.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--######################################################################################################
--#####
--##### MISE À JOUR Base de données de Leed
--##### Date : 09/03/2014
--##### Version Leed : v1.7
--#####
--##### Préfixe des tables : ##MYSQL_PREFIX## est remplacé automatiquement
--#####
--##### Feature(s) :
--##### - Ajout de la variable 'theme' remplaçant celle de 'constant.php'
--#####
--######################################################################################################

-- Mise à jour table event (Obligatoire)
INSERT INTO `##MYSQL_PREFIX##configuration` (`key`, `value`) VALUES ('theme','marigolds');

0 comments on commit 39d57a0

Please sign in to comment.