Commit 03b94413 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

Merge branch 'master' into development

parents 83328573 d8c7016e
...@@ -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.");
} }
......
...@@ -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),
......
...@@ -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
...@@ -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");
} }
......
Supports Markdown
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