/**
  * 
  * @param Theme $theme
  * @return int id of the Theme inserted in base. False if it didn't work.
  */
 public static function flush($theme)
 {
     $themeId = $theme->getIdTheme();
     $themeName = $theme->getThemeName();
     if ($themeId > 0) {
         $sql = 'UPDATE theme SET theme_name = ? ' . 'WHERE id_theme = ?';
         $params = array('si', &$themeName, &$themeId);
     } else {
         $sql = 'INSERT INTO theme ' . '(theme_name) ' . 'VALUES(?)';
         $params = array('s', &$themeName);
     }
     $idInsert = BaseSingleton::insertOrEdit($sql, $params);
     if ($idInsert !== false && $themeId > 0) {
         $idInsert = $themeId;
     }
     return $idInsert;
 }
Ejemplo n.º 2
0
 public static function show($urlKey)
 {
     // App::isLocal()
     //Récupération de tous les fichiers .json (theme.json)
     $themesHash = app_path() . '/config/assets/theme/';
     $pathForAssets = 'theme/';
     try {
         $dir = opendir($themesHash);
         $themesFile = array();
         while ($file = readdir($dir)) {
             if ($file != '.' && $file != '..' && !is_dir($themesHash . $file)) {
                 $themesFile[] = $file;
             }
         }
         closedir($dir);
     } catch (Exception $e) {
         echo 'Exception reçue : ', $e->getMessage(), "\n";
     }
     // Get theme name
     $themeName = Theme::getThemeName();
     $pathForAssets .= $themeName . '/';
     // Get file content
     $fcontent = null;
     try {
         //Lecture du fichier
         $fcontent = file_get_contents($themesHash . Theme::getThemeType() . '-' . $themeName . '.json');
         $json = json_decode($fcontent);
         $json = (array) $json;
     } catch (Exception $e) {
         echo 'Exception reçue : ', $e->getMessage(), "\n";
     }
     //retourne la valeur de la clé, si elle existe, passé en params!
     if (isset($json[$urlKey])) {
         return $pathForAssets . $json[$urlKey];
     } else {
         return $pathForAssets . $urlKey;
         return 'error_assets';
     }
 }
Ejemplo n.º 3
0
<?php

/*
|--------------------------------------------------------------------------
| Register Theme
|--------------------------------------------------------------------------
|
|
*/
//Get themes
//Set namespace with override support
View::addNamespace('theme', [base_path() . '/theme/' . Theme::getThemeName() . '/views', base_path() . '/theme/default/views']);
/*
|--------------------------------------------------------------------------
| Register The Modules Providers
|--------------------------------------------------------------------------
|
|
*/
foreach (Config::get('module') as $module) {
    App::register('Dynamix\\' . $module . '\\' . $module . 'ServiceProvider');
}
/*
|--------------------------------------------------------------------------
| Register The Laravel Class Loader
|--------------------------------------------------------------------------
|
| In addition to using Composer, you may use the Laravel class loader to
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
|
Ejemplo n.º 4
0
require_once "../functions/errorFuncs.php";
require_once "../classes/Localize.php";
$loc = new Localize(OBIB_LOCALE, $tab);
#****************************************************************************
#*  Checking for post vars.  Go back to form if none found.
#****************************************************************************
if (count($_POST) == 0) {
    header("Location: ../admin/theme_new_form.php");
    exit;
}
#****************************************************************************
#*  Validate data
#****************************************************************************
$theme = new Theme();
$theme->setThemeName($_POST["themeName"]);
$_POST["themeName"] = $theme->getThemeName();
$theme->setTitleBg($_POST["titleBg"]);
$_POST["titleBg"] = $theme->getTitleBg();
$theme->setTitleFontFace($_POST["titleFontFace"]);
$_POST["titleFontFace"] = $theme->getTitleFontFace();
$theme->setTitleFontSize($_POST["titleFontSize"]);
$_POST["titleFontSize"] = $theme->getTitleFontSize();
$theme->setTitleFontBold(isset($_POST["titleFontBold"]));
$theme->setTitleFontColor($_POST["titleFontColor"]);
$_POST["titleFontColor"] = $theme->getTitleFontColor();
$theme->setTitleAlign($_POST["titleAlign"]);
$theme->setPrimaryBg($_POST["primaryBg"]);
$_POST["primaryBg"] = $theme->getPrimaryBg();
$theme->setPrimaryFontFace($_POST["primaryFontFace"]);
$_POST["primaryFontFace"] = $theme->getPrimaryFontFace();
$theme->setPrimaryFontSize($_POST["primaryFontSize"]);