Cambios
git-svn-id: https://192.168.0.254/svn/Proyectos.Afetec_Web/trunk@2 828b2857-b6d9-ce4d-95e2-bbc4707c23a3
636
db/afetec.sql
1871
db/afetec.wordpress.2011-10-21.xml
Normal file
BIN
información/Imágenes/alarnet_control_acceso.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
información/Imágenes/certificacion_de_edificios.JPG
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
información/Imágenes/imagen artigulo grupo b.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
información/Imágenes/oficinas_armstrong1119023.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
información/Imágenes/voip1.jpg
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
información/favicon.png
Normal file
|
After Width: | Height: | Size: 346 B |
BIN
información/ondas-logo.jpg
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,11 @@
|
||||
Positive Theme v1.0.1:
|
||||
|
||||
- Fixed : Some of css issues
|
||||
- Fixed : Piecemaker Slider
|
||||
|
||||
|
||||
The Files Modified:
|
||||
|
||||
- style.css
|
||||
- includes/sliders/piecemaker_slider.php
|
||||
- includes/sliders/piecemaker.xml.php
|
||||
@ -0,0 +1,14 @@
|
||||
Positive Theme v1.0.2:
|
||||
|
||||
- Fixed : Some of css issues
|
||||
- Fixed : The importing and uploading issues
|
||||
|
||||
|
||||
The Files Modified:
|
||||
|
||||
- style.css
|
||||
- cloudfw/classes/class.import.php
|
||||
- cloudfw/classes/class.uploader.php
|
||||
- cloudfw/inc/fn.php
|
||||
- cloudfw/inc/fn.admin.register.php
|
||||
- cloudfw/inc/core/core.only_admin.php
|
||||
@ -0,0 +1,15 @@
|
||||
Positive Theme v1.0.3:
|
||||
|
||||
- Improved : The core system of CloudFw
|
||||
- Improved : The importing and uploading system
|
||||
- Fixed : The update notifier for WPMU
|
||||
|
||||
|
||||
The Files Modified:
|
||||
|
||||
- style.css
|
||||
- cloudfw/classes/class.import.php
|
||||
- cloudfw/classes/class.uploader.php
|
||||
- cloudfw/inc/fn.php
|
||||
- cloudfw/inc/fn.admin.register.php
|
||||
- cloudfw/inc/core/core.only_admin.php
|
||||
@ -0,0 +1,14 @@
|
||||
Positive Theme v1.0.4:
|
||||
|
||||
- Improved : The core system of CloudFw
|
||||
- Improved : The importing and uploading system
|
||||
- Fixed : An error in v1.0.3
|
||||
- Fixed : Some javascript issues in IE 8 & 9
|
||||
|
||||
The Files Modified:
|
||||
|
||||
- style.css
|
||||
- cloudfw/inc/fn.php
|
||||
- cloudfw/inc/fn.admin.register.php
|
||||
- cloudfw/inc/core/core.only_admin.php
|
||||
- cloudfw/lib/js folder
|
||||
@ -0,0 +1,3 @@
|
||||
Positive Theme v1.0:
|
||||
|
||||
- Released
|
||||
@ -0,0 +1,6 @@
|
||||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
[InternetShortcut]
|
||||
URL=http://support.cloudfw.net/
|
||||
IDList=
|
||||
HotKey=0
|
||||
@ -0,0 +1 @@
|
||||
Online Documentation URL: http://docs.cloudfw.net/positive/
|
||||
@ -0,0 +1,6 @@
|
||||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
[InternetShortcut]
|
||||
URL=http://docs.cloudfw.net/positive
|
||||
IDList=
|
||||
HotKey=0
|
||||
@ -0,0 +1,277 @@
|
||||
body {
|
||||
background: url(images/background.gif) repeat;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
text-transform: normal;
|
||||
letter-spacing: normal;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
color:#729fb4;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color:#006288;
|
||||
}
|
||||
|
||||
#document {
|
||||
margin: 110px auto;
|
||||
width: 1024px;
|
||||
|
||||
background-color:#f6f8ff;
|
||||
-moz-box-shadow:0 0 24px rgba(0, 0, 0, 0.4);
|
||||
-webkit-box-shadow: 0 0 24px rgba(0, 0, 0, 0.4);
|
||||
box-shadow:0 0 24px rgba(0, 0, 0, 0.4);
|
||||
color:#999ca8;
|
||||
border-top:solid 1px #fff;
|
||||
}
|
||||
|
||||
#header {
|
||||
padding: 110px 0 50px;
|
||||
border-bottom: solid 1px #e5e6eb;
|
||||
}
|
||||
|
||||
#header #logo {
|
||||
height: 175px;
|
||||
background: url(images/logo.png) no-repeat scroll 50% 0;
|
||||
}
|
||||
|
||||
#author {
|
||||
margin:20px 0;
|
||||
text-align:center;
|
||||
text-shadow: 0 1px 1px #fff;
|
||||
}
|
||||
|
||||
#content {
|
||||
border-top:solid 1px #fff;
|
||||
}
|
||||
|
||||
#content #left {
|
||||
float:left;
|
||||
width:300px;
|
||||
}
|
||||
|
||||
#content #right {
|
||||
float:left;
|
||||
width:723px;
|
||||
border-left:solid 1px #e5e6eb;
|
||||
}
|
||||
|
||||
#thedocument-border {
|
||||
border-left:solid 1px #fff;
|
||||
}
|
||||
|
||||
#tableofcontents {
|
||||
margin:40px;
|
||||
}
|
||||
|
||||
div#tableofcontents ol {
|
||||
margin:20px 0;
|
||||
list-style:inside decimal;
|
||||
font-size:14px;
|
||||
color:#48505d;
|
||||
}
|
||||
|
||||
div#tableofcontents ol li{
|
||||
margin:0 0 10px;
|
||||
}
|
||||
|
||||
div#tableofcontents ol ul li{
|
||||
margin:0;
|
||||
}
|
||||
|
||||
div#tableofcontents ol li a {
|
||||
font-size:14px;
|
||||
font-weight:bold;
|
||||
text-decoration:none;
|
||||
line-height:20px;
|
||||
color:#48505d;
|
||||
}
|
||||
|
||||
div#tableofcontents ol li a:hover {
|
||||
text-decoration:underline;
|
||||
color:#636e80;
|
||||
}
|
||||
|
||||
div#tableofcontents ol ul {
|
||||
list-style:inside square;
|
||||
margin: 0 0 10px 20px;
|
||||
}
|
||||
|
||||
div#tableofcontents ol ul li a {
|
||||
font-size:13px;
|
||||
font-weight:normal;
|
||||
text-decoration:none;
|
||||
line-height:20px;
|
||||
color:#48505d;
|
||||
}
|
||||
|
||||
#thedocument {
|
||||
padding:40px 60px;
|
||||
}
|
||||
|
||||
#thanks {
|
||||
margin: 0 0 30px;
|
||||
}
|
||||
|
||||
#thanks-author {
|
||||
font-style:italic;
|
||||
font-size:12px;
|
||||
display:block;
|
||||
margin: 10px 0 0;
|
||||
}
|
||||
|
||||
#thedocument ol {
|
||||
list-style:outside decimal;
|
||||
font-size:24px;
|
||||
font-weight:bold;
|
||||
letter-spacing: -.05em;
|
||||
color:#6b6f7d;
|
||||
}
|
||||
|
||||
#thedocument ol ul {
|
||||
list-style:outside circle;
|
||||
font-size:20px;
|
||||
}
|
||||
|
||||
#thedocument ol li {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
#thedocument ol li p,
|
||||
#thedocument ol ul li p {
|
||||
font-size:14px;
|
||||
font-weight:normal;
|
||||
letter-spacing:0;
|
||||
color:#999ca8;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
h1,h2 {
|
||||
font-weight:bold;
|
||||
letter-spacing: -.05em;
|
||||
text-shadow: 0 1px -1px #FFF;
|
||||
color:#6b6f7d;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size:24px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size:18px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#thedocument ol li {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.fix {clear:both;}
|
||||
|
||||
.back_title {
|
||||
font-size:16px;
|
||||
font-weight:normal;
|
||||
color:#d9dce4;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.divider {
|
||||
margin: 20px -60px;
|
||||
height:1px;
|
||||
background:#fff;
|
||||
border-top:solid 1px #e5e6eb;
|
||||
}
|
||||
|
||||
#top-link {
|
||||
display:none;
|
||||
position:fixed;
|
||||
right:20px;
|
||||
bottom:20px;
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
#top-link a {
|
||||
color:#FFF;
|
||||
text-shadow: 0 0 5px #000;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Elements */
|
||||
.normal,
|
||||
.normal ul,
|
||||
.normal ol,
|
||||
.normal li {
|
||||
font-size:13px;
|
||||
|
||||
font-weight:normal;
|
||||
font-weight: normal;
|
||||
text-transform: normal;
|
||||
letter-spacing: normal;
|
||||
margin:0 !important;
|
||||
padding:0 !important;
|
||||
}
|
||||
|
||||
.normal ul{
|
||||
list-style: inside disc;
|
||||
margin-left: 30px !important;
|
||||
}
|
||||
|
||||
.normal ol{
|
||||
list-style:inside decimal;
|
||||
margin-left: 30px !important;
|
||||
}
|
||||
|
||||
.cau {
|
||||
background:#eff1f8;
|
||||
color:#48505d;
|
||||
border:solid 1px #E5E6EB;
|
||||
margin-bottom:20px;
|
||||
display:block;
|
||||
}
|
||||
|
||||
.cau .cau-init {
|
||||
padding: 20px;
|
||||
border:solid 1px #fafbff;
|
||||
border-top:solid 1px #FFF;
|
||||
display:block;
|
||||
}
|
||||
|
||||
.cau code {
|
||||
background:#e1e3ea;
|
||||
}
|
||||
|
||||
code {
|
||||
padding: 1px 3px;
|
||||
background:#e1e3ea;
|
||||
text-shadow: 0 -1px 0 #f6f8ff;
|
||||
color: #5d5f66;
|
||||
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
embed {
|
||||
padding: 5px;
|
||||
background:#eff1f8;
|
||||
border:solid 1px #fafbff;
|
||||
border-top:solid 1px #FFF;
|
||||
}
|
||||
|
||||
.embed {
|
||||
border:solid 1px #E5E6EB;
|
||||
}
|
||||
|
||||
.space {
|
||||
margin-bottom:60px !important;
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 31 KiB |
@ -0,0 +1,30 @@
|
||||
//plugin
|
||||
jQuery.fn.topLink = function(settings) {
|
||||
settings = jQuery.extend({
|
||||
min: 1,
|
||||
fadeSpeed: 200,
|
||||
ieOffset: 50
|
||||
}, settings);
|
||||
return this.each(function() {
|
||||
//listen for scroll
|
||||
var el = $(this);
|
||||
el.css('display','none'); //in case the user forgot
|
||||
$(window).scroll(function() {
|
||||
//stupid IE hack
|
||||
if(!jQuery.support.hrefNormalized) {
|
||||
el.css({
|
||||
'position': 'absolute',
|
||||
'top': $(window).scrollTop() + $(window).height() - settings.ieOffset
|
||||
});
|
||||
}
|
||||
if($(window).scrollTop() >= settings.min)
|
||||
{
|
||||
el.fadeIn(settings.fadeSpeed);
|
||||
}
|
||||
else
|
||||
{
|
||||
el.fadeOut(settings.fadeSpeed);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 106 B |
|
After Width: | Height: | Size: 347 B |
|
After Width: | Height: | Size: 324 B |
|
After Width: | Height: | Size: 111 B |
|
After Width: | Height: | Size: 352 B |
|
After Width: | Height: | Size: 340 B |
|
After Width: | Height: | Size: 103 B |
|
After Width: | Height: | Size: 503 B |
|
After Width: | Height: | Size: 96 B |
|
After Width: | Height: | Size: 70 B |
|
After Width: | Height: | Size: 506 B |
|
After Width: | Height: | Size: 203 B |
|
After Width: | Height: | Size: 176 B |
|
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
@ -0,0 +1,359 @@
|
||||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
#fancybox-loading {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
margin-top: -20px;
|
||||
margin-left: -20px;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
z-index: 1104;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-loading div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 480px;
|
||||
background-image: url('fancybox.png');
|
||||
}
|
||||
|
||||
#fancybox-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 1100;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-tmp {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding: 20px;
|
||||
z-index: 1101;
|
||||
outline: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-outer {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#fancybox-content {
|
||||
width: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
z-index: 1102;
|
||||
border: 0px solid #fff;
|
||||
}
|
||||
|
||||
#fancybox-hide-sel-frame {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
z-index: 1101;
|
||||
}
|
||||
|
||||
#fancybox-close {
|
||||
position: absolute;
|
||||
top: -15px;
|
||||
right: -15px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: transparent url('fancybox.png') -40px 0px;
|
||||
cursor: pointer;
|
||||
z-index: 1103;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-error {
|
||||
color: #444;
|
||||
font: normal 12px/20px Arial;
|
||||
padding: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#fancybox-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
line-height: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#fancybox-frame {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fancybox-left, #fancybox-right {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
height: 100%;
|
||||
width: 35%;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
background: transparent url('blank.gif');
|
||||
z-index: 1102;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#fancybox-left {
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
#fancybox-right {
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
#fancybox-left-ico, #fancybox-right-ico {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -9999px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
z-index: 1102;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#fancybox-left-ico {
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -30px;
|
||||
}
|
||||
|
||||
#fancybox-right-ico {
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -60px;
|
||||
}
|
||||
|
||||
#fancybox-left:hover, #fancybox-right:hover {
|
||||
visibility: visible; /* IE6 */
|
||||
}
|
||||
|
||||
#fancybox-left:hover span {
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
#fancybox-right:hover span {
|
||||
left: auto;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.fancybox-bg {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
#fancybox-bg-n {
|
||||
top: -20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-image: url('fancybox-x.png');
|
||||
}
|
||||
|
||||
#fancybox-bg-ne {
|
||||
top: -20px;
|
||||
right: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -162px;
|
||||
}
|
||||
|
||||
#fancybox-bg-e {
|
||||
top: 0;
|
||||
right: -20px;
|
||||
height: 100%;
|
||||
background-image: url('fancybox-y.png');
|
||||
background-position: -20px 0px;
|
||||
}
|
||||
|
||||
#fancybox-bg-se {
|
||||
bottom: -20px;
|
||||
right: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -182px;
|
||||
}
|
||||
|
||||
#fancybox-bg-s {
|
||||
bottom: -20px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-image: url('fancybox-x.png');
|
||||
background-position: 0px -20px;
|
||||
}
|
||||
|
||||
#fancybox-bg-sw {
|
||||
bottom: -20px;
|
||||
left: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -142px;
|
||||
}
|
||||
|
||||
#fancybox-bg-w {
|
||||
top: 0;
|
||||
left: -20px;
|
||||
height: 100%;
|
||||
background-image: url('fancybox-y.png');
|
||||
}
|
||||
|
||||
#fancybox-bg-nw {
|
||||
top: -20px;
|
||||
left: -20px;
|
||||
background-image: url('fancybox.png');
|
||||
background-position: -40px -122px;
|
||||
}
|
||||
|
||||
#fancybox-title {
|
||||
font-family: Helvetica;
|
||||
font-size: 12px;
|
||||
z-index: 1102;
|
||||
}
|
||||
|
||||
.fancybox-title-inside {
|
||||
padding-bottom: 10px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fancybox-title-outside {
|
||||
padding-top: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-title-over {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
color: #FFF;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#fancybox-title-over {
|
||||
padding: 10px;
|
||||
background-image: url('fancy_title_over.png');
|
||||
display: block;
|
||||
}
|
||||
|
||||
.fancybox-title-float {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -20px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
#fancybox-title-float-wrap {
|
||||
border: none;
|
||||
border-collapse: collapse;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#fancybox-title-float-wrap td {
|
||||
border: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#fancybox-title-float-left {
|
||||
padding: 0 0 0 15px;
|
||||
background: url('fancybox.png') -40px -90px no-repeat;
|
||||
}
|
||||
|
||||
#fancybox-title-float-main {
|
||||
color: #FFF;
|
||||
line-height: 29px;
|
||||
font-weight: bold;
|
||||
padding: 0 0 3px 0;
|
||||
background: url('fancybox-x.png') 0px -40px;
|
||||
}
|
||||
|
||||
#fancybox-title-float-right {
|
||||
padding: 0 0 0 15px;
|
||||
background: url('fancybox.png') -55px -90px no-repeat;
|
||||
}
|
||||
|
||||
/* IE6 */
|
||||
|
||||
.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
|
||||
.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
|
||||
.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
|
||||
|
||||
.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
|
||||
height: expression(this.parentNode.clientHeight + "px");
|
||||
}
|
||||
|
||||
#fancybox-loading.fancybox-ie6 {
|
||||
position: absolute; margin-top: 0;
|
||||
top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
|
||||
}
|
||||
|
||||
#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
|
||||
|
||||
/* IE6, IE7, IE8 */
|
||||
|
||||
.fancybox-ie .fancybox-bg { background: transparent !important; }
|
||||
|
||||
.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
|
||||
.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
|
||||
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* FancyBox - jQuery Plugin
|
||||
* Simple and fancy lightbox alternative
|
||||
*
|
||||
* Examples and documentation at: http://fancybox.net
|
||||
*
|
||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
||||
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
|
||||
*
|
||||
* Version: 1.3.4 (11/11/2010)
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
|
||||
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
|
||||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
|
||||
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
|
||||
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
|
||||
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
|
||||
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
|
||||
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
|
||||
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
|
||||
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
|
||||
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
|
||||
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
|
||||
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
|
||||
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
|
||||
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
|
||||
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
|
||||
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
|
||||
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
|
||||
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
|
||||
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
|
||||
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
|
||||
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
|
||||
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
|
||||
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
|
||||
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
|
||||
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
|
||||
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
|
||||
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
|
||||
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
|
||||
@ -0,0 +1,14 @@
|
||||
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.4
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
|
||||
(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
|
||||
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
||||
@ -0,0 +1,167 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v1.4.4
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2010, John Resig
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
* http://sizzlejs.com/
|
||||
* Copyright 2010, The Dojo Foundation
|
||||
* Released under the MIT, BSD, and GPL Licenses.
|
||||
*
|
||||
* Date: Thu Nov 11 19:04:53 2010 -0500
|
||||
*/
|
||||
(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
|
||||
h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
|
||||
h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
|
||||
"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
|
||||
e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
|
||||
"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
|
||||
a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
||||
C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
|
||||
s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
|
||||
j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
|
||||
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
|
||||
-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
|
||||
if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
|
||||
if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
|
||||
b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
|
||||
!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
|
||||
l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
|
||||
z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
|
||||
s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
|
||||
s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
|
||||
[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
|
||||
false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
|
||||
k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
|
||||
scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
|
||||
false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
|
||||
1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
|
||||
"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
|
||||
c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
|
||||
else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
|
||||
a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
|
||||
c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
|
||||
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
|
||||
colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
|
||||
1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
|
||||
l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
|
||||
"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
|
||||
if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
|
||||
a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
|
||||
attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
|
||||
b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
|
||||
c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
|
||||
arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
|
||||
d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
|
||||
c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
|
||||
w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
|
||||
8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
|
||||
"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
|
||||
d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
|
||||
fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
|
||||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
|
||||
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
|
||||
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
|
||||
var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
|
||||
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
|
||||
xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
|
||||
B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
|
||||
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
|
||||
0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
|
||||
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
|
||||
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
|
||||
"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
|
||||
c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
|
||||
(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
|
||||
[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
|
||||
break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
|
||||
q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
|
||||
l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
|
||||
return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
|
||||
B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
|
||||
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
|
||||
i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
|
||||
i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
|
||||
"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
|
||||
m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
|
||||
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
|
||||
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
|
||||
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
|
||||
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
|
||||
i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
|
||||
if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
|
||||
g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
|
||||
for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
|
||||
i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
|
||||
n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
|
||||
function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
|
||||
p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
|
||||
t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
|
||||
function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
|
||||
c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
|
||||
not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
|
||||
h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
|
||||
c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
|
||||
2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
|
||||
b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
|
||||
e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
|
||||
"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
|
||||
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
|
||||
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
|
||||
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
|
||||
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
|
||||
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
|
||||
else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
|
||||
c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
|
||||
b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
|
||||
this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
|
||||
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
|
||||
b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
|
||||
1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
|
||||
d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
|
||||
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
|
||||
zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
|
||||
h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
|
||||
if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
|
||||
d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
|
||||
e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
||||
ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
|
||||
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
|
||||
!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
|
||||
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
|
||||
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
|
||||
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
|
||||
false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
|
||||
A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
|
||||
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
|
||||
c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
|
||||
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
|
||||
encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
|
||||
[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
|
||||
e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
|
||||
if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
|
||||
3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
|
||||
d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
|
||||
d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
|
||||
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
|
||||
1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
|
||||
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
|
||||
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
|
||||
var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
|
||||
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
|
||||
this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
|
||||
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
|
||||
b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
|
||||
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
|
||||
for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
|
||||
parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
|
||||
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
|
||||
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
|
||||
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
|
||||
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
|
||||
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
|
||||
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
|
||||
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
|
||||
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* jQuery.ScrollTo - Easy element scrolling using jQuery.
|
||||
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
|
||||
* Dual licensed under MIT and GPL.
|
||||
* Date: 5/25/2009
|
||||
* @author Ariel Flesler
|
||||
* @version 1.4.2
|
||||
*
|
||||
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
|
||||
*/
|
||||
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
|
||||
@ -0,0 +1,17 @@
|
||||
html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, font, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
font-size: 100%;
|
||||
vertical-align: baseline;
|
||||
background: transparent;
|
||||
}
|
||||
body {line-height: 1;}
|
||||
ol, ul {list-style: none;}
|
||||
blockquote, q {quotes: none;}
|
||||
blockquote:before, blockquote:after, q:before, q:after {content: '';content: none;}
|
||||
:focus {outline: 0;}
|
||||
ins {text-decoration: none;}
|
||||
del {text-decoration: line-through;}
|
||||
table {border-collapse: collapse;border-spacing: 0;}
|
||||
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,558 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>CloudFw - Theme Positive Documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="assets/reset.css" type="text/css" />
|
||||
<link rel="stylesheet" href="assets/doc_style.css" type="text/css" />
|
||||
<link rel="stylesheet" href="assets/js/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
|
||||
|
||||
<script type="text/javascript" src="assets/js/jq.js"></script>
|
||||
<script type="text/javascript" src="assets/js/scrollTo.js"></script>
|
||||
<script type="text/javascript" src="assets/js/custom.js"></script>
|
||||
<script type="text/javascript" src="assets/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
//usage w/ smoothscroll
|
||||
$(document).ready(function() {
|
||||
//set the link
|
||||
$('#top-link').topLink({
|
||||
min: 600,
|
||||
fadeSpeed: 500
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#tableofcontents ol li a, a.go').click(function(){
|
||||
$.scrollTo( this.hash, 1000);
|
||||
return false;
|
||||
});
|
||||
$("a.lb").fancybox();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div id="document">
|
||||
|
||||
<div id="header">
|
||||
|
||||
<div id="logo"></div>
|
||||
<div id="author"><em><strong>by “<a href="http://themeforest.net/user/orqun/" target="_blank">OrkunGURSEL</a>” – contact@orkungursel.com</strong></em></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div id="left">
|
||||
|
||||
<div id="tableofcontents">
|
||||
|
||||
<div class="back_title text-center">Table Of Contents</div>
|
||||
|
||||
<ol>
|
||||
<li><a href="#requirements">Requirements</a></li>
|
||||
<li><a href="#getting_started">Getting Started</a>
|
||||
<ul>
|
||||
<li><a href="#downloading">Downloading from Themeforest</a></li>
|
||||
<li><a href="#installation">Installation</a></li>
|
||||
<li><a href="#setup_homepage">Setting up the Homepage</a></li>
|
||||
<li><a href="#setup_blog">Setting up the Blog</a></li>
|
||||
<li><a href="#setup_portfolio">Setting up the Portfolio</a></li>
|
||||
<li><a href="#setting_up_navigation_simple">Setting up the Navigation Menu (Simple)</a></li>
|
||||
<li><a href="#setting_up_navigation_megamenu">Setting up the Navigation Menu (With Mega Menu)</a></li>
|
||||
<li><a href="#setting_up_sliders">Creating a slider and inserting into a page</a></li>
|
||||
<li><a href="#color_skins">Custom Color Skins</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#how-to">How-to</a>
|
||||
|
||||
<ul>
|
||||
<li><a href="#featured_images">Set Featured Image</a></li>
|
||||
<li><a href="#login_module">Activate Custom Login Module</a></li>
|
||||
<li><a href="#setting_up_typo">Setup Typography Options</a></li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="right">
|
||||
<div id="thedocument-border">
|
||||
|
||||
<div id="thedocument">
|
||||
|
||||
<div id="thanks">
|
||||
|
||||
Thank you for purchasing Theme Positive. This theme is easy to use and it has user-friendly admin panel - CloudFw. I hope you like it. If you have any question or problem about the theme please contact us by using <a href="http://support.cloudfw.net/" target="_blank">our support center</a>. However before getting support, please read this documentation and watch video tutorials. They will help you. And also please don't forget to read How-to section. Enjoy it! <span id="thanks-author">Author - Orkun Gursel</span>
|
||||
|
||||
</div>
|
||||
|
||||
<ol>
|
||||
|
||||
<li id="requirements"> <h1>Requirements</h1>
|
||||
|
||||
<p class="normal">
|
||||
|
||||
<ul class="normal">
|
||||
<li>PHP version 5 or greater</li>
|
||||
<li>WordPress 3.0 or greater</li>
|
||||
</ul>
|
||||
|
||||
</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li id="getting_started"> <h1>Getting Started</h1>
|
||||
|
||||
<p class="normal">
|
||||
|
||||
<ul>
|
||||
<li id="downloading"><h2>Downloading from Themeforest</h2>
|
||||
|
||||
<p>Download the Positive theme and unzip this download. Any good quality zip program will do. Just follow the unzip instructions of your program carefully. Some give you the option of unzipping only a portion, or all, of the files. You want to select "all". Once unzipped, you will find the following folders will be in the unzipped directory:</p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li><code><strong>positive/</strong></code> - the folder of the theme files that you need upload to <em>/wp-content/themes/</em> folder on your server</li>
|
||||
<li><code><strong>documentation/</strong></code> - documentation files for current package</li>
|
||||
<li><code><strong>licensing/</strong></code> - license for the theme</li>
|
||||
<li><code><strong>resource/</strong></code> -
|
||||
<ul>
|
||||
<li><code><strong>sample skins/</strong></code> - importable skin files</li>
|
||||
<li><code><strong>sample sliders/</strong></code> - importable slider files</li>
|
||||
<li><code><strong>plug-ins/</strong></code> - optional plug-ins which can be used with the theme</li>
|
||||
<li><code><strong>psd/</strong></code> - all layered psd sources</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><code><strong>change log/</strong></code> - Log files for the theme updates</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li id="installation"><h2>Installation</h2>
|
||||
|
||||
<p>To install this theme you must have a working version of WordPress already installed. For information in regard to installing the WordPress platform, please see the WordPress Codex - <a href="http://codex.wordpress.org/Installing_WordPress">http://codex.wordpress.org/Installing_WordPress</a></p>
|
||||
|
||||
<p>When you are ready to install a theme, you must first upload the theme files and then activate the theme itself. The theme files can be uploaded in two ways:</p>
|
||||
|
||||
<p class="normal">
|
||||
|
||||
<ul class="normal">
|
||||
<li><strong>FTP Upload:</strong> Using your FTP program, upload the non-zipped theme folder into the /wp-content/themes/ folder on your server.</li>
|
||||
<li><strong>WordPress Upload:</strong> Navigate to Appearance > Add New Themes > Upload. Go to browse, and select the zipped theme folder. Hit “Install Now” and the theme will be uploaded and installed.</li>
|
||||
</ul>
|
||||
|
||||
</p>
|
||||
|
||||
<p>Once the theme is uploaded, you need to activate it. Go to <code>Appearance</code> > <code>Themes</code> and activate your chosen theme.</p>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li id="setup_homepage"> <h2>Setting up the Homepage</h2>
|
||||
|
||||
<p>To set up the homepage you must create a new page, you can do so by navigating to <code>Pages</code> > <code>Add New</code>. You can give this page a title yet you do not have to include any content. Select the a template from the Page. Attributes section and click <strong>"Publish"</strong>.</p>
|
||||
|
||||
<p>Once you have created your new page, navigate to <code>Settings</code> > <code>Reading</code> and configure the <code>Front Page Displays</code> setting. Select the static page option and choose the page you just created as your front page.</p>
|
||||
|
||||
<p>Your homepage is now created and can be viewed by visiting your root URL.</p>
|
||||
|
||||
<p>Or you can create a sample homepage with one click. Here is the video tutorial to create sample homepage via <strong>Configuration Wizard</strong>:</p>
|
||||
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/WBgs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="setup_blog"> <h2>Setting up the Blog</h2>
|
||||
|
||||
<p id="creating_blog_page"><strong>A) Creating Main Blog Page</strong></p>
|
||||
|
||||
<p>To set up the blog, you must create a new page, you can do so by navigating to <code>Pages</code> > <code>Add New</code>. You can give this page a title of "blog" yet you do not have to include any content. Click <strong>"Publish"</strong>.</p>
|
||||
|
||||
<p>Once you have created your new page, navigate to <code>Settings</code> > <code>Reading</code> and configure the <code>Front Page Displays</code> setting. Select the static page option and choose the page you just created as your posts page.</p>
|
||||
|
||||
<p>Your blog index is now created and can be viewed by visiting the page you just published.</p>
|
||||
|
||||
<p>Or you can create a sample blog page with one click via <strong>Configuration Wizard</strong>:</p>
|
||||
|
||||
<p class="embed"><img src="assets/screenshots/setup_blog_1.png" alt=""/></p>
|
||||
|
||||
<p id="inserting_blog_post"><strong>B) Inserting A Blog Post and Changing the Layout of the Main Blog Page</strong></p>
|
||||
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/GtCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
</li>
|
||||
|
||||
<li id="setup_portfolio"> <h2>Setting up the Portfolio</h2>
|
||||
|
||||
<p>There is 2 ways to create a portfolio page with Positive Theme.</p>
|
||||
|
||||
<p id="portfolio_by_category"><strong>A) By creating portfolio posts and porfolio category</strong></p>
|
||||
|
||||
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_1.png" alt=""/></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li>First, you must create some portfolio posts, you can do so by navigating to <code>Portfolio</code> > <code>Add New</code></li>
|
||||
|
||||
<li>When creating your portfolio post please be sure to set a <strong>featured image</strong> for each of them. The image will be displayed as the thumbnail when the portfolio post being called via shortcode from any page.
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_2.png" alt=""/></p>
|
||||
</li>
|
||||
|
||||
<li>And take a look at the porfolio settings for each post from "Portfolio Options" metabox. You can insert a description or set what will happen when clicking the post (go to the post, display this post's featured image or video in the lightbox, call this post's content via ajax) or insert a video url.
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_4.png" alt=""/></p>
|
||||
</li>
|
||||
|
||||
<li>After creating the porfolio posts, you must create a new page, you can do so by navigating to <code>Pages</code> > <code>Add New</code>. You can give this page a title of "portfolio".</li>
|
||||
|
||||
<li>And now you must use our <code>shortcode generator</code>, which is coming with built-in the content editor of WordPress
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_3.png" alt=""/></p>
|
||||
</li>
|
||||
|
||||
<li>Click to portfolio tab in the shortcode generator, then set the height of the thumbnail images in the portfolio and other options, select a portfolio source:
|
||||
<ul>
|
||||
<li>If you create a porfolio post you can select "From a porfolio category" - this source type will get all posts in the porfolio category which you select</li>
|
||||
<li>You must select "From selected posts" for getting the post, which selected by you, into the page.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<li>And finally click to <code>Generate The Portfolio Code</code> button. You will have a shortcode like this:
|
||||
<code>[portfolio from="a category" id="5" columns="3" limit="-1"]</code> or <code>[portfolio from="selected posts" id="19,15,17" columns="3" limit="-1"]</code>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<br/>
|
||||
<p>Video Tutorial For (A- Setting up the Portfolio by creating portfolio posts and porfolio category)</p>
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/axCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
<br/>
|
||||
|
||||
<p id="portfolio_by_gallery"><strong>B) By WordPress galleries</strong></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li>You must create some portfolio posts, you can do so by navigating to <code>Portfolio</code> > <code>Add New</code>You can give this page a title of "The post has a gallery" </li>
|
||||
|
||||
<li>And open the media uploader of WordPress. And upload your images via the uploader. Click to <code>Save All Changes</code> button after being finished the uploading. And now you can sort the images. And finally close the uploader and "<strong>Publish</strong>" the post (<em>The post has a gallery</em>).
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_5.png" alt=""/></p>
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_6.png" alt=""/></p>
|
||||
</li>
|
||||
|
||||
<li>Then you must create a new page, you can do so by navigating to <code>Pages</code> > <code>Add New</code>. You can give this page a title of "portfolio".</li>
|
||||
|
||||
<li>Now you must use our <code>shortcode generator</code>, which is coming with built-in the content editor of WordPress, to generate the portfolio shortcode.
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_3.png" alt=""/></p>
|
||||
</li>
|
||||
|
||||
<li>Click to portfolio tab in the shortcode generator, then set the height of the thumbnail images in the portfolio and other options, select <strong>From A Post Gallery</strong> option for Portfolio's Source. And select the post, you just created and titled as <em>The post has a gallery</em>, for source page
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_7.png" alt=""/></p>
|
||||
</li>
|
||||
|
||||
<li>And finally click to <code>Generate The Portfolio Code</code> button. You will have a shortcode like this:
|
||||
<code>[portfolio from="a post gallery" id="5" columns="3" limit="-1"]</code>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<br/>
|
||||
<p>Video Tutorial For (B- Setting up the Portfolio by WordPress galleries)</p>
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/lhCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li id="setting_up_navigation_simple"><h2>Setting up the Navigation Menu (Simple)</h2>
|
||||
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/pgCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="setting_up_navigation_megamenu"><h2>Setting up the Navigation Menu (With Mega Menu)</h2>
|
||||
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/pgCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
</li>
|
||||
|
||||
<li id="setting_up_sliders"><h2>Creating a slider and inserting into a page</h2>
|
||||
|
||||
<p id="creating_slider"><strong>A) Creating a new slider</strong></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li>Navigate to <code>Slider Manager</code> and click to <code>Create New Slider</code> button</li>
|
||||
<p class="embed"><img src="assets/screenshots/setup_slider_1.png" alt=""/></p>
|
||||
<p class="embed"><img src="assets/screenshots/setup_slider_2.png" alt=""/></p>
|
||||
</li>
|
||||
<li>After giving your slider a title and selecting a slider type, click to <code>create</code> button.</li>
|
||||
<li>Now you can see all options for the slider. Set your slider options and click to <code>Update The Slider</code> button.</li>
|
||||
<li>After the options being updated, you must add your slider items to the slider. You can do so by clicking to the slider's title from the root page of <code>Slider Manager</code>
|
||||
<p class="embed"><img src="assets/screenshots/setup_slider_3.png" alt=""/></p>
|
||||
</li>
|
||||
<li>And now click to <code>Add New Item</code> button to add a item to the slider. And upload your image and set the slider item options.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<p id="inserting_slider"><strong>B) Inserting a slider into a page (excepts "Header Sliders")</strong></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Navigate to <code>Pages</code> > <code>Add New</code> or open an existing page in <code>editing mode</code>.</li>
|
||||
|
||||
<li>Now you must use our <code>shortcode generator</code>, which is coming with built-in the content editor of WordPress, to insert the slider into the page via a shortcode.
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_3.png" alt=""/></p>
|
||||
</li>
|
||||
|
||||
<li>Click to slider tab in the shortcode generator, select the slider you just created and click to <code>Generate The Code</code> Button. You will have a shortcode like this: <br/>
|
||||
<code>[slider id="XXXXXXXXXXX"]</code>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<p id="inserting_header_slider"><strong>C) Inserting a "header slider" into a page</strong></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Navigate to <code>Pages</code> > <code>Add New</code> or open an existing page in <code>editing mode</code>.</li>
|
||||
|
||||
<li>Now, select the slider from <strong>Header Slider</strong> metabox on the page.
|
||||
</li>
|
||||
|
||||
<li>Important: Header sliders cannot embedded via a shortcode, only you have to select it from the metabox to display on a page's header area.
|
||||
<p class="embed"><img src="assets/screenshots/setup_slider_4.png" alt=""/></p>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<p><strong>D) Video tutorial: Creating a slider with Slider Manager & Inserting into a page</strong></p>
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/ekCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li id="color_skins"><h2>Custom Color Skins</h2>
|
||||
|
||||
<p id="creating_color_skin"><strong>A) Creating a new color skin</strong></p>
|
||||
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/wqCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li>Navigate to <code>CloudFw Panel</code> and click to <code>Color Skin</code> button</li>
|
||||
<p class="embed"><img src="assets/screenshots/setup_skins_1.png" alt=""/></p>
|
||||
</li>
|
||||
<li>Click to <code>create</code> button and give a name for your custom color skin.
|
||||
<p class="embed"><img src="assets/screenshots/setup_skins_2.png" alt=""/></p>
|
||||
</li>
|
||||
<li>Now you can see all color and layout options for the theme. Insert your colors and click to <code>Save</code> or <code>Save & Apply</code> button.</li>
|
||||
<li><strong>Quick Tip:</strong> you can use <code>CTRL + S (win)</code> and <code>CMD + S (mac)</code> shortcut to save the color skin when in editing mode.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<p id="importing_color_skin"><strong>B) Importing Predefined Color Skins</strong></p>
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/UtCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li>You can find predefined custom skins </li>
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<p id="finding_color_skin_element"><strong>C) Finding a customizable element</strong></p>
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/0uCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li>When in color skin editing mode, click to <code>Search</code> button. By the way, you can use <code>CTRL + F (win)</code> or <code>CMD + F (mac)</code> shortcut.
|
||||
<p class="embed"><img src="assets/screenshots/setup_skins_3.png" alt=""/></p>
|
||||
</li>
|
||||
<li>You will see the searching form, insert the code or title of an element. Example: <code>Header Background</code> or <code>HBG01</code>
|
||||
<p class="embed"><img src="assets/screenshots/setup_skins_4.png" alt=""/></p>
|
||||
<p>Please take a look at element title and codes</p>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<p id="code_list"><strong>D) Code list of the customizable skin elements</strong></p>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li><code>BG01</code> : Body Background</li>
|
||||
<li><code>BG02</code> : Body Head Background</li>
|
||||
<li><code>LNK</code> : General Link Elements</li>
|
||||
<li><code>BRADIUS</code> : Global Border Radius Level</li>
|
||||
<li><code>HBG01</code> : Header Background</li>
|
||||
<li><code>HLINK</code> : Link Elements in the Header</li>
|
||||
<li><code>HTEXT</code> : Text colors in the Header</li>
|
||||
<li><code>NAVSTYLE</code> : Style of the Navigation Menu</li>
|
||||
<li><code>NAVBG</code> : Navigation Line Background</li>
|
||||
<li><code>NAVLNK</code> : Navigation Links (for only 1st Level)</li>
|
||||
<li><code>NAVSHADOW</code> : Navigation Line Shadows</li>
|
||||
<li><code>NAVARROW</code> : Current Navigation Menu Indicator (Arrow)</li>
|
||||
<li><code>DDOWNBG</code> : Navigation Menu Drop Down Background</li>
|
||||
<li><code>DDOWNLINK</code> : Navigation Menu Drop Down Links (for 2nd, 3rd.. Levels)</li>
|
||||
<li><code>HOMEICON</code> : Home Icon Colors in The Header Line</li>
|
||||
<li><code>MDBG</code> : Middle Area Background (Between the Navigation Menu and the Content Area)</li>
|
||||
<li><code>MDHEIGHT</code> : Middle Area Height</li>
|
||||
<li><code>BLURB</code> : Blurb Text Colors</li>
|
||||
<li><code>BREADCRUMBLE</code> : BreadCrubmle Text Colors</li>
|
||||
<li><code>CONTEXT</code> : Content Texts and Heading Colors (h1, h2 .. h6)</li>
|
||||
<li><code>PORTOVERLAY</code> : Overlay Colors of Portfolio Posts</li>
|
||||
<li><code>SBWIDGET</code> : Widget Title and Text Colors for the Left and Right Sidebar Areas</li>
|
||||
<li><code>SBLINK</code> : Link Colors for the Left and Right Sidebar Areas</li>
|
||||
<li><code>FTWIDGET</code> : Widget Title and Text Colors for the Footer Sidebar Areas</li>
|
||||
<li><code>FTLINK</code> : Link Colors for the Footer Sidebar Areas</li>
|
||||
<li><code>CSS</code> : Additional CSS Code</li>
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</p>
|
||||
|
||||
</li>
|
||||
|
||||
<li id="how-to"> <h1>How-to</h1>
|
||||
|
||||
<p class="normal">
|
||||
|
||||
<ul>
|
||||
<li id="featured_images"> <h2>Set Featured Image</h2>
|
||||
|
||||
<div class="cau normal"> <span class="cau-init">
|
||||
|
||||
<ul>
|
||||
<li>Navigate to <code>Pages</code> > <code>Add New</code> or open an existing post in <code>editing mode</code>.</li>
|
||||
<li>Locate the <code>Featured Image module</code> and click the <strong>Set featured image</strong> link.
|
||||
<p class="embed"><img src="assets/screenshots/setup_portfolio_2.png" alt=""/></p>
|
||||
</li>
|
||||
<li>You will see an uploading screen identical to that used when <a target="_blank" href="http://en.support.wordpress.com/images/#uploading-images">inserting an image</a> into a post or page. Follow the on-screen prompts to choose the image from your computer and upload it or choose it from one of the images already in your Media Library.</li>
|
||||
<li>Once the image has successfully been uploaded, look underneath the sizing options, and click on the <strong>Use as featured image</strong> link.
|
||||
<p class="embed"><img src="assets/screenshots/how_to_featured_image.png" alt=""/></p>
|
||||
</li>
|
||||
<li>Your Feature image is now set! You can close the Media selector once you’ve chosen the featured image. The image will then appear wherever a featured image is available.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</span> </div>
|
||||
|
||||
</li>
|
||||
|
||||
<li id="login_module"> <h2>Activate Custom Login Module</h2>
|
||||
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/VuCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
</li>
|
||||
|
||||
<li id="setting_up_typo"> <h2>Setup Typography Options</h2>
|
||||
|
||||
<p class="embed"><iframe src="http://www.screenr.com/embed/KzCs" width="600" height="366" frameborder="0"></iframe></p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</p>
|
||||
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fix"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="top-link"><a class="go" href="#tableofcontents"><strong>Ξ</strong> go to the table of contents</a></div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-20657868-1']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
||||
@ -0,0 +1,85 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
@ -0,0 +1,3 @@
|
||||
Please read about licencing details -
|
||||
|
||||
http://themeforest.net/legal/licences
|
||||
@ -0,0 +1,12 @@
|
||||
This WordPress theme is comprised of two parts:
|
||||
|
||||
|
||||
(1) The PHP code is licensed under the GPL license as is WordPress itself. You will find a copy of the license text in the same directory as this text file. Or you can read it here:
|
||||
|
||||
http://codex.wordpress.org/GPL
|
||||
|
||||
|
||||
|
||||
(2) All other parts of the theme including, but not limited to the CSS code, images, and design are licensed according to the license purchased. Read about licensing details here:
|
||||
|
||||
http://wiki.envato.com/support/legal-terms/licensing-terms/
|
||||
@ -0,0 +1,26 @@
|
||||
<?php get_header(); ?>
|
||||
|
||||
<div id="content-containers">
|
||||
|
||||
<div id="wide-container" class="make-shadow global-radius">
|
||||
|
||||
<div id="wide-content" class="global-radius">
|
||||
|
||||
|
||||
<div class="archives text-center">
|
||||
<h1 class="big-title">404 - Not Found</h1>
|
||||
<h3>The Page You Try To See Cannot Found</h3>
|
||||
</div>
|
||||
|
||||
<div class="text-center" style="width:500px; margin: auto;"><?php get_search_form(); ?></div>
|
||||
|
||||
</div><!-- /#wide-content -->
|
||||
|
||||
</div><!-- /#wide-container -->
|
||||
|
||||
<div class="cf"></div>
|
||||
|
||||
</div><!-- /#content-containers -->
|
||||
|
||||
|
||||
<?php get_footer(); ?>
|
||||
@ -0,0 +1,384 @@
|
||||
<?php
|
||||
define("WP_ADMIN", true);
|
||||
// Call WP Load
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
require_once (TMP_ADMIN_PATH.'/classes/JSON.php');
|
||||
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here", "cloudfw"));
|
||||
|
||||
$case = $_GET["case"];
|
||||
if (!$_REQUEST['comeback']) $_REQUEST['comeback'] = $_SERVER['HTTP_REFERER'];
|
||||
|
||||
switch ($case){
|
||||
case 'export-all-options':
|
||||
default:
|
||||
|
||||
$all_settings = cloudfw_exclude_options(getCO(NULL, FALSE));
|
||||
|
||||
$signatured_settings = array(
|
||||
'case' => 'options',
|
||||
'key' => CLOUD_THEMEKEY,
|
||||
'server' => TMP_URL,
|
||||
'data' => $all_settings
|
||||
);
|
||||
|
||||
|
||||
|
||||
$json = new Services_JSON();
|
||||
$parse_all_options = $json->encode($signatured_settings);
|
||||
$encoded_options = base64_encode($parse_all_options);
|
||||
|
||||
$pfix = cloudfw_PV_make_form_name( CLOUD_THEMENAME.' '. get_bloginfo('name'));
|
||||
$the_file = CLOUD_UPLOAD_DIR."/{$pfix}_backup.backup";
|
||||
$cfile = CLOUD_UPLOAD_DIR."/{$pfix}_backup_copy.backup";
|
||||
$file = cloud_cache_write($encoded_options, $the_file, $cfile, FALSE);
|
||||
|
||||
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=" . urlencode( substr( $pfix.'_backup_'.date("Y_m_d"), 0, 200 ).'.backup'));
|
||||
header("Content-Type: application/force-download");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Type: application/download");
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Length: " . filesize($file));
|
||||
flush(); // this doesn't really matter.
|
||||
$fp = fopen($file, "r");
|
||||
while (!feof($fp))
|
||||
{
|
||||
echo fread($fp, 65536);
|
||||
flush(); // this is essential for large downloads
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
break;
|
||||
case 'export-skins':
|
||||
$ids = $_REQUEST["ids"];
|
||||
|
||||
$pfix = substr( cloudfw_PV_make_form_name( CLOUD_THEMENAME ), 0, 200 );
|
||||
$the_file = CLOUD_UPLOAD_DIR."/{$pfix}.skin";
|
||||
$cfile = CLOUD_UPLOAD_DIR."/{$pfix}_copy.skin";
|
||||
$file = cloud_cache_write($encoded_options, $the_file, $cfile, FALSE);
|
||||
$homeURL = cloudfw_home_url();
|
||||
|
||||
$is_ZIP = $_REQUEST['zip'];
|
||||
|
||||
if (is_array($ids)) {
|
||||
$i = 0;
|
||||
|
||||
foreach ($ids as $id) {
|
||||
|
||||
if ($the_content = cloudfw_get_a_skin($id)):
|
||||
|
||||
$the_content['data']['custom']['foldername'] = cloudfw_PV_make_form_name($the_content['data']['custom']["foldername"] ? $the_content['data']['custom']["foldername"] : $the_content["name"]);
|
||||
|
||||
$the_content['data'] = cloudfw_prepare_URI_for_export($the_content['data'], $homeURL);
|
||||
$all_contents[$id] = $the_content;
|
||||
|
||||
$i++;
|
||||
endif;
|
||||
|
||||
}//foreach
|
||||
|
||||
if ($i>1)
|
||||
$downloadable_file = urlencode($pfix.'_skins_'.$i.'_'.date("Y_m_d"));
|
||||
else
|
||||
$downloadable_file = urlencode($pfix.'_skins_'.cloudfw_PV_make_form_name($the_content["name"]).'_'.date("Y_m_d"));
|
||||
|
||||
}else{
|
||||
$i = 1;
|
||||
|
||||
if ($the_content = cloudfw_get_a_skin($ids)):
|
||||
|
||||
|
||||
$the_content['foldername'] = cloudfw_PV_make_form_name($the_content["name"]);
|
||||
$the_content['data']['custom']['foldername'] = cloudfw_PV_make_form_name($the_content['data']['custom']["foldername"] ? $the_content['data']['custom']["foldername"] : $the_content["name"]);
|
||||
|
||||
if ($is_ZIP)
|
||||
$to_download_images = cloudfw_detect_skin_URIs($the_content['data'], $homeURL);
|
||||
|
||||
|
||||
$the_content['data'] = cloudfw_prepare_URI_for_export($the_content['data'], $homeURL);
|
||||
|
||||
$all_contents[$ids] = $the_content;
|
||||
$downloadable_file = urlencode($pfix.'_skin_'.cloudfw_PV_make_form_name($the_content["name"]).'_'.date("Y_m_d"));
|
||||
|
||||
endif;
|
||||
|
||||
}
|
||||
|
||||
if ($to_download_images)
|
||||
$to_download_images = array_unique($to_download_images);
|
||||
|
||||
$signatured_settings = array(
|
||||
'case' => 'skin',
|
||||
'key' => CLOUD_THEMEKEY,
|
||||
'data' => $all_contents
|
||||
);
|
||||
|
||||
|
||||
|
||||
if (!$all_contents) { wp_redirect(($_REQUEST['comeback'].'&m=9013')); exit;}
|
||||
|
||||
$json = new Services_JSON();
|
||||
$parse_all_options = $json->encode($signatured_settings);
|
||||
$encoded_options = base64_encode($parse_all_options);
|
||||
$file = cloud_cache_write($encoded_options, $the_file, $cfile, FALSE);
|
||||
|
||||
|
||||
if (!$is_ZIP || empty($to_download_images)) {
|
||||
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=" . urlencode( substr( $downloadable_file, 0, 230 ).'.skin'));
|
||||
header("Content-Type: application/force-download");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Type: application/download");
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Length: " . filesize($file));
|
||||
flush(); // this doesn't really matter.
|
||||
$fp = fopen($file, "r");
|
||||
while (!feof($fp))
|
||||
{
|
||||
echo fread($fp, 65536);
|
||||
flush(); // this is essential for large downloads
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
} else {
|
||||
|
||||
$class_path = apply_filters('createZipfile', TMP_ADMIN_PATH.'/classes/class.createZipFile.php');
|
||||
|
||||
if (!$class_path)
|
||||
exit;
|
||||
|
||||
include_once($class_path);
|
||||
|
||||
$no_found_count = 0;
|
||||
|
||||
$createZip = new CreateZipFile;
|
||||
$createZip->addFile($encoded_options, urlencode( substr( $downloadable_file, 0, 230 ).'.skin'));
|
||||
|
||||
if (is_array($to_download_images)) {
|
||||
foreach ($to_download_images as $img) {
|
||||
|
||||
if (file_exists($img)) {
|
||||
$filecontent = file_get_contents($img);
|
||||
$pathinfo = pathinfo($img);
|
||||
|
||||
if ($filecontent)
|
||||
$createZip->addFile($filecontent, $pathinfo['filename'].'.'.$pathinfo['extension']);
|
||||
else {
|
||||
$no_found_count++;
|
||||
$no_found_paths .= "{$no_found_count}:\t'{$img}' source of the file cannot read\r\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$no_found_count++;
|
||||
$no_found_paths .= "{$no_found_count}:\t'{$img}' file cannot found\r\n";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*echo ABSPATH. ' -> ' .$homeURL;
|
||||
|
||||
echo '<pre>';
|
||||
print_r($to_download_images);
|
||||
echo '</pre>';*/
|
||||
//echo $no_found_paths; exit;
|
||||
|
||||
$folder_name = $the_content['foldername'];
|
||||
if ($no_found_count > 0) {
|
||||
|
||||
$createZip->addFile($no_found_paths, "error_log.txt");
|
||||
$folder_name = "With_{$no_found_count}_Error_{$folder_name}";
|
||||
}
|
||||
|
||||
|
||||
$zipFileName = ( substr( $folder_name, 0, 230 ).'.zip');
|
||||
$handle = fopen($zipFileName, 'wb');
|
||||
$out = fwrite($handle, $createZip->getZippedFile());
|
||||
|
||||
fclose($handle);
|
||||
$createZip->forceDownload($zipFileName);
|
||||
|
||||
@unlink($zipFileName);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'export-sliders':
|
||||
$ids = $_REQUEST["ids"];
|
||||
|
||||
|
||||
$pfix = cloudfw_PV_make_form_name(CLOUD_THEMENAME);
|
||||
$the_file = CLOUD_UPLOAD_DIR."/{$pfix}_backup.backup";
|
||||
$cfile = CLOUD_UPLOAD_DIR."/{$pfix}_backup_copy.backup";
|
||||
$file = cloud_cache_write($encoded_options, $the_file, $cfile, FALSE);
|
||||
$sliders = get_option(PFIX.'_slider_ids');
|
||||
$homeURL = cloudfw_home_url();
|
||||
$is_ZIP = $_REQUEST['zip'];
|
||||
$to_download_images = array();
|
||||
|
||||
|
||||
if (is_array($ids)) {
|
||||
$i = 0;
|
||||
|
||||
foreach ($ids as $id) {
|
||||
|
||||
if ($sliders[$id]):
|
||||
|
||||
$sliders[$id]['foldername'] = $folder_name = cloudfw_PV_make_form_name($sliders[$id]["foldername"] ? $sliders[$id]["foldername"] : $sliders[$id]["title"]);
|
||||
|
||||
$the_slider = $sliders[$id];
|
||||
$the_content = get_option($id);
|
||||
|
||||
if ($is_ZIP){
|
||||
$to_download_images = array_merge((array) $to_download_images, (array) cloudfw_detect_skin_URIs($the_slider, $homeURL));
|
||||
$to_download_images = array_merge((array) $to_download_images, (array) cloudfw_detect_skin_URIs($the_content, $homeURL));
|
||||
}
|
||||
|
||||
$all_contents[$id] = array(
|
||||
'main' => cloudfw_prepare_URI_for_export($the_slider, $homeURL),
|
||||
'data' => cloudfw_prepare_URI_for_export($the_content, $homeURL)
|
||||
);
|
||||
$i++;
|
||||
|
||||
endif;
|
||||
|
||||
}//foreach
|
||||
|
||||
if ($i>1)
|
||||
$downloadable_file = urlencode($pfix.'_sliders_'.$i.'_'.date("Y_m_d"));
|
||||
else
|
||||
$downloadable_file = urlencode($pfix.'_slider_'.cloudfw_PV_make_form_name($sliders[$id]["title"]).'_'.date("Y_m_d"));
|
||||
|
||||
}else{
|
||||
|
||||
if ($sliders[$ids]):
|
||||
|
||||
$sliders[$ids]['foldername'] = $folder_name = cloudfw_PV_make_form_name($sliders[$ids]["foldername"] ? $sliders[$ids]["foldername"] : $sliders[$ids]["title"]);
|
||||
|
||||
$the_slider = $sliders[$ids];
|
||||
$the_content = get_option($ids);
|
||||
|
||||
if ($is_ZIP){
|
||||
$to_download_images = array_merge((array) $to_download_images, (array) cloudfw_detect_skin_URIs($the_slider, $homeURL));
|
||||
$to_download_images = array_merge((array) $to_download_images, (array) cloudfw_detect_skin_URIs($the_content, $homeURL));
|
||||
}
|
||||
|
||||
$all_contents[$ids] = array(
|
||||
'main' => cloudfw_prepare_URI_for_export($the_slider, $homeURL),
|
||||
'data' => cloudfw_prepare_URI_for_export($the_content, $homeURL)
|
||||
);
|
||||
$downloadable_file = urlencode($pfix.'_slider_'.cloudfw_PV_make_form_name($sliders[$ids]["title"]).'_'.date("Y_m_d"));
|
||||
|
||||
|
||||
endif;
|
||||
|
||||
}
|
||||
|
||||
if ($to_download_images)
|
||||
$to_download_images = array_unique($to_download_images);
|
||||
|
||||
$signatured_settings = array(
|
||||
'case' => 'slider',
|
||||
'key' => CLOUD_THEMEKEY,
|
||||
'data' => $all_contents
|
||||
);
|
||||
|
||||
|
||||
if (!$all_contents) { wp_redirect(($_REQUEST['comeback'].'&m=9013')); exit;}
|
||||
|
||||
$json = new Services_JSON();
|
||||
$parse_all_options = $json->encode($signatured_settings);
|
||||
$encoded_options = base64_encode($parse_all_options);
|
||||
$file = cloud_cache_write($encoded_options, $the_file, $cfile, FALSE);
|
||||
|
||||
|
||||
if (!$is_ZIP || empty($to_download_images)) {
|
||||
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=" . urlencode( substr( $downloadable_file, 0, 230 ).'.slider'));
|
||||
header("Content-Type: application/force-download");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Type: application/download");
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Length: " . filesize($file));
|
||||
flush(); // this doesn't really matter.
|
||||
$fp = fopen($file, "r");
|
||||
while (!feof($fp)) {
|
||||
echo fread($fp, 65536);
|
||||
flush(); // this is essential for large downloads
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
} else {
|
||||
|
||||
// ZIP
|
||||
$class_path = apply_filters('createZipfile', TMP_ADMIN_PATH.'/classes/class.createZipFile.php');
|
||||
|
||||
if (!$class_path)
|
||||
exit;
|
||||
|
||||
include_once($class_path);
|
||||
|
||||
$no_found_count = 0;
|
||||
|
||||
$createZip = new CreateZipFile;
|
||||
$createZip->addFile($encoded_options, urlencode( substr( $downloadable_file, 0, 230 ).'.slider'));
|
||||
|
||||
if (is_array($to_download_images)) {
|
||||
foreach ($to_download_images as $img) {
|
||||
|
||||
if (file_exists($img)) {
|
||||
$filecontent = file_get_contents($img);
|
||||
$pathinfo = pathinfo($img);
|
||||
|
||||
if ($filecontent)
|
||||
$createZip->addFile($filecontent, $pathinfo['filename'].'.'.$pathinfo['extension']);
|
||||
else {
|
||||
$no_found_count++;
|
||||
$no_found_paths .= "{$no_found_count}:\t'{$img}' source of the file cannot read\r\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$no_found_count++;
|
||||
$no_found_paths .= "{$no_found_count}:\t'{$img}' file cannot found\r\n";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($no_found_count > 0) {
|
||||
|
||||
$createZip->addFile($no_found_paths, "error_log.txt");
|
||||
$folder_name = "With_{$no_found_count}_Error_{$folder_name}";
|
||||
}
|
||||
|
||||
|
||||
$zipFileName = ( substr( $folder_name, 0, 230 ).'.zip');
|
||||
$handle = fopen($zipFileName, 'wb');
|
||||
$out = fwrite($handle, $createZip->getZippedFile());
|
||||
|
||||
fclose($handle);
|
||||
$createZip->forceDownload($zipFileName);
|
||||
|
||||
@unlink($zipFileName);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
$id = $_GET["id"];
|
||||
$ga = $_GET["ga"];
|
||||
$nonce = $_GET["nonce"];
|
||||
|
||||
if (!isset($nonce)) {echo 'ERROR'; die();}
|
||||
|
||||
if (!isset($id) && !isset($ga)) {echo 'ERROR'; die();}
|
||||
|
||||
if (wp_create_nonce('cloudfw') !== $nonce) {echo 'ERROR'; die();}
|
||||
|
||||
check_admin_referer();
|
||||
|
||||
|
||||
|
||||
if (isset($ga)) {
|
||||
update_option(PFIX."_ga_id", NULL);
|
||||
update_option(PFIX."_ga_pass", NULL);
|
||||
update_option(PFIX."_ga_profile", NULL);
|
||||
wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
};
|
||||
|
||||
global $_params;
|
||||
update_option($id, $_params[$id]);
|
||||
|
||||
wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
|
||||
?>
|
||||
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
|
||||
$meta_id = $_POST["meta_id"];
|
||||
$meta_name = $_POST["meta_name"];
|
||||
|
||||
if ($meta_id=="" || $meta_name=="") {echo '<span class="theog_theme_error timer_hide">Error<br />
|
||||
<br />
|
||||
</div>'; die();}
|
||||
|
||||
|
||||
require('../../../../../wp-blog-header.php');
|
||||
|
||||
|
||||
|
||||
check_admin_referer();
|
||||
|
||||
|
||||
delete_post_meta($meta_id, $meta_name);
|
||||
|
||||
|
||||
echo '<span class="theog_theme_ok timer_hide">Image is deleted<br />
|
||||
<br />
|
||||
</div>';
|
||||
|
||||
?>
|
||||
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in())
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
|
||||
require (TMP_ADMIN_PATH.'/classes/gapi.class.php');
|
||||
require (TMP_ADMIN_PATH.'/inc/fn.admin.ga.php');
|
||||
|
||||
|
||||
|
||||
global $_opt, $ga_page;
|
||||
$_opt = getCO(NULL, array(PFIX."_ga_id", PFIX."_ga_pass", PFIX."_ga_profile"));
|
||||
|
||||
echo '<pre>';
|
||||
print_r($opt);
|
||||
echo '</pre>';
|
||||
|
||||
if (defined("GA_ID")&&defined("GA_PASS")):
|
||||
|
||||
$ga_id = GA_ID;
|
||||
$ga_pass = GA_PASS;
|
||||
|
||||
else:
|
||||
|
||||
$ga_id = $_opt[PFIX."_ga_id"];
|
||||
$ga_pass = $_opt[PFIX."_ga_pass"];
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
if (empty($ga_id) || empty($ga_pass) ){
|
||||
|
||||
|
||||
echo '
|
||||
<div class="module">
|
||||
|
||||
<div class="error-div box-div" style="margin:-10px 20px 10px; width:auto;"><a href="'.$ga_page.'">'.__('Please configure your Google Analytics information to view analytics datas here.','cloudfw').'</a> '.__('or you can disable it from the system settings page.','cloudfw').'</div>
|
||||
|
||||
</div>';
|
||||
update_option(PFIX."_ga_profile", NULL);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (empty($_opt[PFIX."_ga_profile"])){
|
||||
|
||||
|
||||
echo '
|
||||
<div class="module">
|
||||
|
||||
<div class="error-div box-div" style="margin:-10px 20px 10px; width:auto;">'.__('Accout ID cannot found.','cloudfw').'<a href="'.$ga_page.'">'.__('Please check your Google Analytics account informations','cloudfw').'</a></div>
|
||||
|
||||
</div>';
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if (empty($_opt[PFIX."_ga_profile"])){
|
||||
|
||||
|
||||
echo '
|
||||
<div class="module">
|
||||
|
||||
<div class="error-div box-div" style="margin:-10px 20px 10px; width:auto;">'.__('Account ID cannot found.','cloudfw').'<a href="'.$ga_page.'">'.__('Please check your Google Analytics account informations','cloudfw').'</a></div>
|
||||
|
||||
</div>';
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET["x"])) { echo '
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li class="firsttab"><a href="#today">'.__('Today','cloudfw').'</a></li>
|
||||
<li><a href="'.TMP_ADMIN.'/ajax/ga.php?case=lastweek" title="lastweek">'.__('Last Week','cloudfw').'</a></li>
|
||||
<li><a href="'.TMP_ADMIN.'/ajax/ga.php?case=lastmonth" title="lastmonth">'.__('Last Month','cloudfw').'</a></li>
|
||||
<li class="lasttab"><a href="'.TMP_ADMIN.'/ajax/ga.php?case=thisyear" title="thisyear">'.__('Last Year','cloudfw').'</a></li>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
|
||||
';
|
||||
|
||||
|
||||
echo '
|
||||
<div id="today">
|
||||
'.cloud_cache(ga_today,'ga_cache_today_'.$_opt[PFIX."_ga_profile"].'.cache').'
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
;} // End of isset x
|
||||
|
||||
if ($_GET["case"] == "lastweek" ) echo cloud_cache(ga_lastweek,'ga_cache_lastweek_'.$_opt[PFIX."_ga_profile"].'.cache');
|
||||
if ($_GET["case"] == "lastmonth" ) echo cloud_cache(ga_lastmonth,'ga_cache_lastmonth_'.$_opt[PFIX."_ga_profile"].'.cache');
|
||||
if ($_GET["case"] == "thisyear" ) echo cloud_cache(ga_thisyear,'ga_cache_thisyear_'.$_opt[PFIX."_ga_profile"].'.cache');
|
||||
|
||||
function ga_today() { return cloudfw_ga('today','hourly',date('Y-m-d'),date('Y-m-d'));};
|
||||
function ga_lastweek() { return cloudfw_ga('lastweek','daily',date('Y-m-d', strtotime('-1 week')), date('Y-m-d'));};
|
||||
function ga_lastmonth() { return cloudfw_ga('lastmonth','daily',date('Y-m-d', strtotime('-1 month')), date('Y-m-d'));};
|
||||
function ga_thisyear() { return cloudfw_ga('lastyear','monthly',date('Y-m-d', strtotime('-1 year')), date('Y-m-d'));};
|
||||
|
||||
?>
|
||||
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in())
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
|
||||
require (TMP_ADMIN_PATH.'/classes/gapi.class.php');
|
||||
require (TMP_ADMIN_PATH.'/inc/fn.admin.ga.php');
|
||||
|
||||
global $_opt;
|
||||
$_opt = getCO(NULL, array(PFIX."_ga_id", PFIX."_ga_pass", PFIX."_ga_profile"));
|
||||
|
||||
|
||||
if (defined("GA_ID")&&defined("GA_PASS")):
|
||||
|
||||
$ga_id = GA_ID;
|
||||
$ga_pass = GA_PASS;
|
||||
|
||||
else:
|
||||
|
||||
$ga_id = $_opt[PFIX."_ga_id"];
|
||||
$ga_pass = $_opt[PFIX."_ga_pass"];
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
$ga = new gapi($ga_id,$ga_pass);
|
||||
}
|
||||
|
||||
catch(Exception $e)
|
||||
{
|
||||
if ($e->getMessage()=="NOAUTH"): echo 'NOAUTH';
|
||||
|
||||
update_option(PFIX."_ga_id", NULL);
|
||||
update_option(PFIX."_ga_pass", NULL);
|
||||
update_option(PFIX."_ga_profile", NULL);
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
endif;
|
||||
}
|
||||
|
||||
$ga->requestAccountData();
|
||||
|
||||
$items = array();
|
||||
|
||||
if ($ga->getResults()) {
|
||||
|
||||
foreach($ga->getResults() as $result)
|
||||
{
|
||||
// $accounts .= $result . ' (' . $result->getProfileId() . ")";
|
||||
|
||||
$items[] = array( "item_value" => $result->getProfileId(),
|
||||
"item_class" => "",
|
||||
"item_html" => '<span class="contrainer">'.$result.'<br/>('.$result->getProfileId().')</span>'
|
||||
);
|
||||
|
||||
$first_id ? NULL: $first_id = $result->getProfileId();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$profile_id = $_opt[PFIX."_ga_profile"];
|
||||
|
||||
|
||||
if (($profile_id=="")): update_option(PFIX."_ga_profile", $first_id); $profile_id = $first_id; endif;
|
||||
|
||||
echo '
|
||||
|
||||
<!-- ROW -->
|
||||
<div class="grid oneof4"><span class="title">'.__('Your Analytics Profiles:','cloudfw').'</span> </div>
|
||||
<div class="grid threeof4 last">',
|
||||
|
||||
($profile_id) ? NULL : '<div style="margin:0 0 15px 0;">'.__('Please select a profile to see in cloudfw dashboard','cloudfw').'</div>'
|
||||
|
||||
,'',
|
||||
|
||||
|
||||
admin_create_selectlist("ga_profile", // id
|
||||
$items, // items
|
||||
'EMPTY', //default_value
|
||||
"radio",
|
||||
$profile_id,
|
||||
'custom_label ga_profiles'
|
||||
)
|
||||
|
||||
|
||||
|
||||
,'
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<a href="'.TMP_ADMIN.'/ajax/del.php?ga=true&nonce='.wp_create_nonce('cloudfw').'" class="small-button small-grey"><span>'.__('Connect To A Different Account','cloudfw').'</span></a>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<!-- /ROW -->
|
||||
|
||||
|
||||
';
|
||||
|
||||
}else{
|
||||
// no profile
|
||||
|
||||
echo 'No Profile';
|
||||
|
||||
};
|
||||
|
||||
?>
|
||||
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
define("WP_ADMIN", true);
|
||||
// Call WP Load
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here"));
|
||||
|
||||
|
||||
$icon_list = cloudfw_get_icons();
|
||||
|
||||
echo '<div id="icon-box-title">
|
||||
Icon List <span id="icon-box-append"></span>
|
||||
<a class="icon-box-icons" style="display:none;" id="icon-box-back" href="#"></a>
|
||||
<a class="icon-box-icons" id="icon-box-close" href="#"></a>
|
||||
</div>
|
||||
<div id="icon-box-content">
|
||||
';
|
||||
|
||||
foreach((array)$icon_list as $icon_cat_name => $icon_cat) {
|
||||
|
||||
echo '
|
||||
<div class="icon-loop">
|
||||
<a href="#" class="icon-cat-title">'.$icon_cat_name.'</a>';
|
||||
echo '<ul class="grouped">';
|
||||
|
||||
foreach((array)$icon_cat as $icon_url => $icon_name) {
|
||||
|
||||
echo '<li>';
|
||||
echo '
|
||||
<a href="#" class="the-icon" data-id="'.$icon_url.'">
|
||||
<div><img src="'.cloudfw_make_icon_url($icon_url).'" alt="'.$icon_name.'" /></div>
|
||||
</a>';
|
||||
echo '</li>';
|
||||
//echo "[icon src=\"{$icon_url}\"]<br/>";
|
||||
|
||||
}
|
||||
|
||||
echo '</ul></div>';
|
||||
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
?>
|
||||
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// Call WP Load
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
|
||||
$id = $_GET["id"];
|
||||
$operation = $_GET["op"];
|
||||
|
||||
if (empty($id)) exit('An Error Has Occurred');
|
||||
$_opt = getCO(NULL, array(PFIX.'_setup_status'));
|
||||
|
||||
if ($id == '__dontshowanymore') {
|
||||
cloudfw_update_option( array(PFIX.'_cloudfw_actives' => array('map' => 'FALSE') ) );
|
||||
exit;
|
||||
|
||||
}else{
|
||||
|
||||
$_setup_status = $_opt[PFIX."_setup_status"];
|
||||
if (empty($_setup_status))
|
||||
$_setup_status = array();
|
||||
|
||||
if ($operation == 'done'){
|
||||
array_push($_setup_status, $id);
|
||||
} else {
|
||||
foreach($_setup_status as $key => $value) {if ($value == $id) unset($_setup_status[$key]);}
|
||||
}
|
||||
|
||||
if (!empty($_setup_status))
|
||||
array_unique($_setup_status);
|
||||
|
||||
update_option(PFIX."_setup_status",$_setup_status);
|
||||
$_opt[PFIX."_setup_status"] = $_setup_status;
|
||||
$in_ajax = 'TRUE';
|
||||
$percent_old = $_GET["old_val"];
|
||||
|
||||
|
||||
require(TMP_ADMIN_PATH . '/inc/fn.guide.php');
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// Call WP Load
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
$x = $_REQUEST["x"];
|
||||
if (!wp_verify_nonce( $_REQUEST["nonce"], 'cloudfw')) die(__("Failed nonce check and the action aborted.","cloudfw"));
|
||||
|
||||
|
||||
switch($x):
|
||||
|
||||
default:
|
||||
|
||||
echo lastupdates_news();
|
||||
|
||||
break;
|
||||
case 'dissmiss':
|
||||
|
||||
echo $_POST["version"];
|
||||
update_option(PFIX.'_last_checked_version', $_POST["version"]);
|
||||
|
||||
break;
|
||||
|
||||
endswitch;
|
||||
|
||||
?>
|
||||
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
|
||||
// Call WP Load
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
|
||||
$id = $_POST["id"];
|
||||
$nonce = $_POST["nonce"];
|
||||
|
||||
if (!isset($id) && !isset($nonce)) {echo 'ERROR'; die();}
|
||||
|
||||
if (wp_create_nonce('sidebar_remove') !== $nonce) {echo 'ERROR'; die();}
|
||||
|
||||
check_admin_referer();
|
||||
|
||||
global $_opt;
|
||||
$bars = $_opt[PFIX."_custom_sidebars"];
|
||||
|
||||
unset($bars[$id]);
|
||||
|
||||
update_option(PFIX."_custom_sidebars", $bars);
|
||||
|
||||
echo 'OK'; die();
|
||||
|
||||
?>
|
||||
@ -0,0 +1,339 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="tr-TR">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Select A Page</title>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
// Call WP Load
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
$protocol = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
|
||||
$this_url = $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||
|
||||
global $_opt;
|
||||
|
||||
wp_enqueue_script('utils');
|
||||
|
||||
$cid = $_GET["id"];
|
||||
$preview = $_GET["pid"];
|
||||
$cases = $_GET["case"];
|
||||
$hideparent = $_GET["hideparent"];
|
||||
$whichin = $_GET["whichin"];
|
||||
$s = $_GET["s"];
|
||||
?>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
jQuery('.senderer').click(function(){
|
||||
|
||||
jQuery('#<?php echo $cid;?>',top.document).val(<?php if ($cases=="" || $cases=="url"){ echo 'jQuery(this).attr("rel")+"||"+jQuery(this).attr("href")';}else if ( $cases=="id"){ echo 'jQuery(this).attr("rel")+"||"+jQuery(this).attr("href")+"||"+jQuery(this).attr("id")';}else if ( $cases=="salturl"){ echo 'jQuery(this).attr("href")';} ?>);
|
||||
<?php if ($preview){?>
|
||||
|
||||
jQuery('#<?php echo $preview;?>',top.document).html('<a href="#" onclick="javascript: jQuery(\'#<?php echo $cid;?>\').val(\'\').show();jQuery(\'#<?php echo $preview;?>\').html(\'\');return false;"><img src="<?php echo TMP_ADMIN_SRC;?>/cancel.gif" /></a> <a href="'+jQuery(this).attr("href")+'" target="_blank" class="page-preview-link"><span class="page-preview-title">'+jQuery(this).attr("rel")+'</span></a><span class="page-preview-url">'+jQuery(this).attr("href")+'</span>');
|
||||
|
||||
<?php }
|
||||
if ($hideparent){?>
|
||||
jQuery('#<?php echo $cid;?>',top.document).hide();
|
||||
<?php }?>
|
||||
|
||||
jQuery("#TB_imageOff",top.document).unbind("click");
|
||||
jQuery("#TB_closeWindowButton",top.document).unbind("click");
|
||||
jQuery("#TB_window",top.document).fadeOut("fast",function(){jQuery('#TB_window,#TB_overlay,#TB_HideSelect',top.document).trigger("unload").unbind().remove();});
|
||||
jQuery("#TB_load",top.document).remove();
|
||||
return false;});
|
||||
|
||||
|
||||
if(!(jQuery.browser.msie && jQuery.browser.version < 7)){
|
||||
jQuery('.senderer').hover(function(){jQuery('#msg').html('Select "'+jQuery(this).attr("rel")+'"<span>'+jQuery(this).attr("href")+'</span>').show();},function(){jQuery('#msg').html('').hide();});
|
||||
jQuery('.ex').hover(function(){jQuery('#msg').html('Open This On New Page<span>'+jQuery(this).attr("href")+'</span>').show();},function(){jQuery('#msg').html('').hide();});
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="<?php bloginfo("template_url")?>/reset.css" />
|
||||
|
||||
<style>
|
||||
|
||||
body {
|
||||
background:#f9f9f9;
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
ul, li {
|
||||
list-style:none;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#left {
|
||||
float:left;
|
||||
width:49%;
|
||||
margin:30px 0;
|
||||
}
|
||||
|
||||
#right {
|
||||
float:left;
|
||||
width:49%;
|
||||
margin:30px 0;
|
||||
border-left: dotted 1px #ccc;
|
||||
padding-left:1%;
|
||||
}
|
||||
|
||||
.inside {
|
||||
padding:20px 10px;;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font: bold 16px/16px Arial, Helvetica, sans-serif;
|
||||
text-shadow:0 1px 0 #FFFFFF;
|
||||
color:#333;
|
||||
margin:0 0 0 20px;
|
||||
}
|
||||
|
||||
ul.items li{
|
||||
/* border-bottom:dotted 1px #ccc;
|
||||
padding:5px 0;
|
||||
list-style: square inside;
|
||||
color:#CCC;*/
|
||||
|
||||
}
|
||||
|
||||
ul.items li a.senderer{
|
||||
display:block;
|
||||
color:#333;
|
||||
border-radius: 6px 0 0 6px;
|
||||
-moz-border-radius:6px 0 0 6px;
|
||||
-webkit-border-radius: 6px 0 0 6px;
|
||||
border:solid 1px #dedede;
|
||||
border-right:none;
|
||||
background: #f1f1f1;
|
||||
padding:5px 10px;
|
||||
margin:3px 0;
|
||||
text-decoration:none;
|
||||
float:left;
|
||||
width:80%;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
ul.items li a.senderer:hover{
|
||||
color:#fff;
|
||||
background: #333;
|
||||
border:solid 1px #333;
|
||||
border-right:none;
|
||||
}
|
||||
|
||||
ul.items li a.senderer:active{
|
||||
color:#fff;
|
||||
background: #C03;
|
||||
border:solid 1px #C03;
|
||||
border-right:none;
|
||||
}
|
||||
|
||||
ul.items li a.ex{
|
||||
display:block;
|
||||
color:#333;
|
||||
border-radius: 0 6px 6px 0;
|
||||
-moz-border-radius: 0 6px 6px 0;
|
||||
-webkit-border-radius: 0 6px 6px 0;
|
||||
border:solid 1px #dedede;
|
||||
border-left:none;
|
||||
background: #f1f1f1 url(../cloudfw/icons/external.gif) no-repeat top center;
|
||||
padding:0;
|
||||
margin:3px 0;
|
||||
text-decoration:none;
|
||||
float:left;
|
||||
width:10%;
|
||||
height:30px;
|
||||
clear:right;
|
||||
}
|
||||
|
||||
ul.items li a.ex:hover{
|
||||
background: #333 url(../cloudfw/icons/external.gif) no-repeat bottom center;
|
||||
border:solid 1px #333;
|
||||
border-left:none;
|
||||
}
|
||||
|
||||
ul.items li a.ex:active{
|
||||
background: #C03 url(../cloudfw/icons/external.gif) no-repeat bottom center;
|
||||
border:solid 1px #C03;
|
||||
border-left:none;
|
||||
}
|
||||
|
||||
#msg {
|
||||
width:100%; bottom:0; left:0;
|
||||
position:fixed;
|
||||
background: #000;
|
||||
color:#FFF;
|
||||
padding:20px 0;
|
||||
text-align:center;
|
||||
-moz-opacity:.75; filter:alpha(opacity=75); opacity:.75;
|
||||
display:none;
|
||||
|
||||
font: bold 16px/16px Arial, Helvetica, sans-serif;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
#msg span {
|
||||
display:block;
|
||||
margin:10px;
|
||||
font: normal 11px/11px Arial, Helvetica, sans-serif;
|
||||
color:#ccc;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="msg"></div>
|
||||
|
||||
<div style="float:right; margin: 10px 30px 0 0;">
|
||||
<form action="<?php echo $this_url; ?>">
|
||||
<input type="text" name="s" id="s" value="<?php echo $s;?>" style="width:150px;" />
|
||||
<input type="hidden" name="id" value="<?php echo $cid;?>" />
|
||||
<input type="hidden" name="pid" value="<?php echo $preview;?>" />
|
||||
<input type="hidden" name="case" value="<?php echo $cases;?>" />
|
||||
<input type="hidden" name="hideparent" value="<?php echo $hideparent;?>" />
|
||||
<input type="hidden" name="whichin" value="<?php echo $whichin;?>" />
|
||||
<input type="submit" value="<?php _e('Search','cloudfw'); ?>" />
|
||||
</form>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
|
||||
<?php if ($whichin=="" || $whichin=="page"){?><div id="left">
|
||||
<h3><?php if (!empty($s)) printf("'%s' In Pages", $s); else echo __('All Pages','cloudfw');?></h3>
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<ul class="items">
|
||||
<?php
|
||||
|
||||
|
||||
$myPosts = new WP_Query();
|
||||
$myPosts->query(array( 'post_type' => array('page'), 'post__not_in' => $_opt['wptb_exclude_post'] , 'showposts' => '-1', 's' => $s));
|
||||
$count = $myPosts->post_count;
|
||||
$post_column_row = ceil($count/2)-1;
|
||||
|
||||
if ($myPosts->have_posts()):
|
||||
|
||||
while ($myPosts->have_posts()) : $myPosts->the_post();
|
||||
?>
|
||||
<li><a href="<?php the_permalink(); ?>" class="senderer" rel="<?php the_title(); ?>" id="<?php the_ID(); ?>"><?php echo (strlen(__translate( get_the_title()))>30) ? mb_substr(__translate( get_the_title() ),0,30).'..': __translate( get_the_title() ); ?></a><a href="<?php the_permalink(); ?>" target="_blank" class="ex"></a></li>
|
||||
<?php
|
||||
|
||||
if ($whichin=="page" && $post_column_row == $i) {
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="right">
|
||||
|
||||
<h3> </h3>
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<ul class="items">';
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
endwhile;
|
||||
|
||||
else:
|
||||
|
||||
echo '<div style="margin-left:30px; color:#ccc;">Pages Not Found</div>';
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php };
|
||||
|
||||
if ($whichin=="" || $whichin=="post"){?>
|
||||
|
||||
<div id="right">
|
||||
<h3><?php if (!empty($s)) printf("'%s' In Posts", $s); else echo __('All Posts','cloudfw');?></h3>
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<ul class="items">
|
||||
<?php
|
||||
|
||||
|
||||
$myPosts = new WP_Query();
|
||||
$myPosts->query(array( 'post_type' => array('post'), 'post__not_in' => $_opt['wptb_exclude_post'] , 'showposts' => '-1', 's' => $s));
|
||||
$count = $myPosts->post_count;
|
||||
$post_column_row = ceil($count/2)-1;
|
||||
|
||||
if ($myPosts->have_posts()):
|
||||
|
||||
while ($myPosts->have_posts()) : $myPosts->the_post();
|
||||
?>
|
||||
<li><a href="<?php the_permalink(); ?>" class="senderer" rel="<?php the_title(); ?>" id="<?php the_ID(); ?>"><?php echo (strlen(__translate( get_the_title() ))>30) ? mb_substr(__translate( get_the_title() ),0,30).'..': __translate( get_the_title() ); ?></a><a href="<?php the_permalink(); ?>" target="_blank" class="ex"></a></li>
|
||||
<?php
|
||||
|
||||
if ($whichin=="post" && $post_column_row == $i) {
|
||||
|
||||
echo '
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div id="left">
|
||||
|
||||
<h3> </h3>
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<ul class="items">';
|
||||
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
endwhile;
|
||||
|
||||
else:
|
||||
|
||||
echo '<div style="margin-left:30px; color:#ccc;">Posts Not Found</div>';
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php };?>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
define("WP_ADMIN", true);
|
||||
// Call WP Load
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
require (TMP_ADMIN_PATH.'/inc/slider.include_forms.php');
|
||||
|
||||
|
||||
$id = $_POST["id"];
|
||||
$form = $_POST["form"];
|
||||
$this_page = $_POST["thispage"];
|
||||
$slider = $_POST["slider"];
|
||||
|
||||
|
||||
switch ($form):
|
||||
default:
|
||||
case 'main_slider':
|
||||
|
||||
if (isset($id)) {
|
||||
|
||||
cloudfw_loop_all_sliders(cloudfw_delete_slider($id),NULL,$this_page);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'default_slider':
|
||||
|
||||
if (isset($id) && is_numeric($id)) {
|
||||
|
||||
$slider_content = cloudfw_get_slider($slider);
|
||||
ksort($slider_content);
|
||||
|
||||
$ii = 0;
|
||||
foreach ($slider_content as $vars => $var){
|
||||
|
||||
if ((int)$vars !== (int)$id):
|
||||
|
||||
$new_slider_content[$ii] = $slider_content[$vars];
|
||||
|
||||
$ii++;
|
||||
|
||||
endif;
|
||||
}
|
||||
|
||||
update_option($slider, $new_slider_content);
|
||||
cloudfw_loop_slider_items($new_slider_content, 'default_slider', $id);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case 'inline_slider':
|
||||
|
||||
if (isset($id) && is_numeric($id)) {
|
||||
|
||||
$slider_content = cloudfw_get_slider($slider);
|
||||
ksort($slider_content);
|
||||
|
||||
$ii = 0;
|
||||
foreach ($slider_content as $vars => $var){
|
||||
|
||||
if ((int)$vars !== (int)$id):
|
||||
|
||||
$new_slider_content[$ii] = $slider_content[$vars];
|
||||
|
||||
$ii++;
|
||||
|
||||
endif;
|
||||
}
|
||||
|
||||
update_option($slider, $new_slider_content);
|
||||
cloudfw_loop_slider_items($new_slider_content, 'inline_slider', $id);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
endswitch;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
define("WP_ADMIN", true);
|
||||
// Call WP Load
|
||||
$wp_include = "../wp-load.php";$i = 0;
|
||||
while (!file_exists($wp_include) && $i++ < 10) {$wp_include = "../$wp_include";} require($wp_include);
|
||||
|
||||
if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
||||
wp_die(__("You are not allowed to be here","cloudfw"));
|
||||
|
||||
require (TMP_ADMIN_PATH.'/inc/core/core.slider.include_forms.php');
|
||||
|
||||
global $_opt;
|
||||
|
||||
$action = $_POST["action"];
|
||||
$type = $_POST["type"];
|
||||
|
||||
$id = $_POST["id"];
|
||||
$main_slider_id = $_POST["main_slider_id"];
|
||||
$lastID = $_POST["lastID"];
|
||||
$this_page = $_POST["thispage"];
|
||||
|
||||
|
||||
switch ($action){
|
||||
case 'edit':
|
||||
|
||||
if ($type == 'main_sliders') {
|
||||
|
||||
if (isset($id)) {
|
||||
$data_ = $_opt[PFIX."_slider_ids"];
|
||||
$data = $data_[$id];
|
||||
}
|
||||
|
||||
cloudfw_main_slider_forms( $this_page, $lastID, $data, $id );
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
if (isset($id)) {
|
||||
$data_ = cloudfw_get_slider($main_slider_id);
|
||||
$data = $data_[$id];
|
||||
}
|
||||
|
||||
cloudfw_sub_slider_forms( $this_page ,$lastID, $data, $id, $main_slider_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'loop':
|
||||
|
||||
if (isset($main_slider_id)) {
|
||||
|
||||
$slider_type = cloudfw_get_slider_type($main_slider_id);
|
||||
cloudfw_loop_slider_items(cloudfw_get_slider($main_slider_id),$slider_type, $main_slider_id);
|
||||
}
|
||||
else
|
||||
cloudfw_loop_all_sliders($_opt[PFIX."_slider_ids"],NULL, $this_page);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'delete':
|
||||
|
||||
if ($type == 'main_sliders') {
|
||||
|
||||
cloudfw_loop_all_sliders(cloudfw_delete_slider($id),NULL,$this_page);
|
||||
|
||||
}else{
|
||||
|
||||
$slider_content = cloudfw_get_slider($main_slider_id);
|
||||
$slider_type = cloudfw_get_slider_type($main_slider_id);
|
||||
ksort($slider_content);
|
||||
|
||||
$ii = 0;
|
||||
foreach ($slider_content as $vars => $var){
|
||||
|
||||
if ((int)$vars !== (int)$id):
|
||||
|
||||
$new_slider_content[$ii] = $slider_content[$vars];
|
||||
|
||||
$ii++;
|
||||
|
||||
endif;
|
||||
}
|
||||
|
||||
update_option($main_slider_id, $new_slider_content);
|
||||
cloudfw_loop_slider_items($new_slider_content, $slider_type, $id);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@ -0,0 +1,804 @@
|
||||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Converts to and from JSON format.
|
||||
*
|
||||
* JSON (JavaScript Object Notation) is a lightweight data-interchange
|
||||
* format. It is easy for humans to read and write. It is easy for machines
|
||||
* to parse and generate. It is based on a subset of the JavaScript
|
||||
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
|
||||
* This feature can also be found in Python. JSON is a text format that is
|
||||
* completely language independent but uses conventions that are familiar
|
||||
* to programmers of the C-family of languages, including C, C++, C#, Java,
|
||||
* JavaScript, Perl, TCL, and many others. These properties make JSON an
|
||||
* ideal data-interchange language.
|
||||
*
|
||||
* This package provides a simple encoder and decoder for JSON notation. It
|
||||
* is intended for use with client-side Javascript applications that make
|
||||
* use of HTTPRequest to perform server communication functions - data can
|
||||
* be encoded into JSON notation for use in a client-side javascript, or
|
||||
* decoded from incoming Javascript requests. JSON format is native to
|
||||
* Javascript, and can be directly eval()'ed with no further parsing
|
||||
* overhead
|
||||
*
|
||||
* All strings should be in ASCII or UTF-8 format!
|
||||
*
|
||||
* LICENSE: 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``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 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.
|
||||
*
|
||||
* @category
|
||||
* @package Services_JSON
|
||||
* @author Michal Migurski <mike-json@teczno.com>
|
||||
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
|
||||
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
|
||||
* @copyright 2005 Michal Migurski
|
||||
* @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
|
||||
*/
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_SLICE', 1);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_STR', 2);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_ARR', 3);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_OBJ', 4);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_CMT', 5);
|
||||
|
||||
/**
|
||||
* Behavior switch for Services_JSON::decode()
|
||||
*/
|
||||
define('SERVICES_JSON_LOOSE_TYPE', 16);
|
||||
|
||||
/**
|
||||
* Behavior switch for Services_JSON::decode()
|
||||
*/
|
||||
define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
|
||||
|
||||
/**
|
||||
* Converts to and from JSON format.
|
||||
*
|
||||
* Brief example of use:
|
||||
*
|
||||
* <code>
|
||||
* // create a new instance of Services_JSON
|
||||
* $json = new Services_JSON();
|
||||
*
|
||||
* // convert a complexe value to JSON notation, and send it to the browser
|
||||
* $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
|
||||
* $output = $json->encode($value);
|
||||
*
|
||||
* print($output);
|
||||
* // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
|
||||
*
|
||||
* // accept incoming POST data, assumed to be in JSON notation
|
||||
* $input = file_get_contents('php://input', 1000000);
|
||||
* $value = $json->decode($input);
|
||||
* </code>
|
||||
*/
|
||||
class Services_JSON
|
||||
{
|
||||
/**
|
||||
* constructs a new JSON instance
|
||||
*
|
||||
* @param int $use object behavior flags; combine with boolean-OR
|
||||
*
|
||||
* possible values:
|
||||
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
|
||||
* "{...}" syntax creates associative arrays
|
||||
* instead of objects in decode().
|
||||
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
|
||||
* Values which can't be encoded (e.g. resources)
|
||||
* appear as NULL instead of throwing errors.
|
||||
* By default, a deeply-nested resource will
|
||||
* bubble up with an error, so all return values
|
||||
* from encode() should be checked with isError()
|
||||
*/
|
||||
function Services_JSON($use = 0)
|
||||
{
|
||||
$this->use = $use;
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string from one UTF-16 char to one UTF-8 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf16 UTF-16 character
|
||||
* @return string UTF-8 character
|
||||
* @access private
|
||||
*/
|
||||
function utf162utf8($utf16)
|
||||
{
|
||||
// oh please oh please oh please oh please oh please
|
||||
if(function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
||||
}
|
||||
|
||||
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
|
||||
|
||||
switch(true) {
|
||||
case ((0x7F & $bytes) == $bytes):
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0x7F & $bytes);
|
||||
|
||||
case (0x07FF & $bytes) == $bytes:
|
||||
// return a 2-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0xC0 | (($bytes >> 6) & 0x1F))
|
||||
. chr(0x80 | ($bytes & 0x3F));
|
||||
|
||||
case (0xFFFF & $bytes) == $bytes:
|
||||
// return a 3-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0xE0 | (($bytes >> 12) & 0x0F))
|
||||
. chr(0x80 | (($bytes >> 6) & 0x3F))
|
||||
. chr(0x80 | ($bytes & 0x3F));
|
||||
}
|
||||
|
||||
// ignoring UTF-32 for now, sorry
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string from one UTF-8 char to one UTF-16 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf8 UTF-8 character
|
||||
* @return string UTF-16 character
|
||||
* @access private
|
||||
*/
|
||||
function utf82utf16($utf8)
|
||||
{
|
||||
// oh please oh please oh please oh please oh please
|
||||
if(function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
|
||||
}
|
||||
|
||||
switch(strlen($utf8)) {
|
||||
case 1:
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return $utf8;
|
||||
|
||||
case 2:
|
||||
// return a UTF-16 character from a 2-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0x07 & (ord($utf8{0}) >> 2))
|
||||
. chr((0xC0 & (ord($utf8{0}) << 6))
|
||||
| (0x3F & ord($utf8{1})));
|
||||
|
||||
case 3:
|
||||
// return a UTF-16 character from a 3-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr((0xF0 & (ord($utf8{0}) << 4))
|
||||
| (0x0F & (ord($utf8{1}) >> 2)))
|
||||
. chr((0xC0 & (ord($utf8{1}) << 6))
|
||||
| (0x7F & ord($utf8{2})));
|
||||
}
|
||||
|
||||
// ignoring UTF-32 for now, sorry
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* encodes an arbitrary variable into JSON format
|
||||
*
|
||||
* @param mixed $var any number, boolean, string, array, or object to be encoded.
|
||||
* see argument 1 to Services_JSON() above for array-parsing behavior.
|
||||
* if var is a strng, note that encode() always expects it
|
||||
* to be in ASCII or UTF-8 format!
|
||||
*
|
||||
* @return mixed JSON string representation of input var or an error if a problem occurs
|
||||
* @access public
|
||||
*/
|
||||
function encode($var)
|
||||
{
|
||||
switch (gettype($var)) {
|
||||
case 'boolean':
|
||||
return $var ? 'true' : 'false';
|
||||
|
||||
case 'NULL':
|
||||
return 'null';
|
||||
|
||||
case 'integer':
|
||||
return (int) $var;
|
||||
|
||||
case 'double':
|
||||
case 'float':
|
||||
return (float) $var;
|
||||
|
||||
case 'string':
|
||||
// STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
|
||||
$ascii = '';
|
||||
$strlen_var = strlen($var);
|
||||
|
||||
/*
|
||||
* Iterate over every character in the string,
|
||||
* escaping with a slash or encoding to UTF-8 where necessary
|
||||
*/
|
||||
for ($c = 0; $c < $strlen_var; ++$c) {
|
||||
|
||||
$ord_var_c = ord($var{$c});
|
||||
|
||||
switch (true) {
|
||||
case $ord_var_c == 0x08:
|
||||
$ascii .= '\b';
|
||||
break;
|
||||
case $ord_var_c == 0x09:
|
||||
$ascii .= '\t';
|
||||
break;
|
||||
case $ord_var_c == 0x0A:
|
||||
$ascii .= '\n';
|
||||
break;
|
||||
case $ord_var_c == 0x0C:
|
||||
$ascii .= '\f';
|
||||
break;
|
||||
case $ord_var_c == 0x0D:
|
||||
$ascii .= '\r';
|
||||
break;
|
||||
|
||||
case $ord_var_c == 0x22:
|
||||
case $ord_var_c == 0x2F:
|
||||
case $ord_var_c == 0x5C:
|
||||
// double quote, slash, slosh
|
||||
$ascii .= '\\'.$var{$c};
|
||||
break;
|
||||
|
||||
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
|
||||
// characters U-00000000 - U-0000007F (same as ASCII)
|
||||
$ascii .= $var{$c};
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xE0) == 0xC0):
|
||||
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
|
||||
$c += 1;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xF0) == 0xE0):
|
||||
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}));
|
||||
$c += 2;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xF8) == 0xF0):
|
||||
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}));
|
||||
$c += 3;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xFC) == 0xF8):
|
||||
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}));
|
||||
$c += 4;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xFE) == 0xFC):
|
||||
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}),
|
||||
ord($var{$c + 5}));
|
||||
$c += 5;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return '"'.$ascii.'"';
|
||||
|
||||
case 'array':
|
||||
/*
|
||||
* As per JSON spec if any array key is not an integer
|
||||
* we must treat the the whole array as an object. We
|
||||
* also try to catch a sparsely populated associative
|
||||
* array with numeric keys here because some JS engines
|
||||
* will create an array with empty indexes up to
|
||||
* max_index which can cause memory issues and because
|
||||
* the keys, which may be relevant, will be remapped
|
||||
* otherwise.
|
||||
*
|
||||
* As per the ECMA and JSON specification an object may
|
||||
* have any string as a property. Unfortunately due to
|
||||
* a hole in the ECMA specification if the key is a
|
||||
* ECMA reserved word or starts with a digit the
|
||||
* parameter is only accessible using ECMAScript's
|
||||
* bracket notation.
|
||||
*/
|
||||
|
||||
// treat as a JSON object
|
||||
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
|
||||
$properties = array_map(array($this, 'name_value'),
|
||||
array_keys($var),
|
||||
array_values($var));
|
||||
|
||||
foreach($properties as $property) {
|
||||
if(Services_JSON::isError($property)) {
|
||||
return $property;
|
||||
}
|
||||
}
|
||||
|
||||
return '{' . join(',', $properties) . '}';
|
||||
}
|
||||
|
||||
// treat it like a regular array
|
||||
$elements = array_map(array($this, 'encode'), $var);
|
||||
|
||||
foreach($elements as $element) {
|
||||
if(Services_JSON::isError($element)) {
|
||||
return $element;
|
||||
}
|
||||
}
|
||||
|
||||
return '[' . join(',', $elements) . ']';
|
||||
|
||||
case 'object':
|
||||
$vars = get_object_vars($var);
|
||||
|
||||
$properties = array_map(array($this, 'name_value'),
|
||||
array_keys($vars),
|
||||
array_values($vars));
|
||||
|
||||
foreach($properties as $property) {
|
||||
if(Services_JSON::isError($property)) {
|
||||
return $property;
|
||||
}
|
||||
}
|
||||
|
||||
return '{' . join(',', $properties) . '}';
|
||||
|
||||
default:
|
||||
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
|
||||
? 'null'
|
||||
: new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* array-walking function for use in generating JSON-formatted name-value pairs
|
||||
*
|
||||
* @param string $name name of key to use
|
||||
* @param mixed $value reference to an array element to be encoded
|
||||
*
|
||||
* @return string JSON-formatted name-value pair, like '"name":value'
|
||||
* @access private
|
||||
*/
|
||||
function name_value($name, $value)
|
||||
{
|
||||
$encoded_value = $this->encode($value);
|
||||
|
||||
if(Services_JSON::isError($encoded_value)) {
|
||||
return $encoded_value;
|
||||
}
|
||||
|
||||
return $this->encode(strval($name)) . ':' . $encoded_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* reduce a string by removing leading and trailing comments and whitespace
|
||||
*
|
||||
* @param $str string string value to strip of comments and whitespace
|
||||
*
|
||||
* @return string string value stripped of comments and whitespace
|
||||
* @access private
|
||||
*/
|
||||
function reduce_string($str)
|
||||
{
|
||||
$str = preg_replace(array(
|
||||
|
||||
// eliminate single line comments in '// ...' form
|
||||
'#^\s*//(.+)$#m',
|
||||
|
||||
// eliminate multi-line comments in '/* ... */' form, at start of string
|
||||
'#^\s*/\*(.+)\*/#Us',
|
||||
|
||||
// eliminate multi-line comments in '/* ... */' form, at end of string
|
||||
'#/\*(.+)\*/\s*$#Us'
|
||||
|
||||
), '', $str);
|
||||
|
||||
// eliminate extraneous space
|
||||
return trim($str);
|
||||
}
|
||||
|
||||
/**
|
||||
* decodes a JSON string into appropriate variable
|
||||
*
|
||||
* @param string $str JSON-formatted string
|
||||
*
|
||||
* @return mixed number, boolean, string, array, or object
|
||||
* corresponding to given JSON input string.
|
||||
* See argument 1 to Services_JSON() above for object-output behavior.
|
||||
* Note that decode() always returns strings
|
||||
* in ASCII or UTF-8 format!
|
||||
* @access public
|
||||
*/
|
||||
function decode($str)
|
||||
{
|
||||
$str = $this->reduce_string($str);
|
||||
|
||||
switch (strtolower($str)) {
|
||||
case 'true':
|
||||
return true;
|
||||
|
||||
case 'false':
|
||||
return false;
|
||||
|
||||
case 'null':
|
||||
return null;
|
||||
|
||||
default:
|
||||
$m = array();
|
||||
|
||||
if (is_numeric($str)) {
|
||||
// Lookie-loo, it's a number
|
||||
|
||||
// This would work on its own, but I'm trying to be
|
||||
// good about returning integers where appropriate:
|
||||
// return (float)$str;
|
||||
|
||||
// Return float or int, as appropriate
|
||||
return ((float)$str == (integer)$str)
|
||||
? (integer)$str
|
||||
: (float)$str;
|
||||
|
||||
} elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
|
||||
// STRINGS RETURNED IN UTF-8 FORMAT
|
||||
$delim = substr($str, 0, 1);
|
||||
$chrs = substr($str, 1, -1);
|
||||
$utf8 = '';
|
||||
$strlen_chrs = strlen($chrs);
|
||||
|
||||
for ($c = 0; $c < $strlen_chrs; ++$c) {
|
||||
|
||||
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||
$ord_chrs_c = ord($chrs{$c});
|
||||
|
||||
switch (true) {
|
||||
case $substr_chrs_c_2 == '\b':
|
||||
$utf8 .= chr(0x08);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\t':
|
||||
$utf8 .= chr(0x09);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\n':
|
||||
$utf8 .= chr(0x0A);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\f':
|
||||
$utf8 .= chr(0x0C);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\r':
|
||||
$utf8 .= chr(0x0D);
|
||||
++$c;
|
||||
break;
|
||||
|
||||
case $substr_chrs_c_2 == '\\"':
|
||||
case $substr_chrs_c_2 == '\\\'':
|
||||
case $substr_chrs_c_2 == '\\\\':
|
||||
case $substr_chrs_c_2 == '\\/':
|
||||
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
|
||||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
|
||||
$utf8 .= $chrs{++$c};
|
||||
}
|
||||
break;
|
||||
|
||||
case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
|
||||
// single, escaped unicode character
|
||||
$utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
|
||||
. chr(hexdec(substr($chrs, ($c + 4), 2)));
|
||||
$utf8 .= $this->utf162utf8($utf16);
|
||||
$c += 5;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
|
||||
$utf8 .= $chrs{$c};
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xE0) == 0xC0:
|
||||
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 2);
|
||||
++$c;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xF0) == 0xE0:
|
||||
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 3);
|
||||
$c += 2;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xF8) == 0xF0:
|
||||
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 4);
|
||||
$c += 3;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xFC) == 0xF8:
|
||||
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 5);
|
||||
$c += 4;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xFE) == 0xFC:
|
||||
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 6);
|
||||
$c += 5;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $utf8;
|
||||
|
||||
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
|
||||
// array, or object notation
|
||||
|
||||
if ($str{0} == '[') {
|
||||
$stk = array(SERVICES_JSON_IN_ARR);
|
||||
$arr = array();
|
||||
} else {
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$stk = array(SERVICES_JSON_IN_OBJ);
|
||||
$obj = array();
|
||||
} else {
|
||||
$stk = array(SERVICES_JSON_IN_OBJ);
|
||||
$obj = new stdClass();
|
||||
}
|
||||
}
|
||||
|
||||
array_push($stk, array('what' => SERVICES_JSON_SLICE,
|
||||
'where' => 0,
|
||||
'delim' => false));
|
||||
|
||||
$chrs = substr($str, 1, -1);
|
||||
$chrs = $this->reduce_string($chrs);
|
||||
|
||||
if ($chrs == '') {
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
return $arr;
|
||||
|
||||
} else {
|
||||
return $obj;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//print("\nparsing {$chrs}\n");
|
||||
|
||||
$strlen_chrs = strlen($chrs);
|
||||
|
||||
for ($c = 0; $c <= $strlen_chrs; ++$c) {
|
||||
|
||||
$top = end($stk);
|
||||
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||
|
||||
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
|
||||
// found a comma that is not inside a string, array, etc.,
|
||||
// OR we've reached the end of the character list
|
||||
$slice = substr($chrs, $top['where'], ($c - $top['where']));
|
||||
array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
|
||||
//print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
// we are in an array, so just push an element onto the stack
|
||||
array_push($arr, $this->decode($slice));
|
||||
|
||||
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||
// we are in an object, so figure
|
||||
// out the property name and set an
|
||||
// element in an associative array,
|
||||
// for now
|
||||
$parts = array();
|
||||
|
||||
if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
||||
// "name":value pair
|
||||
$key = $this->decode($parts[1]);
|
||||
$val = $this->decode($parts[2]);
|
||||
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$obj[$key] = $val;
|
||||
} else {
|
||||
$obj->$key = $val;
|
||||
}
|
||||
} elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
||||
// name:value pair, where name is unquoted
|
||||
$key = $parts[1];
|
||||
$val = $this->decode($parts[2]);
|
||||
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$obj[$key] = $val;
|
||||
} else {
|
||||
$obj->$key = $val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
|
||||
// found a quote, and we are not inside a string
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
|
||||
//print("Found start of string at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == $top['delim']) &&
|
||||
($top['what'] == SERVICES_JSON_IN_STR) &&
|
||||
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
|
||||
// found a quote, we're in a string, and it's not escaped
|
||||
// we know that it's not escaped becase there is _not_ an
|
||||
// odd number of backslashes at the end of the string so far
|
||||
array_pop($stk);
|
||||
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($chrs{$c} == '[') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a left-bracket, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
|
||||
//print("Found start of array at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
|
||||
// found a right-bracket, and we're in an array
|
||||
array_pop($stk);
|
||||
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($chrs{$c} == '{') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a left-brace, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
|
||||
//print("Found start of object at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
|
||||
// found a right-brace, and we're in an object
|
||||
array_pop($stk);
|
||||
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($substr_chrs_c_2 == '/*') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a comment start, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
|
||||
$c++;
|
||||
//print("Found start of comment at {$c}\n");
|
||||
|
||||
} elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
|
||||
// found a comment end, and we're in one now
|
||||
array_pop($stk);
|
||||
$c++;
|
||||
|
||||
for ($i = $top['where']; $i <= $c; ++$i)
|
||||
$chrs = substr_replace($chrs, ' ', $i, 1);
|
||||
|
||||
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
return $arr;
|
||||
|
||||
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||
return $obj;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Ultimately, this should just call PEAR::isError()
|
||||
*/
|
||||
function isError($data, $code = null)
|
||||
{
|
||||
if (class_exists('pear')) {
|
||||
return PEAR::isError($data, $code);
|
||||
} elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
|
||||
is_subclass_of($data, 'services_json_error'))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('PEAR_Error')) {
|
||||
|
||||
class Services_JSON_Error extends PEAR_Error
|
||||
{
|
||||
function Services_JSON_Error($message = 'unknown error', $code = null,
|
||||
$mode = null, $options = null, $userinfo = null)
|
||||
{
|
||||
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/**
|
||||
* @todo Ultimately, this class shall be descended from PEAR_Error
|
||||
*/
|
||||
class Services_JSON_Error
|
||||
{
|
||||
function Services_JSON_Error($message = 'unknown error', $code = null,
|
||||
$mode = null, $options = null, $userinfo = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}?>
|
||||
@ -0,0 +1,220 @@
|
||||
<?php
|
||||
/**
|
||||
* Class to dynamically create a zip file (archive) of file(s) and/or directory
|
||||
*
|
||||
* @author Rochak Chauhan www.rochakchauhan.com
|
||||
* @package CreateZipFile
|
||||
* @see Distributed under "General Public License"
|
||||
*
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
class CreateZipFile {
|
||||
|
||||
public $compressedData = array();
|
||||
public $centralDirectory = array(); // central directory
|
||||
public $endOfCentralDirectory = "\x50\x4b\x05\x06\x00\x00\x00\x00"; //end of Central directory record
|
||||
public $oldOffset = 0;
|
||||
|
||||
/**
|
||||
* Function to create the directory where the file(s) will be unzipped
|
||||
*
|
||||
* @param string $directoryName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function addDirectory($directoryName) {
|
||||
$directoryName = str_replace("\\", "/", $directoryName);
|
||||
$feedArrayRow = "\x50\x4b\x03\x04";
|
||||
$feedArrayRow .= "\x0a\x00";
|
||||
$feedArrayRow .= "\x00\x00";
|
||||
$feedArrayRow .= "\x00\x00";
|
||||
$feedArrayRow .= "\x00\x00\x00\x00";
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("v", strlen($directoryName) );
|
||||
$feedArrayRow .= pack("v", 0 );
|
||||
$feedArrayRow .= $directoryName;
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$this->compressedData[] = $feedArrayRow;
|
||||
$newOffset = strlen(implode("", $this->compressedData));
|
||||
$addCentralRecord = "\x50\x4b\x01\x02";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x0a\x00";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x00\x00\x00\x00";
|
||||
$addCentralRecord .= pack("V",0);
|
||||
$addCentralRecord .= pack("V",0);
|
||||
$addCentralRecord .= pack("V",0);
|
||||
$addCentralRecord .= pack("v", strlen($directoryName) );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("V", 16 );
|
||||
$addCentralRecord .= pack("V", $this->oldOffset );
|
||||
$this->oldOffset = $newOffset;
|
||||
$addCentralRecord .= $directoryName;
|
||||
$this->centralDirectory[] = $addCentralRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to add file(s) to the specified directory in the archive
|
||||
*
|
||||
* @param string $directoryName
|
||||
* @param string $data
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function addFile($data, $directoryName) {
|
||||
$directoryName = str_replace("\\", "/", $directoryName);
|
||||
$feedArrayRow = "\x50\x4b\x03\x04";
|
||||
$feedArrayRow .= "\x14\x00";
|
||||
$feedArrayRow .= "\x00\x00";
|
||||
$feedArrayRow .= "\x08\x00";
|
||||
$feedArrayRow .= "\x00\x00\x00\x00";
|
||||
$uncompressedLength = strlen($data);
|
||||
$compression = crc32($data);
|
||||
$gzCompressedData = gzcompress($data);
|
||||
$gzCompressedData = substr( substr($gzCompressedData, 0, strlen($gzCompressedData) - 4), 2);
|
||||
$compressedLength = strlen($gzCompressedData);
|
||||
$feedArrayRow .= pack("V",$compression);
|
||||
$feedArrayRow .= pack("V",$compressedLength);
|
||||
$feedArrayRow .= pack("V",$uncompressedLength);
|
||||
$feedArrayRow .= pack("v", strlen($directoryName) );
|
||||
$feedArrayRow .= pack("v", 0 );
|
||||
$feedArrayRow .= $directoryName;
|
||||
$feedArrayRow .= $gzCompressedData;
|
||||
$feedArrayRow .= pack("V",$compression);
|
||||
$feedArrayRow .= pack("V",$compressedLength);
|
||||
$feedArrayRow .= pack("V",$uncompressedLength);
|
||||
$this->compressedData[] = $feedArrayRow;
|
||||
$newOffset = strlen(implode("", $this->compressedData));
|
||||
$addCentralRecord = "\x50\x4b\x01\x02";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x14\x00";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x08\x00";
|
||||
$addCentralRecord .="\x00\x00\x00\x00";
|
||||
$addCentralRecord .= pack("V",$compression);
|
||||
$addCentralRecord .= pack("V",$compressedLength);
|
||||
$addCentralRecord .= pack("V",$uncompressedLength);
|
||||
$addCentralRecord .= pack("v", strlen($directoryName) );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("V", 32 );
|
||||
$addCentralRecord .= pack("V", $this->oldOffset );
|
||||
$this->oldOffset = $newOffset;
|
||||
$addCentralRecord .= $directoryName;
|
||||
$this->centralDirectory[] = $addCentralRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to return the zip file
|
||||
*
|
||||
* @return zipfile (archive)
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getZippedfile() {
|
||||
$data = implode("", $this->compressedData);
|
||||
$controlDirectory = implode("", $this->centralDirectory);
|
||||
return
|
||||
$data.
|
||||
$controlDirectory.
|
||||
$this->endOfCentralDirectory.
|
||||
pack("v", sizeof($this->centralDirectory)).
|
||||
pack("v", sizeof($this->centralDirectory)).
|
||||
pack("V", strlen($controlDirectory)).
|
||||
pack("V", strlen($data)).
|
||||
"\x00\x00";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Function to force the download of the archive as soon as it is created
|
||||
*
|
||||
* @param archiveName string - name of the created archive file
|
||||
* @access public
|
||||
* @return ZipFile via Header
|
||||
*/
|
||||
public function forceDownload($archiveName) {
|
||||
if(ini_get('zlib.output_compression')) {
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
}
|
||||
|
||||
// Security checks
|
||||
if( $archiveName == "" ) {
|
||||
echo "<html><title>Public Photo Directory - Download </title><body><BR><B>ERROR:</B> The download file was NOT SPECIFIED.</body></html>";
|
||||
exit;
|
||||
}
|
||||
elseif ( ! file_exists( $archiveName ) ) {
|
||||
echo "<html><title>Public Photo Directory - Download </title><body><BR><B>ERROR:</B> File not found.</body></html>";
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Pragma: public");
|
||||
header("Expires: 0");
|
||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||
header("Cache-Control: private",false);
|
||||
header("Content-Type: application/zip");
|
||||
header("Content-Disposition: attachment; filename=".basename($archiveName).";" );
|
||||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-Length: ".filesize($archiveName));
|
||||
readfile("$archiveName");
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to parse a directory to return all its files and sub directories as array
|
||||
*
|
||||
* @param string $dir
|
||||
* @access protected
|
||||
* @return array
|
||||
*/
|
||||
protected function parseDirectory($rootPath, $seperator="/"){
|
||||
$fileArray=array();
|
||||
$handle = opendir($rootPath);
|
||||
while( ($file = @readdir($handle))!==false) {
|
||||
if($file !='.' && $file !='..'){
|
||||
if (is_dir($rootPath.$seperator.$file)){
|
||||
$array=$this->parseDirectory($rootPath.$seperator.$file);
|
||||
$fileArray=array_merge($array,$fileArray);
|
||||
}
|
||||
else {
|
||||
$fileArray[]=$rootPath.$seperator.$file;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $fileArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to Zip entire directory with all its files and subdirectories
|
||||
*
|
||||
* @param string $dirName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function zipDirectory($dirName, $outputDir) {
|
||||
if (!is_dir($dirName)){
|
||||
trigger_error("CreateZipFile FATAL ERROR: Could not locate the specified directory $dirName", E_USER_ERROR);
|
||||
}
|
||||
$tmp=$this->parseDirectory($dirName);
|
||||
$count=count($tmp);
|
||||
$this->addDirectory($outputDir);
|
||||
for ($i=0;$i<$count;$i++){
|
||||
$fileToZip=trim($tmp[$i]);
|
||||
$newOutputDir=substr($fileToZip,0,(strrpos($fileToZip,'/')+1));
|
||||
$outputDir=$outputDir.$newOutputDir;
|
||||
$fileContents=file_get_contents($fileToZip);
|
||||
$this->addFile($fileContents,$fileToZip);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,232 @@
|
||||
<?php
|
||||
/**
|
||||
* Class to dynamically create a zip file (archive) of file(s) and/or directory for MAC users
|
||||
*
|
||||
* @author Rochak Chauhan www.rochakchauhan.com
|
||||
* @package CreateZipFile
|
||||
* @see Distributed under "General Public License"
|
||||
*
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
class CreateZipFileMac {
|
||||
public $compressedData = array();
|
||||
public $centralDirectory = array(); // central directory
|
||||
public $endOfCentralDirectory = "\x50\x4b\x05\x06\x00\x00\x00\x00"; //end of Central directory record
|
||||
public $oldOffset = 0;
|
||||
|
||||
/**
|
||||
* Function to create the directory where the file(s) will be unzipped
|
||||
*
|
||||
* @param string $directoryName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function addDirectory($directoryName) {
|
||||
$directoryName = str_replace("\\", "/", $directoryName);
|
||||
|
||||
$feedArrayRow = "\x50\x4b\x03\x04";
|
||||
$feedArrayRow .= "\x0a\x00";
|
||||
$feedArrayRow .= "\x00\x00";
|
||||
$feedArrayRow .= "\x00\x00";
|
||||
$feedArrayRow .= "\x00\x00\x00\x00";
|
||||
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("v", strlen($directoryName) );
|
||||
$feedArrayRow .= pack("v", 0 );
|
||||
$feedArrayRow .= $directoryName;
|
||||
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("V",0);
|
||||
$feedArrayRow .= pack("V",0);
|
||||
|
||||
$this->compressedData[] = $feedArrayRow;
|
||||
|
||||
$newOffset = strlen(implode("", $this->compressedData));
|
||||
|
||||
$addCentralRecord = "\x50\x4b\x01\x02";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x0a\x00";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x00\x00\x00\x00";
|
||||
$addCentralRecord .= pack("V",0);
|
||||
$addCentralRecord .= pack("V",0);
|
||||
$addCentralRecord .= pack("V",0);
|
||||
$addCentralRecord .= pack("v", strlen($directoryName) );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("V", 16 );
|
||||
|
||||
$addCentralRecord .= pack("V", $this->oldOffset );
|
||||
$this->oldOffset = $newOffset;
|
||||
|
||||
$addCentralRecord .= $directoryName;
|
||||
|
||||
$this->centralDirectory[] = $addCentralRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to add file(s) to the specified directory in the archive
|
||||
*
|
||||
* @param string $directoryName
|
||||
* @param string $data
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function addFile($data, $directoryName) {
|
||||
|
||||
$directoryName = str_replace("\\", "/", $directoryName);
|
||||
|
||||
$feedArrayRow = "\x50\x4b\x03\x04";
|
||||
$feedArrayRow .= "\x14\x00";
|
||||
$feedArrayRow .= "\x00\x00";
|
||||
$feedArrayRow .= "\x08\x00";
|
||||
$feedArrayRow .= "\x00\x00\x00\x00";
|
||||
|
||||
$uncompressedLength = strlen($data);
|
||||
$compression = crc32($data);
|
||||
//$gzCompressedData = gzcompress($data);
|
||||
$gzCompressedData = $data; // Removed gz Compression to make compatible with Mac OS
|
||||
$gzCompressedData = substr( substr($gzCompressedData, 0, strlen($gzCompressedData) - 4), 2);
|
||||
$compressedLength = strlen($gzCompressedData);
|
||||
$feedArrayRow .= pack("v", strlen($directoryName) );
|
||||
$feedArrayRow .= pack("v", 0 );
|
||||
$feedArrayRow .= $directoryName;
|
||||
$feedArrayRow .= $gzCompressedData;
|
||||
$this->compressedData[] = $feedArrayRow;
|
||||
|
||||
$newOffset = strlen(implode("", $this->compressedData));
|
||||
|
||||
$addCentralRecord = "\x50\x4b\x01\x02";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x14\x00";
|
||||
$addCentralRecord .="\x00\x00";
|
||||
$addCentralRecord .="\x08\x00";
|
||||
$addCentralRecord .="\x00\x00\x00\x00";
|
||||
$addCentralRecord .= pack("V",$compression);
|
||||
$addCentralRecord .= pack("V",$compressedLength);
|
||||
$addCentralRecord .= pack("V",$uncompressedLength);
|
||||
$addCentralRecord .= pack("v", strlen($directoryName) );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("v", 0 );
|
||||
$addCentralRecord .= pack("V", 32 );
|
||||
|
||||
$addCentralRecord .= pack("V", $this->oldOffset );
|
||||
$this->oldOffset = $newOffset;
|
||||
$addCentralRecord .= $directoryName;
|
||||
$this->centralDirectory[] = $addCentralRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to return the zip file
|
||||
*
|
||||
* @return zipfile (archive)
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getZippedfile() {
|
||||
|
||||
$data = implode("", $this->compressedData);
|
||||
$controlDirectory = implode("", $this->centralDirectory);
|
||||
|
||||
return
|
||||
$data.
|
||||
$controlDirectory.
|
||||
$this->endOfCentralDirectory.
|
||||
pack("v", sizeof($this->centralDirectory)).
|
||||
pack("v", sizeof($this->centralDirectory)).
|
||||
pack("V", strlen($controlDirectory)).
|
||||
pack("V", strlen($data)).
|
||||
"\x00\x00";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Function to force the download of the archive as soon as it is created
|
||||
*
|
||||
* @param archiveName string - name of the created archive file
|
||||
* @access public
|
||||
* @return ZipFile via Header
|
||||
*/
|
||||
public function forceDownload($archiveName) {
|
||||
if(ini_get('zlib.output_compression')) {
|
||||
ini_set('zlib.output_compression', 'Off');
|
||||
}
|
||||
|
||||
// Security checks
|
||||
if( $archiveName == "" ) {
|
||||
echo "<html><title>Public Photo Directory - Download </title><body><BR><B>ERROR:</B> The download file was NOT SPECIFIED.</body></html>";
|
||||
exit;
|
||||
}
|
||||
elseif ( ! file_exists( $archiveName ) ) {
|
||||
echo "<html><title>Public Photo Directory - Download </title><body><BR><B>ERROR:</B> File not found.</body></html>";
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Pragma: public");
|
||||
header("Expires: 0");
|
||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||
header("Cache-Control: private",false);
|
||||
header("Content-Type: application/zip");
|
||||
header("Content-Disposition: attachment; filename=".basename($archiveName).";" );
|
||||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-Length: ".filesize($archiveName));
|
||||
readfile("$archiveName");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to parse a directory to return all its files and sub directories as array
|
||||
*
|
||||
* @param string $dir
|
||||
* @access private
|
||||
* @return array
|
||||
*/
|
||||
private function parseDirectory($rootPath, $seperator="/"){
|
||||
$fileArray=array();
|
||||
$handle = opendir($rootPath);
|
||||
while( ($file = @readdir($handle))!==false) {
|
||||
if($file !='.' && $file !='..'){
|
||||
if (is_dir($rootPath.$seperator.$file)){
|
||||
$array=$this->parseDirectory($rootPath.$seperator.$file);
|
||||
$fileArray=array_merge($array,$fileArray);
|
||||
}
|
||||
else {
|
||||
$fileArray[]=$rootPath.$seperator.$file;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $fileArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to Zip entire directory with all its files and subdirectories
|
||||
*
|
||||
* @param string $dirName
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function zipDirectory($dirName, $outputDir) {
|
||||
if (!is_dir($dirName)){
|
||||
trigger_error("CreateZipFile FATAL ERROR: Could not locate the specified directory $dirName", E_USER_ERROR);
|
||||
}
|
||||
$tmp=$this->parseDirectory($dirName);
|
||||
$count=count($tmp);
|
||||
$this->addDirectory($outputDir);
|
||||
for ($i=0;$i<$count;$i++){
|
||||
$fileToZip=trim($tmp[$i]);
|
||||
$newOutputDir=substr($fileToZip,0,(strrpos($fileToZip,'/')+1));
|
||||
$outputDir=$outputDir.$newOutputDir;
|
||||
$fileContents=file_get_contents($fileToZip);
|
||||
$this->addFile($fileContents,$fileToZip);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,695 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* CloudFw Uploader Class
|
||||
*
|
||||
* @class CloudFw_Upload_Xhr
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
class CloudFw_Uploader {
|
||||
|
||||
function save($path) {
|
||||
if(!move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $path)){
|
||||
return false;
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
function getName() {
|
||||
return $_FILES['uploadedfile']['name'];
|
||||
}
|
||||
function getSize() {
|
||||
return $_FILES['uploadedfile']['size'];
|
||||
}
|
||||
function getPathInfo() {
|
||||
return pathinfo($this->getName());
|
||||
}
|
||||
function detectMode(){
|
||||
//print_r ($_FILES['uploadedfile']);
|
||||
switch ( $_FILES['uploadedfile']['type'] ) {
|
||||
case 'application/octet-stream':
|
||||
return 'cfile';
|
||||
break;
|
||||
case 'application/zip':
|
||||
case 'application/x-zip-compressed':
|
||||
case 'application/s-compressed':
|
||||
return 'zip';
|
||||
default:
|
||||
return 'unknown';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* CloudFw Import/Export Class
|
||||
*
|
||||
* @class CloudFw_Import
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param $args array
|
||||
* @return NULL
|
||||
*/
|
||||
class CloudFw_Import {
|
||||
private $allowedTypes = array();
|
||||
private $sizeLimit = 8388608;
|
||||
private $uploadFolder;
|
||||
private $zipFolder;
|
||||
private $mode;
|
||||
private $message;
|
||||
private $status = true;
|
||||
private $file;
|
||||
|
||||
|
||||
function __construct( array $args = array() ){
|
||||
|
||||
extract(shortcode_atts(array(
|
||||
'allowedTypes' => array(),
|
||||
'sizeLimit' => NULL,
|
||||
'type' => '',
|
||||
'uploadFolder' => ''
|
||||
), $args));
|
||||
|
||||
$this->allowedTypes = array_map("strtolower", $allowedTypes);
|
||||
$this->sizeLimit = $sizeLimit;
|
||||
$this->uploadFolder = $uploadFolder;
|
||||
$this->type = $type;
|
||||
|
||||
}
|
||||
|
||||
function result(){
|
||||
|
||||
$this->checkServerSettings();
|
||||
|
||||
if ($this->status()) {
|
||||
|
||||
if (isset($_FILES['uploadedfile'])) {
|
||||
$this->file = new CloudFw_Uploader();
|
||||
} else {
|
||||
$this->file = false;
|
||||
}
|
||||
|
||||
# Detect Mode
|
||||
$this->mode = $this->file->detectMode();
|
||||
|
||||
if ($this->mode == 'zip')
|
||||
$this->uploadFolder = CLOUD_UPLOAD_DIR;
|
||||
elseif ($this->mode == 'cfile')
|
||||
$this->uploadFolder = CLOUD_UPLOAD_DIR;
|
||||
else
|
||||
return $this->message(9021, false); // not valid file type
|
||||
|
||||
return $this -> handleUpload();
|
||||
}
|
||||
|
||||
return $this->getMessage();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Check Server Settings
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
private function checkServerSettings(){
|
||||
$postSize = cloudfw_toBytes(ini_get('post_max_size'));
|
||||
$uploadSize = cloudfw_toBytes(ini_get('upload_max_filesize'));
|
||||
|
||||
if ($postSize < $this->sizeLimit || $uploadSize < $this->sizeLimit){
|
||||
$size = max(1, $this->sizeLimit / 1024 / 1024) . 'M';
|
||||
$this->message(1024, false); // increase post_max_size and upload_max_filesize to $size
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handler
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function handleUpload(){
|
||||
$uploadDirectory = $this->uploadFolder;
|
||||
|
||||
if (!is_writable($uploadDirectory))
|
||||
return $this->message(9009, false); // Server error. Upload directory isn't writable.
|
||||
|
||||
if (!$this->file)
|
||||
return $this->message(9003, false); // please upload a file
|
||||
|
||||
$size = $this->file->getSize();
|
||||
|
||||
if ($size == 0)
|
||||
return $this->message(9003, false); // please upload a file
|
||||
|
||||
if ($size > $this->sizeLimit)
|
||||
return $this->message(9007, false); // File is too large
|
||||
|
||||
|
||||
$pathinfo = pathinfo($this->file->getName());
|
||||
$filename = sanitize_file_name($pathinfo['filename']);
|
||||
$ext = $pathinfo['extension'];
|
||||
|
||||
/*if($this->allowedTypes && !in_array(strtolower($ext), $this->allowedTypes)){
|
||||
$these = implode(', ', $this->allowedTypes);
|
||||
return array('error' => 'File type is invalid, it should be one of '. $these . '.');
|
||||
}*/
|
||||
|
||||
/*if($replaceOldFile){
|
||||
/// don't overwrite previous files that were uploaded
|
||||
while (file_exists($uploadDirectory . $filename . '.' . $ext)) {
|
||||
$filename .= rand(10, 99);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
if ($this->status()) {
|
||||
|
||||
if ($the_file = $this->file->save($uploadDirectory . $filename . '.' . $ext)){
|
||||
$this->import($the_file, $filename);
|
||||
$this->delFile($uploadDirectory . $filename . '.' . $ext);
|
||||
|
||||
if ( ! $this->status() )
|
||||
$this->delFolder( $this->getZipFolder() );
|
||||
|
||||
return $this->getMessage();
|
||||
|
||||
} else
|
||||
return $this->message(9008, false); // Could not save uploaded file. The upload was cancelled, or server error encountered
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
return $this->getMessage();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check Signature
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function checkSignature($data){
|
||||
return $data['key'] === CLOUD_THEMEKEY;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check Type
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function checkType($data){
|
||||
return !empty($this->type) ? ($data['case'] == $this->type) : ($data['case'] == 'options');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get File Content
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
private function getContent($the_file){
|
||||
if (empty($the_file) || !$the_file)
|
||||
return false;
|
||||
|
||||
|
||||
$fp = fopen($the_file, "r");
|
||||
while (!feof($fp))
|
||||
$the_content = fread($fp, 65536);
|
||||
|
||||
fclose($fp);
|
||||
|
||||
return $this->decodeContent($the_content);
|
||||
}
|
||||
|
||||
/*
|
||||
* Decode Contents
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
private function decodeContent($content){
|
||||
include_once(TMP_ADMIN_PATH.'/classes/JSON.php');
|
||||
$json = new Services_JSON();
|
||||
|
||||
$decoded_options = @(base64_decode($content));
|
||||
$parse_all_options = @($json->decode($decoded_options));
|
||||
|
||||
if ( $this->status() && ! $parse_all_options )
|
||||
$this->message(9005, false);
|
||||
|
||||
|
||||
if ($this->status()){
|
||||
if (!empty($parse_all_options))
|
||||
return objectToArray((array) $parse_all_options);
|
||||
}
|
||||
|
||||
return $this->status();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Set FeedBack Message
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function message($message, $status = 1){
|
||||
$this->message = $message;
|
||||
if (isset($status))
|
||||
$this->status = $status;
|
||||
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get Message
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function getMessage(){
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get Status
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function status(){
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Delete A File
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
private function delFile($the_file){
|
||||
return @unlink($the_file);
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete A Folder
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
private function delFolder($dir){
|
||||
if (!$dir)
|
||||
return false;
|
||||
|
||||
if ($handle = @opendir($dir)) {
|
||||
$array = array();
|
||||
|
||||
while (false !== ($file = @readdir($handle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
|
||||
if(@is_dir($dir.$file))
|
||||
{
|
||||
if(!@rmdir($dir.$file)) // Empty directory? Remove it
|
||||
{
|
||||
$this->delFolder($dir.$file.'/'); // Not empty? Delete the files inside it
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@unlink($dir.$file);
|
||||
}
|
||||
}
|
||||
}
|
||||
@closedir($handle);
|
||||
|
||||
@rmdir($dir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Set Zip Folder
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function getZipFolder(){
|
||||
return $this->zipFolder;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get Message
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function setZipFolder($folder){
|
||||
$this->zipFolder = $folder;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract Zip File
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function extractZip($the_file, $to){
|
||||
|
||||
|
||||
$pathinfo = pathinfo($the_file);
|
||||
$filename = $pathinfo['filename'];
|
||||
|
||||
$target = $to.$filename.'/';
|
||||
|
||||
@mkdir($target);
|
||||
@chmod($target, 0777);
|
||||
|
||||
if ( ! is__writable($target) === true )
|
||||
$this->message(9020, false); // the folder not writable
|
||||
|
||||
|
||||
if ($this->status()){
|
||||
|
||||
if ( extractZip($the_file, $target) ) {
|
||||
$this->delFile($the_file);
|
||||
$this->setZipFolder($target);
|
||||
return $target;
|
||||
}
|
||||
else
|
||||
$this->message(9019, false); // Php ZipArchive extension is not found
|
||||
|
||||
}
|
||||
|
||||
return $this->status();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Find Skin File In Folder
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function findSkinFile($the_folder){
|
||||
|
||||
if ($handle = @opendir($the_folder)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != ".." &&
|
||||
(
|
||||
strpos($file, '.skin') !== false
|
||||
)
|
||||
) {
|
||||
$skin_files[] = $file;
|
||||
}
|
||||
}
|
||||
@closedir($handle);
|
||||
}
|
||||
else
|
||||
$this->message(9018, false); // the folder cannot opened
|
||||
|
||||
|
||||
if ($this->status()){
|
||||
|
||||
if ( !empty($skin_files) )
|
||||
return $skin_files; // .skin file found
|
||||
else
|
||||
$this->message(9017, false); // no-found .skin file in the folder
|
||||
|
||||
}
|
||||
|
||||
return $this->status();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Find Slider File In Folder
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function findSliderFile($the_folder){
|
||||
|
||||
if ($handle = @opendir($the_folder)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != ".." &&
|
||||
(
|
||||
strpos($file, '.slider') !== false
|
||||
)
|
||||
) {
|
||||
$skin_files[] = $file;
|
||||
}
|
||||
}
|
||||
@closedir($handle);
|
||||
}
|
||||
else
|
||||
$this->message(9018, false); // the folder cannot opened
|
||||
|
||||
|
||||
if ($this->status()){
|
||||
|
||||
if ( !empty($skin_files) )
|
||||
return $skin_files; // .skin file found
|
||||
else
|
||||
$this->message(9022, false); // no-found .slider file in the folder
|
||||
|
||||
}
|
||||
|
||||
return $this->status();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Import
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
private function import($the_file, $filename){
|
||||
|
||||
switch ($this->type) {
|
||||
case '':
|
||||
case 'options':
|
||||
|
||||
return $this->importOptions($the_file);
|
||||
|
||||
break;
|
||||
case 'skin':
|
||||
|
||||
|
||||
if ($this->mode == 'zip') {
|
||||
$zip_folder = $this->extractZip($the_file, TEMPLATEPATH.'/resources/skins/');
|
||||
$zip_folder_relative = TMP_URL.'/resources/skins/'.sanitize_file_name($filename).'/';
|
||||
|
||||
if ($zip_folder) {
|
||||
$the_skin_files = $this->findSkinFile($zip_folder);
|
||||
|
||||
if ($the_skin_files)
|
||||
$the_file = $zip_folder.$the_skin_files[0];
|
||||
|
||||
}
|
||||
|
||||
$this->importSkin($the_file, $zip_folder_relative);
|
||||
|
||||
} elseif ($this->mode == 'cfile'){
|
||||
|
||||
$this->importSkin($the_file);
|
||||
|
||||
} else
|
||||
return $this->message(9004, false); // not compatible
|
||||
|
||||
|
||||
break;
|
||||
case 'slider':
|
||||
|
||||
|
||||
if ($this->mode == 'zip') {
|
||||
$zip_folder = $this->extractZip($the_file, TEMPLATEPATH.'/resources/sliders/');
|
||||
$zip_folder_relative = TMP_URL.'/resources/sliders/'.sanitize_file_name($filename).'/';
|
||||
|
||||
if ($zip_folder) {
|
||||
$the_slider_files = $this->findSliderFile($zip_folder);
|
||||
|
||||
if ($the_slider_files)
|
||||
$the_file = $zip_folder.$the_slider_files[0];
|
||||
|
||||
}
|
||||
|
||||
$this->importSlider($the_file, $zip_folder_relative);
|
||||
|
||||
} elseif ($this->mode == 'cfile'){
|
||||
|
||||
$this->importSlider($the_file);
|
||||
|
||||
} else
|
||||
return $this->message(9004, false); // not compatible
|
||||
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Import: Theme Options
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function importOptions($the_file){
|
||||
/*
|
||||
Check whether the file is exists
|
||||
**/
|
||||
|
||||
if($the_file && file_exists($the_file))
|
||||
$data = $this->getContent($the_file);
|
||||
else{
|
||||
if ( ! $this->getMessage() )
|
||||
$this->message(9005, false); // problem in the file
|
||||
}
|
||||
|
||||
/*
|
||||
Check Signature
|
||||
**/
|
||||
if ( $this->status() ){
|
||||
|
||||
if ($this->checkSignature($data) && $this->checkType($data)){
|
||||
//true
|
||||
$data["data"] = cloudfw_exclude_options($data["data"], $data["server"], NULL, TRUE);
|
||||
cloudfw_update_option( (array) $data["data"]);
|
||||
|
||||
$this->message(9002, true); /*success*/
|
||||
|
||||
} else {
|
||||
|
||||
$this->message(9006, false); // not compatible
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Import: Skin
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function importSkin($the_file, $the_folder = ''){
|
||||
/*
|
||||
Check whether the file is exists
|
||||
**/
|
||||
if($the_file && file_exists($the_file))
|
||||
$data = $this->getContent($the_file);
|
||||
else{
|
||||
if ( ! $this->getMessage() )
|
||||
$this->message(9005, false); // problem in the file
|
||||
}
|
||||
|
||||
/*
|
||||
Check Signature
|
||||
**/
|
||||
if ( $this->status() ){
|
||||
|
||||
if ($this->checkSignature($data) && $this->checkType($data)){
|
||||
//true
|
||||
|
||||
foreach( $data["data"] as $skin_id => $skin ) {
|
||||
|
||||
if (!is_array($skin))
|
||||
continue;
|
||||
|
||||
if ( ! $the_folder )
|
||||
$target_folder = TMP_URL . '/resources/skins/' .$skin['data']['custom']['foldername'] . '/';
|
||||
else
|
||||
$target_folder = $the_folder;
|
||||
|
||||
|
||||
$success = true;
|
||||
$skin = cloudfw_prepare_URI_for_import($skin, $target_folder);
|
||||
$id = cloudfw_manage_skin_ID(NULL, 'add', $skin);
|
||||
|
||||
}
|
||||
|
||||
if ($success)
|
||||
$this->message(9011, true); /*success*/
|
||||
else
|
||||
$this->message(9004, false); /*an error occured*/
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$this->message(9006, false); // not compatible
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Import: Slider
|
||||
*
|
||||
* @since 1.0
|
||||
**/
|
||||
function importSlider($the_file, $the_folder = ''){
|
||||
/*
|
||||
Check whether the file is exists
|
||||
**/
|
||||
if($the_file && file_exists($the_file))
|
||||
$data = $this->getContent($the_file);
|
||||
else{
|
||||
if ( ! $this->getMessage() )
|
||||
$this->message(9005, false); // problem in the file
|
||||
}
|
||||
|
||||
/*
|
||||
Check Signature
|
||||
**/
|
||||
if ( $this->status() ){
|
||||
|
||||
if ($this->checkSignature($data) && $this->checkType($data)){
|
||||
//true
|
||||
|
||||
foreach( $data["data"] as $slider_id => $slider ) {
|
||||
|
||||
if (!is_array($slider) || !is_array($slider["main"]))
|
||||
continue;
|
||||
|
||||
$main_id = $slider_id;
|
||||
|
||||
|
||||
|
||||
if ( ! $the_folder )
|
||||
$target_folder = TMP_URL . '/resources/sliders/' .$slider["main"]["foldername"]. '/';
|
||||
else
|
||||
$target_folder = $the_folder;
|
||||
|
||||
|
||||
$success = true;
|
||||
$slider['main'] = cloudfw_prepare_URI_for_import($slider['main'], $target_folder);
|
||||
$slider['data'] = cloudfw_prepare_URI_for_import($slider['data'], $target_folder);
|
||||
|
||||
$main_id = cloudfw_create_slider($slider["main"]);
|
||||
if (!empty($main_id))
|
||||
update_option($main_id, $slider["data"]);
|
||||
|
||||
}
|
||||
|
||||
if ($success)
|
||||
$this->message(9016, true); /*success*/
|
||||
else
|
||||
$this->message(9004, false); /*an error occured*/
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$this->message(9006, false); // not compatible
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,165 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Handle file uploads via XMLHttpRequest
|
||||
*/
|
||||
class qqUploadedFileXhr {
|
||||
/**
|
||||
* Save the file to the specified path
|
||||
* @return boolean TRUE on success
|
||||
*/
|
||||
function save($path) {
|
||||
$input = fopen("php://input", "r");
|
||||
$temp = tmpfile();
|
||||
$realSize = stream_copy_to_stream($input, $temp);
|
||||
fclose($input);
|
||||
|
||||
if ($realSize != $this->getSize()){
|
||||
return false;
|
||||
}
|
||||
|
||||
$target = fopen($path, "w");
|
||||
fseek($temp, 0, SEEK_SET);
|
||||
stream_copy_to_stream($temp, $target);
|
||||
fclose($target);
|
||||
|
||||
return true;
|
||||
}
|
||||
function getName() {
|
||||
return $_GET['qqfile'];
|
||||
}
|
||||
function getSize() {
|
||||
if (isset($_SERVER["CONTENT_LENGTH"])){
|
||||
return (int)$_SERVER["CONTENT_LENGTH"];
|
||||
} else {
|
||||
throw new Exception('Getting content length is not supported.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle file uploads via regular form post (uses the $_FILES array)
|
||||
*/
|
||||
class qqUploadedFileForm {
|
||||
/**
|
||||
* Save the file to the specified path
|
||||
* @return boolean TRUE on success
|
||||
*/
|
||||
function save($path) {
|
||||
if(!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function getName() {
|
||||
return $_FILES['qqfile']['name'];
|
||||
}
|
||||
function getSize() {
|
||||
return $_FILES['qqfile']['size'];
|
||||
}
|
||||
}
|
||||
|
||||
class qqFileUploader {
|
||||
private $allowedExtensions = array();
|
||||
private $sizeLimit = 8388608;
|
||||
private $file;
|
||||
private $lang;
|
||||
private $category_ID;
|
||||
private $documents_dir;
|
||||
|
||||
function __construct(array $allowedExtensions = array(), $documents_dir = NULL, $sizeLimit = NULL, $lang = '', $category_ID = ''){
|
||||
$allowedExtensions = array_map("strtolower", $allowedExtensions);
|
||||
|
||||
$this->allowedExtensions = $allowedExtensions;
|
||||
if ( $sizeLimit )
|
||||
$this->sizeLimit = $sizeLimit;
|
||||
$this->lang = $lang;
|
||||
$this->cat = $category_ID;
|
||||
$this->documents_dir = $documents_dir;
|
||||
|
||||
$this->checkServerSettings();
|
||||
|
||||
if (isset($_GET['qqfile'])) {
|
||||
$this->file = new qqUploadedFileXhr();
|
||||
} elseif (isset($_FILES['qqfile'])) {
|
||||
$this->file = new qqUploadedFileForm();
|
||||
} else {
|
||||
$this->file = false;
|
||||
}
|
||||
}
|
||||
|
||||
private function checkServerSettings(){
|
||||
$postSize = $this->toBytes(ini_get('post_max_size'));
|
||||
$uploadSize = $this->toBytes(ini_get('upload_max_filesize'));
|
||||
|
||||
if ($postSize < $this->sizeLimit || $uploadSize < $this->sizeLimit){
|
||||
$size = max(1, $this->sizeLimit / 1024 / 1024) . 'M';
|
||||
die("{'error':'increase post_max_size and upload_max_filesize to $size'}");
|
||||
}
|
||||
}
|
||||
|
||||
private function toBytes($str){
|
||||
$val = trim($str);
|
||||
$last = strtolower($str[strlen($str)-1]);
|
||||
switch($last) {
|
||||
case 'g': $val *= 1024;
|
||||
case 'm': $val *= 1024;
|
||||
case 'k': $val *= 1024;
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array('success'=>true) or array('error'=>'error message')
|
||||
*/
|
||||
function handleUpload($uploadDirectory, $replaceOldFile = FALSE){
|
||||
if (!is_writable($uploadDirectory)){
|
||||
return array('error' => "Server error. Upload directory isn't writable.");
|
||||
}
|
||||
|
||||
if (!$this->file){
|
||||
return array('error' => 'No files were uploaded.');
|
||||
}
|
||||
|
||||
$size = $this->file->getSize();
|
||||
|
||||
if ($size == 0) {
|
||||
return array('error' => 'File is empty');
|
||||
}
|
||||
|
||||
if ($size > $this->sizeLimit) {
|
||||
return array('error' => 'File is too large');
|
||||
}
|
||||
|
||||
if (is_numeric($this->cat) && $this->cat) {
|
||||
$category = get_category($this->cat);
|
||||
$temp_category_slug = '_'.$category->slug;
|
||||
}
|
||||
|
||||
$pathinfo = pathinfo($this->file->getName());
|
||||
$filename = sanitize_file_name($this->lang.$temp_category_slug.'_'.$pathinfo['filename']);
|
||||
//$filename = md5(uniqid());
|
||||
$ext = $pathinfo['extension'];
|
||||
|
||||
if($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)){
|
||||
$these = implode(', ', $this->allowedExtensions);
|
||||
return array('error' => 'File has an invalid extension, it should be one of '. $these . '.');
|
||||
}
|
||||
|
||||
if(!$replaceOldFile){
|
||||
/// don't overwrite previous files that were uploaded
|
||||
while (file_exists($uploadDirectory . $filename . '.' . $ext)) {
|
||||
$filename .= rand(10, 99);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->file->save($uploadDirectory . $filename . '.' . $ext)){
|
||||
$documents_dir = $this->documents_dir;
|
||||
return array('success'=>true, 'filepath' => ($documents_dir.$filename . '.' . $ext), 'fileRelpath' => ($uploadDirectory . $filename . '.' . $ext));
|
||||
} else {
|
||||
return array('error'=> 'Could not save uploaded file.' .
|
||||
'The upload was cancelled, or server error encountered');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,822 @@
|
||||
<?php
|
||||
/**
|
||||
* GAPI - Google Analytics PHP Interface
|
||||
*
|
||||
* http://code.google.com/p/gapi-google-analytics-php-interface/
|
||||
*
|
||||
* @copyright Stig Manning 2009
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @author Stig Manning <stig@sdm.co.nz>
|
||||
* @version 1.3
|
||||
*
|
||||
*/
|
||||
|
||||
class gapi
|
||||
{
|
||||
const http_interface = 'auto'; //'auto': autodetect, 'curl' or 'fopen'
|
||||
|
||||
const client_login_url = 'https://www.google.com/accounts/ClientLogin';
|
||||
const account_data_url = 'https://www.google.com/analytics/feeds/accounts/default';
|
||||
const report_data_url = 'https://www.google.com/analytics/feeds/data';
|
||||
const interface_name = 'GAPI-1.3';
|
||||
const dev_mode = false;
|
||||
|
||||
private $auth_token = null;
|
||||
private $account_entries = array();
|
||||
private $account_root_parameters = array();
|
||||
private $report_aggregate_metrics = array();
|
||||
private $report_root_parameters = array();
|
||||
private $results = array();
|
||||
|
||||
/**
|
||||
* Constructor function for all new gapi instances
|
||||
*
|
||||
* Set up authenticate with Google and get auth_token
|
||||
*
|
||||
* @param String $email
|
||||
* @param String $password
|
||||
* @param String $token
|
||||
* @return gapi
|
||||
*/
|
||||
public function __construct($email, $password, $token=null)
|
||||
{
|
||||
if($token !== null)
|
||||
{
|
||||
$this->auth_token = $token;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->authenticateUser($email,$password);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the auth token, used for storing the auth token in the user session
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public function getAuthToken()
|
||||
{
|
||||
return $this->auth_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request account data from Google Analytics
|
||||
*
|
||||
* @param Int $start_index OPTIONAL: Start index of results
|
||||
* @param Int $max_results OPTIONAL: Max results returned
|
||||
*/
|
||||
public function requestAccountData($start_index=1, $max_results=20)
|
||||
{
|
||||
$response = $this->httpRequest(gapi::account_data_url, array('start-index'=>$start_index,'max-results'=>$max_results), null, $this->generateAuthHeader());
|
||||
|
||||
if(substr($response['code'],0,1) == '2')
|
||||
{
|
||||
return $this->accountObjectMapper($response['body']);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('GAPI: Failed to request account data. Error: "' . strip_tags($response['body']) . '"');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request report data from Google Analytics
|
||||
*
|
||||
* $report_id is the Google report ID for the selected account
|
||||
*
|
||||
* $parameters should be in key => value format
|
||||
*
|
||||
* @param String $report_id
|
||||
* @param Array $dimensions Google Analytics dimensions e.g. array('browser')
|
||||
* @param Array $metrics Google Analytics metrics e.g. array('pageviews')
|
||||
* @param Array $sort_metric OPTIONAL: Dimension or dimensions to sort by e.g.('-visits')
|
||||
* @param String $filter OPTIONAL: Filter logic for filtering results
|
||||
* @param String $start_date OPTIONAL: Start of reporting period
|
||||
* @param String $end_date OPTIONAL: End of reporting period
|
||||
* @param Int $start_index OPTIONAL: Start index of results
|
||||
* @param Int $max_results OPTIONAL: Max results returned
|
||||
*/
|
||||
public function requestReportData($report_id, $dimensions, $metrics, $sort_metric=null, $filter=null, $start_date=null, $end_date=null, $start_index=1, $max_results=30)
|
||||
{
|
||||
$parameters = array('ids'=>'ga:' . $report_id);
|
||||
|
||||
if(is_array($dimensions))
|
||||
{
|
||||
$dimensions_string = '';
|
||||
foreach($dimensions as $dimesion)
|
||||
{
|
||||
$dimensions_string .= ',ga:' . $dimesion;
|
||||
}
|
||||
$parameters['dimensions'] = substr($dimensions_string,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parameters['dimensions'] = 'ga:'.$dimensions;
|
||||
}
|
||||
|
||||
if(is_array($metrics))
|
||||
{
|
||||
$metrics_string = '';
|
||||
foreach($metrics as $metric)
|
||||
{
|
||||
$metrics_string .= ',ga:' . $metric;
|
||||
}
|
||||
$parameters['metrics'] = substr($metrics_string,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parameters['metrics'] = 'ga:'.$metrics;
|
||||
}
|
||||
|
||||
if($sort_metric==null&&isset($parameters['metrics']))
|
||||
{
|
||||
$parameters['sort'] = $parameters['metrics'];
|
||||
}
|
||||
elseif(is_array($sort_metric))
|
||||
{
|
||||
$sort_metric_string = '';
|
||||
|
||||
foreach($sort_metric as $sort_metric_value)
|
||||
{
|
||||
//Reverse sort - Thanks Nick Sullivan
|
||||
if (substr($sort_metric_value, 0, 1) == "-")
|
||||
{
|
||||
$sort_metric_string .= ',-ga:' . substr($sort_metric_value, 1); // Descending
|
||||
}
|
||||
else
|
||||
{
|
||||
$sort_metric_string .= ',ga:' . $sort_metric_value; // Ascending
|
||||
}
|
||||
}
|
||||
|
||||
$parameters['sort'] = substr($sort_metric_string, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (substr($sort_metric, 0, 1) == "-")
|
||||
{
|
||||
$parameters['sort'] = '-ga:' . substr($sort_metric, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parameters['sort'] = 'ga:' . $sort_metric;
|
||||
}
|
||||
}
|
||||
|
||||
if($filter!=null)
|
||||
{
|
||||
$filter = $this->processFilter($filter);
|
||||
if($filter!==false)
|
||||
{
|
||||
$parameters['filters'] = $filter;
|
||||
}
|
||||
}
|
||||
|
||||
if($start_date==null)
|
||||
{
|
||||
$start_date=date('Y-m-d',strtotime('1 month ago'));
|
||||
}
|
||||
|
||||
$parameters['start-date'] = $start_date;
|
||||
|
||||
if($end_date==null)
|
||||
{
|
||||
$end_date=date('Y-m-d');
|
||||
}
|
||||
|
||||
$parameters['end-date'] = $end_date;
|
||||
|
||||
|
||||
$parameters['start-index'] = $start_index;
|
||||
$parameters['max-results'] = $max_results;
|
||||
|
||||
$parameters['prettyprint'] = gapi::dev_mode ? 'true' : 'false';
|
||||
|
||||
$response = $this->httpRequest(gapi::report_data_url, $parameters, null, $this->generateAuthHeader());
|
||||
|
||||
//HTTP 2xx
|
||||
if(substr($response['code'],0,1) == '2')
|
||||
{
|
||||
return $this->reportObjectMapper($response['body']);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('GAPI: Failed to request report data. Error: "' . strip_tags($response['body']) . '"');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process filter string, clean parameters and convert to Google Analytics
|
||||
* compatible format
|
||||
*
|
||||
* @param String $filter
|
||||
* @return String Compatible filter string
|
||||
*/
|
||||
protected function processFilter($filter)
|
||||
{
|
||||
$valid_operators = '(!~|=~|==|!=|>|<|>=|<=|=@|!@)';
|
||||
|
||||
$filter = preg_replace('/\s\s+/',' ',trim($filter)); //Clean duplicate whitespace
|
||||
$filter = str_replace(array(',',';'),array('\,','\;'),$filter); //Escape Google Analytics reserved characters
|
||||
$filter = preg_replace('/(&&\s*|\|\|\s*|^)([a-z]+)(\s*' . $valid_operators . ')/i','$1ga:$2$3',$filter); //Prefix ga: to metrics and dimensions
|
||||
$filter = preg_replace('/[\'\"]/i','',$filter); //Clear invalid quote characters
|
||||
$filter = preg_replace(array('/\s*&&\s*/','/\s*\|\|\s*/','/\s*' . $valid_operators . '\s*/'),array(';',',','$1'),$filter); //Clean up operators
|
||||
|
||||
if(strlen($filter)>0)
|
||||
{
|
||||
return urlencode($filter);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Report Account Mapper to convert the XML to array of useful PHP objects
|
||||
*
|
||||
* @param String $xml_string
|
||||
* @return Array of gapiAccountEntry objects
|
||||
*/
|
||||
protected function accountObjectMapper($xml_string)
|
||||
{
|
||||
$xml = simplexml_load_string($xml_string);
|
||||
|
||||
$this->results = null;
|
||||
|
||||
$results = array();
|
||||
$account_root_parameters = array();
|
||||
|
||||
//Load root parameters
|
||||
|
||||
$account_root_parameters['updated'] = strval($xml->updated);
|
||||
$account_root_parameters['generator'] = strval($xml->generator);
|
||||
$account_root_parameters['generatorVersion'] = strval($xml->generator->attributes());
|
||||
|
||||
$open_search_results = $xml->children('http://a9.com/-/spec/opensearchrss/1.0/');
|
||||
|
||||
foreach($open_search_results as $key => $open_search_result)
|
||||
{
|
||||
$report_root_parameters[$key] = intval($open_search_result);
|
||||
}
|
||||
|
||||
$account_root_parameters['startDate'] = strval($google_results->startDate);
|
||||
$account_root_parameters['endDate'] = strval($google_results->endDate);
|
||||
|
||||
//Load result entries
|
||||
|
||||
foreach($xml->entry as $entry)
|
||||
{
|
||||
$properties = array();
|
||||
foreach($entry->children('http://schemas.google.com/analytics/2009')->property as $property)
|
||||
{
|
||||
$properties[str_replace('ga:','',$property->attributes()->name)] = strval($property->attributes()->value);
|
||||
}
|
||||
|
||||
$properties['title'] = strval($entry->title);
|
||||
$properties['updated'] = strval($entry->updated);
|
||||
|
||||
$results[] = new gapiAccountEntry($properties);
|
||||
}
|
||||
|
||||
$this->account_root_parameters = $account_root_parameters;
|
||||
$this->results = $results;
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Report Object Mapper to convert the XML to array of useful PHP objects
|
||||
*
|
||||
* @param String $xml_string
|
||||
* @return Array of gapiReportEntry objects
|
||||
*/
|
||||
protected function reportObjectMapper($xml_string)
|
||||
{
|
||||
$xml = simplexml_load_string($xml_string);
|
||||
|
||||
$this->results = null;
|
||||
$results = array();
|
||||
|
||||
$report_root_parameters = array();
|
||||
$report_aggregate_metrics = array();
|
||||
|
||||
//Load root parameters
|
||||
|
||||
$report_root_parameters['updated'] = strval($xml->updated);
|
||||
$report_root_parameters['generator'] = strval($xml->generator);
|
||||
$report_root_parameters['generatorVersion'] = strval($xml->generator->attributes());
|
||||
|
||||
$open_search_results = $xml->children('http://a9.com/-/spec/opensearchrss/1.0/');
|
||||
|
||||
foreach($open_search_results as $key => $open_search_result)
|
||||
{
|
||||
$report_root_parameters[$key] = intval($open_search_result);
|
||||
}
|
||||
|
||||
$google_results = $xml->children('http://schemas.google.com/analytics/2009');
|
||||
|
||||
foreach($google_results->dataSource->property as $property_attributes)
|
||||
{
|
||||
$report_root_parameters[str_replace('ga:','',$property_attributes->attributes()->name)] = strval($property_attributes->attributes()->value);
|
||||
}
|
||||
|
||||
$report_root_parameters['startDate'] = strval($google_results->startDate);
|
||||
$report_root_parameters['endDate'] = strval($google_results->endDate);
|
||||
|
||||
//Load result aggregate metrics
|
||||
|
||||
foreach($google_results->aggregates->metric as $aggregate_metric)
|
||||
{
|
||||
$metric_value = strval($aggregate_metric->attributes()->value);
|
||||
|
||||
//Check for float, or value with scientific notation
|
||||
if(preg_match('/^(\d+\.\d+)|(\d+E\d+)|(\d+.\d+E\d+)$/',$metric_value))
|
||||
{
|
||||
$report_aggregate_metrics[str_replace('ga:','',$aggregate_metric->attributes()->name)] = floatval($metric_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$report_aggregate_metrics[str_replace('ga:','',$aggregate_metric->attributes()->name)] = intval($metric_value);
|
||||
}
|
||||
}
|
||||
|
||||
//Load result entries
|
||||
|
||||
foreach($xml->entry as $entry)
|
||||
{
|
||||
$metrics = array();
|
||||
foreach($entry->children('http://schemas.google.com/analytics/2009')->metric as $metric)
|
||||
{
|
||||
$metric_value = strval($metric->attributes()->value);
|
||||
|
||||
//Check for float, or value with scientific notation
|
||||
if(preg_match('/^(\d+\.\d+)|(\d+E\d+)|(\d+.\d+E\d+)$/',$metric_value))
|
||||
{
|
||||
$metrics[str_replace('ga:','',$metric->attributes()->name)] = floatval($metric_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$metrics[str_replace('ga:','',$metric->attributes()->name)] = intval($metric_value);
|
||||
}
|
||||
}
|
||||
|
||||
$dimensions = array();
|
||||
foreach($entry->children('http://schemas.google.com/analytics/2009')->dimension as $dimension)
|
||||
{
|
||||
$dimensions[str_replace('ga:','',$dimension->attributes()->name)] = strval($dimension->attributes()->value);
|
||||
}
|
||||
|
||||
$results[] = new gapiReportEntry($metrics,$dimensions);
|
||||
}
|
||||
|
||||
$this->report_root_parameters = $report_root_parameters;
|
||||
$this->report_aggregate_metrics = $report_aggregate_metrics;
|
||||
$this->results = $results;
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate Google Account with Google
|
||||
*
|
||||
* @param String $email
|
||||
* @param String $password
|
||||
*/
|
||||
protected function authenticateUser($email, $password)
|
||||
{
|
||||
$post_variables = array(
|
||||
'accountType' => 'GOOGLE',
|
||||
'Email' => $email,
|
||||
'Passwd' => $password,
|
||||
'source' => gapi::interface_name,
|
||||
'service' => 'analytics'
|
||||
);
|
||||
|
||||
$response = $this->httpRequest(gapi::client_login_url,null,$post_variables);
|
||||
|
||||
//Convert newline delimited variables into url format then import to array
|
||||
parse_str(str_replace(array("\n","\r\n"),'&',$response['body']),$auth_token);
|
||||
|
||||
if(substr($response['code'],0,1) != '2' || !is_array($auth_token) || empty($auth_token['Auth']))
|
||||
{
|
||||
throw new Exception("NOAUTH");
|
||||
}
|
||||
|
||||
$this->auth_token = $auth_token['Auth'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate authentication token header for all requests
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
protected function generateAuthHeader()
|
||||
{
|
||||
return array('Authorization: GoogleLogin auth=' . $this->auth_token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform http request
|
||||
*
|
||||
*
|
||||
* @param Array $get_variables
|
||||
* @param Array $post_variables
|
||||
* @param Array $headers
|
||||
*/
|
||||
protected function httpRequest($url, $get_variables=null, $post_variables=null, $headers=null)
|
||||
{
|
||||
$interface = gapi::http_interface;
|
||||
|
||||
if(gapi::http_interface =='auto')
|
||||
{
|
||||
if(function_exists('curl_exec'))
|
||||
{
|
||||
$interface = 'curl';
|
||||
}
|
||||
else
|
||||
{
|
||||
$interface = 'fopen';
|
||||
}
|
||||
}
|
||||
|
||||
if($interface == 'curl')
|
||||
{
|
||||
return $this->curlRequest($url, $get_variables, $post_variables, $headers);
|
||||
}
|
||||
elseif($interface == 'fopen')
|
||||
{
|
||||
return $this->fopenRequest($url, $get_variables, $post_variables, $headers);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('Invalid http interface defined. No such interface "' . gapi::http_interface . '"');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP request using PHP CURL functions
|
||||
* Requires curl library installed and configured for PHP
|
||||
*
|
||||
* @param Array $get_variables
|
||||
* @param Array $post_variables
|
||||
* @param Array $headers
|
||||
*/
|
||||
private function curlRequest($url, $get_variables=null, $post_variables=null, $headers=null)
|
||||
{
|
||||
$ch = curl_init();
|
||||
|
||||
if(is_array($get_variables))
|
||||
{
|
||||
$get_variables = '?' . str_replace('&','&',urldecode(http_build_query($get_variables)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$get_variables = null;
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $url . $get_variables);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //CURL doesn't like google's cert
|
||||
|
||||
if(is_array($post_variables))
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_variables);
|
||||
}
|
||||
|
||||
if(is_array($headers))
|
||||
{
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
|
||||
}
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$code = curl_getinfo($ch,CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
return array('body'=>$response,'code'=>$code);
|
||||
}
|
||||
|
||||
/**
|
||||
* HTTP request using native PHP fopen function
|
||||
* Requires PHP openSSL
|
||||
*
|
||||
* @param Array $get_variables
|
||||
* @param Array $post_variables
|
||||
* @param Array $headers
|
||||
*/
|
||||
private function fopenRequest($url, $get_variables=null, $post_variables=null, $headers=null)
|
||||
{
|
||||
$http_options = array('method'=>'GET','timeout'=>3);
|
||||
|
||||
if(is_array($headers))
|
||||
{
|
||||
$headers = implode("\r\n",$headers) . "\r\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$headers = '';
|
||||
}
|
||||
|
||||
if(is_array($get_variables))
|
||||
{
|
||||
$get_variables = '?' . str_replace('&','&',urldecode(http_build_query($get_variables)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$get_variables = null;
|
||||
}
|
||||
|
||||
if(is_array($post_variables))
|
||||
{
|
||||
$post_variables = str_replace('&','&',urldecode(http_build_query($post_variables)));
|
||||
$http_options['method'] = 'POST';
|
||||
$headers = "Content-type: application/x-www-form-urlencoded\r\n" . "Content-Length: " . strlen($post_variables) . "\r\n" . $headers;
|
||||
$http_options['header'] = $headers;
|
||||
$http_options['content'] = $post_variables;
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_variables = '';
|
||||
$http_options['header'] = $headers;
|
||||
}
|
||||
|
||||
$context = stream_context_create(array('http'=>$http_options));
|
||||
$response = @file_get_contents($url . $get_variables, null, $context);
|
||||
|
||||
return array('body'=>$response!==false?$response:'Request failed, fopen provides no further information','code'=>$response!==false?'200':'400');
|
||||
}
|
||||
|
||||
/**
|
||||
* Case insensitive array_key_exists function, also returns
|
||||
* matching key.
|
||||
*
|
||||
* @param String $key
|
||||
* @param Array $search
|
||||
* @return String Matching array key
|
||||
*/
|
||||
public static function array_key_exists_nc($key, $search)
|
||||
{
|
||||
if (array_key_exists($key, $search))
|
||||
{
|
||||
return $key;
|
||||
}
|
||||
if (!(is_string($key) && is_array($search)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$key = strtolower($key);
|
||||
foreach ($search as $k => $v)
|
||||
{
|
||||
if (strtolower($k) == $key)
|
||||
{
|
||||
return $k;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Results
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getResults()
|
||||
{
|
||||
if(is_array($this->results))
|
||||
{
|
||||
return $this->results;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get an array of the metrics and the matchning
|
||||
* aggregate values for the current result
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getMetrics()
|
||||
{
|
||||
return $this->report_aggregate_metrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call method to find a matching root parameter or
|
||||
* aggregate metric to return
|
||||
*
|
||||
* @param $name String name of function called
|
||||
* @return String
|
||||
* @throws Exception if not a valid parameter or aggregate
|
||||
* metric, or not a 'get' function
|
||||
*/
|
||||
public function __call($name,$parameters)
|
||||
{
|
||||
if(!preg_match('/^get/',$name))
|
||||
{
|
||||
throw new Exception('No such function "' . $name . '"');
|
||||
}
|
||||
|
||||
$name = preg_replace('/^get/','',$name);
|
||||
|
||||
$parameter_key = gapi::array_key_exists_nc($name,$this->report_root_parameters);
|
||||
|
||||
if($parameter_key)
|
||||
{
|
||||
return $this->report_root_parameters[$parameter_key];
|
||||
}
|
||||
|
||||
$aggregate_metric_key = gapi::array_key_exists_nc($name,$this->report_aggregate_metrics);
|
||||
|
||||
if($aggregate_metric_key)
|
||||
{
|
||||
return $this->report_aggregate_metrics[$aggregate_metric_key];
|
||||
}
|
||||
|
||||
throw new Exception('No valid root parameter or aggregate metric called "' . $name . '"');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class gapiAccountEntry
|
||||
*
|
||||
* Storage for individual gapi account entries
|
||||
*
|
||||
*/
|
||||
class gapiAccountEntry
|
||||
{
|
||||
private $properties = array();
|
||||
|
||||
public function __construct($properties)
|
||||
{
|
||||
$this->properties = $properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* toString function to return the name of the account
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if(isset($this->properties['title']))
|
||||
{
|
||||
return $this->properties['title'];
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an associative array of the properties
|
||||
* and the matching values for the current result
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getProperties()
|
||||
{
|
||||
return $this->properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call method to find a matching parameter to return
|
||||
*
|
||||
* @param $name String name of function called
|
||||
* @return String
|
||||
* @throws Exception if not a valid parameter, or not a 'get' function
|
||||
*/
|
||||
public function __call($name,$parameters)
|
||||
{
|
||||
if(!preg_match('/^get/',$name))
|
||||
{
|
||||
throw new Exception('No such function "' . $name . '"');
|
||||
}
|
||||
|
||||
$name = preg_replace('/^get/','',$name);
|
||||
|
||||
$property_key = gapi::array_key_exists_nc($name,$this->properties);
|
||||
|
||||
if($property_key)
|
||||
{
|
||||
return $this->properties[$property_key];
|
||||
}
|
||||
|
||||
throw new Exception('No valid property called "' . $name . '"');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class gapiReportEntry
|
||||
*
|
||||
* Storage for individual gapi report entries
|
||||
*
|
||||
*/
|
||||
class gapiReportEntry
|
||||
{
|
||||
private $metrics = array();
|
||||
private $dimensions = array();
|
||||
|
||||
public function __construct($metrics,$dimesions)
|
||||
{
|
||||
$this->metrics = $metrics;
|
||||
$this->dimensions = $dimesions;
|
||||
}
|
||||
|
||||
/**
|
||||
* toString function to return the name of the result
|
||||
* this is a concatented string of the dimesions chosen
|
||||
*
|
||||
* For example:
|
||||
* 'Firefox 3.0.10' from browser and browserVersion
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if(is_array($this->dimensions))
|
||||
{
|
||||
return implode(' ',$this->dimensions);
|
||||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an associative array of the dimesions
|
||||
* and the matching values for the current result
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getDimesions()
|
||||
{
|
||||
return $this->dimensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of the metrics and the matchning
|
||||
* values for the current result
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
public function getMetrics()
|
||||
{
|
||||
return $this->metrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call method to find a matching metric or dimension to return
|
||||
*
|
||||
* @param $name String name of function called
|
||||
* @return String
|
||||
* @throws Exception if not a valid metric or dimensions, or not a 'get' function
|
||||
*/
|
||||
public function __call($name,$parameters)
|
||||
{
|
||||
if(!preg_match('/^get/',$name))
|
||||
{
|
||||
throw new Exception('No such function "' . $name . '"');
|
||||
}
|
||||
|
||||
$name = preg_replace('/^get/','',$name);
|
||||
|
||||
$metric_key = gapi::array_key_exists_nc($name,$this->metrics);
|
||||
|
||||
if($metric_key)
|
||||
{
|
||||
return $this->metrics[$metric_key];
|
||||
}
|
||||
|
||||
$dimension_key = gapi::array_key_exists_nc($name,$this->dimensions);
|
||||
|
||||
if($dimension_key)
|
||||
{
|
||||
return $this->dimensions[$dimension_key];
|
||||
}
|
||||
|
||||
throw new Exception('No valid metric or dimesion called "' . $name . '"');
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 947 B |