Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 2192 additions and 2705 deletions
<html>
<head>
<script src="../../js/amber.js" type="text/javascript"></script>
<script type="text/javascript">
loadAmber({
files: ['GoogleCharts.js','GoogleChartsExamples'],
prefix: 'examples/googlecharts/js', // path for js files i think
ready: function() {
$(function() {
smalltalk.PopupChartApp._new(); // Start the smalltalk App
});
}});
</script>
</head>
<body>
<h1>My First Google Chart Project</h1>
<button onclick="smalltalk.Browser._open()">class browser</button>
<button id="popPieChart">pop pie chart</button>
<div id="pie_chart_div"></div>
<button id="popScatterChart">pop scatter chart</button>
<div id="scatter_chart_div"></div>
<button id="popGaugeChart">pop gauge chart</button>
<div id="gauge_chart_div"></div>
<button id="popGeoMarkersChart">pop Geo Markers Chart</button>
<div id="geo_markers_chart_div"></div>
</body>
<html>
<head>
<script src="../../js/amber.js" type="text/javascript"></script>
<script type="text/javascript">
loadAmber({
files: ['GoogleCharts.js','GoogleChartsExamples'],
prefix: 'examples/googlecharts/js', // path for js files i think
ready: function() {
$(function() {
smalltalk.PopupChartApp._new(); // Start the smalltalk App
});
}});
</script>
</head>
<body>
<h1>My First Google Chart Project</h1>
<button onclick="smalltalk.Browser._open()">class browser</button>
<button id="popPieChart">pop pie chart</button>
<div id="pie_chart_div"></div>
<button id="popScatterChart">pop scatter chart</button>
<div id="scatter_chart_div"></div>
<button id="popGaugeChart">pop gauge chart</button>
<div id="gauge_chart_div"></div>
<button id="popGeoMarkersChart">pop Geo Markers Chart</button>
<div id="geo_markers_chart_div"></div>
</body>
</html>
\ No newline at end of file
/* @Booklet
----------------------------------------*/
.booklet {width:800px; height:600px; position:relative; /*background:#fff;*/ margin:0 auto 10px; overflow:visible !important;}
.booklet .b-page {left:0; top:0; position:absolute; overflow:hidden; padding:0;}
.booklet .b-pN {}
.booklet .b-p0 {}
.booklet .b-p1 {}
.booklet .b-p2 {}
.booklet .b-p3 {}
.booklet .b-p4 {}
.booklet .b-load {}
/* Page Wrappers */
.booklet .b-wrap {top:0; position:absolute;}
.booklet .b-wrap-left {background:#fff;}
.booklet .b-wrap-right {background:#efefef;}
.booklet .b-pN .b-wrap,
.booklet .b-p1 .b-wrap,
.booklet .b-p2 .b-wrap,
.booklet .b-p3 .b-wrap,
.booklet .b-p4 .b-wrap {left:0;}
.booklet .b-p0 .b-wrap {right:0;}
/* Custom Page Types */
.booklet .b-page-blank {padding:0; width:100%; height:100%;}
.booklet .b-page-cover {padding:0; width:100%; height:100%; background:#925C0E;}
.booklet .b-page-cover h3 {color:#fff; text-shadow:0px 1px 3px #222;}
/* Page Numbers */
.booklet .b-counter {bottom:10px; position:absolute; display:block; width:25px; height:20px; background:#ccc; color:#444; text-align:center; font-family:Georgia, "Times New Roman", Times, serif; font-size:10px; padding:5px 0 0;}
.booklet .b-wrap-left .b-counter {left:10px;}
.booklet .b-wrap-right .b-counter {right:10px;}
/* Page Shadows */
.booklet .b-shadow-f {right:0; top:0; position:absolute; opacity:0; background-image:url("images/shadow-top-forward.png"); background-repeat:repeat-y; background-position:100% 0;}
.booklet .b-shadow-b {left:0; top:0; position:absolute; opacity:0; background-image:url("images/shadow-top-back.png"); background-repeat:repeat-y; background-position:0 0;}
.booklet .b-p0 {background-image:url("images/shadow.png"); background-repeat:repeat-y; background-position:100% 10px;}
.booklet .b-p3 {background-image:url("images/shadow.png"); background-repeat:repeat-y; background-position:0 10px;}
/* Overlay Controls */
.booklet .b-grab {cursor: url(images/openhand.cur), default;}
.booklet .b-grabbing {cursor: url(images/closedhand.cur), default;}
/* Overlay Controls */
.booklet .b-overlay {top:0; position:absolute; height:100%; width:50%;}
.booklet .b-overlay-prev {left:0;}
.booklet .b-overlay-next {right:0;}
/* Tab Controls */
.booklet .b-tab {background:#000; height:40px; width:100%; padding:10px 0 0; text-align:center; color:#ccc; position:absolute; font-size:11px;}
.booklet .b-tab-prev {left:0;}
.booklet .b-tab-next {right:0;}
.booklet .b-tab:hover {background:#aaa; color:#000;}
/* Arrow Controls */
.booklet .b-arrow {display:block; position:absolute; text-indent:-9999px; top:0; height:100%; width:74px;}
.booklet .b-arrow div {display:none; text-indent:-9999px; height:170px; width:74px; position:absolute; left:0; top:25%;}
.booklet .b-arrow-next {right:-80px;}
.booklet .b-arrow-prev {left:-80px;}
.booklet .b-arrow-next div {background:url("images/arrow-next.png") no-repeat left top;}
.booklet .b-arrow-prev div {background:url("images/arrow-prev.png") no-repeat left top;}
/* @z-index fix (needed for older IE browsers)
----------------------------------------*/
body {z-index:0;}
.b-menu {z-index:100;}
.b-selector {z-index:100;}
.booklet {z-index:10;}
.b-pN {z-index:10;}
.b-p0 {z-index:10;}
.b-p1 {z-index:10;}
.b-p2 {z-index:10;}
.b-p3 {z-index:10;}
.b-p4 {z-index:10;}
.b-prev {z-index:40;}
.b-next {z-index:40;}
.b-counter {z-index:40;}
/* @Menu Items
----------------------------------------*/
.b-menu {height:40px; padding:0 0 10px;}
.b-selector {height:40px; position:relative; float:right; border:none; color:#cecece; cursor:pointer;}
.b-selector .b-current {padding:8px 15px 12px; line-height:20px; min-width:18px; height:20px; display:block; background:#000; text-align:center;}
.b-selector-page {width:auto; margin-left:15px;}
.b-selector-chapter {width:auto;}
.b-selector:hover {color:#fff; background-position:left 0px;}
.b-selector:hover .b-current {background-position:right 0px;}
.b-selector ul {overflow:hidden; margin:0; list-style:none !important; position:absolute; top:40px; right:0; padding:0 0 10px; background:#000; width:240px; font:normal 12px "Myriad Pro", Myriad, "DejaVu Sans Condensed","Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;}
.b-selector li {border:none;}
.b-selector a {color:#cecece; height:14px; text-decoration:none; display:block; padding:5px 10px;}
.b-selector a .b-text {float:left; clear:none;}
.b-selector a .b-num {float:right; clear:none;}
.b-selector a:hover {color:#fff;}
/* @Booklet
----------------------------------------*/
.booklet {width:800px; height:600px; position:relative; /*background:#fff;*/ margin:0 auto 10px; overflow:visible !important;}
.booklet .b-page {left:0; top:0; position:absolute; overflow:hidden; padding:0;}
.booklet .b-pN {}
.booklet .b-p0 {}
.booklet .b-p1 {}
.booklet .b-p2 {}
.booklet .b-p3 {}
.booklet .b-p4 {}
.booklet .b-load {}
/* Page Wrappers */
.booklet .b-wrap {top:0; position:absolute;}
.booklet .b-wrap-left {background:#fff;}
.booklet .b-wrap-right {background:#efefef;}
.booklet .b-pN .b-wrap,
.booklet .b-p1 .b-wrap,
.booklet .b-p2 .b-wrap,
.booklet .b-p3 .b-wrap,
.booklet .b-p4 .b-wrap {left:0;}
.booklet .b-p0 .b-wrap {right:0;}
/* Custom Page Types */
.booklet .b-page-blank {padding:0; width:100%; height:100%;}
.booklet .b-page-cover {padding:0; width:100%; height:100%; background:#925C0E;}
.booklet .b-page-cover h3 {color:#fff; text-shadow:0px 1px 3px #222;}
/* Page Numbers */
.booklet .b-counter {bottom:10px; position:absolute; display:block; width:25px; height:20px; background:#ccc; color:#444; text-align:center; font-family:Georgia, "Times New Roman", Times, serif; font-size:10px; padding:5px 0 0;}
.booklet .b-wrap-left .b-counter {left:10px;}
.booklet .b-wrap-right .b-counter {right:10px;}
/* Page Shadows */
.booklet .b-shadow-f {right:0; top:0; position:absolute; opacity:0; background-image:url("images/shadow-top-forward.png"); background-repeat:repeat-y; background-position:100% 0;}
.booklet .b-shadow-b {left:0; top:0; position:absolute; opacity:0; background-image:url("images/shadow-top-back.png"); background-repeat:repeat-y; background-position:0 0;}
.booklet .b-p0 {background-image:url("images/shadow.png"); background-repeat:repeat-y; background-position:100% 10px;}
.booklet .b-p3 {background-image:url("images/shadow.png"); background-repeat:repeat-y; background-position:0 10px;}
/* Overlay Controls */
.booklet .b-grab {cursor: url(images/openhand.cur), default;}
.booklet .b-grabbing {cursor: url(images/closedhand.cur), default;}
/* Overlay Controls */
.booklet .b-overlay {top:0; position:absolute; height:100%; width:50%;}
.booklet .b-overlay-prev {left:0;}
.booklet .b-overlay-next {right:0;}
/* Tab Controls */
.booklet .b-tab {background:#000; height:40px; width:100%; padding:10px 0 0; text-align:center; color:#ccc; position:absolute; font-size:11px;}
.booklet .b-tab-prev {left:0;}
.booklet .b-tab-next {right:0;}
.booklet .b-tab:hover {background:#aaa; color:#000;}
/* Arrow Controls */
.booklet .b-arrow {display:block; position:absolute; text-indent:-9999px; top:0; height:100%; width:74px;}
.booklet .b-arrow div {display:none; text-indent:-9999px; height:170px; width:74px; position:absolute; left:0; top:25%;}
.booklet .b-arrow-next {right:-80px;}
.booklet .b-arrow-prev {left:-80px;}
.booklet .b-arrow-next div {background:url("images/arrow-next.png") no-repeat left top;}
.booklet .b-arrow-prev div {background:url("images/arrow-prev.png") no-repeat left top;}
/* @z-index fix (needed for older IE browsers)
----------------------------------------*/
body {z-index:0;}
.b-menu {z-index:100;}
.b-selector {z-index:100;}
.booklet {z-index:10;}
.b-pN {z-index:10;}
.b-p0 {z-index:10;}
.b-p1 {z-index:10;}
.b-p2 {z-index:10;}
.b-p3 {z-index:10;}
.b-p4 {z-index:10;}
.b-prev {z-index:40;}
.b-next {z-index:40;}
.b-counter {z-index:40;}
/* @Menu Items
----------------------------------------*/
.b-menu {height:40px; padding:0 0 10px;}
.b-selector {height:40px; position:relative; float:right; border:none; color:#cecece; cursor:pointer;}
.b-selector .b-current {padding:8px 15px 12px; line-height:20px; min-width:18px; height:20px; display:block; background:#000; text-align:center;}
.b-selector-page {width:auto; margin-left:15px;}
.b-selector-chapter {width:auto;}
.b-selector:hover {color:#fff; background-position:left 0px;}
.b-selector:hover .b-current {background-position:right 0px;}
.b-selector ul {overflow:hidden; margin:0; list-style:none !important; position:absolute; top:40px; right:0; padding:0 0 10px; background:#000; width:240px; font:normal 12px "Myriad Pro", Myriad, "DejaVu Sans Condensed","Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif;}
.b-selector li {border:none;}
.b-selector a {color:#cecece; height:14px; text-decoration:none; display:block; padding:5px 10px;}
.b-selector a .b-text {float:left; clear:none;}
.b-selector a .b-num {float:right; clear:none;}
.b-selector a:hover {color:#fff;}
\ No newline at end of file
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright © 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright © 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});
......@@ -1198,10 +1198,10 @@ smalltalk.addMethod(
"_style",
smalltalk.method({
selector: "style",
fn: function (){
fn: function(){
var self=this;
var $1;
$1=smalltalk.send(self["@root"],"_addBrush_",[smalltalk.send((smalltalk.StyleTag || StyleTag),"_canvas_",[self])]);
$1=smalltalk.send(self,"_tag_",["style"]);
return $1;
}
}),
......@@ -2335,42 +2335,6 @@ return $1;
smalltalk.TagBrush.klass);
smalltalk.addClass('StyleTag', smalltalk.TagBrush, ['canvas', 'element'], 'Canvas');
smalltalk.addMethod(
"_with_",
smalltalk.method({
selector: "with:",
fn: function (aString){
var self=this;
var $1;
$1=smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas),"_isMSIE",[]);
if(smalltalk.assert($1)){
smalltalk.send(smalltalk.send(smalltalk.send(self,"_element",[]),"_styleSheet",[]),"_cssText_",[aString]);
} else {
smalltalk.send(self,"_with_",[aString],smalltalk.TagBrush);
};
return self}
}),
smalltalk.StyleTag);
smalltalk.addMethod(
"_canvas_",
smalltalk.method({
selector: "canvas:",
fn: function (aCanvas){
var self=this;
var $2,$3,$1;
$2=smalltalk.send(self,"_new",[]);
smalltalk.send($2,"_initializeFromString_canvas_",["style",aCanvas]);
$3=smalltalk.send($2,"_yourself",[]);
$1=$3;
return $1;
}
}),
smalltalk.StyleTag.klass);
smalltalk.addClass('Widget', smalltalk.Object, [], 'Canvas');
smalltalk.addMethod(
"_appendToBrush_",
......
......@@ -1659,16 +1659,16 @@ smalltalk.addMethod(
smalltalk.method({
selector: "style",
category: 'tags',
fn: function (){
fn: function(){
var self=this;
var $1;
$1=smalltalk.send(self["@root"],"_addBrush_",[smalltalk.send((smalltalk.StyleTag || StyleTag),"_canvas_",[self])]);
$1=smalltalk.send(self,"_tag_",["style"]);
return $1;
},
args: [],
source: "style\x0a\x09^ root addBrush: (StyleTag canvas: self)",
messageSends: ["addBrush:", "canvas:"],
referencedClasses: ["StyleTag"]
source: "style\x0a\x09^ self tag: 'style'",
messageSends: ["tag:"],
referencedClasses: []
}),
smalltalk.HTMLCanvas);
......@@ -3270,53 +3270,6 @@ referencedClasses: []
smalltalk.TagBrush.klass);
smalltalk.addClass('StyleTag', smalltalk.TagBrush, ['canvas', 'element'], 'Canvas');
smalltalk.StyleTag.comment="I'm a <style> tag use to inline CSS or load a stylesheet.\x0a\x0aFor inlining handle IE compatibility problems."
smalltalk.addMethod(
"_with_",
smalltalk.method({
selector: "with:",
category: 'adding',
fn: function (aString){
var self=this;
var $1;
$1=smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas),"_isMSIE",[]);
if(smalltalk.assert($1)){
smalltalk.send(smalltalk.send(smalltalk.send(self,"_element",[]),"_styleSheet",[]),"_cssText_",[aString]);
} else {
smalltalk.send(self,"_with_",[aString],smalltalk.TagBrush);
};
return self},
args: ["aString"],
source: "with: aString\x0a\x09HTMLCanvas isMSIE\x0a\x09\x09ifTrue: [self element styleSheet cssText: aString ]\x0a\x09\x09ifFalse: [super with: aString ].",
messageSends: ["ifTrue:ifFalse:", "cssText:", "styleSheet", "element", "with:", "isMSIE"],
referencedClasses: ["HTMLCanvas"]
}),
smalltalk.StyleTag);
smalltalk.addMethod(
"_canvas_",
smalltalk.method({
selector: "canvas:",
category: 'instance creation',
fn: function (aCanvas){
var self=this;
var $2,$3,$1;
$2=smalltalk.send(self,"_new",[]);
smalltalk.send($2,"_initializeFromString_canvas_",["style",aCanvas]);
$3=smalltalk.send($2,"_yourself",[]);
$1=$3;
return $1;
},
args: ["aCanvas"],
source: "canvas: aCanvas\x0a ^self new\x0a\x09initializeFromString: 'style' canvas: aCanvas;\x0a\x09yourself",
messageSends: ["initializeFromString:canvas:", "new", "yourself"],
referencedClasses: []
}),
smalltalk.StyleTag.klass);
smalltalk.addClass('Widget', smalltalk.Object, [], 'Canvas');
smalltalk.addMethod(
"_appendToBrush_",
......
......@@ -732,19 +732,18 @@ smalltalk.addMethod(
"_close",
smalltalk.method({
selector: "close",
fn: function () {
var self = this;
if (smalltalk.assert(self['@opened'])) {
smalltalk.send(smalltalk.send("#amber", "_asJQuery", []), "_hide", []);
smalltalk.send(smalltalk.send(self['@ul'], "_asJQuery", []), "_hide", []);
smalltalk.send(self['@selectedTab'], "_hide", []);
smalltalk.send(self, "_removeBodyMargin", []);
smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amberBody"]);
self['@opened'] = false;
self['@opened'];
}
return self;
}
fn: function(){
var self=this;
if(smalltalk.assert(self["@opened"])){
smalltalk.send(smalltalk.send(smalltalk.send("#amber","_asJQuery",[]),"_hide",[]),"_trigger_",["hide"]);
smalltalk.send(smalltalk.send(self["@ul"],"_asJQuery",[]),"_hide",[]);
smalltalk.send(self["@selectedTab"],"_hide",[]);
smalltalk.send(self,"_removeBodyMargin",[]);
smalltalk.send(smalltalk.send("body","_asJQuery",[]),"_removeClass_",["amberBody"]);
self["@opened"]=false;
self["@opened"];
};
return self}
}),
smalltalk.TabManager);
......
......@@ -983,22 +983,21 @@ smalltalk.addMethod(
smalltalk.method({
selector: "close",
category: 'actions',
fn: function () {
var self = this;
if (smalltalk.assert(self['@opened'])) {
smalltalk.send(smalltalk.send("#amber", "_asJQuery", []), "_hide", []);
smalltalk.send(smalltalk.send(self['@ul'], "_asJQuery", []), "_hide", []);
smalltalk.send(self['@selectedTab'], "_hide", []);
smalltalk.send(self, "_removeBodyMargin", []);
smalltalk.send(smalltalk.send("body", "_asJQuery", []), "_removeClass_", ["amberBody"]);
self['@opened'] = false;
self['@opened'];
}
return self;
},
fn: function(){
var self=this;
if(smalltalk.assert(self["@opened"])){
smalltalk.send(smalltalk.send(smalltalk.send("#amber","_asJQuery",[]),"_hide",[]),"_trigger_",["hide"]);
smalltalk.send(smalltalk.send(self["@ul"],"_asJQuery",[]),"_hide",[]);
smalltalk.send(self["@selectedTab"],"_hide",[]);
smalltalk.send(self,"_removeBodyMargin",[]);
smalltalk.send(smalltalk.send("body","_asJQuery",[]),"_removeClass_",["amberBody"]);
self["@opened"]=false;
self["@opened"];
};
return self},
args: [],
source: "close\x0a opened ifTrue: [\x0a\x09'#amber' asJQuery hide.\x0a\x09ul asJQuery hide.\x0a\x09selectedTab hide.\x0a\x09self removeBodyMargin.\x0a\x09'body' asJQuery removeClass: 'amberBody'.\x0a\x09opened := false]",
messageSends: ["ifTrue:", "hide", "asJQuery", "removeBodyMargin", "removeClass:"],
source: "close\x0a opened ifTrue: [\x0a\x09'#amber' asJQuery hide trigger: 'hide'.\x0a\x09ul asJQuery hide.\x0a\x09selectedTab hide.\x0a\x09self removeBodyMargin.\x0a\x09'body' asJQuery removeClass: 'amberBody'.\x0a\x09opened := false]",
messageSends: ["ifTrue:", "trigger:", "hide", "asJQuery", "removeBodyMargin", "removeClass:"],
referencedClasses: []
}),
smalltalk.TabManager);
......
......@@ -385,7 +385,7 @@ strong: anObject
!
style
^ root addBrush: (StyleTag canvas: self)
^ self tag: 'style'
!
style: aString
......@@ -804,30 +804,6 @@ fromString: aString canvas: aCanvas
yourself
! !
TagBrush subclass: #StyleTag
instanceVariableNames: 'canvas element'
package: 'Canvas'!
!StyleTag commentStamp!
I'm a <style> tag use to inline CSS or load a stylesheet.
For inlining handle IE compatibility problems.!
!StyleTag methodsFor: 'adding'!
with: aString
HTMLCanvas isMSIE
ifTrue: [self element styleSheet cssText: aString ]
ifFalse: [super with: aString ].
! !
!StyleTag class methodsFor: 'instance creation'!
canvas: aCanvas
^self new
initializeFromString: 'style' canvas: aCanvas;
yourself
! !
Object subclass: #Widget
instanceVariableNames: ''
package: 'Canvas'!
......
......@@ -356,7 +356,7 @@ tabs
close
opened ifTrue: [
'#amber' asJQuery hide.
'#amber' asJQuery hide trigger: 'hide'.
ul asJQuery hide.
selectedTab hide.
self removeBodyMargin.
......
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
require_once __DIR__ . '/../../../../library/activitystreams/autoload.php';
use Patbator\ActivityStreams\Model\Join;
use Patbator\ActivityStreams\Model\Leave;
use Patbator\ActivityStreams\Model\Accept;
use Patbator\ActivityStreams\Model\Reject;
use Patbator\ActivityStreams\Model\CollectionPage;
use Patbator\ActivityStreams\Stream;
class Activitypub_ReviewController extends ZendAfi_Controller_Action {
use Trait_TimeSource;
protected $_log;
public function preDispatch() {
parent::preDispatch();
$this->getHelper('ViewRenderer')->setNoRender();
$this->_log = null;//new Zend_Log(new Zend_Log_Writer_Stream(PATH_TEMP . 'activitypub_server.log'));
}
public function unavailableAction() {
$this->_response->setHttpResponseCode(503);
}
public function indexAction() {
if (Class_WebService_ActivityPub::MIME_TYPE != $this->_request->getHeader('Accept'))
return $this->_response->setHttpResponseCode(500);
$service = $this->_service()->asActor()
->inbox($this->_absoluteUrl(['module' => 'activitypub',
'controller' => 'review',
'action' => 'inbox']))
->outbox($this->_absoluteUrl(['module' => 'activitypub',
'controller' => 'review',
'action' => 'outbox']))
->publicKey($this->_absoluteUrl(['module' => 'activitypub',
'controller' => 'review',
'action' => 'pubkey']))
;
$this->_activityResponseWith($service);
return null;
}
public function pubkeyAction() {
if (Class_WebService_ActivityPub::MIME_TYPE != $this->_request->getHeader('Accept'))
return $this->_response->setHttpResponseCode(500);
$key = (new Class_ActivityPub_PublicKey)
->id($this->_absoluteUrl(['module' => 'activitypub',
'controller' => 'review',
'action' => 'pubkey']))
->owner($this->_absoluteUrl(['module' => 'activitypub',
'controller' => 'review']))
->publicKeyPem((new Class_Federation())->getPublicKey());
$this->_activityResponseWith($key);
return null;
}
public function inboxAction() {
if (!$this->_request->isPost()
|| Class_WebService_ActivityPub::MIME_TYPE != $this->_request->getHeader('Content-Type'))
return $this->_response->setHttpResponseCode(500);
if (!$signature = $this->_request->getHeader('Signature'))
return $this->_response->setHttpResponseCode(400);
$rawBody = $this->_request->getRawBody();
if ((!$activity = Stream::fromJson($rawBody)->getRoot())
|| (!$actor = $activity->actor()))
return $this->_response->setHttpResponseCode(400);
$service = (new Class_WebService_ActivityPub($actor->id()))
->setLogger($this->_log);
if (!$service->validateRequest($this->_request))
return $this->_response->setHttpResponseCode(400);
if ($handler = Activitypub_ReviewController_GroupHandler::handlerFor($activity)) {
$response = $handler->handle()
->actor($this->_service());
return $this->_activityResponseWith($response);
}
$this->_response->setHttpResponseCode(400);
return null;
}
public function outboxAction() {
if (Class_WebService_ActivityPub::MIME_TYPE != $this->_request->getHeader('Accept'))
return $this->_response->setHttpResponseCode(500);
if ((!$auth = $this->_request->getHeader('Authorization'))
|| (!$bearer = trim(str_replace('Bearer ', '', $auth))))
return $this->_response->setHttpResponseCode(403);
if ($key = $this->_getParam('key'))
return $this->_receiveRecordQueryFrom($key, $bearer);
if (1 == $this->_getParam('status'))
return $this->_receiveStatusQueryFrom($bearer);
if (Class_AdminVar::get('FEDERATION_COMMUNITY_SERVER') != $bearer)
return $this->_response->setHttpResponseCode(403);
$filters = ['abon_ou_bib' => Class_AvisNotice::TYPE_LIBRARIAN];
if (Class_AdminVar::isLibrarianReviewsModerated())
$filters['statut'] = Class_AvisNotice::STATUS_VALIDATED;
if ($from = $this->_getParam('from')) {
if (false === $from_date = DateTime::createFromFormat('Y-m-d', $from))
return $this->_response->setHttpResponseCode(400);
$filters['where'] = 'date_avis >= "' . $from_date->format('Y-m-d') . '"';
}
$this->_reviewPageFilteredBy($filters);
return null;
}
protected function _receiveRecordQueryFrom($key, $bearer) {
if (!Class_Federation_GroupMembership::findFirstBy(['actor_id' => $bearer,
'group_name' => 'REVIEW_DISPLAY']))
return $this->_response->setHttpResponseCode(403);
$filters = ['source_key' => $key,
'source_primary not' => null,
'source_actor_id not' => $bearer];
$this->_reviewPageFilteredBy($filters, ['key' => $key]);
return null;
}
protected function _reviewPageFilteredBy($filters, $url_params=[]) {
$items_by_page = 15;
$total = Class_AvisNotice::countBy($filters);
$page = $this->_getParam('page', 1);
$models = Class_AvisNotice::findAllBy(array_merge($filters,
['limitPage' => [$page, $items_by_page]]));
$items = array_map([$this, '_filterAttributes'], $models);
$activity = (new CollectionPage)
->id($this->_absoluteUrl(array_merge(['module' => 'activitypub',
'controller' => 'review',
'action' => 'outbox',
'page' => $page],
$url_params)))
->totalItems($total)
->items($items);
$this->_activityResponseWith($activity);
}
protected function _filterAttributes($review) {
return ['id' => $review->getId(),
'date_avis' => $review->getDateAvis(),
'date_mod' => $review->getDateMod(),
'note' => $review->getNote(),
'entete' => $review->getEntete(),
'avis' => $review->getAvis(),
'abon_ou_bib' => $review->getAbonOuBib(),
'source_author' => $review->getSourceAuthor(),
'source_key' => $review->getFederationRecordKey()];
}
protected function _receiveStatusQueryFrom($bearer) {
$your_count = ($member = Class_Federation_GroupMembership::findShareByActor($bearer))
? $member->getNumberOfReviews()
: 0;
$last_harvest = ($member && ($last = $member->lastHarvestJournal()))
? date('c', strtotime($last->getCreatedAt()))
: '';
$activity = (new CollectionPage)
->id($this->_absoluteUrl(['module' => 'activitypub', 'controller' => 'review', 'action' => 'outbox', 'page' => 1, 'status' => 1]))
->totalItems(1)
->items([['total_count' => Class_AvisNotice::count(),
'your_count' => $your_count,
'last_harvest' => $last_harvest]]);
$this->_activityResponseWith($activity);
}
protected function _absoluteUrl($params) {
return Class_Url::absolute($params, null, true, false);
}
protected function _service() {
return (new Class_ActivityPub_Service())
->id($this->_absoluteUrl(['module' => 'activitypub',
'controller' => 'review']))
->name((new Class_Federation())->getActorName());
}
protected function _activityResponseWith($activity) {
(new Class_WebService_ActivityPubServer($this->_absoluteUrl(['module' => 'activitypub',
'controller' => 'review'])))
->setLogger($this->_log)
->respondTo($this->_request, $this->_response, $activity);
}
}
abstract class Activitypub_ReviewController_GroupHandler {
protected $_group_name, $_actor_id, $_activity_id;
public static function handlerFor($activity) {
if (!$activity->object()
|| (!$group_name = $activity->object()->name()))
return null;
if ($activity instanceof Join)
return new Activitypub_ReviewController_JoinHandler($activity);
if ($activity instanceof Leave)
return new Activitypub_ReviewController_LeaveHandler($activity);
return null;
}
public function __construct($activity) {
$this->_group_name = $activity->object()->name();
$this->_actor_id = $activity->actor()->id();
$this->_activity_id = $activity->id();
}
protected function _findMembership() {
return Class_Federation_GroupMembership::findFirstBy($this->_membershipParams());
}
protected function _newMembership() {
return Class_Federation_GroupMembership::newInstance($this->_membershipParams());
}
protected function _membershipParams() {
return ['actor_id' => $this->_actor_id,
'group_name' => $this->_group_name];
}
protected function _reject($message) {
return (new Reject)->summary($message);
}
protected function _accept($member) {
return (new Accept)->id(Class_Url::absolute(['module' => 'activitypub',
'controller' => 'review',
'action' => 'group-membership',
'id' => $member->getId()],
null, true, false));
}
public function handle() {
return Class_AdminVar::isFederationCommunityServer()
? $this->_handle()
: $this->_reject('Service unavailable');
}
abstract protected function _handle();
}
class Activitypub_ReviewController_JoinHandler extends Activitypub_ReviewController_GroupHandler {
protected function _handle() {
if (!$member = $this->_findMembership())
$member = $this->_newMembership();
$response = ($member->isNew() && !$member->save())
? $this->_reject(implode(', ', $member->getErrors()))
: $this->_accept($member);
return $response->object((new Join)->id($this->_activity_id));
}
}
class Activitypub_ReviewController_LeaveHandler extends Activitypub_ReviewController_GroupHandler {
protected function _handle() {
if ($member = $this->_findMembership())
$member->delete();
$response = ($member)
? $this->_accept($member)
: $this->_reject('Cannot leave a group you did not join');
return $response->object((new Leave)->id($this->_activity_id));
}
}
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_AccueilController extends Zend_Controller_Action {
private $id_profil; // Profil a modifier
private $config; // Qui a appelé la config : "admin" ou "accueil"
private $id_module; // Identifiant unique du module a traiter
private $type_module; // Identifiant du module à traiter
/** @var Class_Systeme_ModulesAccueil */
private $_systemeModulesAccueil;
public function preDispatch() {
parent::preDispatch();
// Changer le layout
$viewRenderer = $this->getHelper('ViewRenderer');
$viewRenderer->setLayoutScript('subModal.phtml');
// Recup des parametres
$this->id_module = $this->_request->getParam("id_module");
$this->id_profil = $this->_request->getParam("id_profil");
$this->config = $this->_request->getParam("config");
// On initalise les proprietes
if (!$this->profil = Class_Profil::find($this->id_profil)) {
$this->profil = Class_Profil::getCurrentProfil();
$this->id_profil = $this->profil->getId();
}
$this->type_module = $this->_getParam('type_module');
$user = Class_Users::getIdentity();
if ((!$user->isAdminBib() && !$user->hasRightConfigFront())
|| ($user->isAdminBib() && ($user->getIdSite() !== $this->profil->getIdSite()))) {
$this->_redirect('admin/index');
return;
}
$this->preferences = ($this->config == 'admin')
? $this->_extractProperties()
: $this->profil->getOrCreateConfigAccueil($this->id_module, $this->type_module);
$boite = isset($this->preferences["boite"]) ? $this->preferences["boite"] : '';
$this->view->preferences = $this->preferences;
$this->view->url = $this->_request->getRequestUri();
$this->view->combo_templates = ZendAfi_View_Helper_Accueil_Base::getComboTemplates($boite, $this->profil);
$this->view->id_profil = $this->profil->getId();
$this->view->id_bib = $this->profil->getIdSite();
$this->_systemeModulesAccueil = new Class_Systeme_ModulesAccueil();
Zend_Layout::startMvc([]);
}
public function calendrierAction() {
$this->_simpleAction('CALENDAR');
}
public function menuverticalAction() {
$this->_simpleAction('MENU_VERTICAL');
}
public function rechguideeAction() {
$this->_simpleAction('RECH_GUIDEE');
}
public function rechsimpleAction() {
$this->view->getHelper('ComboProfils')
->setTagId('profil_redirect')
->setTagName('profil_redirect')
->addEmptyOption();
$this->_simpleAction('RECH_SIMPLE');
}
public function cartezonesAction() {
$this->_simpleAction('CARTE_ZONES');
}
public function preprocessSitoCategories() {
if ((int)$this->_getParam('type_aff',0)!=3)
return;
if ($categories=explode('-',$this->_getParam('id_categorie')))
$this->_request->setPost('id_categorie',$categories[0]);
}
public function sitothequeAction() {
$this->preprocessSitoCategories();
$this->_request->setPost('group_by_categorie','0');
$this->_simpleAction('SITO');
}
public function domainBrowserAction() {
$this->view->module_settings = $this->profil
->getModuleAccueilConfig($this->id_module, 'DOMAIN_BROWSER')['preferences'];
$this->_simpleAction('DOMAIN_BROWSER');
}
public function formationsWidgetAction() {
$this->view->module_settings = $this->profil
->getModuleAccueilConfig($this->id_module, 'FORMATIONS_WIDGET')['preferences'];
$this->_simpleAction('FORMATIONS_WIDGET');
}
public function newsAction() {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
return;
}
$this->_simpleAction('NEWS');
}
public function rssAction() {
$this->_simpleAction('RSS');
}
public function langueAction() {
$this->_simpleAction('LANGUE');
}
public function loginAction() {
$this->_simpleAction('LOGIN');
}
public function compteursAction() {
$this->_simpleAction('COMPTEURS');
}
public function pretsAction() {
$this->_simpleAction('PRETS');
}
public function historiqueRecherchesAction() {
$this->_simpleAction('HISTORIQUE_RECHERCHES');
}
public function reservationsAction() {
$this->_simpleAction('RESERVATIONS');
}
public function multimediaAction() {
$this->_simpleAction('MULTIMEDIA');
}
public function newslettersAction() {
$this->_simpleAction('NEWSLETTERS');
}
public function panierAction() {
$this->_simpleAction('PANIER');
}
public function bibliothequeNumeriqueAction() {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
} else {
$this->_simpleAction('BIB_NUMERIQUE');
}
$this->view->categories = Class_AlbumCategorie::getLoader()->getCollections();
$moduleBibNumerique = $this->_systemeModulesAccueil->getModuleByCode('BIB_NUMERIQUE');
$this->view->displayModes = $moduleBibNumerique->getDisplayModes();
$this->view->orderModes = $moduleBibNumerique->getOrderModes();
$this->view->albums = Class_AlbumCategorie::getLoader()->findAlbumsRecursively();
}
public function tagsAction() {
// Retour du formulaire
if ($this->_request->isPost()) {
$enreg = $this->_request->getPost();
$enreg['nombre'] = (int)$this->_getParam('nombre', 10);
$enreg['limite'] = (int)$this->_getParam('limite', 1000);
$enreg['type_tags'] = $enreg['type_tags_codes'];
$this->_updateEtRetour($enreg, 'TAGS');
} else {
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
}
}
public function critiquesAction() {
if ($this->_request->isPost()) {
$enreg = $this->_request->getPost();
if ($enreg["id_panier"]) {
$user = ZendAfi_Auth::getInstance()->getIdentity();
$enreg["id_catalogue"] = 0;
$enreg["id_user"] = $user->ID_USER;
} else {
$enreg["id_user"] = 0;
}
$this->_updateEtRetour($enreg, 'CRITIQUES');
}
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
$this->view->paniers = Class_PanierNotice::getPaniersForCombo();
}
public function catalogueAction() {
if ($this->_request->isPost()) {
extract($_POST);
$nb_requete = intval($nb_requete);
if (!$nb_requete)
$nb_requete = 200;
$nb_aff = intval($nb_aff);
if (!$nb_aff)
$nb_aff = 10;
if ($ordre == "1")
$nb_requete = $nb_aff; // si ordre strict on ne lit pas plus de notices qu'on en affiche
$enreg["message"] = $message;
$enreg["notices"] = $notices;
$enreg["format"] = $format;
$enreg["ordre"] = $ordre;
$enreg["type_doc"] = $type_doc;
$enreg["section"] = $section;
$enreg["genre"] = $genre;
$enreg["dewey"] = $dewey;
$enreg["pcdm4"] = $pcdm4;
$enreg["matiere"] = $matiere;
$enreg["nb_requete"] = $nb_requete;
$enreg["nb_aff"] = $nb_aff;
$this->_updateEtRetour($enreg, 'CATALOGUE');
}
}
public function kiosqueAction() {
if ($this->_request->isPost()) {
if (1 == $this->_getParam('styles_reload')) {
$this->view->preferences = $this->_request->getPost();
} else {
if ($this->isAFlashStyleSelected())
$_POST['profil_redirect'] = '';
$this->_updateConfig('KIOSQUE');
}
}
$this->view->styles_liste = $this->_getStylesListes();
$this->view->flash_selected = $this->isAFlashStyleSelected();
$this->view->catalogues = Class_Catalogue::getCataloguesForCombo();
$this->view->paniers = Class_PanierNotice::getPaniersForCombo();
}
protected function isAFlashStyleSelected() {
return Class_Systeme_ModulesAccueil::moduleByCode('KIOSQUE')
->isAFlashStyle($this->_getParam('style_liste',
$this->view->preferences['style_liste']));
}
protected function _unsetStyleReload(&$enreg) {
if (array_key_exists('styles_reload', $enreg)) {
unset($enreg["styles_reload"]);
}
}
protected function _setTypeDAnalyse(&$enreg) {
$enreg = isset($enreg['nb_notices']) ? $enreg : array_merge($enreg,['nb_notices' => 1]) ;
$enreg['nb_notices'] = (1 < (int)$enreg['nb_notices']) ?
(int)$enreg["nb_notices"]
: 1;
$enreg = isset($enreg['nb_analyse']) ? $enreg : array_merge($enreg,['nb_analyse' => 10]) ;
$enreg['nb_analyse'] = (int)$enreg['nb_analyse'];
if ($enreg['nb_analyse'] < $enreg['nb_notices'])
$enreg['nb_analyse'] = $enreg['nb_notices'] + 10;
}
protected function _setPanierOrDomaine(&$enreg) {
if ($enreg['id_panier'] > 0)
$enreg['id_catalogue'] = 0;
if ($enreg['id_catalogue'] > 0)
$enreg['id_panier'] = 0;
}
protected function _updateConfig($type) {
$enreg = $this->_request->getPost();
$this->_unsetStyleReload($enreg);
$this->_setTypeDAnalyse($enreg);
$this->_setPanierOrDomaine($enreg);
$this->_updateEtRetour($enreg, $type);
}
public function kiosqueChangeSelectionAction() {
$this->getHelper('ViewRenderer')->setNoRender();
$module_config = $this->profil
->getModuleAccueilConfig($this->id_module, 'KIOSQUE');
$selected_elementId = explode('-', $this->_request->getPost('domaine_panier'));
if($selected_elementId[0] == 'p') {
$module_config['preferences']['id_catalogue'] = 0;
$module_config['preferences']['id_panier'] = $selected_elementId[1];
} else if ($selected_elementId[0] == 'c') {
$module_config['preferences']['id_panier'] = 0;
$module_config['preferences']['id_catalogue'] = $selected_elementId[1];
} else {
$module_config['preferences']['id_catalogue'] = 0;
$module_config['preferences']['id_panier'] = 0;
}
$this->profil
->updateModuleConfigAccueil($this->id_module, $module_config)
->save();
$this->_redirect($this->_request->getServer('HTTP_REFERER'));
}
public function conteneur2colonnesAction() {
if ($this->_request->isPost()) {
$enreg = $this->_request->getPost();
$this->preferences = array_merge($this->preferences, $enreg);
foreach(['gauche', 'droite'] as $colonne)
$enreg['col_' . $colonne .'_module_id'] = $this->createModuleFor($colonne);
return $this->_updateEtRetour($enreg, 'CONTENEUR_DEUX_COLONNES');
}
$modules_accueil = Class_Systeme_ModulesAccueil::getModules();
$modules = [];
foreach ($modules_accueil as $key => $module)
$modules[$key] = $module->getLibelle();
$this->view->modules = $modules;
}
protected function createModuleFor($colonne) {
return Class_Systeme_ModulesAccueil_ConteneurDeuxColonnes::createModuleForCol($colonne,
$this->preferences,
$this->id_module);
}
private function _simpleAction($type) {
// pour combo des annexes
$this->view->ya_annexes = fetchAll("select count(*) from codif_annexe where invisible=0 order by libelle");
if ($this->_request->isPost())
$this->_updateEtRetour($this->_request->getPost(), $type);
}
/**
* @param array $datas
* @return string
*/
private function _compactProperties($datas) {
$properties = array();
foreach ($datas as $k => $v) {
$properties[] = $k . '=' . $v;
}
return implode('/', $properties);
}
/** @return array */
private function _extractProperties() {
if (null != ($props = $this->_getParam("proprietes"))) {
$props = explode('/', $props);
foreach ($props as $prop) {
$pos = strpos($prop, '=');
$clef = substr($prop, 0, $pos);
$valeur = substr($prop, ($pos + 1));
$properties[$clef] = $valeur;
}
} else {
$cls = new Class_Systeme_ModulesAccueil();
$properties = $cls->getValeursParDefaut($this->type_module);
}
return $properties;
}
/**
* @param array $data
*/
protected function _updateEtRetour($data, $type) {
$enreg = [];
foreach ($data as $clef => $valeur)
$enreg[$clef] = addslashes($valeur);
if ($this->config == "admin") {
$this->view->id_module = $this->id_module;
$this->view->properties = $this->_compactProperties($enreg);
} else {
$module_config = $this->profil->getModuleAccueilConfig($this->id_module, $type);
$module_config['preferences'] = array_merge($module_config['preferences'], $enreg);
$this->profil
->updateModuleConfigAccueil($this->id_module, $module_config)
->save();
$this->view->reload = 'SITE';
}
$viewRenderer = $this->getHelper('ViewRenderer');
$viewRenderer->renderScript('accueil/_retour.phtml');
}
protected function _getStylesListes() {
return Class_Systeme_ModulesAccueil::moduleByCode('KIOSQUE')
->getStylesListes();
}
}
\ No newline at end of file
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_ActivityController extends ZendAfi_Controller_Action {
public function getPlugins() : array {
return [ZendAfi_Controller_Plugin_ResourceDefinition_Activity::class,
ZendAfi_Controller_Plugin_Manager_Manager::class];
}
protected function setYearsForCombo() {
$years = Class_SessionActivity::getYears();
$current_year = Class_SessionActivity::getCurrentYear();
if (empty($years))
$years[$current_year]=$current_year;
$this->view->years = $years;
return $this->view->selected_year = $this->_getParam('year',
in_array($current_year, $this->view->years) ?
$current_year:reset($years));
}
public function downloadAction() {
$registrations = new Storm_Collection;
$year = $this->_getParam('year', Class_SessionActivity::getCurrentYear());
foreach(Class_SessionActivity::getAllSessionsForYear($year) as $session)
$registrations->addAll($session->getSessionActivityInscriptions());
$description = new Class_TableDescription_SessionActivityInscriptions('registrations');
$this->_helper->csv('activities-'.$year.'.csv',
$this->view->renderCsv($description,
$registrations->getArrayCopy()));
}
public function indexAction() {
if ($this->_request->isPost()) {
$this->_redirect('/admin/activity/index/year/'.$this->_getPost()['year']);
return;
}
$this->view->titre = $this->_('Mise à jour des activités');
$this->view->activities = array_filter(Class_Activity::findAllBy(['order' => 'id desc']),
fn($f) => !$f->hasSessions());
$this->setYearsForCombo();
$this->view->sessions = Class_SessionActivity::getAllSessionsForYear($this->view->selected_year);
$this->_setParam('year', $this->view->selected_year);
}
public function getAction() {
$this->_helper->viewRenderer->setNoRender();
$this->getResponse()->setHeader('Content-Type', 'application/json; charset=utf-8');
$activities_years = Class_Activity::indexByYear(
Class_Activity::findAllBy(['order' => 'libelle']),
true);
$data_activities = [[
'id' => 'activities',
'label' => $this->view->_('Activités'),
'categories' => [],
'items' => [],
'options' => []
]];
krsort($activities_years);
foreach($activities_years as $year => $activities) {
$categorie = ['id' => $year,
'label' => "$year",
'categories' => [],
'items' => []];
foreach($activities as $activity) {
$categorie['items'][] = $activity->toDataForJSON();
}
$data_activities[0]['categories'][]=$categorie;
}
$json = json_encode($data_activities);
$this->getResponse()->setBody($json);
}
protected function _readPostDate($date) {
return implode('-', array_reverse(explode('/', $date)));
}
public function sessiondeleteAction() {
if ($session = Class_SessionActivity::getLoader()->find((int)$this->_getParam('id')))
$session->delete();
$this->_redirect('admin/activity');
}
public function sessioneditAction() {
if (!$session = Class_SessionActivity::getLoader()->find((int)$this->_getParam('id'))) {
$this->_redirect('admin/activity');
return;
}
$this->view->titre = $this->_('Modifier la session du %s de l\'activité "%s"',
$this->view->humanDate($session->getDateDebut(), 'd MMMM yyyy'),
$session->getLibelleActivity());
$this->view->activity = $session->getActivity();
$this->view->session_activity = $session;
$this->_setupSessionFormAndSave($session, 'sessionedit');
}
public function presencesAction() {
$session = Class_SessionActivity::find((int)$this->_getParam('id'));
if ($this->_request->isPost()) {
$user_ids = $this->_request->getPost('user_ids');
foreach ($session->getSessionActivityInscriptions() as $inscription) {
$inscription
->setPresence(in_array($inscription->getStagiaire()->getId(), $user_ids))
->save();
}
$this->_helper->notify($this->_('Présences sauvegardées'));
$this->_redirect('admin/activity/presences/id/'.$session->getId());
return;
}
$this->view->titre = $this->_('Personnes présentes à la session du %s de l\'activité "%s"',
$this->view->humanDate($session->getDateDebut(), 'd MMMM yyyy'),
$session->getLibelleActivity());
$this->view->activity = $session->getActivity();
$this->view->form = $this->_presencesForm($session);
}
protected function _presencesForm($session) {
$user_checkboxes = new Zend_Form_Element_MultiCheckbox('user_ids');
$ids = [];
foreach($session->getSessionActivityInscriptions() as $inscription) {
$user = $inscription->getStagiaire();
if ($inscription->isPresent())
$ids[] = $user->getId();
$user_checkboxes->addMultiOption($user->getId(),
sprintf('%s %s - %s',
$user->getNom(),
$user->getPrenom(),
$user->getLogin()));
}
$user_checkboxes->setValue($ids);
return $this->view
->newForm(['id' => 'presencesForm'])
->setMethod('post')
->addElement($user_checkboxes)
->addDisplayGroup(['user_ids'],
'presences',
['legend' => $this->_('Stagiaires présents')]);
}
public function sessionaddAction() {
if (!$activity = Class_Activity::getLoader()->find((int)$this->_getParam('activity_id'))) {
$this->_redirect('admin/activity');
return;
}
$this->view->titre = $this->_('Nouvelle session de l\'activité "%s"',
$activity->getLibelle());
$session = Class_SessionActivity::getLoader()
->newInstance()
->setActivity($activity);
$this->view->activity = $activity;
if ($this->_setupSessionFormAndSave($session, 'sessionadd')) {
$activity->addSession($session)->save();
}
}
protected function _setupSessionFormAndSave($session, $action) {
$form = $this->_sessionForm($session, $action);
if ($this->_request->isPost()) {
$intervenants = [];
$post = $this->_request->getPost();
if (is_array($intervenant_ids = $this->_request->getPost('intervenant_ids'))) {
foreach($intervenant_ids as $intervenant_id)
$intervenants []= Class_Users::find($intervenant_id);
unset($post['intervenant_ids']);
}
$session
->updateAttributes($post)
->setDateDebut($this->_readPostDate($this->_request->getPost('date_debut')))
->setDateFin($this->_readPostDate($this->_request->getPost('date_fin')))
->setDateLimiteInscription($this->_readPostDate($this->_request->getPost('date_limite_inscription')))
->setIntervenants($intervenants);
if ($form->isValid($session)) {
$session->save();
$this->_helper->notify($this->_('Session du %s sauvegardée',
$this->view->humanDate($session->getDateDebut(),
'd MMMM yyyy')));
$this->_redirect('admin/activity/session_edit/id/'.$session->getId());
return true;
}
}
$this->view->form = $form;
$this->renderScript('activity/activity_form.phtml');
return false;
}
protected function _redirect($url, array $options = []) {
$year = $this->_getParam('year');
$url .= (($year && (false == strpos($url, 'year'))) ? '/year/'.$year : '');
return parent::_redirect($url, $options);
}
}
<?php
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_AjaxController extends Zend_Controller_Action {
public function preDispatch() {
$this->getHelper('ViewRenderer')->setNoRender();
}
public function listesuggestionAction() {
$autorite = $this->_getParam('type_autorite');
$id_champ = $this->_getParam('id_champ');
$mode_recherche = $this->_getParam('mode');
$recherche = $this->_getParam('valeur');
$limite_resultat = 100;
if (!$authority = $this->getAuthorityFor($autorite)) {
print('mauvais code rubrique');
return;
}
$params = [$recherche, $mode_recherche, $limite_resultat];
if ('thesaurus' == $autorite)
$params[] = $id_champ;
if (!$liste = call_user_func_array([$authority, 'getListeSuggestion'], $params)) {
echo '';
return;
}
foreach($liste as $item) {
echo '<div class="tag_liste" clef="'.$item[0].'" onclick="selectSuggest(\''.$id_champ.'\',this)">'.$item[1].'</div>';
}
}
protected function getAuthorityFor($code) {
$authorities = ['auteur' => new Class_Auteur(),
'matiere' => new Class_Matiere(),
'interet' => new Class_CodifCentreInteret(),
'dewey' => new Class_CodifDewey(),
'pcdm4' => new Class_CodifPcdm4(),
'thesaurus' => new Class_CodifThesaurus(),
'tag' => new Class_TagNotice()];
if (isset($authorities[$code]))
return $authorities[$code];
}
}
?>
\ No newline at end of file
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_AmberController extends Zend_Controller_Action {
use Trait_StaticFileWriter;
......@@ -51,7 +51,7 @@ class Admin_AmberController extends Zend_Controller_Action {
$commit_path .= 'src/';
$commit_path .= $commit_subpath.'/'.$filename;
$this->_writeContents($commit_path, $contents);
return $this;
......
<?php
/**
* Copyright (c) 2012-2017, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Admin_AuthorBrowserController extends ZendAfi_Controller_Action {
public function getPlugins() : array {
return [ZendAfi_Controller_Plugin_ResourceDefinition_Author::class];
}
}
\ No newline at end of file