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
Pixel Humain
api
Commits
03b94413
Commit
03b94413
authored
Apr 03, 2019
by
Tibor Katelbach
Browse files
Merge branch 'master' into development
parents
83328573
d8c7016e
Changes
4
Hide whitespace changes
Inline
Side-by-side
assets/js/dataHelpers.js
View file @
03b94413
...
@@ -90,43 +90,6 @@ function isUniqueUsername(username) {
...
@@ -90,43 +90,6 @@ function isUniqueUsername(username) {
return
response
;
return
response
;
}
}
function
addCustomValidators
()
{
//Validate a postalCode
jQuery
.
validator
.
addMethod
(
"
validPostalCode
"
,
function
(
value
,
element
)
{
var
response
;
$
.
ajax
({
url
:
baseUrl
+
'
/
'
+
moduleId
+
"
/opendata/getcitiesbypostalcode/
"
,
data
:
{
postalCode
:
value
},
type
:
'
post
'
,
global
:
false
,
async
:
false
,
dataType
:
'
json
'
,
success
:
function
(
data
)
{
response
=
data
;
}
});
if
(
Object
.
keys
(
response
).
length
>
0
)
{
return
true
;
}
else
{
return
false
;
}
},
"
Code postal inconnu
"
);
jQuery
.
validator
.
addMethod
(
"
validUserName
"
,
function
(
value
,
element
)
{
//Check authorized caracters
var
usernameRegex
=
/^
[
a-zA-Z0-9
]
+$/
;
var
validUsername
=
value
.
match
(
usernameRegex
);
if
(
validUsername
==
null
)
{
return
false
;
}
else
{
return
true
;
}
},
"
Invalid username : Only characters A-Z, a-z, 0-9 and '-' are acceptable.
"
);
jQuery
.
validator
.
addMethod
(
"
uniqueUserName
"
,
function
(
value
,
element
)
{
//Check unique username
return
isUniqueUsername
(
value
);
},
"
A user with the same username already exists. Please choose an other one.
"
);
}
}
...
...
components/ApiController.php
View file @
03b94413
...
@@ -21,6 +21,7 @@ class ApiController extends Controller
...
@@ -21,6 +21,7 @@ class ApiController extends Controller
public
$pages
=
array
(
public
$pages
=
array
(
"data"
=>
array
(
"data"
=>
array
(
"get"
=>
array
(
"href"
=>
"/ph/api/data/get"
,
"public"
=>
true
),
"get"
=>
array
(
"href"
=>
"/ph/api/data/get"
,
"public"
=>
true
),
"tags"
=>
array
(
"href"
=>
"/ph/api/data/tags"
,
"public"
=>
true
),
),
),
"default"
=>
array
(
"default"
=>
array
(
"index"
=>
array
(
"href"
=>
"/ph/api/default/index"
,
"public"
=>
true
),
"index"
=>
array
(
"href"
=>
"/ph/api/default/index"
,
"public"
=>
true
),
...
...
controllers/DataController.php
View file @
03b94413
...
@@ -8,9 +8,12 @@ class DataController extends ApiController {
...
@@ -8,9 +8,12 @@ class DataController extends ApiController {
public
function
actions
(){
public
function
actions
(){
return
array
(
return
array
(
'get'
=>
'citizenToolKit.controllers.opendata.GetDataSwaggerAction'
,
'get'
=>
'citizenToolKit.controllers.opendata.GetDataSwaggerAction'
,
'tags'
=>
'citizenToolKit.controllers.tags.GetAction'
,
);
);
}
}
}
}
?>
?>
\ No newline at end of file
controllers/DefaultController.php
View file @
03b94413
...
@@ -24,6 +24,7 @@ class DefaultController extends ApiController {
...
@@ -24,6 +24,7 @@ class DefaultController extends ApiController {
*/
*/
public
function
actionIndex
()
public
function
actionIndex
()
{
{
Yii
::
app
()
->
theme
=
"ph-dori"
;
$this
->
layout
=
"//layouts/mainApi"
;
$this
->
layout
=
"//layouts/mainApi"
;
$this
->
render
(
"index"
);
$this
->
render
(
"index"
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment