Commit a420387f authored by Laurent Després's avatar Laurent Després
Browse files

first recensement getAjax plus renomé en old fichiers/dossiers non utile

parent dbe287bf
var loadActivity = true;
function getHistoryOfActivities(id,type){
/** @namespace api */
function getHistoryOfActivities(id, type) {
$("#contentGeneralInfos").hide();
$("#activityContent").removeClass("hide");
$("#getHistoryOfActivities").html("<i class='fa fa-arrow-left'></i> <span class='hidden-xs'>Revenir aux détails</span>").attr("onclick","getBackDetails('"+id+"','"+type+"')");
$("#getHistoryOfActivities").html("<i class='fa fa-arrow-left'></i> <span class='hidden-xs'>Revenir aux détails</span>").attr("onclick", "getBackDetails('" + id + "','" + type + "')");
//if($("#activityContent").html()=='<h2 class="homestead text-dark" style="padding:40px;"><i class="fa fa-spin fa-refresh"></i> Chargement des activités ...</h2>')
if(loadActivity==true){
getAjax('#activityContent',baseUrl+'/'+moduleId+"/pod/activitylist/type/"+type+"/id/"+id,function(){
},"html");
if (loadActivity == true) {
/**
* @method getAjax
* @param {string} '#activityContent' @description dom element id
* @param {string} baseUrl+'/'+moduleId+"/pod/activitylist/type/"+type+"/id/"+id @description url
* @param {function} function() @description callback here none
* @param {string} "html" @description format
* @return {string} - @description test
**/
getAjax('#activityContent', baseUrl + '/' + moduleId + "/pod/activitylist/type/" + type + "/id/" + id, function () {
}, "html");
}
}
function getBackDetails(id,type){
function getBackDetails(id, type) {
$("#contentGeneralInfos").show();
$("#activityContent").addClass("hide");
$("#getHistoryOfActivities").html("<i class='fa fa-history'></i> <span class='hidden-xs'>Historique</span>").attr("onclick","getHistoryOfActivities('"+id+"','"+type+"')");
loadActivity=false;
$("#getHistoryOfActivities").html("<i class='fa fa-history'></i> <span class='hidden-xs'>Historique</span>").attr("onclick", "getHistoryOfActivities('" + id + "','" + type + "')");
loadActivity = false;
}
<?php
class BookmarkController extends ApiController {
public $hasSocial = false;
public $loginRegister = true;
public function accessRules() {
return array(
// not logged in users should be able to login and view captcha images as well as errors
array('allow', 'actions' => array('index','graph','register','register2')),
// logged in users can do whatever they want to
array('allow', 'users' => array('@')),
// not logged in users can't do anything except above
array('deny'),
);
}
protected function beforeAction($action) {
//parent::initPage();
return parent::beforeAction($action);
}
public function actions(){
return array(
'get' => $this->dispatch(),
);
}
public function dispatch(Type $var = null)
{
//var_dump(["test" => Yii::app()->controller->pages]);exit;
var_dump(["request" => Yii::app()->request]);
$method = yii::app()->request->requestType;
var_dump(["currentTest" => $method]);exit;
// $classToCall = ucfirst(substr($request->getPathInfo(), 1));
// $toCall = "App\Controller\\" . $classToCall;
// $params = $request->getQueryString();
// $requestUri = $request->getPathInfo() . "?" . $params;
// if (!empty($_SERVER['HTTP_AUTHORIZATION'])) {
// $tokenClient = explode(" ", $_SERVER['HTTP_AUTHORIZATION'])[1];
// } else {
// $tokenClient = "noToken";
// }
// // la route login est a part avec le traitement de generation de token
// // sinon gestions des requétes par methode via les classes au nom des tables de la bdd
// if ($req === 'login') {
// $log = new $toCall($request);
// return $log->makeTok();
// } else {
// switch ($method) {
// case 'GET':
// $table = new $toCall($request, $tokenClient);
// return $table->get($requestUri);
// case 'POST':
// $table = new $toCall($request, $tokenClient);
// return $table->post();
// case 'PUT':
// $id = substr($_REQUEST['id'], 3);
// $_REQUEST['id'] = $id;
// if (strstr($params, "password=")) {
// return new Response("", 204, array("status" => 'KO', 'Message' => 'impossible de changer le password via put'));
// }
// $explodeParams = explode("&",$params);
// $paramToSend = '?'.$explodeParams[0];
// $table = new $toCall($request, $tokenClient);
// return $table->put($paramToSend, $_REQUEST);
// case 'DELETE':
// $table = new $toCall($request, $tokenClient);
// return $table->delete();
// default:
// return new Response("PAGE NOT FOUND", 404);
// break;
// }
// }
// }
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
* @author: Tibor Katelbach <tibor@pixelhumain.com>
* Date: 18/07/2014
*/
class ErrorController extends APiController {
class ErrorController extends ApiController {
protected function beforeAction($action)
{
......
////////////////////////////
///getAjax()
////////////////////////////
//modules/api/assets/js/activityHistory.js l8
getAjax('#activityContent', baseUrl + '/' + moduleId + "/pod/activitylist/type/" + type + "/id/" + id, function () {
}, "html");
///home/lotik/pixelhumain-docker/code/modules/api/assets/js/communecter.js l745
getAjax('.main-col-search', baseUrl + '/' + moduleId + url, function (data) {
initNotifications();
bindExplainLinks();
bindTags();
$.unblockUI();
}, "html");
///home/lotik/pixelhumain-docker/code/modules/api/assets/js/news/newsHtml.js l669
getAjax('.commentContent', baseUrl + '/' + moduleId + "/comment/index/type/news/id/" + id, function () { }, "html");
///home/lotik/pixelhumain-docker/code/modules/chat/views/default/rocketchat.php l99/101/167
//preload the iframe
getAjax('.RCcontainer', baseUrl + '/' + moduleId + '/rocketchat', null, "html");
//get all users Lsit of channels
getAjax(null, baseUrl + '/' + moduleId + '/rocketchat/list', function (data) {
mylog.log("rcObj.list : ", data);
rcObj.list = data;
}, "json");
getAjax(null, iframeUrl, function (data) {
$('.btnChatColor').addClass("text-red");
rcObj.goto(name, isOpen);
}, "json");
///home/lotik/pixelhumain-docker/code/modules/classifieds/views/co/preview.php l234
getAjax("#commentElement", baseUrl + "/" + moduleId + "/comment/index/type/classified/id/" + element['_id']['$id'],
function () {
}, "html");
//home/lotik/pixelhumain-docker/code/modules/classifieds/views/co/search.php l152
getAjax('#page', baseUrl + '/' + moduleId + "/default/directoryjs" + typeUrl + appUrl, function () {
$(".btn-directory-type").click(function () {
var typeD = $(this).data("type");
if (typeD == "events") {
var typeEvent = $(this).data("type-event");
searchSType = typeEvent;
}
initTypeSearch(typeD);
mylog.log("search.php", searchType);
setHeaderDirectory(typeD);
loadingData = false;
pageCount = true;
pageEvent = false;
search.type = searchType;
startSearch(0, indexStepInit, searchCallback);
// KScrollTo("#content-social");
$(".btn-directory-type").removeClass("active");
$(this).addClass("active");
});
$(".btn-open-filliaire").click(function () {
KScrollTo("#content-social");
});
//anny double section filter directory
//<?php if(@$type == "classified" || @$type == "place" ){ ?>
initClassifiedInterface();
// <?php } ?>
bindLeftMenuFilters();
loadingData = false;
initTypeSearch(type);
startSearch(null, null, searchCallback);
initSearchInterface();
}, "html");
//home/lotik/pixelhumain-docker/code/modules/classifieds/views/co/standalone.php l220
getAjax("#commentElement", baseUrl + "/" + moduleId + "/comment/index/type/classified/id/" + element['_id']['$id'],
function () { }, "html");
//home/lotik/pixelhumain-docker/code/modules/classifieds/views/default/index.php l31
getAjax('', baseUrl + '/<?php echo $this->module->id;?>/default/doc',
function (data) {
descHtml = dataHelper.markdownToHtml(data);
$('#doc').html(descHtml);
}, "html");
//home/lotik/pixelhumain-docker/code/modules/classifieds/views/terla/standalone.php l125
getAjax("#commentElement", baseUrl + "/" + moduleId + "/comment/index/type/classified/id/" + element['_id']['$id'],
function () {
$(".container-txtarea").hide();
$(".btn-select-arg-comment").click(function () {
var argval = $(this).data("argval");
$(".container-txtarea").hide();
});
}, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/activityHistory.js l8
getAjax('#activityContent', baseUrl + '/' + moduleId + "/pod/activitylist/type/" + type + "/id/" + id, function () {
}, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/co.js l1678/3324/3659/3676/3690/3711
getAjax(dest, url, function () {
//next and previous btn to nav from preview to preview
if (nextPrev) {
var p = 0;
var n = 0;
var found = false;
var l = $('.searchEntityContainer .container-img-profil').length;
$.each($('.searchEntityContainer .container-img-profil'), function (i, val) {
if (found) {
n = (i == l - 1) ? $($('.searchEntityContainer .container-img-profil')[0]).attr('href') : $(this).attr('href');
return false;
}
if ($(this).attr('href') == nextPrev)
found = true;
else
p = (i == 0) ? $($('.searchEntityContainer .container-img-profil')[$('.searchEntityContainer .container-img-profil').length]).attr('href') : $(this).attr('href');
});
html = "<div style='margin-bottom:50px'><a href='" + p + "' class='lbhp text-dark'><i class='fa fa-2x fa-arrow-circle-left'></i> PREV </a> " +
" <a href='" + n + "' class='lbhp text-dark'> NEXT <i class='fa fa-2x fa-arrow-circle-right'></i></a></div>";
$(dest).prepend(html);
}
coInterface.bindLBHLinks();
}, "html");
getAjax(null, baseUrl + '/' + moduleId + "/document/list/id/" + id + "/type/" + type + "/tpl/json", function (data) {
console.dir(data);
smallMenu.build(
data.list,
function (params) {
str = '<style>.thumb-info{height:200px; overflow: hidden; position: relative; } .thumb-info img{}</style><a class="pull-left btn bg-red addPhotoBtn" data-type="' + type + '" data-id="' + id + '" href="javascript:;"> Ajouter des Photos <i class="fa fa-plus"></i></a>' +
"<div class='homestead titleSmallMenu' style='font-size:35px'> Album <i class='fa fa-angle-right'></i> " + data.element.name + " </div><br/>" +
js_templates.loop(params, "album");
return str;
},
function () {
$(".addPhotoBtn").click(function () {
uploadObj.set(type, id);
dyFObj.openForm("addPhoto");
});
album.delete();
});
});
getAjax('', url, function (data) {
descHtml = dataHelper.markdownToHtml(data);
smallMenu.content(title + descHtml);
}
, "html"); //x3
getAjax('', url, function (data) {
urlT = url.split('/');
title = url + "<br/>" + urlT[8];
smallMenu.content().JSONView(data);
}
, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/cooperation/uiCoop.js l521/662/730
getAjax("#comments-container", baseUrl + "/" + uiCoop.moduleIdCoop + "/comment/index/type/proposals/id/" + idParentProposal,
function () { //$(".commentCount").html( $(".nbComments").html() );
$(".container-txtarea").hide();
$(".btn-select-arg-comment").click(function () {
var argval = $(this).data("argval");
$(".container-txtarea").show();
$(".textarea-new-comment").removeClass("bg-green-comment bg-white-comment bg-red-comment");
var classe = "";
var pholder = "Votre commentaire";
if (argval == "up") { classe = "bg-green-comment"; pholder = "Votre argument pour"; }
if (argval == "down") { classe = "bg-red-comment"; pholder = "Votre argument contre"; }
$(".textarea-new-comment").addClass(classe).attr("placeholder", pholder);
$("#argval").val(argval);
});
}, "html");
getAjax("#comments-container", baseUrl + "/" + uiCoop.moduleIdCoop + "/comment/index/type/actions/id/" + idAction,
function () { //$(".commentCount").html( $(".nbComments").html() );
}, "html");
getAjax("#comments-container", baseUrl + "/" + uiCoop.moduleIdCoop + "/comment/index/type/resolutions/id/" + idParentResolution,
function () { //$(".commentCount").html( $(".nbComments").html() );
$(".container-txtarea").hide();
$(".btn-select-arg-comment").click(function () {
var argval = $(this).data("argval");
$(".container-txtarea").show();
$(".textarea-new-comment").removeClass("bg-green-comment bg-red-comment");
var classe = "";
var pholder = "Votre commentaire";
if (argval == "up") { classe = "bg-green-comment"; pholder = "Votre argument pour"; }
if (argval == "down") { classe = "bg-red-comment"; pholder = "Votre argument contre"; }
$(".textarea-new-comment").addClass(classe).attr("placeholder", pholder);
$("#argval").val(argval);
});
}, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/default/admin.js l1335
getAjax(".content-risk-comment-tree", baseUrl + "/" + moduleId + "/comment/index/type/" + type + "/id/" + id,
function () { //$(".commentCount").html( $(".nbComments").html() );
}, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/default/editInPlace.js l28
getAjax(".calendar", baseUrl + "/" + moduleId + "/event/calendarview/id/" + contextData.id + "/pod/1?date=1", null, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/default/media.js l173
getAjax('#commentContent' + id, baseUrl + '/' + moduleId + "/comment/index/type/media/id/" + id, function () {
}, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/default/profilSocial.js
//l249
getAjax('', baseUrl + '/' + moduleId + '/element/getdatadetail/type/' + contextData.type +
'/id/' + contextData.id + '/dataName/' + pageProfil.params.dir + sub + '?tpl=json',
function (data) {
var type = ($.inArray(pageProfil.params.dir, ["poi", "ressources", "vote", "actions", "discuss"]) >= 0) ? pageProfil.params.dir : null;
mylog.log("pageProfil.views.directory canEdit", canEdit);
if (typeof canEdit != "undefined" && canEdit)
canEdit = pageProfil.params.dir;
mylog.log("pageProfil.views.directory edit", canEdit);
displayInTheContainer(data, pageProfil.params.dir, dataIcon, type, canEdit);
if (typeof mapCO != "undefined") {
mapCO.clearMap();
mapCO.addElts(data);
mapCO.map.invalidateSize();
}
coInterface.bindButtonOpenForm();
if (typeof callBack != "undefined" && callBack != null)
callBack();
}
, "html");
//l293
getAjax('', baseUrl + '/' + moduleId + '/element/geturls/type/' + contextData.type +
'/id/' + contextData.id,
function (data) {
displayInTheContainer(data, "urls", "external-link", "urls");
}
, "html");
//l302
getAjax('', baseUrl + '/' + moduleId + '/element/getnetworks/type/' + contextData.type +
'/id/' + contextData.id,
function (data) {
mylog.log("loadNetworks success", data, canEdit);
displayInTheContainer(data, "networks", "external-link", "networks", canEdit);
}
, "html");
//l312
getAjax('', baseUrl + '/' + moduleId + '/element/getcuriculum/type/' + contextData.type +
'/id/' + contextData.id,
function (html) {
mylog.log("loadCuriculum success", html);
$("#central-container").html(html);
}
, "html");
//l322
getAjax('', baseUrl + '/' + moduleId + '/settings/index',
function (html) {
$("#central-container").html(html);
}
, "html");
//l330
getAjax('', baseUrl + '/' + moduleId + '/settings/confidentiality/type/' + contextData.type + '/id/' + contextData.id,
function (html) {
$("#central-container").html("<div class='col-xs-12 bg-white'>" + html + "</div>");
}
, "html");
//l338
getAjax('', baseUrl + '/' + moduleId + '/element/getcontacts/type/' + contextData.type +
'/id/' + contextData.id,
function (data) {
mylog.log("loadContacts", data);
displayInTheContainer(data, "contacts", "envelope", "contacts");
$(".openFormContact").click(function () {
var idReceiver = $(this).data("id-receiver");
var idReceiverParent = contextData.id;
var typeReceiverParent = contextData.type;
var contactMail = $(this).data("email");
var contactName = $(this).data("name");
//mylog.log('contactMail', contactMail);
$("#formContact .contact-email").html(contactMail);
$("#formContact #contact-name").html(contactName);
$("#formContact #emailSender").val(userConnected.email);
$("#formContact #name").val(userConnected.name);
$("#formContact #form-control").val("");
$("#formContact #idReceiver").val(idReceiver);
$("#formContact #idReceiverParent").val(idReceiverParent);
$("#formContact #typeReceiverParent").val(typeReceiverParent);
$("#conf-fail-mail, #conf-send-mail, #form-fail").addClass("hidden");
$("#form-group-contact").removeClass("hidden");
$("#formContact").modal("show");
});
}
, "html");
//l372
getAjax('', baseUrl + '/api/person/get/id/' + contextData.id + "/format/md",
function (data) {
descHtml = dataHelper.markdownToHtml(data);
$('#central-container').html(descHtml);
coInterface.bindLBHLinks();
}
, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/default/shoppingCart.js
//l375
getAjax(".contentCB", baseUrl + '/' + moduleId + "/pay" + params, null, "html");
//l380
getAjax(".contentCB", baseUrl + '/' + moduleId + "/done?amount=" + shopping.checkoutObj.total + "&cur=EUR&card=CB_VISA_MASTERCARD", null, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/dynForm/entry.js
//l43
getAjax(null, baseUrl + "/" + moduleId + "/rooms/index/type/citoyens/id/" + userId + "/view/data/fields/votes", function (data) {
window.myVotesList = {};
$.each(data.votes, function (k, v) {
parentName = "";
if (v.parentType != "cities" && !window.myVotesList[v.parentType]) {
var label = (v.parentType == "cities" && cpCommunexion && v.parentId.indexOf(cpCommunexion)) ? cityNameCommunexion : v.parentType;
window.myVotesList[v.parentType] = { "label": label };
window.myVotesList[v.parentType].options = {}
} /*else{
//if(notNull(myContactsById[v.parentType]) && notNull(myContactsById[v.parentType][v['_id']['$id']]))
//parentName = myContactsById[v.parentType][v['_id']['$id']].name;
}*/
window.myVotesList[v.parentType].options[v['_id']['$id']] = v.name + parentName;
});
//run through myContacts to fill parent names
mylog.dir(window.myVotesList);
html = buildSelectGroupOptions(window.myVotesList);
$("#survey").append(html);
if (contextDataDDA && contextDataDDA.room)
$("#ajaxFormModal #survey").val(contextDataDDA.room);
});
///home/lotik/pixelhumain-docker/code/modules/co2/views/admin/moderateAll.php
//l343
getAjax('.commentContent', urlToSend, function () {
$('.bar_tools_post').hide();
$('.saySomething').hide();
}, "html");
//home/lotik/pixelhumain-docker/code/modules/co2/views/admin/moderateOne.php
//l42
getAjax('.toModerateContent', urlToSend, function (handleResponse) {
$('.buttonBar').show();
$(".timeline_element").css("min-width", "95%");
$(".timeline_element").css("pointer-events", "none");
$(".timeline_element").css("cursor", "default");
$("div.timeline").css("min-height", 0);
$(".date_separator").hide();
$(".dropdown").hide();
$(".newsAddComment").hide();
}, "html");
///home/lotik/pixelhumain-docker/code/modules/co2/views/app/city.php
//l27
getAjax("#city-main-container", baseUrl + '/' + moduleId + "/city/detail/insee/" + insee + "/postalCode/" + postalCode, function (data) {
}, "html");
/////////////////////////////
////getAjaxNotifications()
///////////////////////////////
//home/lotik/pixelhumain-docker/code/modules/co2/assets/js/default/notifications.js l76/84/194
//ici voir fonction interne $.ajax encore la
getAjaxNotification(element, "scroll", elementType, elementId);
getAjaxNotification($(this).data("element"), null, $(this).data("type"), $(this).data("id"));
getAjaxNotification(element, event, elementType, elementId);
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