Commit 717fa99e authored by thomas craipeau's avatar thomas craipeau
Browse files

update theme

parent a3fc6690
......@@ -34,13 +34,13 @@ $cssAnsScriptFilesModule = array(
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
HtmlHelper::registerCssAndScriptsFiles( array( '/css/calendar.css') , Yii::app()->theme->baseUrl. '/assets');
$calendarParams=(@Yii::app()->session["paramsConfig"]["pages"]["#agenda"] && @Yii::app()->session["paramsConfig"]["pages"]["#agenda"]["calendar"]) ?Yii::app()->session["paramsConfig"]["pages"]["#agenda"]["calendar"] : null;
if(isset(Yii::app()->session["costum"]) && !empty($calendarParams)){
$calendarParams=(@$this->appConfig["pages"]["#agenda"] && @$this->appConfig["pages"]["#agenda"]["calendar"]) ?$this->appConfig["pages"]["#agenda"]["calendar"] : null;
if(isset($this->costum) && !empty($calendarParams)){
$cssJsCostum=array();
if(isset($calendarParams["js"]))
array_push($cssJsCostum, '/js/'.Yii::app()->session["costum"]["slug"].'/calendar.js');
array_push($cssJsCostum, '/js/'.$this->costum["slug"].'/calendar.js');
if(isset($calendarParams["css"]))
array_push($cssJsCostum, '/css/'.Yii::app()->session["costum"]["slug"].'/calendar.css');
array_push($cssJsCostum, '/css/'.$this->costum["slug"].'/calendar.css');
if(!empty($cssJsCostum))
HtmlHelper::registerCssAndScriptsFiles($cssJsCostum, Yii::app()->getModule( "costum" )->getAssetsUrl());
}
......
......@@ -8,7 +8,7 @@
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
//header + menu
$onepageKey = @Yii::app()->session['paramsConfig']["onepageKey"];
$onepageKey = @$this->appConfig["onepageKey"];
/* if( $this->module->id != "network" &&
!empty($onepageKey) &&
......@@ -28,14 +28,14 @@
<div class="" id="onepage">
<?php
//var_dump($type); exit;
if( !empty(Yii::app()->session['costum']) &&
!empty(Yii::app()->session['costum']['htmlConstruct']) &&
!empty(Yii::app()->session['costum']['htmlConstruct']['element']) &&
!empty(Yii::app()->session['costum']['htmlConstruct']['element']['urlTpl'])&&
!empty(Yii::app()->session['costum']['htmlConstruct']['element']['urlTpl'][$type]) ) {
if( !empty($this->costum) &&
!empty($this->costum['htmlConstruct']) &&
!empty($this->costum['htmlConstruct']['element']) &&
!empty($this->costum['htmlConstruct']['element']['urlTpl'])&&
!empty($this->costum['htmlConstruct']['element']['urlTpl'][$type]) ) {
$tpl = Yii::app()->session['costum']['htmlConstruct']['element']['urlTpl'][$type] ;
$tpl = $this->costum['htmlConstruct']['element']['urlTpl'][$type] ;
$url = ( !empty($tpl[$element["type"]]) ? $tpl[$element["type"]] : $tpl["default"] ) ;
$params = array("element"=>$element ,
"id" => @$id,
......
......@@ -43,15 +43,15 @@
if(@$type=="proposals") { $page = "dda";}
$filliaireCategories = CO2::getContextList("filliaireCategories");
$directoryParams=Yii::app()->session["paramsConfig"]["directory"];
if(@Yii::app()->session["paramsConfig"]["pages"]["#".$page]["directory"])
$directoryParams=Yii::app()->session["paramsConfig"]["pages"]["#".$page]["directory"];
if( isset(Yii::app()->session["costum"]["app"]["#".$page]["tagsList"]) && Yii::app()->session["costum"][ Yii::app()->session["costum"]["app"]["#".$page]["tagsList"] ] ){
$tagsList = Yii::app()->session["costum"][ Yii::app()->session["costum"]["app"]["#".$page]["tagsList"] ] ;
$nameParamsTags = Yii::app()->session["costum"]["app"]["#".$page]["tagsList"];
}else if( isset(Yii::app()->session["costum"]["tags"]) ){
$directoryParams=$this->appConfig["directory"];
if(@$this->appConfig["pages"]["#".$page]["directory"])
$directoryParams=$this->appConfig["pages"]["#".$page]["directory"];
if( isset($this->costum["app"]["#".$page]["tagsList"]) && $this->costum[ $this->costum["app"]["#".$page]["tagsList"] ] ){
$tagsList = $this->costum[ $this->costum["app"]["#".$page]["tagsList"] ] ;
$nameParamsTags = $this->costum["app"]["#".$page]["tagsList"];
}else if( isset($this->costum["tags"]) ){
$nameParamsTags = "tags" ;
$tagsList = Yii::app()->session["costum"]["tags"];
$tagsList = $this->costum["tags"];
}
......@@ -99,25 +99,25 @@
id="content-social" style="min-height:700px;">
<div class="col-md-12 col-sm-12 col-xs-12 no-padding app-<?php echo $page ?>" id="page">
<?php
if(isset(Yii::app()->session["paramsConfig"]["pages"]["#".$page]["header"])){
$this->renderPartial(Yii::app()->session["paramsConfig"]["pages"]["#".$page]["header"], array("page"=>$page));
if(isset($this->appConfig["pages"]["#".$page]["header"])){
$this->renderPartial($this->appConfig["pages"]["#".$page]["header"], array("page"=>$page));
}
if( isset(Yii::app()->session["costum"]) &&
isset(Yii::app()->session["costum"]["htmlConstruct"]) &&
isset(Yii::app()->session["costum"]["htmlConstruct"]["directory"]) &&
isset(Yii::app()->session["costum"]["htmlConstruct"]["directory"]["filters"]) &&
isset(Yii::app()->session["costum"]["htmlConstruct"]["directory"]["filters"]["tagsList"]) &&
//isset(Yii::app()->session["costum"]["tags"])
if( isset($this->costum) &&
isset($this->costum["htmlConstruct"]) &&
isset($this->costum["htmlConstruct"]["directory"]) &&
isset($this->costum["htmlConstruct"]["directory"]["filters"]) &&
isset($this->costum["htmlConstruct"]["directory"]["filters"]["tagsList"]) &&
//isset($this->costum["tags"])
isset($tagsList)
){
if( !empty(Yii::app()->session["costum"]["paramsData"]) &&
!empty(Yii::app()->session["costum"]["paramsData"][$nameParamsTags]) ){
$paramsTags = Yii::app()->session["costum"]["paramsData"][$nameParamsTags];
if( !empty($this->costum["paramsData"]) &&
!empty($this->costum["paramsData"][$nameParamsTags]) ){
$paramsTags = $this->costum["paramsData"][$nameParamsTags];
}
$tagsVertical = false ;
if(!empty(Yii::app()->session["costum"]["htmlConstruct"]["directory"]["filters"]["tagsList"]["rendering"]) && Yii::app()->session["costum"]["htmlConstruct"]["directory"]["filters"]["tagsList"]["rendering"] == "vertical"){
if(!empty($this->costum["htmlConstruct"]["directory"]["filters"]["tagsList"]["rendering"]) && $this->costum["htmlConstruct"]["directory"]["filters"]["tagsList"]["rendering"] == "vertical"){
$tagsVertical = true ;
}
......@@ -163,9 +163,9 @@
<?php }
//top page Title
if( isset( Yii::app()->session[ "costum" ][ "app" ][ "#".$page ]["title"] ) ){
if( isset( $this->costum[ "app" ][ "#".$page ]["title"] ) ){
?>
<h1 class="text-center"><?php echo Yii::app()->session[ "costum" ][ "app" ][ "#".$page ]["title"] ?></h1>
<h1 class="text-center"><?php echo $this->costum[ "app" ][ "#".$page ]["title"] ?></h1>
<?php
}
......@@ -177,9 +177,9 @@
<?php } ?>
<?php
if( @$type=="events" &&
( !isset(Yii::app()->session["paramsConfig"]["pages"]["#".$page]["calendar"]) &&
( empty(Yii::app()->session["paramsConfig"]["pages"]["#".$page]["calendar"]["renderingCalendar"]) ||
Yii::app()->session["paramsConfig"]["pages"]["#".$page]["calendar"]["renderingCalendar"] == "top" ) )
( !isset($this->appConfig["pages"]["#".$page]["calendar"]) &&
( empty($this->appConfig["pages"]["#".$page]["calendar"]["renderingCalendar"]) ||
$this->appConfig["pages"]["#".$page]["calendar"]["renderingCalendar"] == "top" ) )
) {
$this->renderPartial('co2.views.app.calendar', array());
}
......@@ -211,9 +211,9 @@
<?php
$this->renderPartial($layoutPath.'modals.'.Yii::app()->params["CO2DomainName"].'.pageCreate', array());
if( @$type=="events" &&
!empty(Yii::app()->session["paramsConfig"]["pages"]["#".$page]["calendar"]) &&
!empty(Yii::app()->session["paramsConfig"]["pages"]["#".$page]["calendar"]["renderingCalendar"]) &&
Yii::app()->session["paramsConfig"]["pages"]["#".$page]["calendar"]["renderingCalendar"] == "bottom" ) {
!empty($this->appConfig["pages"]["#".$page]["calendar"]) &&
!empty($this->appConfig["pages"]["#".$page]["calendar"]["renderingCalendar"]) &&
$this->appConfig["pages"]["#".$page]["calendar"]["renderingCalendar"] == "bottom" ) {
$this->renderPartial('co2.views.app.calendar', array());
}
//$this->renderPartial($layoutPath.'footer', array( "page" => $page)); ?>
......
......@@ -13,17 +13,20 @@
var_dump("iccccccccccccccccccc");exit;
Yii::app()->session['paramsConfig'] = CO2::getThemeParams();
$params=Yii::app()->session['paramsConfig'];
Yii::app()->session["costum"]=null;
$this->costum=null;
}*/
if( @Yii::app()->session['costum']["welcomeTpl"]){
if( isset(Yii::app()->session["userId"]) && isset(Yii::app()->session["costum"]["contextType"]) && isset(Yii::app()->session["costum"]["contextId"]) )
$canEdit = Authorisation::canEditItem(Yii::app()->session["userId"],@Yii::app()->session["costum"]["contextType"], @Yii::app()->session["costum"]["contextId"]);
$this->renderPartial( Yii::app()->session["costum"]["welcomeTpl"],["canEdit"=>$canEdit] );
//var_dump($this->costum);
//exit;
if( @$this->costum["welcomeTpl"]){
$canEdit = false;
if( isset(Yii::app()->session["userId"]) && isset($this->costum["contextType"]) && isset($this->costum["contextId"]) )
$canEdit = Authorisation::canEditItem(Yii::app()->session["userId"],@$this->costum["contextType"], @$this->costum["contextId"]);
$this->renderPartial( $this->costum["welcomeTpl"],["canEdit"=>$canEdit] );
}
else if( @$_GET["city"] || Yii::app()->session['costum']['id'] )
else if( @$_GET["city"] || $this->costum['id'] )
{
$city = City::getById( Yii::app()->session['costum']['id'] );
$city = City::getById( $this->costum['id'] );
if(@$city["costum"] && $city["costum"]["bannerTpl"])
$this->renderPartial( 'eco.views.costum.'.$city["costum"]["bannerTpl"] );
}
......
......@@ -92,8 +92,9 @@ if( @$_GET["el"] || @$custom )
$c["request"]["sourceKey"]=[$el["slug"]];
}
Yii::app()->session['costum'] = $c;
Costum::filterThemeInCustom(Yii::app()->session["paramsConfig"]);
$this->costum = $c;
// Costum::filterThemeInCustom(Yii::app()->session["paramsConfig"]);
$this->appConfig = Costum::filterThemeInCustom($c,CacheHelper::get("appConfig"));
?>
<meta name="title" content="<?php echo $c["title"]; ?>">
<meta name="description" content="<?php echo @$c["description"]; ?>">
......@@ -112,12 +113,13 @@ if( @$_GET["el"] || @$custom )
//delete custom;
}
if( @Yii::app()->session['costum'] ){ ?>
if( @$this->costum ){ ?>
<script type="text/javascript">
var costum = <?php echo json_encode(Yii::app()->session['costum']) ?>;
var costum = <?php echo json_encode($this->costum) ?>;
//if(typeof custom.appRendering != "undefined")
themeParams=<?php echo json_encode(Yii::app()->session['paramsConfig']) ?>;
themeParams=<?php echo json_encode($this->appConfig) ?>;
costum.init = function(where){
if(costum.logo){
$(".topLogoAnim").remove();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment