class Cubedesigners_Form_Settings extends CubeIT_Form_Settings {
- public function init() {
- parent::init();
-
- $this->setTitle('Edition des paramètres du site');
-
- $longTitle = new Zend_Form_Element_Text('longTitle');
- $longTitle->setLabel('Titre long par défaut');
- $this->addElementLocalized($longTitle);
-
- $description = new CubeIT_Form_Element_Textarea('description');
- $description->setLabel('Description de la page par défaut');
- $this->addElementLocalized($description);
-
- /* BLOC CONTACT */
- $contact = new Cubedesigners_Form_CMS_Sub_Contact();
- $contact->setLabel('Informations de contact');
- $this->addSubFormLocalized($contact, 'contact');
-
-
- /* BLOC ACTUALITES */
- $actus = new Cubedesigners_Form_CMS_Sub_News();
- $actus->setLabel('Bloc Actualités');
- $this->addSubFormLocalized($actus, 'actus');
-
- /* BLOC SUIVEZ-NOUS */
- $followus = new Cubedesigners_Form_CMS_Sub_Followus();
- $followus->setLabel('Bloc Suivez-nous');
- $this->addSubFormLocalized($followus, 'followus');
-
- /* COPYRIGHT */
- $copyright = new Zend_Form_Element_Text('copyright');
- $copyright->setLabel('Copyright du bas de page');
- $this->addElementLocalized($copyright);
-
- $tags = new Cubedesigners_Form_Element_Tags('tags');
- $tags->setLabel(__('Tags'));
- $this->addElement($tags);
- }
+ public function init() {
+ parent::init();
+
+ $this->setTitle('Edition des paramètres du site');
+
+ $longTitle = new Zend_Form_Element_Text('longTitle');
+ $longTitle->setLabel('Titre long par défaut (limité à 65 caractères)');
+ $longTitle->setAttrib('maxlength', 65);
+ $this->addElementLocalized($longTitle);
+
+ $description = new CubeIT_Form_Element_Textarea('description');
+ $description->setLabel('Description de la page par défaut (limité à 160 caractères)');
+ $description->setAttrib('maxlength', 160);
+ $description->setAttrib('rows', 2);
+ $this->addElementLocalized($description);
+
+ /* BLOC CONTACT */
+ $contact = new Cubedesigners_Form_CMS_Sub_Contact();
+ $contact->setLabel('Informations de contact');
+ $this->addSubFormLocalized($contact, 'contact');
+
+
+ /* BLOC ACTUALITES */
+ $actus = new Cubedesigners_Form_CMS_Sub_News();
+ $actus->setLabel('Bloc Actualités');
+ $this->addSubFormLocalized($actus, 'actus');
+
+ /* BLOC SUIVEZ-NOUS */
+ $followus = new Cubedesigners_Form_CMS_Sub_Followus();
+ $followus->setLabel('Bloc Suivez-nous');
+ $this->addSubFormLocalized($followus, 'followus');
+
+ /* COPYRIGHT */
+ $copyright = new Zend_Form_Element_Text('copyright');
+ $copyright->setLabel('Copyright du bas de page');
+ $this->addElementLocalized($copyright);
+
+ $tags = new Cubedesigners_Form_Element_Tags('tags');
+ $tags->setLabel(__('Tags'));
+ $this->addElement($tags);
+ }
}
-TO_LOAD_ONCE[TO_LOAD_ONCE.length]='load_realisations();';\r
-\r
-var showIds = new Array();\r
-var isAnim = false;\r
-var currentOpen = 0;\r
-var currentOpenValues;\r
-var detail = "";\r
-var currentSlide = 1;\r
-var autoSlide = false;\r
-var totalWidth;\r
-var lastWidth;\r
-var showIds = new Array();\r
-\r
-function load_realisations() {\r
- initTagsLink();\r
- \r
- $("#main").css('height', 1500);\r
- \r
- $(".bloc").click( function () {\r
- \r
- var currentRea = $(this).attr("data-pos");\r
- \r
- if( !isAnim && currentRea != currentOpen ) {\r
-\r
- isAnim = true;\r
-\r
- var reaWidth = $(this).width() + parseInt($(this).css("margin-right").split("px")[0]);\r
- var reaId = $(this).parent().attr("data-id");\r
- var reaPerRow = $(this).parent().parent().width() / reaWidth;\r
-\r
- var nbReas = $('.project-photo').length;\r
-\r
- var nbRow = Math.ceil(nbReas / reaPerRow ); \r
- \r
- var reaPos = 1;\r
- var count = 0;\r
-\r
- var cible = $("#realisations-list").find("[data-pos='1']");\r
-\r
- while( count < currentRea) {\r
- count++;\r
- if( (count % (reaPerRow+1)) == 0 ) {\r
- reaPos++;\r
- cible = $("#realisations-list").find("[data-pos='" + count + "']");\r
- }\r
- }\r
-\r
- detail = "";\r
- \r
- $.ajax({\r
- url : '/ajax/displayrealisation',\r
- type : 'GET',\r
- data: 'realisation_id=' + reaId,\r
- complete: function(ret) {\r
- \r
- var response = JSON.parse(ret.responseText);\r
- var rea = response.vars.rea;\r
- \r
- currentOpenValues = rea;\r
- \r
- detail += '<div id="detailContent"><div id="detail">';\r
- detail += '<div class="detailLeft">';\r
- detail += '<div class="titre">'+rea.titre+'</div>';\r
- \r
- if( rea.legende != '') {\r
- detail += '<div class="legende">'+rea.legende+'</div>';\r
- }\r
- \r
- if( rea.agence != '') {\r
- detail += '<div class="agence">Agence : '+rea.agence+'</div>';\r
- }\r
- \r
- \r
- detail += '<ul class="taglist">';\r
- detail += '<li>' + rea.annee +'</li>';\r
- \r
- for( var i=0; i<rea.tags_secondaires.length; i++) {\r
- detail += '<li>' + rea.tags_secondaires[i] +'</li>';\r
- }\r
- \r
- detail += '</ul>';\r
- \r
- \r
- detail += '<div class="description">'+rea.description+'</div>';\r
- detail += '<a class="link" href="'+rea.url+'">Voir le site</a>';\r
- detail += '</div>';\r
- detail += '<div class="detailRight"><div class="slides"><ul>';\r
- \r
- totalWidth = 0;\r
- for( var i=0; i<rea.visuel_detail.length; i++) {\r
- \r
- var image=new Image();\r
- image.src=rea.visuel_detail[i];\r
- totalWidth += image.width;\r
- \r
- if( i == ( rea.visuel_detail.length-1 ) ) {\r
- lastWidth = image.width;\r
- }\r
- \r
- detail += '<li><img id="visuel_detail" src="'+rea.visuel_detail[i]+'" /></li>';\r
- }\r
- \r
- detail += '</ul></div></div>';\r
- detail += '</div><div class="close"></div></div>';\r
- \r
- if( $( "#detail" ).length > 0) {\r
- $( "#detail" ).slideUp( 500, function() {\r
- \r
- $('#detailContent').remove();\r
- \r
- $(cible.parent()).before(detail);\r
- \r
- $("html, body").animate({ scrollTop: $('#detailContent').offset().top-100 }, 1000);\r
- $('.close').css("top", $('#detailContent').offset().top);\r
- \r
- $( "#detail" ).slideDown( "slow", function() {\r
- isAnim = false;\r
- addCloseAction();\r
- currentSlide = 1;\r
- autoSlide = true;\r
- initSlideShow();\r
- \r
- }).animate(\r
- { opacity: 1 },\r
- { queue: true, duration: 'slow' }\r
- );\r
- \r
- }).animate(\r
- { opacity: 1 },\r
- { queue: true, duration: 'slow' }\r
- );\r
- }else{\r
- $(cible.parent()).before(detail);\r
- \r
- $("html, body").animate({ scrollTop: $('#detailContent').offset().top-100 }, 1000);\r
- $('.close').css("top", $('#detailContent').offset().top);\r
- /*\r
- $( "#detail" ).slideDown( "slow", function() {\r
- \r
- isAnim = false;\r
- addCloseAction();\r
- currentSlide = 1;\r
- autoSlide = true;\r
- initSlideShow();\r
- \r
- }).animate(\r
- { opacity: 1 },\r
- { queue: true, duration: 'slow' }\r
- );*/\r
- \r
- \r
- $( "#detail" ).addClass("showDown");\r
- $('#detail').one("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd transitionEnd", function(e) {\r
- isAnim = false;\r
- addCloseAction();\r
- currentSlide = 1;\r
- autoSlide = true;\r
- initSlideShow();\r
- }); \r
- \r
- }\r
-\r
- /*$(".project-photo").each( function() {\r
- var id = $(this).parent().attr("data-pos");\r
- if( id != currentRea ) {\r
- $(this).addClass("gray");\r
- }else{\r
- $(this).removeClass("gray");\r
- }\r
- });*/\r
- }\r
- \r
- });\r
-\r
- \r
- }\r
- \r
- currentOpen = currentRea;\r
- }); \r
-}\r
-\r
-function addCloseAction() {\r
- $(".close").click(function() {\r
- $("html, body").animate({ scrollTop: 0 }, 1000);\r
- \r
- /* $( "#detail" ).slideUp( "slow", function() {\r
- $('#detailContent').remove();\r
- currentOpen = 0;\r
- $(".project-photo").each( function() {\r
- $(this).removeClass("gray");\r
- });\r
- }).animate(\r
- { opacity: 1 },\r
- { queue: false, duration: 'slow' }\r
- );*/\r
- \r
- $( "#detail" ).addClass("showUp");\r
- $('#detail').one("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd transitionEnd", function(e) {\r
- currentOpen = 0;\r
- $(".project-photo").each( function() {\r
- $(this).removeClass("gray");\r
- });\r
- });\r
- \r
- });\r
-}\r
-\r
-function initTagsLink() {\r
- \r
- $(".tag").click(function() {\r
- \r
- $(".close").click();\r
- \r
- $(this).toggleClass('active');\r
- \r
- if( $(this).hasClass('active') ) {\r
- if( $(this).attr("data-id") != 0) {\r
- showIds.push( $(this).attr("data-id") );\r
- }else{\r
- showIds = new Array(); \r
- $(".tag").removeClass('active');\r
- }\r
- } else {\r
- var index = $.inArray( $(this).attr("data-id"), showIds );\r
- showIds.splice(index, 1);\r
- }\r
- \r
- if( showIds.length > 0 ) {\r
- $(".tag:first").removeClass('active');\r
- }else{\r
- $(".tag:first").addClass('active');\r
- }\r
- \r
- displayRealisations();\r
- });\r
- \r
-}\r
-\r
-function displayRealisations() {\r
- \r
- if( showIds.length ) {\r
- $('#realisations-list .bloc').each(function(){\r
- var categories = $(this).attr("data-categories");\r
- if( $.inArray( categories, showIds ) == -1 ) {\r
- $(this).parent().fadeOut( 500, function() {}); \r
- }else{\r
- $(this).parent().fadeIn( 500, function() {}); \r
- }\r
- });\r
- }else{\r
- $( '#realisations-list .bloc' ).parent().fadeIn( 500, function() {});\r
- }\r
- \r
-}\r
-\r
-function initSlideShow() {\r
- \r
- var mouse_move=false;\r
- function move(e) {\r
- if(mouse_move) {\r
- if(document.documentElement.clientWidth>0) {\r
-\r
- position = e.pageX-document.documentElement.scrollLeft;\r
- } else {\r
- position = e.pageX-document.body.scrollLeft;\r
- }\r
- }\r
- }\r
- document.onmousemove=move;\r
-\r
- $(".slides").mouseover(function(e){\r
-\r
- mouse_move = true;\r
- le_div = '.' + 'slides';\r
-\r
- if($(le_div + " ul li").length > 1){\r
-\r
- var total_lenght = totalWidth;\r
-\r
- var t= setInterval(function(){\r
-\r
- var offset = $(le_div).offset();\r
-\r
- if((position - offset.left) < ($("#detailContent").width()/2) ){\r
- if($(le_div + " ul").css('marginLeft').replace("px", "") > - (total_lenght - lastWidth)){\r
- $(le_div + " ul").animate({marginLeft:"-=2px"},0);\r
- }\r
- }else{\r
- if($(le_div + " ul").css('marginLeft').replace("px", "") <= 0){\r
- $(le_div + " ul").animate({marginLeft:"+=2px"},0);\r
- }\r
- }\r
- \r
- },5);\r
-\r
- $(le_div).mouseout(function(){\r
- clearInterval(t);\r
- mouse_move=false;\r
- });\r
- }\r
- });\r
- \r
+TO_LOAD_ONCE[TO_LOAD_ONCE.length] = 'load_realisations();';
+
+var showIds = new Array();
+var isAnim = false;
+var currentOpen = 0;
+var currentOpenValues;
+var detail = "";
+var currentSlide = 1;
+var autoSlide = false;
+var totalWidth;
+var lastWidth;
+var showIds = new Array();
+
+function load_realisations() {
+ initTagsLink();
+
+ $(".bloc").click(function () {
+
+ var currentRea = $(this).attr("data-pos");
+
+ if (!isAnim && currentRea != currentOpen) {
+
+ isAnim = true;
+
+ var reaWidth = $(this).width() + parseInt($(this).css("margin-right").split("px")[0]);
+ var reaId = $(this).parent().attr("data-id");
+ var reaPerRow = $(this).parent().parent().width() / reaWidth;
+
+ var nbReas = $('.project-photo').length;
+
+ var nbRow = Math.ceil(nbReas / reaPerRow);
+
+ var reaPos = 1;
+ var count = 0;
+
+ var cible = $("#realisations-list").find("[data-pos='1']");
+
+ while (count < currentRea) {
+ count++;
+ if ((count % (reaPerRow + 1)) == 0) {
+ reaPos++;
+ cible = $("#realisations-list").find("[data-pos='" + count + "']");
+ }
+ }
+
+ detail = "";
+
+ $.ajax({
+ url: '/ajax/displayrealisation',
+ type: 'GET',
+ data: 'realisation_id=' + reaId,
+ complete: function (ret) {
+
+ var response = JSON.parse(ret.responseText);
+ var rea = response.vars.rea;
+
+ currentOpenValues = rea;
+
+ detail += '<div id="detailContent"><div id="detail">';
+ detail += '<div class="detailLeft">';
+ detail += '<div class="titre">' + rea.titre + '</div>';
+
+ if (rea.legende != '') {
+ detail += '<div class="legende">' + rea.legende + '</div>';
+ }
+
+ if (rea.agence != '') {
+ detail += '<div class="agence">Agence : ' + rea.agence + '</div>';
+ }
+
+
+ detail += '<ul class="taglist">';
+ detail += '<li>' + rea.annee + '</li>';
+
+ for (var i = 0; i < rea.tags_secondaires.length; i++) {
+ detail += '<li>' + rea.tags_secondaires[i] + '</li>';
+ }
+
+ detail += '</ul>';
+
+
+ detail += '<div class="description">' + rea.description + '</div>';
+ detail += '<a class="link" href="' + rea.url + '">Voir le site</a>';
+ detail += '</div>';
+ detail += '<div class="detailRight"><div class="slides"><ul>';
+
+ totalWidth = 0;
+ for (var i = 0; i < rea.visuel_detail.length; i++) {
+
+ var image = new Image();
+ image.src = rea.visuel_detail[i];
+ totalWidth += image.width;
+
+ if (i == (rea.visuel_detail.length - 1)) {
+ lastWidth = image.width;
+ }
+
+ detail += '<li><img id="visuel_detail" src="' + rea.visuel_detail[i] + '" /></li>';
+ }
+
+ detail += '</ul></div></div>';
+ detail += '</div><div class="close"></div></div>';
+
+ if ($("#detail").length > 0) {
+ $("#detail").slideUp(500, function () {
+
+ $('#detailContent').remove();
+
+ $(cible.parent()).before(detail);
+
+ $("html, body").animate({scrollTop: $('#detailContent').offset().top - 100}, 1000);
+ $('.close').css("top", $('#detailContent').offset().top);
+
+ $("#detail").slideDown("slow", function () {
+ isAnim = false;
+ addCloseAction();
+ currentSlide = 1;
+ autoSlide = true;
+ initSlideShow();
+
+ }).animate(
+ {opacity: 1},
+ {queue: true, duration: 'slow'}
+ );
+
+ }).animate(
+ {opacity: 1},
+ {queue: true, duration: 'slow'}
+ );
+ } else {
+ $(cible.parent()).before(detail);
+
+ $("html, body").animate({scrollTop: $('#detailContent').offset().top - 100}, 1000);
+ $('.close').css("top", $('#detailContent').offset().top);
+ /*
+ $( "#detail" ).slideDown( "slow", function() {
+
+ isAnim = false;
+ addCloseAction();
+ currentSlide = 1;
+ autoSlide = true;
+ initSlideShow();
+
+ }).animate(
+ { opacity: 1 },
+ { queue: true, duration: 'slow' }
+ );*/
+
+
+ $("#detail").addClass("showDown");
+ $('#detail').one("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd transitionEnd", function (e) {
+ isAnim = false;
+ addCloseAction();
+ currentSlide = 1;
+ autoSlide = true;
+ initSlideShow();
+ });
+
+ }
+
+ /*$(".project-photo").each( function() {
+ var id = $(this).parent().attr("data-pos");
+ if( id != currentRea ) {
+ $(this).addClass("gray");
+ }else{
+ $(this).removeClass("gray");
+ }
+ });*/
+ }
+
+ });
+
+
+ }
+
+ currentOpen = currentRea;
+ });
+}
+
+function addCloseAction() {
+ $(".close").click(function () {
+ $("html, body").animate({scrollTop: 0}, 1000);
+
+ /* $( "#detail" ).slideUp( "slow", function() {
+ $('#detailContent').remove();
+ currentOpen = 0;
+ $(".project-photo").each( function() {
+ $(this).removeClass("gray");
+ });
+ }).animate(
+ { opacity: 1 },
+ { queue: false, duration: 'slow' }
+ );*/
+
+ $("#detail").addClass("showUp");
+ $('#detail').one("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd transitionEnd", function (e) {
+ currentOpen = 0;
+ $(".project-photo").each(function () {
+ $(this).removeClass("gray");
+ });
+ });
+
+ });
+}
+
+function initTagsLink() {
+
+ $(".tag").click(function () {
+
+ $(".close").click();
+
+ $(this).toggleClass('active');
+
+ if ($(this).hasClass('active')) {
+ if ($(this).attr("data-id") != 0) {
+ showIds.push($(this).attr("data-id"));
+ } else {
+ showIds = new Array();
+ $(".tag").removeClass('active');
+ }
+ } else {
+ var index = $.inArray($(this).attr("data-id"), showIds);
+ showIds.splice(index, 1);
+ }
+
+ if (showIds.length > 0) {
+ $(".tag:first").removeClass('active');
+ } else {
+ $(".tag:first").addClass('active');
+ }
+
+ displayRealisations();
+ });
+
+}
+
+function displayRealisations() {
+
+ if (showIds.length) {
+ $('#realisations-list .bloc').each(function () {
+ var categories = $(this).attr("data-categories");
+ if ($.inArray(categories, showIds) == -1) {
+ $(this).parent().fadeOut(500, function () {
+ });
+ } else {
+ $(this).parent().fadeIn(500, function () {
+ });
+ }
+ });
+ } else {
+ $('#realisations-list .bloc').parent().fadeIn(500, function () {
+ });
+ }
+
+}
+
+function initSlideShow() {
+
+ var mouse_move = false;
+ function move(e) {
+ if (mouse_move) {
+ if (document.documentElement.clientWidth > 0) {
+
+ position = e.pageX - document.documentElement.scrollLeft;
+ } else {
+ position = e.pageX - document.body.scrollLeft;
+ }
+ }
+ }
+ document.onmousemove = move;
+
+ $(".slides").mouseover(function (e) {
+
+ mouse_move = true;
+ le_div = '.' + 'slides';
+
+ if ($(le_div + " ul li").length > 1) {
+
+ var total_lenght = totalWidth;
+
+ var t = setInterval(function () {
+
+ var offset = $(le_div).offset();
+
+ if ((position - offset.left) < ($("#detailContent").width() / 2)) {
+ if ($(le_div + " ul").css('marginLeft').replace("px", "") > -(total_lenght - lastWidth)) {
+ $(le_div + " ul").animate({marginLeft: "-=2px"}, 0);
+ }
+ } else {
+ if ($(le_div + " ul").css('marginLeft').replace("px", "") <= 0) {
+ $(le_div + " ul").animate({marginLeft: "+=2px"}, 0);
+ }
+ }
+
+ }, 5);
+
+ $(le_div).mouseout(function () {
+ clearInterval(t);
+ mouse_move = false;
+ });
+ }
+ });
+
}
\ No newline at end of file