Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Julie Bideux
co2
Commits
295d8806
Commit
295d8806
authored
Feb 05, 2019
by
Clément Damiens
Browse files
refactor custom to costum
parent
a42ceaa9
Changes
13
Hide whitespace changes
Inline
Side-by-side
CustomModule.php
View file @
295d8806
...
...
@@ -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
[
'c
u
st
o
mParams'
]
=
(
@
Yii
::
app
()
->
session
[
"c
u
st
o
mParams"
]
)
?
Yii
::
app
()
->
session
[
"c
u
st
o
mParams"
]
:
@
$_GET
[
"c
u
st
o
m"
];
Yii
::
app
()
->
params
[
'c
o
st
u
mParams'
]
=
(
@
Yii
::
app
()
->
session
[
"c
o
st
u
mParams"
]
)
?
Yii
::
app
()
->
session
[
"c
o
st
u
mParams"
]
:
@
$_GET
[
"c
o
st
u
m"
];
/*if(@$_GET["network"] ){
Yii::app()->theme = "network";
...
...
@@ -125,7 +125,7 @@ class CustomModule extends CWebModule {
if
(
@
$_GET
[
"tpl"
]
==
"iframesig"
){
$theme
=
$_GET
[
"tpl"
];
}
if
(
@
$_GET
[
"c
u
st
o
m"
])
{
if
(
@
$_GET
[
"c
o
st
u
m"
])
{
$theme
=
"CO2"
;
//Yii::app()->params['customParams'] = $_GET["network"];
}
...
...
assets/js/co.js
View file @
295d8806
...
...
@@ -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
c
u
st
o
m
!=
"
undefined
"
&&
c
u
st
o
m
!=
null
&&
typeof
c
u
st
o
m
.
title
!=
"
undefined
"
)
?
c
u
st
o
m
.
title
:
"
Communecter, se connecter à sa commune
"
;
defaultTitle
=
(
typeof
c
o
st
u
m
!=
"
undefined
"
&&
c
o
st
u
m
!=
null
&&
typeof
c
o
st
u
m
.
title
!=
"
undefined
"
)
?
c
o
st
u
m
.
title
:
"
Communecter, se connecter à sa commune
"
;
$
(
document
).
prop
(
'
title
'
,
(
str
!=
""
)
?
str
:
defaultTitle
);
if
(
notNull
(
keywords
))
$
(
'
meta[name="keywords"]
'
).
attr
(
"
content
"
,
keywords
);
else
if
(
typeof
c
u
st
o
m
==
"
undefined
"
||
!
notNull
(
c
u
st
o
m
))
else
if
(
typeof
c
o
st
u
m
==
"
undefined
"
||
!
notNull
(
c
o
st
u
m
))
$
(
'
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
c
u
st
o
m
==
"
undefined
"
||
!
notNull
(
c
u
st
o
m
))
else
if
(
typeof
c
o
st
u
m
==
"
undefined
"
||
!
notNull
(
c
o
st
u
m
))
$
(
'
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é.
"
);
}
...
...
assets/js/default/directory.js
View file @
295d8806
...
...
@@ -84,7 +84,7 @@ function initTypeSearch(typeInit){
if
(
typeInit
==
"
all
"
)
{
if
(
isCustom
(
typeInit
,
"
types
"
)){
searchObject
.
types
=
[];
$
.
each
(
c
u
st
o
m
.
filters
.
app
[
searchObject
.
initType
].
types
,
function
(
e
,
v
){
$
.
each
(
c
o
st
u
m
.
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
(
c
u
st
o
m
.
filters
.
app
[
searchObject
.
initType
].
types
,
function
(
e
,
v
){
$
.
each
(
c
o
st
u
m
.
filters
.
app
[
searchObject
.
initType
].
types
,
function
(
e
,
v
){
searchObject
.
countType
.
push
(
v
);
});
}
...
...
@@ -861,9 +861,9 @@ var directory = {
multiTagsT
:
[],
multiScopesT
:[],
viewMode
:
directoryViewMode
,
c
u
st
o
m
:
(
typeof
c
u
st
o
m
!=
"
undefined
"
&&
c
u
st
o
m
!=
null
&&
typeof
c
u
st
o
m
.
htmlConstruct
!=
"
undefined
"
&&
typeof
c
u
st
o
m
.
htmlConstruct
.
directory
!=
"
undefined
"
)
?
c
u
st
o
m
.
htmlConstruct
.
directory
:
null
,
c
o
st
u
m
:
(
typeof
c
o
st
u
m
!=
"
undefined
"
&&
c
o
st
u
m
!=
null
&&
typeof
c
o
st
u
m
.
htmlConstruct
!=
"
undefined
"
&&
typeof
c
o
st
u
m
.
htmlConstruct
.
directory
!=
"
undefined
"
)
?
c
o
st
u
m
.
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
.
c
u
st
o
m
)){
if
(
!
notNull
(
directory
.
c
o
st
u
m
)){
//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
c
u
st
o
m
!=
"
undefined
"
&&
c
u
st
o
m
!=
null
&&
typeof
c
u
st
o
m
.
filters
!=
'
undefined
'
&&
typeof
c
u
st
o
m
.
filters
.
searchFilters
!=
'
undefined
'
){
if
(
typeof
c
o
st
u
m
!=
"
undefined
"
&&
c
o
st
u
m
!=
null
&&
typeof
c
o
st
u
m
.
filters
!=
'
undefined
'
&&
typeof
c
o
st
u
m
.
filters
.
searchFilters
!=
'
undefined
'
){
$
.
each
(
c
u
st
o
m
.
filters
.
searchFilters
,
function
(
k
,
p
)
{
$
.
each
(
c
o
st
u
m
.
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
.
c
u
st
o
m
)
&&
typeof
directory
.
c
u
st
o
m
.
header
!=
"
undefined
"
&&
typeof
directory
.
c
u
st
o
m
.
header
.
add
!=
"
undefined
"
&&
typeof
directory
.
c
u
st
o
m
.
header
.
add
[
searchObject
.
initType
]
!=
"
undefined
"
){
&& */
notNull
(
directory
.
c
o
st
u
m
)
&&
typeof
directory
.
c
o
st
u
m
.
header
!=
"
undefined
"
&&
typeof
directory
.
c
o
st
u
m
.
header
.
add
!=
"
undefined
"
&&
typeof
directory
.
c
o
st
u
m
.
header
.
add
[
searchObject
.
initType
]
!=
"
undefined
"
){
headerStr
+=
"
<div class='pull-right'>
"
;
headerStr
+=
directory
.
createBtnHtml
();
headerStr
+=
"
</div>
"
;
}
if
(
!
notNull
(
directory
.
c
u
st
o
m
)
||
typeof
directory
.
c
u
st
o
m
.
header
==
"
undefined
"
||
typeof
directory
.
c
u
st
o
m
.
header
.
viewMode
==
"
undefined
"
||
directory
.
c
u
st
o
m
.
header
.
viewMode
)
{
if
(
!
notNull
(
directory
.
c
o
st
u
m
)
||
typeof
directory
.
c
o
st
u
m
.
header
==
"
undefined
"
||
typeof
directory
.
c
o
st
u
m
.
header
.
viewMode
==
"
undefined
"
||
directory
.
c
o
st
u
m
.
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
.
c
u
st
o
m
)
||
typeof
directory
.
c
u
st
o
m
.
header
==
"
undefined
"
||
typeof
directory
.
c
u
st
o
m
.
header
.
map
==
"
undefined
"
||
directory
.
c
u
st
o
m
.
header
.
map
))
{
(
!
notNull
(
directory
.
c
o
st
u
m
)
||
typeof
directory
.
c
o
st
u
m
.
header
==
"
undefined
"
||
typeof
directory
.
c
o
st
u
m
.
header
.
map
==
"
undefined
"
||
directory
.
c
o
st
u
m
.
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
c
u
st
o
m
!=
"
undefined
"
){
if
(
typeof
c
o
st
u
m
!=
"
undefined
"
){
formData
.
mailParams
=
{
logo
:
c
u
st
o
m
.
logo
,
title
:
c
u
st
o
m
.
title
,
url
:
c
u
st
o
m
.
url
logo
:
c
o
st
u
m
.
logo
,
title
:
c
o
st
u
m
.
title
,
url
:
c
o
st
u
m
.
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
)
{
...
...
assets/js/default/globalsearch.js
View file @
295d8806
...
...
@@ -78,9 +78,9 @@ function autoCompleteSearchGS(search, indexMin, indexMax, input){
data
.
countType
=
[
"
citoyens
"
,
"
organizations
"
,
"
projects
"
,
"
events
"
];
data
.
searchType
=
[
"
citoyens
"
,
"
organizations
"
,
"
projects
"
,
"
events
"
];
}
if
(
typeof
c
u
st
o
m
!=
"
undefined
"
&&
notNull
(
c
u
st
o
m
)
&&
typeof
c
u
st
o
m
.
filters
!=
"
undefined
"
&&
typeof
c
u
st
o
m
.
filters
.
searchTypeGS
!=
"
undefined
"
){
data
.
countType
=
c
u
st
o
m
.
filters
.
searchTypeGS
;
data
.
searchType
=
c
u
st
o
m
.
filters
.
searchTypeGS
;
if
(
typeof
c
o
st
u
m
!=
"
undefined
"
&&
notNull
(
c
o
st
u
m
)
&&
typeof
c
o
st
u
m
.
filters
!=
"
undefined
"
&&
typeof
c
o
st
u
m
.
filters
.
searchTypeGS
!=
"
undefined
"
){
data
.
countType
=
c
o
st
u
m
.
filters
.
searchTypeGS
;
data
.
searchType
=
c
o
st
u
m
.
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
c
u
st
o
m
!=
"
undefined
"
&&
notNull
(
c
u
st
o
m
)
&&
typeof
c
u
st
o
m
.
searchOpenMenu
!=
"
undefined
"
){
extendMsg
=
c
u
st
o
m
.
searchOpenMenu
.
msg
;
extendUrl
=
c
u
st
o
m
.
searchOpenMenu
.
url
;
if
(
typeof
c
o
st
u
m
!=
"
undefined
"
&&
notNull
(
c
o
st
u
m
)
&&
typeof
c
o
st
u
m
.
searchOpenMenu
!=
"
undefined
"
){
extendMsg
=
c
o
st
u
m
.
searchOpenMenu
.
msg
;
extendUrl
=
c
o
st
u
m
.
searchOpenMenu
.
url
;
}
str
+=
'
<div class="text-center" id="footerDropdownGS">
'
;
...
...
assets/js/default/search.js
View file @
295d8806
...
...
@@ -869,16 +869,16 @@ function initCategoriesApp(type){
}
function
isCustom
(
typeInterface
,
labelFilter
){
res
=
false
;
if
(
typeof
c
u
st
o
m
!=
"
undefined
"
&&
typeof
c
u
st
o
m
.
filters
!=
"
undefined
"
&&
typeof
c
u
st
o
m
.
filters
.
app
!=
"
undefined
"
&&
typeof
c
u
st
o
m
.
filters
.
app
[
typeInterface
]
!=
"
undefined
"
){
if
(
typeof
c
o
st
u
m
!=
"
undefined
"
&&
typeof
c
o
st
u
m
.
filters
!=
"
undefined
"
&&
typeof
c
o
st
u
m
.
filters
.
app
!=
"
undefined
"
&&
typeof
c
o
st
u
m
.
filters
.
app
[
typeInterface
]
!=
"
undefined
"
){
if
(
notNull
(
labelFilter
)){
if
(
typeof
c
u
st
o
m
.
filters
.
app
[
typeInterface
]
!=
"
undefined
"
&&
typeof
c
u
st
o
m
.
filters
.
app
[
typeInterface
][
labelFilter
]
!=
"
undefined
"
)
if
(
typeof
c
o
st
u
m
.
filters
.
app
[
typeInterface
]
!=
"
undefined
"
&&
typeof
c
o
st
u
m
.
filters
.
app
[
typeInterface
][
labelFilter
]
!=
"
undefined
"
)
return
true
;
else
return
false
;
}
else
if
(
_
.
isObject
(
c
u
st
o
m
.
filters
.
app
[
typeInterface
]))
}
else
if
(
_
.
isObject
(
c
o
st
u
m
.
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
c
u
st
o
m
.
filters
.
app
[
searchObject
.
initType
]
!=
"
undefined
"
){
$
.
each
(
c
u
st
o
m
.
filters
.
app
[
searchObject
.
initType
],
function
(
e
,
v
){
if
(
typeof
c
o
st
u
m
.
filters
.
app
[
searchObject
.
initType
]
!=
"
undefined
"
){
$
.
each
(
c
o
st
u
m
.
filters
.
app
[
searchObject
.
initType
],
function
(
e
,
v
){
if
(
v
.
length
>
1
){
c
u
st
o
m
.
categories
=
new
Object
;
c
u
st
o
m
.
categories
=
v
;
c
o
st
u
m
.
categories
=
new
Object
;
c
o
st
u
m
.
categories
=
v
;
if
(
e
==
"
types
"
){
$
.
each
(
categoriesFilters
,
function
(
i
,
content
){
if
(
$
.
inArray
(
i
,
v
)
<
0
&&
i
!=
"
all
"
)
...
...
assets/js/scopes/scopes.js
View file @
295d8806
...
...
@@ -141,19 +141,19 @@ function getUrlSearchLocality(urlGet, alert){
//if(notNull(alert)){
if
(
value
.
active
==
true
){
if
(
value
.
type
==
"
cities
"
&&
(
typeof
c
u
st
o
m
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
.
scopes
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
.
scopes
.
cities
==
"
undefned
"
||
key
.
indexOf
(
c
u
st
o
m
.
filters
.
scopes
.
cities
)
<
0
)){
&&
(
typeof
c
o
st
u
m
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
.
scopes
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
.
scopes
.
cities
==
"
undefned
"
||
key
.
indexOf
(
c
o
st
u
m
.
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
c
u
st
o
m
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
.
scopes
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
.
scopes
.
cp
==
"
undefned
"
||
value
.
id
.
indexOf
(
c
u
st
o
m
.
filters
.
scopes
.
cp
)
<
0
))
&&
(
typeof
c
o
st
u
m
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
.
scopes
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
.
scopes
.
cp
==
"
undefned
"
||
value
.
id
.
indexOf
(
c
o
st
u
m
.
filters
.
scopes
.
cp
)
<
0
))
urlScopeCp
.
push
(
value
.
id
);
else
if
(
value
.
type
.
indexOf
(
"
level
"
)
>=
0
&&
(
typeof
c
u
st
o
m
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
.
scopes
==
"
undefined
"
||
typeof
c
u
st
o
m
.
filters
.
scopes
.
zones
==
"
undefned
"
||
value
.
id
.
indexOf
(
c
u
st
o
m
.
filters
.
scopes
.
zones
)
<
0
))
&&
(
typeof
c
o
st
u
m
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
.
scopes
==
"
undefined
"
||
typeof
c
o
st
u
m
.
filters
.
scopes
.
zones
==
"
undefned
"
||
value
.
id
.
indexOf
(
c
o
st
u
m
.
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
)
c
u
st
o
m
.
scopes
=
myScopes
[
"
open
"
];
c
o
st
u
m
.
scopes
=
myScopes
[
"
open
"
];
},
error
:
function
(
error
){
toastr
.
error
(
"
waswrong
"
)
...
...
components/CommunecterController.php
View file @
295d8806
...
...
@@ -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
[
"c
u
st
o
m"
]
||
!@
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"admins"
]
||
!
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"admins"
][
Yii
::
app
()
->
session
[
"userId"
]]))
&&
(
!@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
]
||
!@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"admins"
]
||
!
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"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"
]
)
)
...
...
models/CO2.php
View file @
295d8806
...
...
@@ -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
[
"c
u
st
o
m"
][
"htmlConstruct"
]){
$constructParams
=
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"htmlConstruct"
];
if
(
@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"htmlConstruct"
]){
$constructParams
=
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"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
[
"c
u
st
o
m"
][
"add"
])
$params
[
"add"
]
=
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"add"
];
if
(
@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"add"
])
$params
[
"add"
]
=
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"add"
];
Yii
::
app
()
->
session
[
"paramsConfig"
]
=
$params
;
}
...
...
views/admin/index.php
View file @
295d8806
...
...
@@ -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
[
"c
u
st
o
m"
])
&&
isset
(
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"htmlConstruct"
])
&&
isset
(
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"htmlConstruct"
][
"adminPanel"
])
&&
isset
(
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"htmlConstruct"
][
"adminPanel"
][
"add"
])){
if
(
isset
(
Yii
::
app
()
->
session
[
"c
o
st
u
m"
])
&&
isset
(
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"htmlConstruct"
])
&&
isset
(
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"htmlConstruct"
][
"adminPanel"
])
&&
isset
(
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"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
[
"c
u
st
o
m"
][
"add"
])){
if
(
isset
(
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"add"
])){
foreach
(
$addElement
as
$key
=>
$v
)
if
(
!@
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"add"
][
$key
]
&&
(
!@
$v
[
"type"
]
||
!@
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"add"
][
$v
[
"type"
]]))
unset
(
$addElement
[
$key
]);
if
(
!@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"add"
][
$key
]
&&
(
!@
$v
[
"type"
]
||
!@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"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
[
"c
u
st
o
m"
]
&&
@
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"admins"
]
&&
@
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"admins"
][
Yii
::
app
()
->
session
[
"userId"
]])){
&&
@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
]
&&
@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"admins"
]
&&
@
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"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
[
'c
u
st
o
m'
][
"logo"
])
?
Yii
::
app
()
->
session
[
'c
u
st
o
m'
][
"logo"
]
:
Yii
::
app
()
->
theme
->
baseUrl
.
"/assets/img/LOGOS/CO2/logo-min.png"
;
$logo
=
(
@
Yii
::
app
()
->
session
[
'c
o
st
u
m'
][
"logo"
])
?
Yii
::
app
()
->
session
[
'c
o
st
u
m'
][
"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
[
"c
u
st
o
m"
])
&&
isset
(
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"sourceKey"
]))){
?>
if
(
!
isset
(
$v
[
"sourceKey"
])
||
(
isset
(
Yii
::
app
()
->
session
[
"c
o
st
u
m"
])
&&
isset
(
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"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>
...
...
views/admin/referenceTable.php
View file @
295d8806
...
...
@@ -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
c
u
st
o
m
!=
"
undefined
"
&&
c
u
st
o
m
.
slug
)
?
c
u
st
o
m
.
slug
:
null
;
var
sourceKey
=
(
typeof
c
o
st
u
m
!=
"
undefined
"
&&
c
o
st
u
m
.
slug
)
?
c
o
st
u
m
.
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
c
u
st
o
m
!=
"
undefined
"
&&
notNull
(
c
u
st
o
m
)
&&
c
u
st
o
m
.
slug
){
params
.
origin
=
"
c
u
st
o
m
"
;
params
.
sourceKey
=
c
u
st
o
m
.
slug
;
if
(
typeof
c
o
st
u
m
!=
"
undefined
"
&&
notNull
(
c
o
st
u
m
)
&&
c
o
st
u
m
.
slug
){
params
.
origin
=
"
c
o
st
u
m
"
;
params
.
sourceKey
=
c
o
st
u
m
.
slug
;
}
$
.
ajax
({
type
:
"
POST
"
,
...
...
views/app/live.php
View file @
295d8806
<?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
;
...
...
views/app/welcome.php
View file @
295d8806
...
...
@@ -27,11 +27,11 @@
<section
class=
"bg-white inline-block pull-left no-padding"
id=
"bg-homepage"
>
<?php
if
(
@
Yii
::
app
()
->
session
[
'c
u
st
o
m'
][
"welcomeTpl"
])
$this
->
renderPartial
(
Yii
::
app
()
->
session
[
"c
u
st
o
m"
][
"welcomeTpl"
]
);
else
if
(
@
$_GET
[
"city"
]
||
Yii
::
app
()
->
session
[
'c
u
st
o
m'
][
'id'
]
)
if
(
@
Yii
::
app
()
->
session
[
'c
o
st
u
m'
][
"welcomeTpl"
])
$this
->
renderPartial
(
Yii
::
app
()
->
session
[
"c
o
st
u
m"
][
"welcomeTpl"
]
);
else
if
(
@
$_GET
[
"city"
]
||
Yii
::
app
()
->
session
[
'c
o
st
u
m'
][
'id'
]
)
{
$city
=
City
::
getById
(
Yii
::
app
()
->
session
[
'c
u
st
o
m'
][
'id'
]
);
$city
=
City
::
getById
(
Yii
::
app
()
->
session
[
'c
o
st
u
m'
][
'id'
]
);
if
(
@
$city
[
"custom"
]
&&
$city
[
"custom"
][
"bannerTpl"
])
$this
->
renderPartial
(
'eco.views.custom.'
.
$city
[
"custom"
][
"bannerTpl"
]
);
}
...
...
views/custom/init.php
View file @
295d8806
...
...
@@ -92,7 +92,7 @@ if( @$_GET["el"] || @$custom )
$c
[
"request"
][
"sourceKey"
]
=
[
$el
[
"slug"
]];
}
Yii
::
app
()
->
session
[
'c
u
st
o
m'
]
=
$c
;
Yii
::
app
()
->
session
[
'c
o
st
u
m'
]
=
$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
[
"c
u
st
o
m"
]
=
null
;
Yii
::
app
()
->
session
[
"c
o
st
u
m"
]
=
null
;
//delete custom;
}
if
(
@
Yii
::
app
()
->
session
[
'c
u
st
o
m'
]
){
?>
if
(
@
Yii
::
app
()
->
session
[
'c
o
st
u
m'
]
){
?>
<script
type=
"text/javascript"
>
var
c
u
st
o
m
=
<?php
echo
json_encode
(
Yii
::
app
()
->
session
[
'c
u
st
o
m'
])
?>
;
var
c
o
st
u
m
=
<?php
echo
json_encode
(
Yii
::
app
()
->
session
[
'c
o
st
u
m'
])
?>
;
//if(typeof custom.appRendering != "undefined")
themeParams
=
<?php
echo
json_encode
(
Yii
::
app
()
->
session
[
'paramsConfig'
])
?>
;
custom
.
init
=
function
(
where
){
if
(
c
u
st
o
m
.
logo
){
if
(
c
o
st
u
m
.
logo
){
$
(
"
.topLogoAnim
"
).
remove
();
$
(
"
.logo-menutop, .logoLoginRegister
"
).
attr
({
'
src
'
:
c
u
st
o
m
.
logo
});
$
(
"
.logo-menutop, .logoLoginRegister
"
).
attr
({
'
src
'
:
c
o
st
u
m
.
logo
});