Commit 295d8806 authored by Clément Damiens's avatar Clément Damiens
Browse files

refactor custom to costum 
parent a42ceaa9
......@@ -38,7 +38,7 @@ class CustomModule extends CWebModule {
//sudo ln -s co2 network
Yii::app()->theme = "CO2";
Yii::app()->session["theme"] == "CO2";
Yii::app()->params['customParams'] = ( @Yii::app()->session["customParams"] ) ? Yii::app()->session["customParams"] : @$_GET["custom"];
Yii::app()->params['costumParams'] = ( @Yii::app()->session["costumParams"] ) ? Yii::app()->session["costumParams"] : @$_GET["costum"];
/*if(@$_GET["network"] ){
Yii::app()->theme = "network";
......@@ -125,7 +125,7 @@ class CustomModule extends CWebModule {
if(@$_GET["tpl"] == "iframesig"){ $theme = $_GET["tpl"]; }
if(@$_GET["custom"]) {
if(@$_GET["costum"]) {
$theme = "CO2";
//Yii::app()->params['customParams'] = $_GET["network"];
}
......
......@@ -1150,13 +1150,10 @@ var urlCtrl = {
}
} );
}else{
//if(typeof custom == "undefined" || typeof custom.url=="undefined")
showAjaxPanel( baseUrl+'/'+ moduleId + '/app/index', 'Home','home' );
//else
showAjaxPanel( baseUrl+'/'+ moduleId + '/app/index', 'Home','home' );
}
}
else if ( moduleId != activeModuleId && activeModuleId != "costum") {
//alert( ctrlId +"/"+ actionId );
showAjaxPanel( baseUrl+'/'+ activeModuleId + '/'+ctrlId +"/"+ actionId, 'Home','home' );
}
else
......@@ -1434,11 +1431,10 @@ function showAjaxPanel (url,title,icon, mapEnd , urlObj) {
// if( custom && custom.logo )
// custom.init("co.js");
// }
if( typeof custom != "undefined" && custom.type == "cities" )
setOpenBreadCrum({'cities': custom.id });
//$(".logo-menutop").attr( {'src':custom.logo} );
if( typeof costum != "undefined" && costum.type == "cities" )
setOpenBreadCrum({'cities': costum.id });
if( location.hash.indexOf("#panel") >= 0 ){
panelName = location.hash.substr(7);
mylog.log("panelName",panelName);
......@@ -1552,18 +1548,18 @@ function setTitle(str, icon, topTitle,keywords,shortDesc) { mylog.log("setTitle"
if(topTitle)
str = topTitle;
defaultTitle=(typeof custom != "undefined" && custom != null && typeof custom.title != "undefined") ? custom.title : "Communecter, se connecter à sa commune";
defaultTitle=(typeof costum != "undefined" && costum != null && typeof costum.title != "undefined") ? costum.title : "Communecter, se connecter à sa commune";
$(document).prop('title', ( str != "" ) ? str : defaultTitle );
if(notNull(keywords))
$('meta[name="keywords"]').attr("content",keywords);
else if(typeof custom == "undefined" || !notNull(custom))
else if(typeof costum == "undefined" || !notNull(costum))
$('meta[name="keywords"]').attr("content","communecter,connecter, commun,commune, réseau, sociétal, citoyen, société, territoire, participatif, social, smarterre");
if(notNull(shortDesc)){
$('meta[name="description"]').attr("content",shortDesc);
}
else if(typeof custom == "undefined" || !notNull(custom))
else if(typeof costum == "undefined" || !notNull(costum))
$('meta[name="description"]').attr("content","Communecter : Connecter à sa commune, inter connecter les communs, un réseau sociétal pour un citoyen connecté et acteur au centre de sa société.");
}
......
......@@ -84,7 +84,7 @@ function initTypeSearch(typeInit){
if(typeInit == "all") {
if(isCustom(typeInit, "types")){
searchObject.types = [];
$.each(custom.filters.app[searchObject.initType].types, function(e, v){
$.each(costum.filters.app[searchObject.initType].types, function(e, v){
if($.inArray(v, ["NGO","Group","LocalBusiness","GovernmentOrganization"]) >= 0){
if( $.inArray("organizations", searchObject.types)<0)
searchObject.types.push("organizations");
......@@ -112,7 +112,7 @@ function initCountType(){
if(searchObject.initType=="all"){
if(isCustom(searchObject.initType, "types")){
searchObject.countType = [];
$.each(custom.filters.app[searchObject.initType].types, function(e, v){
$.each(costum.filters.app[searchObject.initType].types, function(e, v){
searchObject.countType.push(v);
});
}
......@@ -861,9 +861,9 @@ var directory = {
multiTagsT : [],
multiScopesT :[],
viewMode: directoryViewMode,
custom : ( typeof custom != "undefined" && custom != null
&& typeof custom.htmlConstruct != "undefined"
&& typeof custom.htmlConstruct.directory != "undefined") ? custom.htmlConstruct.directory : null,
costum : ( typeof costum != "undefined" && costum != null
&& typeof costum.htmlConstruct != "undefined"
&& typeof costum.htmlConstruct.directory != "undefined") ? costum.htmlConstruct.directory : null,
colPos: "left",
dirLog : false,
defaultPanelHtml : function(params){
......@@ -3026,7 +3026,7 @@ var directory = {
//Event scroll and all searching
$("#btnShowMoreResult").remove();
scrollEnd=true;
if(!notNull(directory.custom)){
if(!notNull(directory.costum)){
//msg specific for end search
match= (searchObject.text != "") ? "match" : "";
msg= (notNull(noResult) && noResult) ? trad["noresult"+match] : trad["nomoreresult"+match];
......@@ -3119,10 +3119,10 @@ var directory = {
toolsSize=(searchObject.initType=="classifieds") ? "col-md-4 col-sm-6" : "col-md-3 col-sm-4";
headerFilters = "";
if( typeof custom != "undefined" && custom != null && typeof custom.filters != 'undefined'
&& typeof custom.filters.searchFilters != 'undefined'){
if( typeof costum != "undefined" && costum != null && typeof costum.filters != 'undefined'
&& typeof costum.filters.searchFilters != 'undefined'){
$.each(custom.filters.searchFilters,function(k,p) {
$.each(costum.filters.searchFilters,function(k,p) {
colorClass = (typeof p.colorClass != "unde") ? p.colorClass : "";
headerFilters += "<a href='javascript:;' data-filter='"+k+"' class='btn-coopfilter btn btn-xs "+colorClass+"'> "+p.label+"</a> ";
});
......@@ -3144,18 +3144,18 @@ var directory = {
// '</a>';
// }
if(/*userId != ""
&& */notNull(directory.custom)
&& typeof directory.custom.header != "undefined"
&& typeof directory.custom.header.add != "undefined"
&& typeof directory.custom.header.add[searchObject.initType] != "undefined"){
&& */notNull(directory.costum)
&& typeof directory.costum.header != "undefined"
&& typeof directory.costum.header.add != "undefined"
&& typeof directory.costum.header.add[searchObject.initType] != "undefined"){
headerStr+="<div class='pull-right'>";
headerStr+=directory.createBtnHtml();
headerStr+="</div>";
}
if(!notNull(directory.custom)
|| typeof directory.custom.header == "undefined"
|| typeof directory.custom.header.viewMode == "undefined"
|| directory.custom.header.viewMode) {
if(!notNull(directory.costum)
|| typeof directory.costum.header == "undefined"
|| typeof directory.costum.header.viewMode == "undefined"
|| directory.costum.header.viewMode) {
headerStr+='<button class="btn switchDirectoryView ';
if(directory.viewMode=="list") headerStr+='active ';
......@@ -3170,10 +3170,10 @@ var directory = {
if( typeof themeParams != "undefined" &&
themeParams.appRendering !="undefined" &&
themeParams.appRendering=="vertical" &&
(!notNull(directory.custom)
|| typeof directory.custom.header == "undefined"
|| typeof directory.custom.header.map== "undefined"
|| directory.custom.header.map)) {
(!notNull(directory.costum)
|| typeof directory.costum.header == "undefined"
|| typeof directory.costum.header.map== "undefined"
|| directory.costum.header.map)) {
headerStr+= '<button class="btn-show-map hidden-xs" style="" title="'+trad.showthemap+'" alt="'+trad.Showthemap+'">'+
'<i class="fa fa-map-marker"></i> Carte'+
'</button>';
......@@ -3243,11 +3243,11 @@ var directory = {
"name":$("#nameFavorite").val(),
"type":"research"
}
if(typeof custom != "undefined"){
if(typeof costum != "undefined"){
formData.mailParams={
logo : custom.logo,
title : custom.title,
url : custom.url
logo : costum.logo,
title : costum.title,
url : costum.url
};
}
//var urlToSearch=getParamsUrlForAlert();;
......@@ -3475,21 +3475,12 @@ var directory = {
params.imgProfil = "<i class='fa fa-image fa-2x'></i>";
params.imgMediumProfil = "<i class='fa fa-image fa-2x'></i>";
}
// <<<<<<< HEAD
// mylog.log("DIrectory ", directory.custom);
// if( directory.custom != null &&
// typeof directory.custom != "undefined" &&
// typeof directory.custom.results != "undefined" &&
// typeof directory.custom.results[params.type] != "undefined" &&
// typeof directory.custom.results[params.type].defaultImg != "undefined")
// =======
if("undefined" != typeof directory.custom && notNull(directory.custom)
&& typeof directory.custom.results != "undefined"
&& typeof directory.custom.results[params.type] != "undefined"
&& typeof directory.custom.results[params.type].defaultImg != "undefined")
params.imgMediumProfil= "<img class='img-responsive' onload='directory.checkImage(this);' src='"+parentModuleUrl+directory.custom.results[params.type].defaultImg+"'/>";
if("undefined" != typeof directory.costum && notNull(directory.costum)
&& typeof directory.costum.results != "undefined"
&& typeof directory.costum.results[params.type] != "undefined"
&& typeof directory.costum.results[params.type].defaultImg != "undefined")
params.imgMediumProfil= "<img class='img-responsive' onload='directory.checkImage(this);' src='"+parentModuleUrl+directory.costum.results[params.type].defaultImg+"'/>";
if("undefined" != typeof params.profilMediumImageUrl && params.profilMediumImageUrl != "")
params.imgMediumProfil= "<img class='img-responsive' onload='directory.checkImage(this);' src='"+baseUrl+params.profilMediumImageUrl+"'/>";
......@@ -3502,33 +3493,9 @@ var directory = {
if(!params.useMinSize)
params.imgBanner = "<i class='fa fa-image fa-2x'></i>";
//if("undefined" != typeof params.profilBannerUrl && params.profilBannerUrl != "")
// params.imgBanner= "<img class='' height=100 src='"+baseUrl+params.profilBannerUrl+"'/>";
/*if(params.type=="news"){
delete params.imgProfil;
if(typeof params.media != "undefined"){
if (params.media.type=="gallery_images")
params.media=getMediaImages(params.media, null, null, null,'directory');
else if (params.media.type=="gallery_files")
params.media=getMediaFiles(params.media,null);
else if(params.media.type=="url_content")
params.media=processUrl.getMediaCommonHtml(params.media,"show");
else if (params.media.type=="activityStream")
params.media=directory.showResultsDirectoryHtml(new Array(params.media.object),params.media.object.type);
if(params.text!= "")
delete params.media;
else{
params.text=params.media;
delete params.media;
}
}
}*/
if (false && typeof params.addresses != "undefined" && params.addresses != null) {
$.each(params.addresses, function(key, val){
//console.log("second address", val);
var postalCode = val.address.postalCode ? val.address.postalCode : "";
var cityName = val.address.addressLocality ? val.address.addressLocality : "";
......@@ -3538,15 +3505,6 @@ var directory = {
params.type = dyFInputs.get(itemType).col;
params.urlParent = (notEmpty(params.parentType) && notEmpty(params.parentId)) ?
'#page.type.'+params.parentType+'.id.' + params.parentId : "";
// var urlImg = "/upload/communecter/color.jpg";
// params.profilImageUrl = urlImg;
/*if(dyFInputs.get(itemType) &&
dyFInputs.get(itemType).col == "poi" &&
typeof params.medias != "undefined" && typeof params.medias[0].content.image != "undefined")
params.imgProfil= "<img class='img-responsive' src='"+params.medias[0].content.image+"'/>";
*/
params.insee = params.insee ? params.insee : "";
params.postalCode = "", params.city="",params.cityName="";
if (params.address != null) {
......
......@@ -78,9 +78,9 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input){
data.countType = [ "citoyens", "organizations", "projects", "events" ];
data.searchType = [ "citoyens", "organizations", "projects", "events" ];
}
if(typeof custom != "undefined" && notNull(custom) && typeof custom.filters != "undefined" && typeof custom.filters.searchTypeGS != "undefined"){
data.countType = custom.filters.searchTypeGS;
data.searchType = custom.filters.searchTypeGS;
if(typeof costum != "undefined" && notNull(costum) && typeof costum.filters != "undefined" && typeof costum.filters.searchTypeGS != "undefined"){
data.countType = costum.filters.searchTypeGS;
data.searchType = costum.filters.searchTypeGS;
}
var domTarget = (notNull(input)) ? input+" .dropdown-result-global-search" : ".dropdown-result-global-search";
showDropDownGS(true, domTarget);
......@@ -386,9 +386,9 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input){
"</div>"; */
extendMsg=trad.extendedsearch;
extendUrl="#search";
if(typeof custom != "undefined" && notNull(custom) && typeof custom.searchOpenMenu != "undefined"){
extendMsg=custom.searchOpenMenu.msg;
extendUrl=custom.searchOpenMenu.url;
if(typeof costum != "undefined" && notNull(costum) && typeof costum.searchOpenMenu != "undefined"){
extendMsg=costum.searchOpenMenu.msg;
extendUrl=costum.searchOpenMenu.url;
}
str += '<div class="text-center" id="footerDropdownGS">';
......
......@@ -869,16 +869,16 @@ function initCategoriesApp(type){
}
function isCustom(typeInterface, labelFilter){
res=false;
if(typeof custom != "undefined"
&& typeof custom.filters != "undefined"
&& typeof custom.filters.app != "undefined"
&& typeof custom.filters.app[typeInterface] != "undefined"){
if(typeof costum != "undefined"
&& typeof costum.filters != "undefined"
&& typeof costum.filters.app != "undefined"
&& typeof costum.filters.app[typeInterface] != "undefined"){
if(notNull(labelFilter)){
if(typeof custom.filters.app[typeInterface] != "undefined" && typeof custom.filters.app[typeInterface][labelFilter] != "undefined")
if(typeof costum.filters.app[typeInterface] != "undefined" && typeof costum.filters.app[typeInterface][labelFilter] != "undefined")
return true;
else
return false;
}else if(_.isObject(custom.filters.app[typeInterface]))
}else if(_.isObject(costum.filters.app[typeInterface]))
return true;
}
return res;
......@@ -946,11 +946,11 @@ function customFiltersInterface(){
events:["tags", "types"],
news:["tags", "types"],
classifieds:["tags", "types", "section", "category", "price", "source"]};
if(typeof custom.filters.app[searchObject.initType] != "undefined"){
$.each(custom.filters.app[searchObject.initType], function(e, v){
if(typeof costum.filters.app[searchObject.initType] != "undefined"){
$.each(costum.filters.app[searchObject.initType], function(e, v){
if(v.length > 1){
custom.categories=new Object;
custom.categories=v;
costum.categories=new Object;
costum.categories=v;
if(e=="types"){
$.each(categoriesFilters, function(i, content){
if($.inArray(i, v) < 0 && i!="all")
......
......@@ -141,19 +141,19 @@ function getUrlSearchLocality(urlGet, alert){
//if(notNull(alert)){
if(value.active == true){
if(value.type == "cities"
&& (typeof custom == "undefined" || typeof custom.filters == "undefined" || typeof custom.filters.scopes == "undefined" || typeof custom.filters.scopes.cities == "undefned"
|| key.indexOf(custom.filters.scopes.cities) < 0)){
&& (typeof costum == "undefined" || typeof costum.filters == "undefined" || typeof costum.filters.scopes == "undefined" || typeof costum.filters.scopes.cities == "undefned"
|| key.indexOf(costum.filters.scopes.cities) < 0)){
keyScope=(typeof value.postalCode == "undefined") ? value.id : value.id+"cp"+value.postalCode;
keyScope+=(typeof value.allCP == "undefined" && value.allCP) ? "allPostalCode" : "";
urlScopeCity.push(keyScope);
}
else if (value.type == "cp"
&& (typeof custom == "undefined" || typeof custom.filters == "undefined" || typeof custom.filters.scopes == "undefined" || typeof custom.filters.scopes.cp == "undefned"
|| value.id.indexOf(custom.filters.scopes.cp) < 0))
&& (typeof costum == "undefined" || typeof costum.filters == "undefined" || typeof costum.filters.scopes == "undefined" || typeof costum.filters.scopes.cp == "undefned"
|| value.id.indexOf(costum.filters.scopes.cp) < 0))
urlScopeCp.push(value.id);
else if (value.type.indexOf("level") >= 0
&& (typeof custom == "undefined" || typeof custom.filters == "undefined" || typeof custom.filters.scopes == "undefined" || typeof custom.filters.scopes.zones == "undefned"
|| value.id.indexOf(custom.filters.scopes.zones) < 0))
&& (typeof costum == "undefined" || typeof costum.filters == "undefined" || typeof costum.filters.scopes == "undefined" || typeof costum.filters.scopes.zones == "undefned"
|| value.id.indexOf(costum.filters.scopes.zones) < 0))
urlScopeZone.push(value.id);
}
//}
......@@ -262,7 +262,7 @@ function setOpenBreadCrum(params, customCity){
localStorage.setItem("myScopes",JSON.stringify(myScopes));
appendScopeBreadcrum();
if(customCity)
custom.scopes=myScopes["open"];
costum.scopes=myScopes["open"];
},
error: function(error){
toastr.error("waswrong")
......
......@@ -674,8 +674,8 @@ class CommunecterController extends Controller
//managed public and private sections through a url manager
if( Yii::app()->controller->id == "admin" && !Yii::app()->session[ "userIsAdmin" ]
&& (!@Yii::app()->session[ "custom" ] || !@Yii::app()->session[ "custom" ]["admins"]
|| !Yii::app()->session[ "custom" ]["admins"][Yii::app()->session["userId"]]))
&& (!@Yii::app()->session[ "costum" ] || !@Yii::app()->session[ "costum" ]["admins"]
|| !Yii::app()->session[ "costum" ]["admins"][Yii::app()->session["userId"]]))
throw new CHttpException(403,Yii::t('error','Unauthorized Access.'));
if( Yii::app()->controller->id == "adminpublic" && ( !Yii::app()->session[ "userIsAdmin" ] && !Yii::app()->session[ "userIsAdminPublic" ] ) )
......
......@@ -108,8 +108,8 @@ class CO2 {
public static function filterThemeInCustom($params){
$menuApp=array("#annonces", "#search", "#agenda", "#live", "#dda");
//filter menu app custom
if(@Yii::app()->session["custom"]["htmlConstruct"]){
$constructParams=Yii::app()->session["custom"]["htmlConstruct"];
if(@Yii::app()->session["costum"]["htmlConstruct"]){
$constructParams=Yii::app()->session["costum"]["htmlConstruct"];
if(@$constructParams["app"]){
$params["numberOfApp"]=count($constructParams["app"]);
$menuPages=self::checkCOstumList($constructParams["app"], $params["pages"]);
......@@ -172,8 +172,8 @@ class CO2 {
if(@$constructParams["footer"])
$params["footer"]=$constructParams["footer"];
}
if(@Yii::app()->session["custom"]["add"])
$params["add"]=Yii::app()->session["custom"]["add"];
if(@Yii::app()->session["costum"]["add"])
$params["add"]=Yii::app()->session["costum"]["add"];
Yii::app()->session["paramsConfig"]=$params;
}
......
......@@ -17,10 +17,10 @@
"page" => "admin",
"useFilter"=>false, "useHeader"=>true) );
//BUTTON ADD +> TODO BOUBOULE GET GENERIC VIEW OF ADD ELEMENT DASHBOARD
if(isset(Yii::app()->session["custom"])
&& isset(Yii::app()->session["custom"]["htmlConstruct"])
&& isset(Yii::app()->session["custom"]["htmlConstruct"]["adminPanel"])
&& isset(Yii::app()->session["custom"]["htmlConstruct"]["adminPanel"]["add"])){
if(isset(Yii::app()->session["costum"])
&& isset(Yii::app()->session["costum"]["htmlConstruct"])
&& isset(Yii::app()->session["costum"]["htmlConstruct"]["adminPanel"])
&& isset(Yii::app()->session["costum"]["htmlConstruct"]["adminPanel"]["add"])){
$addElement=array(
Person::COLLECTION => array(
"label"=>Yii::t("common","Invite someone"),"icon"=>Person::ICON,"addClass"=> "bg-yellow lbhp", "color"=>"yellow", "href"=>"#element.invite"
......@@ -75,9 +75,9 @@
"href"=>"javascript:;"
)
);
if(isset(Yii::app()->session["custom"]["add"])){
if(isset(Yii::app()->session["costum"]["add"])){
foreach($addElement as $key=>$v)
if(!@Yii::app()->session["custom"]["add"][$key] && (!@$v["type"] || !@Yii::app()->session["custom"]["add"][$v["type"]])) unset($addElement[$key]);
if(!@Yii::app()->session["costum"]["add"][$key] && (!@$v["type"] || !@Yii::app()->session["costum"]["add"][$v["type"]])) unset($addElement[$key]);
}
}
//STRUCTURE MENU ADMIN
......@@ -172,12 +172,12 @@
<?php if(@Yii::app()->session["userIsAdmin"] || Yii::app()->session["userIsAdminPublic"]
|| (@Yii::app()->session["userId"]
&& @Yii::app()->session["custom"]
&& @Yii::app()->session["custom"]["admins"]
&& @Yii::app()->session["custom"]["admins"][Yii::app()->session["userId"]])){
&& @Yii::app()->session["costum"]
&& @Yii::app()->session["costum"]["admins"]
&& @Yii::app()->session["costum"]["admins"][Yii::app()->session["userId"]])){
$authorizedAdmin=true;
$title=(@Yii::app()->session["userIsAdmin"]) ? Yii::t("common","Administration portal") : Yii::t("common","Public administration portal");
$logo = (@Yii::app()->session['custom']["logo"]) ? Yii::app()->session['custom']["logo"] : Yii::app()->theme->baseUrl."/assets/img/LOGOS/CO2/logo-min.png";
$logo = (@Yii::app()->session['costum']["logo"]) ? Yii::app()->session['costum']["logo"] : Yii::app()->theme->baseUrl."/assets/img/LOGOS/CO2/logo-min.png";
?>
<div class="col-md-12 col-sm-12 col-xs-12" id="navigationAdmin">
<div class="col-md-12 col-sm-12 col-xs-12 text-center">
......@@ -223,7 +223,7 @@
<ul class="list-group text-left no-margin">
<?php foreach(Yii::app()->session["paramsConfig"]["adminPanel"] as $key => $v){
if((!isset($v["super"]) || empty($v["super"]) || Role::isSuperAdmin(Role::getRolesUserId(Yii::app()->session["userId"]))) && $key!="add"){
if(!isset($v["sourceKey"]) || (isset(Yii::app()->session["custom"]) && isset(Yii::app()->session["custom"]["sourceKey"]))){?>
if(!isset($v["sourceKey"]) || (isset(Yii::app()->session["costum"]) && isset(Yii::app()->session["costum"]["sourceKey"]))){?>
<li class="list-group-item col-md-4 col-sm-6 col-xs-12">
<a href="javascript:;" class="<?php echo $v["class"] ?>" id="<?php echo $v["id"] ?>" style="cursor:pointer;">
<i class="fa fa-<?php echo $v["icon"] ?> fa-2x"></i>
......
......@@ -111,7 +111,7 @@ var results = <?php echo json_encode($results) ?>;
var initType = (typeof paramsAdmin != "undefined"
&& typeof paramsAdmin["reference"] != "undefined"
&& typeof paramsAdmin["reference"]["initType"] != "undefined") ? paramsAdmin["reference"]["initType"]: ["organizations", "events", "projects"];
var sourceKey = (typeof custom != "undefined" && custom.slug) ? custom.slug : null;
var sourceKey = (typeof costum != "undefined" && costum.slug) ? costum.slug : null;
var icons = {
organizations : "fa-group",
projects : "fa-lightbulb-o",
......@@ -463,9 +463,9 @@ function setSourceAdmin(btnClick){
id:btnClick.data("id"),
type:btnClick.data("type")
};
if(typeof custom != "undefined" && notNull(custom) && custom.slug){
params.origin="custom";
params.sourceKey=custom.slug;
if(typeof costum != "undefined" && notNull(costum) && costum.slug){
params.origin="costum";
params.sourceKey=costum.slug;
}
$.ajax({
type: "POST",
......
<?php
/******************************* NOT USED ANYMORE ********************/
/**********************MOVE IN LIVE MODULE **************************/
$cssAnsScriptFilesModule = array(
'/js/default/search.js',
//'/js/default/live.js',
......@@ -23,32 +26,7 @@ $filliaireCategories = CO2::getContextList("filliaireCategories");
?>
<style>
/* #formCreateNewsTemp .form-create-news-container{
max-width: inherit !important;
}
.item-globalscope-checker.inactive{
color:#DBBCC1 !important;
border-bottom:0px;
margin(top:-6px;)
}
.item-globalscope-checker:hover,
.item-globalscope-checker:active,
.item-globalscope-checker:focus{
color:#e6344d !important;
border-bottom:1px solid #e6344d;
text-decoration: none !important;
}
@media (min-width: 991px) {
.subModuleTitle{
width: 100% !important;
margin-left: 11% !important;
}
}*/
#noMoreNews {
position: relative;
padding: 0px 40px;
......
......@@ -27,11 +27,11 @@
<section class="bg-white inline-block pull-left no-padding" id="bg-homepage">
<?php
if( @Yii::app()->session['custom']["welcomeTpl"])
$this->renderPartial( Yii::app()->session["custom"]["welcomeTpl"] );
else if( @$_GET["city"] || Yii::app()->session['custom']['id'] )
if( @Yii::app()->session['costum']["welcomeTpl"])
$this->renderPartial( Yii::app()->session["costum"]["welcomeTpl"] );
else if( @$_GET["city"] || Yii::app()->session['costum']['id'] )
{
$city = City::getById( Yii::app()->session['custom']['id'] );
$city = City::getById( Yii::app()->session['costum']['id'] );
if(@$city["custom"] && $city["custom"]["bannerTpl"])
$this->renderPartial( 'eco.views.custom.'.$city["custom"]["bannerTpl"] );
}
......
......@@ -92,7 +92,7 @@ if( @$_GET["el"] || @$custom )
$c["request"]["sourceKey"]=[$el["slug"]];
}
Yii::app()->session['custom'] = $c;
Yii::app()->session['costum'] = $c;
CO2::filterThemeInCustom(Yii::app()->session["paramsConfig"]);
?>
<meta name="title" content="<?php echo $c["title"]; ?>">
......@@ -107,34 +107,34 @@ if( @$_GET["el"] || @$custom )
<link rel='shortcut icon' type='image/x-icon' href="<?php echo @$c["favicon"]; ?>" />
<?php
} else {
Yii::app()->session["custom"] = null;
Yii::app()->session["costum"] = null;
//delete custom;
}
if( @Yii::app()->session['custom'] ){ ?>
if( @Yii::app()->session['costum'] ){ ?>
<script type="text/javascript">
var custom = <?php echo json_encode(Yii::app()->session['custom']) ?>;
var costum = <?php echo json_encode(Yii::app()->session['costum']) ?>;
//if(typeof custom.appRendering != "undefined")
themeParams=<?php echo json_encode(Yii::app()->session['paramsConfig']) ?>;
custom.init = function(where){
if(custom.logo){
if(costum.logo){
$(".topLogoAnim").remove();
$(".logo-menutop, .logoLoginRegister").attr({'src':custom.logo});
$(".logo-menutop, .logoLoginRegister").attr({'src':costum.logo});