mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 12:25:16 +00:00
First commit
This commit is contained in:
27
corePage/config/dev.config.php
Normal file
27
corePage/config/dev.config.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* PHP dev config for the website
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
//Path to assets
|
||||
$config['pathAssets'] = "assets/";
|
||||
|
||||
//CSS files to include
|
||||
$config['CSSfiles'] = array(
|
||||
"%PATH_ASSETS%adminLTE/bootstrap/css/bootstrap.min.css",
|
||||
"%PATH_ASSETS%adminLTE/plugins/font-awesome/css/font-awesome.min.css",
|
||||
"%PATH_ASSETS%adminLTE/plugins/ionicons/css/ionicons.min.css",
|
||||
"%PATH_ASSETS%adminLTE/dist/css/AdminLTE.min.css",
|
||||
"%PATH_ASSETS%adminLTE/dist/css/skins/_all-skins.min.css",
|
||||
);
|
||||
|
||||
//JS files to include (at the end of the page)
|
||||
$config['JSfiles'] = array(
|
||||
"%PATH_ASSETS%adminLTE/plugins/jQuery/jquery-2.2.3.min.js",
|
||||
"%PATH_ASSETS%adminLTE/plugins/jquery-ui/jquery-ui.min.js",
|
||||
"%PATH_ASSETS%js/common/api.js",
|
||||
"%PATH_ASSETS%js/common/errors.js",
|
||||
"%PATH_ASSETS%js/common/messages.js",
|
||||
);
|
17
corePage/config/global.config.php
Normal file
17
corePage/config/global.config.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Project main config page
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
//Site mode (could be dev or prod)
|
||||
$config['siteMode'] = "dev";
|
||||
|
||||
//Site URL
|
||||
$config['siteURL'] = "http://devweb.local/comunic/v2/";
|
||||
|
||||
//API config
|
||||
$config['API_URL'] = "http://devweb.local/comunic/current/api.php/";
|
||||
$config['API_SERVICE_NAME'] = "";
|
||||
$config['API_SERVICE_TOKEN'] = "";
|
26
corePage/helpers/assets.helper.php
Normal file
26
corePage/helpers/assets.helper.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Assets helper inclusion
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the source code for including a javascript file
|
||||
*
|
||||
* @param String $file The path to the file
|
||||
* @return String Source code for including a javascript file
|
||||
*/
|
||||
function javascriptFileInclusionCode($file){
|
||||
return "<script type='text/javascript' src='".$file."'></script>".(config['siteMode'] == 0 ? "\n\t\t" : "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the source code for including a CSS file
|
||||
*
|
||||
* @param String $file Path to the CSS file
|
||||
* @return String HTML Source code to include the CSS file
|
||||
*/
|
||||
function CSSFileInclusionCode($file){
|
||||
return "<link rel='stylesheet' href='".$file."'>".(config['siteMode'] == 0 ? "\n\t\t" : "");
|
||||
}
|
34
corePage/initPage.php
Normal file
34
corePage/initPage.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Page initiator
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
/**
|
||||
* Define system path
|
||||
*/
|
||||
define("SYSTEM_PATH", __DIR__."/");
|
||||
|
||||
/**
|
||||
* Include main config
|
||||
*/
|
||||
require(SYSTEM_PATH."config/global.config.php");
|
||||
|
||||
/**
|
||||
* Include site mode config
|
||||
*/
|
||||
require(SYSTEM_PATH."config/".$config['siteMode'].".config.php");
|
||||
|
||||
/**
|
||||
* Include helpers
|
||||
*/
|
||||
foreach (glob(SYSTEM_PATH . "helpers/*.php") as $file) {
|
||||
//Including helpers file
|
||||
include($file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make config constant
|
||||
*/
|
||||
define("config", $config);
|
Reference in New Issue
Block a user