1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| $().SPServices(
{
operation: "GetAllSubWebCollection",
webURL: targetUrl,
async: false,
completefunc: function (xData, Status)
{
$(xData.responseXML).find("Web").each(function ()
{
$().SPServices(
{
operation: "GetListCollection",
webURL: $(this).attr("WebFullUrl"),
async: false,
completefunc: function (xData, Status)
{
$(xData.responseXML).find("List").each(function ()
{
//function to get all items inside every list called "Pages"
if ($(this).attr("Title") == "Pages")
{
$().SPServices(
{
operation: "GetListItems",
webURL: $(this).attr("WebFullUrl"),
async: false,
listName: $(this).attr("Title"),
CAMLViewFields: "<ViewFields><FieldRef Name='EncodedAbsUrl' /><FieldRef Name='Title' /></ViewFields>",
completefunc: function (xData, Status)
{
$(xData.responseXML).SPFilterNode("z:row").each(function ()
{
var title = $(this).attr("ows_Title");
console.log( $(this).attr('Name'));
if ($.inArray(title, TabLibs) != -1)
{
console.log(title);
$().SPServices(
{
operation: "GetListItems",
async: false,
//if you set this to true, you may get faster performance, but your order may not be accurate.
webURL: targetUrl,
listName:"HSE Causerie",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
CAMLQuery: "<Query>" +
"<Where>" +
"<Eq>" +
"<FieldRef Name='PublicationPortail' />" +
"<Value Type='Boolean'>1</Value>" +
"</Eq>" +
"</Where>" +
"<OrderBy>" +
"<FieldRef Name='Debut_Publication' Ascending='True' />" +
"</OrderBy>" +
"</Query>",
CAMLRowLimit: 0,
//AJax Callback
completefunc: function (xData, Status)
{
//Boucle sur les row:z retournés
var ListActu = [];
console.log('\n',xData.responseText,'\n');
$(xData.responseXML).SPFilterNode("z:row").each(function ()
{
ListActu.push(
{
Titre: $(this).attr('ows_Title'),
});
});
console.log(ListActu);
CreateActu(ListActu);
}
});
}
});
}
});
}
})
}
});
})
}
}) |
Partager