Commit 5deee2a6 authored by Raph El's avatar Raph El
Browse files

Hotfix network

parent e0681c03
......@@ -68,12 +68,11 @@ class CO2 {
public static function getThemeParams($domainName=null){
$domainName = @$domainName ? $domainName : Yii::app()->params["CO2DomainName"];
$layoutPath ="../../modules/co2/config/".$domainName."/params.json";
$str = file_get_contents($layoutPath);
$params = json_decode($str, true);
return $params;
}
/*public static function getThemeParams($domainName=null){
......
......@@ -9,16 +9,24 @@
$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
//header + menu
$onepageKey = @Yii::app()->session['paramsConfig']["onepageKey"];
if($this->module->id != "network" &&
($type!=Product::COLLECTION ||
($element["creator"]==Yii::app()->session["userId"] && $view != "show")) && !in_array($view, $onepageKey))
//le param USEHEADER de params.json sert à afficher ou non le header,
//donc normalement pas besoin de faire de IF ici
$this->renderPartial($layoutPath.'header',
array( "layoutPath"=>$layoutPath ,
"page" => "page",
"dontShowMenu"=>true,
"useFilter"=>false) );
//var_dump($this->module->id); exit;
//Rest::json(array("view" => $view, "onepageKey" => $onepageKey)); exit ;
if( $this->module->id != "network" &&
( $type!=Product::COLLECTION ||
($element["creator"]==Yii::app()->session["userId"] && $view != "show") ) &&
!empty($view) &&
!empty($onepageKey) &&
!in_array($view, $onepageKey) ){
//le param USEHEADER de params.json sert à afficher ou non le header,
//donc normalement pas besoin de faire de IF ici
$this->renderPartial($layoutPath.'header',
array( "layoutPath"=>$layoutPath ,
"page" => "page",
"dontShowMenu"=>true,
"useFilter"=>false) );
}
?>
<div class="col-md-12 col-sm-12 col-xs-12 no-padding social-main-container">
......@@ -42,10 +50,10 @@
if(@$members) $params["members"] = $members;
if(@$invitedMe) $params["invitedMe"] = $invitedMe;
//error_log($params);
//Rest::json(array("view" => $view, "onepageKey" => $onepageKey)); exit ;
if(Yii::app()->params["CO2DomainName"] == "terla")
$this->renderPartial('co2.views.element.terla.index', $params );
else if(in_array($view, $onepageKey))
else if(!empty($view) && !empty($onepageKey) && in_array($view, $onepageKey))
$this->renderPartial("co2.views.element.onepage", $params);
else
$this->renderPartial('co2.views.element.profilSocial', $params );
......
......@@ -929,6 +929,11 @@ $this->renderPartial( $layoutPath.'modals.'.Yii::app()->params["CO2DomainName"].
//Sig.showMapElements(Sig.map, mapElements);
var elemSpec = dyFInputs.get("<?php echo $type?>");
buildQRCode( elemSpec.ctrl ,"<?php echo (string)$element["_id"]?>");
if(notNull(networkJson)){
$(".main-menu-left").hide();
}
});
......
......@@ -946,7 +946,7 @@ function getAjaxFiche(url, breadcrumLevel){
url= "/app/"+urlHash.replace( "#@","" ).replace( /\./g,"/" );
else
url= "/app/"+urlHash.replace( "#","" ).replace( /\./g,"/" );
mylog.log("getAjaxFiche url",url);
// mylog.log("url", url);
$("#repertory").hide( 700 );
$(".main-menu-left").hide( 700 );
......@@ -958,7 +958,7 @@ function getAjaxFiche(url, breadcrumLevel){
});
// mylog.log("networkParams", networkParams);
getAjax('#ficheInfoDetail', baseUrl+'/'+moduleId+url+'?src='+networkParams, function(){
getAjax('#ficheInfoDetail', baseUrl+'/co2'+url+'?src='+networkParams, function(){
$.unblockUI();
// mylog.log(contextData);
//Construct breadcrumb
......@@ -985,13 +985,18 @@ function getAjaxFiche(url, breadcrumLevel){
slug=urlSplit[0];
$.ajax({
type: "POST",
url: baseUrl+"/"+moduleId+"/slug/getinfo/key/"+slug,
url: baseUrl+"/co2/slug/getinfo/key/"+slug,
dataType: "json",
success: function(data){
mylog.log("getAjaxFiche data",data);
if(data.result){
var urlHash="#page.type."+data.contextType+".id."+data.contextId;
urlHash="#page.type."+data.contextType+".id."+data.contextId;
}else{
urlHash="page/"+url;
}
url= "/app/"+urlHash.replace( "#","" ).replace( /\./g,"/" );
mylog.log("getAjaxFiche url2",url);
// mylog.log("url", url);
$("#repertory").hide( 700 );
$(".main-menu-left").hide( 700 );
......@@ -1003,7 +1008,7 @@ function getAjaxFiche(url, breadcrumLevel){
});
// mylog.log("networkParams", networkParams);
getAjax('#ficheInfoDetail', baseUrl+'/'+moduleId+url+'?src='+networkParams, function(){
getAjax('#ficheInfoDetail', baseUrl+'/co2'+url+'?src='+networkParams, function(){
$.unblockUI();
// mylog.log(contextData);
//Construct breadcrumb
......
......@@ -130,7 +130,14 @@
// MENU LEFT OF THE ELEMENT
// - List of this menu is define on the document CO2/config/CO2/params.json at @element.menuLeft
// - $variable stocked in session variable {paramsConfig} during the initialization in mainSearch.php with @CO2::getThemeParams()
// - customized if necessary with @CO2::filterThemeInCustom() during the process in co2/views/custom/init.php
// - customized if necessary with @CO2::filterThemeInCustom() during the process in co2/views/custom/init.php
// Rest::json($themeParams);
// Rest::json(Yii::app()->session['paramsConfig']); exit;
// if(empty($themeParams)){
// $themeParams = Yii::app()->session['paramsConfig'];
// Rest::json($themeParams); exit;
// }
foreach($themeParams["element"]["menuLeft"] as $key => $v){
if(!@$v["typeAllow"] || in_array($type, $v["typeAllow"])){
$labelButon=($key=="events" && $type=="events")? Yii::t("common","Program"): Yii::t("common", $v["label"]);
......
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