├── js ├── index.html ├── custom.js ├── bootstrap.min.js └── jquery.js ├── stylesheets ├── index.html ├── grid-18px.png ├── prettify.css ├── extra.css ├── style.css ├── bootstrap-responsive.min.css └── bootstrap-responsive.css ├── fonts ├── UniMon.eot ├── UniMon.ttf ├── iMon.eot ├── iMon.ttf ├── mon3.eot ├── mon3.ttf ├── padauk.eot ├── padauk.ttf ├── zawgyi.eot ├── zawgyi.ttf ├── myanmar3.eot ├── myanmar3.ttf ├── yunghkio.eot ├── yunghkio.ttf ├── masterpiece.ttf ├── ourunicode.eot ├── ourunicode.ttf ├── MyMMUnicodeUniversal.eot ├── MyMMUnicodeUniversal.ttf ├── macos.php ├── .htaccess ├── src │ ├── autoload.php │ └── GoogleAnalytics │ │ ├── Exception.php │ │ ├── Internals │ │ ├── Util.php │ │ ├── X10.php │ │ └── ParameterHolder.php │ │ ├── Page.php │ │ ├── SocialInteraction.php │ │ ├── Session.php │ │ ├── Item.php │ │ ├── Event.php │ │ ├── CustomVariable.php │ │ ├── Transaction.php │ │ ├── Config.php │ │ ├── Campaign.php │ │ ├── Tracker.php │ │ └── Visitor.php ├── tester.php ├── functions.php └── index.php ├── README.md ├── img ├── glyphicons-halflings.png └── glyphicons-halflings-white.png └── index.html /js/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stylesheets/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fonts/UniMon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/UniMon.eot -------------------------------------------------------------------------------- /fonts/UniMon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/UniMon.ttf -------------------------------------------------------------------------------- /fonts/iMon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/iMon.eot -------------------------------------------------------------------------------- /fonts/iMon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/iMon.ttf -------------------------------------------------------------------------------- /fonts/mon3.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/mon3.eot -------------------------------------------------------------------------------- /fonts/mon3.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/mon3.ttf -------------------------------------------------------------------------------- /fonts/padauk.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/padauk.eot -------------------------------------------------------------------------------- /fonts/padauk.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/padauk.ttf -------------------------------------------------------------------------------- /fonts/zawgyi.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/zawgyi.eot -------------------------------------------------------------------------------- /fonts/zawgyi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/zawgyi.ttf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Requirement 2 | ========== 3 | 4 | * Need PHP 5 for using google analytics 5 | -------------------------------------------------------------------------------- /fonts/myanmar3.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/myanmar3.eot -------------------------------------------------------------------------------- /fonts/myanmar3.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/myanmar3.ttf -------------------------------------------------------------------------------- /fonts/yunghkio.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/yunghkio.eot -------------------------------------------------------------------------------- /fonts/yunghkio.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/yunghkio.ttf -------------------------------------------------------------------------------- /fonts/masterpiece.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/masterpiece.ttf -------------------------------------------------------------------------------- /fonts/ourunicode.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/ourunicode.eot -------------------------------------------------------------------------------- /fonts/ourunicode.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/ourunicode.ttf -------------------------------------------------------------------------------- /stylesheets/grid-18px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/stylesheets/grid-18px.png -------------------------------------------------------------------------------- /img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /fonts/MyMMUnicodeUniversal.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/MyMMUnicodeUniversal.eot -------------------------------------------------------------------------------- /fonts/MyMMUnicodeUniversal.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/fonts/MyMMUnicodeUniversal.ttf -------------------------------------------------------------------------------- /img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saturngod/mmwebfonts/HEAD/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /fonts/macos.php: -------------------------------------------------------------------------------- 1 | MacOS"; 10 | } 11 | else 12 | { 13 | echo "

not MacOS

"; 14 | } 15 | -------------------------------------------------------------------------------- /fonts/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Header set Access-Control-Allow-Origin "*" 4 | Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT" 5 | 6 | 7 | 8 | RewriteEngine On 9 | RewriteRule ^/?font=(.*)$ /index.php?font=$1 [L] -------------------------------------------------------------------------------- /fonts/src/autoload.php: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /fonts/tester.php: -------------------------------------------------------------------------------- 1 | "; 16 | if($is_mac) 17 | { 18 | echo "Mac OS
"; 19 | } 20 | 21 | if($is_android) 22 | { 23 | echo "Android OS
"; 24 | } 25 | 26 | if($is_webkit) 27 | { 28 | echo "Web Kit"; 29 | } 30 | -------------------------------------------------------------------------------- /stylesheets/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #268bd2; } 6 | .kwd, .tag { color: #195f91; } 7 | .typ, .atn, .dec, .var { color: #CB4B16; } 8 | .pln { color: #93a1a1; } 9 | pre.prettyprint { 10 | background: #fefbf3; 11 | padding: 9px; 12 | border: 1px solid rgba(0,0,0,.2); 13 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.1); 14 | -moz-box-shadow: 0 1px 2px rgba(0,0,0,.1); 15 | box-shadow: 0 1px 2px rgba(0,0,0,.1); 16 | } 17 | 18 | /* Specify class=linenums on a pre to get line numbering */ 19 | ol.linenums { margin: 0 0 0 40px; } /* IE indents via margin-left */ 20 | ol.linenums li { color: rgba(0,0,0,.15); line-height: 20px; } 21 | /* Alternate shading for lines */ 22 | li.L1, li.L3, li.L5, li.L7, li.L9 { } 23 | 24 | /* 25 | $base03: #002b36; 26 | $base02: #073642; 27 | $base01: #586e75; 28 | $base00: #657b83; 29 | $base0: #839496; 30 | $base1: #93a1a1; 31 | $base2: #eee8d5; 32 | $base3: #fdf6e3; 33 | $yellow: #b58900; 34 | $orange: #cb4b16; 35 | $red: #dc322f; 36 | $magenta: #d33682; 37 | $violet: #6c71c4; 38 | $blue: #268bd2; 39 | $cyan: #2aa198; 40 | $green: #859900; 41 | */ -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Exception.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | /** 32 | * @see Config::$errorSeverity 33 | * @see Tracker::_raiseError() 34 | */ 35 | class Exception extends \Exception { 36 | 37 | } 38 | 39 | ?> -------------------------------------------------------------------------------- /fonts/functions.php: -------------------------------------------------------------------------------- 1 | 1){ 21 | //Then we're using IE 22 | $version = $matches[1]; 23 | 24 | return $version; 25 | } 26 | return 0; 27 | } 28 | 29 | function get_browser_name() { 30 | $user_agent = $_SERVER['HTTP_USER_AGENT']; 31 | if(preg_match("/Firefox/",$user_agent)) 32 | { 33 | return "firefox"; 34 | } 35 | else if(preg_match("/iPhone/",$user_agent)) 36 | { 37 | return "iPhone"; 38 | } 39 | else if(preg_match("/iPad/",$user_agent)) 40 | { 41 | if(preg_match("/iPad; U;/",$user_agent)) 42 | { 43 | return "android"; 44 | } 45 | 46 | return "iPad"; 47 | } 48 | else if(preg_match("/Android/",$user_agent)) 49 | { 50 | return "android"; 51 | } 52 | else if(preg_match("/Chrome/",$user_agent)) 53 | { 54 | return "chrome"; 55 | } 56 | else if(preg_match("/Safari/",$user_agent)) 57 | { 58 | return "safari"; 59 | } 60 | else if(preg_match("/Opera/",$user_agent)) 61 | { 62 | return "opera"; 63 | } 64 | else if(preg_match("/IEMobile/",$user_agent)) 65 | { 66 | return "iemobile"; 67 | } 68 | else if(preg_match("/MSIE/",$user_agent)) 69 | { 70 | return "ie"; 71 | } 72 | } 73 | 74 | function mac_os() { 75 | $user_agent = $_SERVER['HTTP_USER_AGENT']; 76 | if(preg_match("/Macintosh/",$user_agent)) 77 | { 78 | return true; 79 | } 80 | return false; 81 | } 82 | 83 | function android_os() 84 | { 85 | $user_agent = $_SERVER['HTTP_USER_AGENT']; 86 | if(preg_match("/Android/",$user_agent)) 87 | { 88 | return true; 89 | } 90 | return false; 91 | } 92 | 93 | function webKit_browser() 94 | { 95 | $user_agent = $_SERVER['HTTP_USER_AGENT']; 96 | if(preg_match("/WebKit/",$user_agent)) 97 | { 98 | return true; 99 | } 100 | return false; 101 | } 102 | 103 | function currentPageURL() { 104 | $pageURL = 'http'; 105 | if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {$pageURL .= "s";} 106 | $pageURL .= "://"; 107 | if ($_SERVER["SERVER_PORT"] != "80") { 108 | $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["PHP_SELF"]; 109 | } else { 110 | $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; 111 | } 112 | return $pageURL; 113 | } 114 | -------------------------------------------------------------------------------- /stylesheets/extra.css: -------------------------------------------------------------------------------- 1 | #masthead, #footer { 2 | background-color: #049cd9; 3 | background-repeat: no-repeat; 4 | background-image: -webkit-gradient(linear, left top, left bottom, from(#004D9F), to(#049cd9)); 5 | background-image: -webkit-linear-gradient(#004D9F, #049cd9); 6 | background-image: -moz-linear-gradient(#004D9F, #049cd9); 7 | background-image: -o-linear-gradient(top, #004D9F, #049cd9); 8 | background-image: -khtml-gradient(linear, left top, left bottom, from(#004D9F), to(#049cd9)); 9 | filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#004D9F', EndColorStr='#049cd9', GradientType=0); 10 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#004D9F', EndColorStr='#049cd9', GradientType=0))"; 11 | } 12 | #masthead div.inner, #footer div.inner { 13 | background: transparent url(./grid-18px.png) top center; 14 | padding: 45px 0; 15 | -webkit-box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.3); 16 | -moz-box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.3); 17 | box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.3); 18 | } 19 | #masthead h1, 20 | #footer h1, 21 | #masthead p, 22 | #footer p { 23 | color: #fff; 24 | text-shadow: 0 1px 1px rgba(0,0,0,.3); 25 | } 26 | #masthead p a, 27 | #footer p a { 28 | color: #fff; 29 | font-weight: bold; 30 | } 31 | #masthead { 32 | margin-top: 40px; 33 | } 34 | #masthead h1, 35 | #masthead p { 36 | text-align: center; 37 | margin-bottom: 9px; 38 | } 39 | #masthead h1 { 40 | font-size: 54px; 41 | line-height: 1; 42 | text-shadow: 0 1px 2px rgba(0,0,0,.5); 43 | } 44 | #masthead p { 45 | font-weight: 300; 46 | } 47 | #masthead p.lead { 48 | font-size: 20px; 49 | line-height: 27px; 50 | } 51 | 52 | section { 53 | padding-top: 60px; 54 | } 55 | 56 | #footer { 57 | margin-top: 80px; 58 | } 59 | #footer p { 60 | margin-bottom: 0; 61 | color: rgba(255,255,255,.8) 62 | } 63 | #footer p.right { 64 | float: right; 65 | } 66 | 67 | /* 68 | * Myanmar Font Style 69 | */ 70 | 71 | .myanmar3 { 72 | font-family:Myanmar3,Yunghkio,"Masterpiece Uni Sans"; 73 | } 74 | 75 | .yunghkio { 76 | font-family:"Masterpiece Uni Sans",Yunghkio,Myanmar3; 77 | } 78 | 79 | .masterpiece { 80 | font-family:"Masterpiece Uni Sans",Yunghkio,Myanmar3; 81 | } 82 | .zawgyi { 83 | font-family:'Zawgyi-One'; 84 | } 85 | 86 | .padauk { 87 | font-family:"Masterpiece Uni Sans",padauk,Yunghkio,Myanmar3; 88 | } 89 | 90 | .monanonta { 91 | font-family:"MON3 Anonta 1"; 92 | } 93 | 94 | .mymyanmar { 95 | font-family:"MyMyanmar Universal",Myanmar3,Yunghkio,'Masterpiece Uni Sans'; 96 | } 97 | 98 | #codeNormalTab { 99 | 100 | } 101 | 102 | #codeNormalTab > code { 103 | margin-top: -17px; 104 | } 105 | 106 | #codeNormalTab , #codeImportTab , #fontfamilyTab{ 107 | background: #f8f8ff; 108 | } 109 | 110 | -------------------------------------------------------------------------------- /js/custom.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | function generateHighlight() 4 | { 5 | hljs.tabReplace = ' '; //4 spaces 6 | 7 | $("pre > code").each(function(ele,i) { 8 | //fix for hightlight.js erro 9 | var newHTML = $(this).html().replace(/&gt;/gm,">").replace(/&lt;/gm,"<"); 10 | 11 | $(this).html(newHTML); 12 | 13 | }); 14 | 15 | $('pre code').each(function(i, e) {hljs.highlightBlock(e)}); 16 | } 17 | 18 | $('[data-spy="scroll"]').each(function () { 19 | var $spy = $(this).scrollspy('refresh') 20 | }); 21 | //init 22 | generateHighlight(); 23 | 24 | $("#codeImportTab").hide(); 25 | 26 | // $(".menu_click").click(function(){ 27 | 28 | // $(".menu_click").removeClass('active'); 29 | // $(this).addClass('active'); 30 | 31 | // }); 32 | $(".tabs_code").click(function(){ 33 | $(".tabs_code").removeClass('active'); 34 | $(this).addClass('active'); 35 | 36 | console.log($(this).attr('id')); 37 | 38 | if($(this).attr('id')=="standard_click") { 39 | $("#codeNormalTab").show(); 40 | $("#codeImportTab").hide(); 41 | } 42 | else { 43 | $("#codeNormalTab").hide(); 44 | $("#codeImportTab").show(); 45 | } 46 | return false; 47 | }); 48 | 49 | $(".fontselect").change(function(){ 50 | 51 | $("#codeNormal").html("<link rel=\"stylesheet\" href='http://mmwebfonts.comquas.com/fonts/?font="+$(this).val()+"' />"); 52 | $("#codeImport").html("@import url('http://mmwebfonts.comquas.com/fonts/?font="+$(this).val()+"');"); 53 | 54 | font_family=""; 55 | if($(this).val()=="myanmar3") { 56 | font_family="Myanmar3,Yunghkio,'Masterpiece Uni Sans'"; 57 | } 58 | else if($(this).val()=="masterpiece") { 59 | font_family="'Masterpiece Uni Sans',Yunghkio,Myanmar3"; 60 | } 61 | else if($(this).val()=="yunghkio") { 62 | font_family="Yunghkio,Myanmar3,'Masterpiece Uni Sans'"; 63 | } 64 | else if($(this).val()=="padauk") { 65 | font_family="padauk,Yunghkio,Myanmar3,'Masterpiece Uni Sans'"; 66 | } 67 | else if($(this).val()=="mymyanmar") { 68 | font_family="'MyMyanmar Universal',Myanmar3,Yunghkio,'Masterpiece Uni Sans'"; 69 | } 70 | else if($(this).val()=="zawgyi") { 71 | font_family="Zawgyi-One"; 72 | } 73 | else if($(this).val()=="imon") { 74 | font_family="iMon"; 75 | } 76 | else if($(this).val()=="unimon") { 77 | font_family="'Uni Mon'"; 78 | } 79 | else if($(this).val()=="mon3") 80 | { 81 | font_family = "'MON3 Anonta 1'"; 82 | } 83 | 84 | $("#fontfamily").html("font-family:"+font_family+";"); 85 | 86 | generateHighlight(); 87 | }); 88 | }); -------------------------------------------------------------------------------- /stylesheets/style.css: -------------------------------------------------------------------------------- 1 | /* Specify class=linenums on a pre to get line numbering */ 2 | ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ 3 | li.L0, 4 | li.L1, 5 | li.L2, 6 | li.L3, 7 | li.L5, 8 | li.L6, 9 | li.L7, 10 | li.L8 { list-style-type: none /* this is the cause. Just remove it */ } 11 | /* Alternate shading for lines */ 12 | li.L1, 13 | li.L3, 14 | li.L5, 15 | li.L7, 16 | li.L9 { background: #eee } 17 | 18 | 19 | #masthead, #footer { 20 | background-color: #049cd9; 21 | background-repeat: no-repeat; 22 | background-image: -webkit-gradient(linear, left top, left bottom, from(#004D9F), to(#049cd9)); 23 | background-image: -webkit-linear-gradient(#004D9F, #049cd9); 24 | background-image: -moz-linear-gradient(#004D9F, #049cd9); 25 | background-image: -o-linear-gradient(top, #004D9F, #049cd9); 26 | background-image: -khtml-gradient(linear, left top, left bottom, from(#004D9F), to(#049cd9)); 27 | filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#004D9F', EndColorStr='#049cd9', GradientType=0); 28 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#004D9F', EndColorStr='#049cd9', GradientType=0))"; 29 | } 30 | #masthead div.inner, #footer div.inner { 31 | background: transparent url(./grid-18px.png) top center; 32 | padding: 45px 0; 33 | -webkit-box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.3); 34 | -moz-box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.3); 35 | box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.3); 36 | } 37 | #masthead h1, 38 | #footer h1, 39 | #masthead p, 40 | #footer p { 41 | color: #fff; 42 | text-shadow: 0 1px 1px rgba(0,0,0,.3); 43 | } 44 | #masthead p a, 45 | #footer p a { 46 | color: #fff; 47 | font-weight: bold; 48 | } 49 | #masthead { 50 | margin-top: 40px; 51 | } 52 | #masthead h1, 53 | #masthead p { 54 | text-align: center; 55 | margin-bottom: 9px; 56 | } 57 | #masthead h1 { 58 | font-size: 54px; 59 | line-height: 1; 60 | text-shadow: 0 1px 2px rgba(0,0,0,.5); 61 | } 62 | #masthead p { 63 | font-weight: 300; 64 | } 65 | #masthead p.lead { 66 | font-size: 20px; 67 | line-height: 27px; 68 | } 69 | 70 | section { 71 | padding-top: 60px; 72 | } 73 | 74 | #footer { 75 | margin-top: 80px; 76 | } 77 | #footer p { 78 | margin-bottom: 0; 79 | color: rgba(255,255,255,.8) 80 | } 81 | #footer p.right { 82 | float: right; 83 | } 84 | 85 | /* 86 | * Myanmar Font Style 87 | */ 88 | 89 | .myanmar3 { 90 | font-family:Myanmar3,Yunghkio,"Masterpiece Uni Sans"; 91 | } 92 | 93 | .yunghkio { 94 | font-family:"Masterpiece Uni Sans",Yunghkio,Myanmar3; 95 | } 96 | 97 | .masterpiece { 98 | font-family:"Masterpiece Uni Sans",Yunghkio,Myanmar3; 99 | } 100 | .zawgyi { 101 | font-family:'Zawgyi-One'; 102 | } 103 | 104 | .padauk { 105 | font-family:"Masterpiece Uni Sans",padauk,Yunghkio,Myanmar3; 106 | } 107 | 108 | .monanonta { 109 | font-family:"MON3 Anonta 1"; 110 | } 111 | 112 | .mymyanmar { 113 | font-family:"MyMyanmar Universal",Myanmar3,Yunghkio,'Masterpiece Uni Sans'; 114 | } -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Internals/Util.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics\Internals; 30 | 31 | /** 32 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/core/Utils.as 33 | */ 34 | class Util { 35 | 36 | /** 37 | * This class does only have public static methods, no instantiation necessary 38 | */ 39 | private function __construct() { } 40 | 41 | 42 | /** 43 | * Mimics Javascript's encodeURIComponent() function for consistency with the GA Javascript client. 44 | * 45 | * @param mixed $value 46 | * @return string 47 | */ 48 | public static function encodeUriComponent($value) { 49 | return static::convertToUriComponentEncoding(rawurlencode($value)); 50 | } 51 | 52 | /** 53 | * Here as a separate method so it can also be applied to e.g. a http_build_query() result. 54 | * 55 | * @link http://stackoverflow.com/questions/1734250/what-is-the-equivalent-of-javascripts-encodeuricomponent-in-php/1734255#1734255 56 | * @link http://devpro.it/examples/php_js_escaping.php 57 | * 58 | * @param string $encodedValue 59 | * @return string 60 | */ 61 | public static function convertToUriComponentEncoding($encodedValue) { 62 | return str_replace(array('%21', '%2A', '%27', '%28', '%29'), array('!', '*', "'", '(', ')'), $encodedValue); 63 | } 64 | 65 | /** 66 | * Generates a 32bit random number. 67 | * 68 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/core/Utils.as#33 69 | * @return int 70 | */ 71 | public static function generate32bitRandom() { 72 | return round((rand() / getrandmax()) * 0x7fffffff); 73 | } 74 | 75 | /** 76 | * Generates a hash for input string. 77 | * 78 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/core/Utils.as#44 79 | * @param string $string 80 | * @return int 81 | */ 82 | public static function generateHash($string) { 83 | $string = (string)$string; 84 | $hash = 1; 85 | 86 | if($string !== null && $string !== '') { 87 | $hash = 0; 88 | 89 | $length = strlen($string); 90 | for($pos = $length - 1; $pos >= 0; $pos--) { 91 | $current = ord($string[$pos]); 92 | $hash = (($hash << 6) & 0xfffffff) + $current + ($current << 14); 93 | $leftMost7 = $hash & 0xfe00000; 94 | if($leftMost7 != 0) { 95 | $hash ^= $leftMost7 >> 21; 96 | } 97 | } 98 | } 99 | 100 | return $hash; 101 | } 102 | 103 | } 104 | 105 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Page.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | class Page { 32 | 33 | /** 34 | * Page request URI, e.g. "/path/page.html", will be mapped to 35 | * "utmp" parameter 36 | * 37 | * @see Internals\ParameterHolder::$utmp 38 | * @var string 39 | */ 40 | protected $path; 41 | 42 | /** 43 | * Page title, will be mapped to "utmdt" parameter 44 | * 45 | * @see Internals\ParameterHolder::$utmdt 46 | * @var string 47 | */ 48 | protected $title; 49 | 50 | /** 51 | * Charset encoding (e.g. "UTF-8"), will be mapped to "utmcs" parameter 52 | * 53 | * @see Internals\ParameterHolder::$utmcs 54 | * @var string 55 | */ 56 | protected $charset; 57 | 58 | /** 59 | * Referer URL, e.g. "http://www.example.com/path/page.html", will be 60 | * mapped to "utmr" parameter 61 | * 62 | * @see Internals\ParameterHolder::$utmr 63 | * @var string 64 | */ 65 | protected $referrer; 66 | 67 | 68 | /** 69 | * Constant to mark referrer as a site-internal one. 70 | * 71 | * @see Page::$referrer 72 | * @const string 73 | */ 74 | const REFERRER_INTERNAL = '0'; 75 | 76 | 77 | /** 78 | * @param string $path 79 | */ 80 | public function __construct($path) { 81 | $this->setPath($path); 82 | } 83 | 84 | /** 85 | * @param string $path 86 | */ 87 | public function setPath($path) { 88 | if($path && $path[0] != '/') { 89 | Tracker::_raiseError('The page path should always start with a slash ("/").', __METHOD__); 90 | } 91 | 92 | $this->path = $path; 93 | } 94 | 95 | /** 96 | * @return string 97 | */ 98 | public function getPath() { 99 | return $this->path; 100 | } 101 | 102 | /** 103 | * @param string $title 104 | */ 105 | public function setTitle($title) { 106 | $this->title = $title; 107 | } 108 | 109 | /** 110 | * @return string 111 | */ 112 | public function getTitle() { 113 | return $this->title; 114 | } 115 | 116 | /** 117 | * @param string $charset 118 | */ 119 | public function setCharset($encoding) { 120 | $this->charset = $encoding; 121 | } 122 | 123 | /** 124 | * @return string 125 | */ 126 | public function getCharset() { 127 | return $this->charset; 128 | } 129 | 130 | /** 131 | * @param string $referrer 132 | */ 133 | public function setReferrer($referrer) { 134 | $this->referrer = $referrer; 135 | } 136 | 137 | /** 138 | * @return string 139 | */ 140 | public function getReferrer() { 141 | return $this->referrer; 142 | } 143 | 144 | } 145 | 146 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/SocialInteraction.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | class SocialInteraction { 32 | 33 | /** 34 | * Required. A string representing the social network being tracked (e.g. "Facebook", "Twitter", "LinkedIn", ...), 35 | * will be mapped to "utmsn" parameter 36 | * 37 | * @see Internals\ParameterHolder::$utmsn 38 | * @var string 39 | */ 40 | protected $network; 41 | 42 | /** 43 | * Required. A string representing the social action being tracked (e.g. "Like", "Share", "Tweet", ...), 44 | * will be mapped to "utmsa" parameter 45 | * 46 | * @see Internals\ParameterHolder::$utmsa 47 | * @var string 48 | */ 49 | protected $action; 50 | 51 | /** 52 | * Optional. A string representing the URL (or resource) which receives the action. For example, 53 | * if a user clicks the Like button on a page on a site, the the target might be set to the title 54 | * of the page, or an ID used to identify the page in a content management system. In many cases, 55 | * the page you Like is the same page you are on. So if this parameter is not given, we will default 56 | * to using the path of the corresponding Page object. 57 | * 58 | * @see Internals\ParameterHolder::$utmsid 59 | * @var string 60 | */ 61 | protected $target; 62 | 63 | 64 | /** 65 | * @param string $path 66 | */ 67 | public function __construct($network = null, $action = null, $target = null) { 68 | if($network !== null) $this->setNetwork($network); 69 | if($action !== null) $this->setAction($action); 70 | if($target !== null) $this->setTarget($target); 71 | } 72 | 73 | public function validate() { 74 | if($this->network === null || $this->action === null) { 75 | Tracker::_raiseError('Social interactions need to have at least the "network" and "action" attributes defined.', __METHOD__); 76 | } 77 | } 78 | 79 | /** 80 | * @param string $network 81 | */ 82 | public function setNetwork($network) { 83 | $this->network = $network; 84 | } 85 | 86 | /** 87 | * @return string 88 | */ 89 | public function getNetwork() { 90 | return $this->network; 91 | } 92 | 93 | /** 94 | * @param string $action 95 | */ 96 | public function setAction($action) { 97 | $this->action = $action; 98 | } 99 | 100 | /** 101 | * @return string 102 | */ 103 | public function getAction() { 104 | return $this->action; 105 | } 106 | 107 | /** 108 | * @param string $target 109 | */ 110 | public function setTarget($target) { 111 | $this->target = $target; 112 | } 113 | 114 | /** 115 | * @return string 116 | */ 117 | public function getTarget() { 118 | return $this->target; 119 | } 120 | 121 | } 122 | 123 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Session.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | use UnitedPrototype\GoogleAnalytics\Internals\Util; 32 | 33 | use DateTime; 34 | 35 | /** 36 | * You should serialize this object and store it in the user session to keep it 37 | * persistent between requests (similar to the "__umtb" cookie of 38 | * the GA Javascript client). 39 | */ 40 | class Session { 41 | 42 | /** 43 | * A unique per-session ID, will be mapped to "utmhid" parameter 44 | * 45 | * @see Internals\ParameterHolder::$utmhid 46 | * @var int 47 | */ 48 | protected $sessionId; 49 | 50 | /** 51 | * The amount of pageviews that were tracked within this session so far, 52 | * will be part of the "__utmb" cookie parameter. 53 | * 54 | * Will get incremented automatically upon each request. 55 | * 56 | * @see Internals\ParameterHolder::$__utmb 57 | * @see Internals\Request\Request::buildHttpRequest() 58 | * @var int 59 | */ 60 | protected $trackCount; 61 | 62 | /** 63 | * Timestamp of the start of this new session, will be part of the "__utmb" 64 | * cookie parameter 65 | * 66 | * @see Internals\ParameterHolder::$__utmb 67 | * @var DateTime 68 | */ 69 | protected $startTime; 70 | 71 | 72 | public function __construct() { 73 | $this->setSessionId($this->generateSessionId()); 74 | $this->setTrackCount(0); 75 | $this->setStartTime(new DateTime()); 76 | } 77 | 78 | /** 79 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/core/DocumentInfo.as#52 80 | * @return int 81 | */ 82 | protected function generateSessionId() { 83 | // TODO: Integrate AdSense support 84 | return Util::generate32bitRandom(); 85 | } 86 | 87 | /** 88 | * @return int 89 | */ 90 | public function getSessionId() { 91 | return $this->sessionId; 92 | } 93 | 94 | /** 95 | * @param int $sessionId 96 | */ 97 | public function setSessionId($sessionId) { 98 | $this->sessionId = $sessionId; 99 | } 100 | 101 | /** 102 | * @return int 103 | */ 104 | public function getTrackCount() { 105 | return $this->trackCount; 106 | } 107 | 108 | /** 109 | * @param int $trackCount 110 | */ 111 | public function setTrackCount($trackCount) { 112 | $this->trackCount = (int)$trackCount; 113 | } 114 | 115 | /** 116 | * @param int $byAmount 117 | */ 118 | public function increaseTrackCount($byAmount = 1) { 119 | $this->trackCount += $byAmount; 120 | } 121 | 122 | /** 123 | * @return DateTime 124 | */ 125 | public function getStartTime() { 126 | return $this->startTime; 127 | } 128 | 129 | /** 130 | * @param DateTime $startTime 131 | */ 132 | public function setStartTime(DateTime $startTime) { 133 | $this->startTime = $startTime; 134 | } 135 | 136 | } 137 | 138 | ?> -------------------------------------------------------------------------------- /fonts/index.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | /** 32 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/ecommerce/Item.as 33 | */ 34 | class Item { 35 | 36 | /** 37 | * Order ID, e.g. "a2343898", will be mapped to "utmtid" parameter 38 | * 39 | * @see Internals\ParameterHolder::$utmtid 40 | * @var string 41 | */ 42 | protected $orderId; 43 | 44 | /** 45 | * Product Code. This is the sku code for a given product, e.g. "989898ajssi", 46 | * will be mapped to "utmipc" parameter 47 | * 48 | * @see Internals\ParameterHolder::$utmipc 49 | * @var string 50 | */ 51 | protected $sku; 52 | 53 | /** 54 | * Product Name, e.g. "T-Shirt", will be mapped to "utmipn" parameter 55 | * 56 | * @see Internals\ParameterHolder::$utmipn 57 | * @var string 58 | */ 59 | protected $name; 60 | 61 | /** 62 | * Variations on an item, e.g. "white", "black", "green" etc., will be mapped 63 | * to "utmiva" parameter 64 | * 65 | * @see Internals\ParameterHolder::$utmiva 66 | * @var string 67 | */ 68 | protected $variation; 69 | 70 | /** 71 | * Unit Price. Value is set to numbers only (e.g. 19.95), will be mapped to 72 | * "utmipr" parameter 73 | * 74 | * @see Internals\ParameterHolder::$utmipr 75 | * @var float 76 | */ 77 | protected $price; 78 | 79 | /** 80 | * Unit Quantity, e.g. 4, will be mapped to "utmiqt" parameter 81 | * 82 | * @see Internals\ParameterHolder::$utmiqt 83 | * @var int 84 | */ 85 | protected $quantity = 1; 86 | 87 | 88 | public function validate() { 89 | if($this->sku === null) { 90 | Tracker::_raiseError('Items need to have a sku/product code defined.', __METHOD__); 91 | } 92 | } 93 | 94 | /** 95 | * @return string 96 | */ 97 | public function getOrderId() { 98 | return $this->orderId; 99 | } 100 | 101 | /** 102 | * @param string $orderId 103 | */ 104 | public function setOrderId($orderId) { 105 | $this->orderId = $orderId; 106 | } 107 | 108 | /** 109 | * @return string 110 | */ 111 | public function getSku() { 112 | return $this->sku; 113 | } 114 | 115 | /** 116 | * @param string $sku 117 | */ 118 | public function setSku($sku) { 119 | $this->sku = $sku; 120 | } 121 | 122 | /** 123 | * @return string 124 | */ 125 | public function getName() { 126 | return $this->name; 127 | } 128 | 129 | /** 130 | * @param string $name 131 | */ 132 | public function setName($name) { 133 | $this->name = $name; 134 | } 135 | 136 | /** 137 | * @return string 138 | */ 139 | public function getVariation() { 140 | return $this->variation; 141 | } 142 | 143 | /** 144 | * @param string $variation 145 | */ 146 | public function setVariation($variation) { 147 | $this->variation = $variation; 148 | } 149 | 150 | /** 151 | * @return float 152 | */ 153 | public function getPrice() { 154 | return $this->price; 155 | } 156 | 157 | /** 158 | * @param float $price 159 | */ 160 | public function setPrice($price) { 161 | $this->price = (float)$price; 162 | } 163 | 164 | /** 165 | * @return int 166 | */ 167 | public function getQuantity() { 168 | return $this->quantity; 169 | } 170 | 171 | /** 172 | * @param int $quantity 173 | */ 174 | public function setQuantity($quantity) { 175 | $this->quantity = (int)$quantity; 176 | } 177 | 178 | } 179 | 180 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Event.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | /** 32 | * @link http://code.google.com/apis/analytics/docs/tracking/eventTrackerOverview.html 33 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEventTracking.html 34 | */ 35 | class Event { 36 | 37 | /** 38 | * The general event category (e.g. "Videos"). 39 | * 40 | * @var string 41 | */ 42 | protected $category; 43 | 44 | /** 45 | * The action for the event (e.g. "Play"). 46 | * 47 | * @var string 48 | */ 49 | protected $action; 50 | 51 | /** 52 | * An optional descriptor for the event (e.g. the video's title). 53 | * 54 | * @var string 55 | */ 56 | protected $label; 57 | 58 | /** 59 | * An optional value associated with the event. You can see your event values in the Overview, 60 | * Categories, and Actions reports, where they are listed by event or aggregated across events, 61 | * depending upon your report view. 62 | * 63 | * @var int 64 | */ 65 | protected $value; 66 | 67 | /** 68 | * Default value is false. By default, event hits will impact a visitor's bounce rate. 69 | * By setting this parameter to true, this event hit will not be used in bounce rate calculations. 70 | * 71 | * @var bool 72 | */ 73 | protected $noninteraction = false; 74 | 75 | 76 | /** 77 | * @param string $category 78 | * @param string $action 79 | * @param string $label 80 | * @param int $value 81 | * @param bool $noninteraction 82 | */ 83 | public function __construct($category = null, $action = null, $label = null, $value = null, $noninteraction = null) { 84 | if($category !== null) $this->setCategory($category); 85 | if($action !== null) $this->setAction($action); 86 | if($label !== null) $this->setLabel($label); 87 | if($value !== null) $this->setValue($value); 88 | if($noninteraction !== null) $this->setNoninteraction($noninteraction); 89 | } 90 | 91 | public function validate() { 92 | if($this->category === null || $this->action === null) { 93 | Tracker::_raiseError('Events need at least to have a category and action defined.', __METHOD__); 94 | } 95 | } 96 | 97 | /** 98 | * @return string 99 | */ 100 | public function getCategory() { 101 | return $this->category; 102 | } 103 | 104 | /** 105 | * @param string $category 106 | */ 107 | public function setCategory($category) { 108 | $this->category = $category; 109 | } 110 | 111 | /** 112 | * @return string 113 | */ 114 | public function getAction() { 115 | return $this->action; 116 | } 117 | 118 | /** 119 | * @param string $action 120 | */ 121 | public function setAction($action) { 122 | $this->action = $action; 123 | } 124 | 125 | /** 126 | * @return string 127 | */ 128 | public function getLabel() { 129 | return $this->label; 130 | } 131 | 132 | /** 133 | * @param string $label 134 | */ 135 | public function setLabel($label) { 136 | $this->label = $label; 137 | } 138 | 139 | /** 140 | * @return int 141 | */ 142 | public function getValue() { 143 | return $this->value; 144 | } 145 | 146 | /** 147 | * @param int $value 148 | */ 149 | public function setValue($value) { 150 | $this->value = (int)$value; 151 | } 152 | 153 | /** 154 | * @return bool 155 | */ 156 | public function getNoninteraction() { 157 | return $this->noninteraction; 158 | } 159 | 160 | /** 161 | * @param bool $value 162 | */ 163 | public function setNoninteraction($value) { 164 | $this->noninteraction = (bool)$value; 165 | } 166 | 167 | } 168 | 169 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/CustomVariable.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | use UnitedPrototype\GoogleAnalytics\Internals\Util; 32 | 33 | /** 34 | * @link http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html 35 | */ 36 | class CustomVariable { 37 | 38 | /** 39 | * @var int 40 | */ 41 | protected $index; 42 | 43 | /** 44 | * WATCH OUT: It's a known issue that GA will not decode URL-encoded characters 45 | * in custom variable names and values properly, so spaces will show up 46 | * as "%20" in the interface etc. 47 | * 48 | * @link http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=2cdb3ec0be32e078 49 | * @var string 50 | */ 51 | protected $name; 52 | 53 | /** 54 | * WATCH OUT: It's a known issue that GA will not decode URL-encoded characters 55 | * in custom variable names and values properly, so spaces will show up 56 | * as "%20" in the interface etc. 57 | * 58 | * @link http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=2cdb3ec0be32e078 59 | * @var mixed 60 | */ 61 | protected $value; 62 | 63 | /** 64 | * See SCOPE_* constants 65 | * 66 | * @var int 67 | */ 68 | protected $scope = self::SCOPE_PAGE; 69 | 70 | 71 | /** 72 | * @const int 73 | */ 74 | const SCOPE_VISITOR = 1; 75 | /** 76 | * @const int 77 | */ 78 | const SCOPE_SESSION = 2; 79 | /** 80 | * @const int 81 | */ 82 | const SCOPE_PAGE = 3; 83 | 84 | 85 | /** 86 | * @param int $index 87 | * @param string $name 88 | * @param mixed $value 89 | * @param int $scope See SCOPE_* constants 90 | */ 91 | public function __construct($index = null, $name = null, $value = null, $scope = null) { 92 | if($index !== null) $this->setIndex($index); 93 | if($name !== null) $this->setName($name); 94 | if($value !== null) $this->setValue($value); 95 | if($scope !== null) $this->setScope($scope); 96 | } 97 | 98 | public function validate() { 99 | // According to the GA documentation, there is a limit to the combined size of 100 | // name and value of 64 bytes after URL encoding, 101 | // see http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#varTypes 102 | // and http://xahlee.org/js/google_analytics_tracker_2010-07-01_expanded.js line 563 103 | if(strlen(Util::encodeUriComponent($this->name . $this->value)) > 64) { 104 | Tracker::_raiseError('Custom Variable combined name and value encoded length must not be larger than 64 bytes.', __METHOD__); 105 | } 106 | } 107 | 108 | /** 109 | * @return int 110 | */ 111 | public function getIndex() { 112 | return $this->index; 113 | } 114 | 115 | /** 116 | * @link http://code.google.com/intl/de-DE/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#usage 117 | * @param int $index 118 | */ 119 | public function setIndex($index) { 120 | // Custom Variables are limited to five slots officially, but there seems to be a 121 | // trick to allow for more of them which we could investigate at a later time (see 122 | // http://analyticsimpact.com/2010/05/24/get-more-than-5-custom-variables-in-google-analytics/) 123 | if($index < 1 || $index > 5) { 124 | Tracker::_raiseError('Custom Variable index has to be between 1 and 5.', __METHOD__); 125 | } 126 | 127 | $this->index = (int)$index; 128 | } 129 | 130 | /** 131 | * @return string 132 | */ 133 | public function getName() { 134 | return $this->name; 135 | } 136 | 137 | /** 138 | * @param string $name 139 | */ 140 | public function setName($name) { 141 | $this->name = $name; 142 | } 143 | 144 | /** 145 | * @return mixed 146 | */ 147 | public function getValue() { 148 | return $this->value; 149 | } 150 | 151 | /** 152 | * @param mixed $value 153 | */ 154 | public function setValue($value) { 155 | $this->value = $value; 156 | } 157 | 158 | /** 159 | * @return int 160 | */ 161 | public function getScope() { 162 | return $this->scope; 163 | } 164 | 165 | /** 166 | * @param int $scope 167 | */ 168 | public function setScope($scope) { 169 | if(!in_array($scope, array(self::SCOPE_PAGE, self::SCOPE_SESSION, self::SCOPE_VISITOR))) { 170 | Tracker::_raiseError('Custom Variable scope has to be one of the CustomVariable::SCOPE_* constant values.', __METHOD__); 171 | } 172 | 173 | $this->scope = (int)$scope; 174 | } 175 | 176 | } 177 | 178 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Transaction.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | /** 32 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/ecommerce/Transaction.as 33 | */ 34 | class Transaction { 35 | 36 | /** 37 | * Order ID, e.g. "a2343898", will be mapped to "utmtid" parameter 38 | * 39 | * @see Internals\ParameterHolder::$utmtid 40 | * @var string 41 | */ 42 | protected $orderId; 43 | 44 | /** 45 | * Affiliation, Will be mapped to "utmtst" parameter 46 | * 47 | * @see Internals\ParameterHolder::$utmtst 48 | * @var string 49 | */ 50 | protected $affiliation; 51 | 52 | /** 53 | * Total Cost, will be mapped to "utmtto" parameter 54 | * 55 | * @see Internals\ParameterHolder::$utmtto 56 | * @var float 57 | */ 58 | protected $total; 59 | 60 | /** 61 | * Tax Cost, will be mapped to "utmttx" parameter 62 | * 63 | * @see Internals\ParameterHolder::$utmttx 64 | * @var float 65 | */ 66 | protected $tax; 67 | 68 | /** 69 | * Shipping Cost, values as for unit and price, e.g. 3.95, will be mapped to 70 | * "utmtsp" parameter 71 | * 72 | * @see Internals\ParameterHolder::$utmtsp 73 | * @var float 74 | */ 75 | protected $shipping; 76 | 77 | /** 78 | * Billing City, e.g. "Cologne", will be mapped to "utmtci" parameter 79 | * 80 | * @see Internals\ParameterHolder::$utmtci 81 | * @var string 82 | */ 83 | protected $city; 84 | 85 | /** 86 | * Billing Region, e.g. "North Rhine-Westphalia", will be mapped to "utmtrg" parameter 87 | * 88 | * @see Internals\ParameterHolder::$utmtrg 89 | * @var string 90 | */ 91 | protected $region; 92 | 93 | /** 94 | * Billing Country, e.g. "Germany", will be mapped to "utmtco" parameter 95 | * 96 | * @see Internals\ParameterHolder::$utmtco 97 | * @var string 98 | */ 99 | protected $country; 100 | 101 | /** 102 | * @see Transaction::addItem() 103 | * @var \UnitedPrototype\GoogleAnalytics\Item[] 104 | */ 105 | protected $items = array(); 106 | 107 | 108 | public function validate() { 109 | if(!$this->items) { 110 | Tracker::_raiseError('Transactions need to consist of at least one item.', __METHOD__); 111 | } 112 | } 113 | 114 | /** 115 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEcommerce.html#_gat.GA_Tracker_._addItem 116 | * @param \UnitedPrototype\GoogleAnalytics\Item $item 117 | */ 118 | public function addItem(Item $item) { 119 | // Associated items inherit the transaction's order ID 120 | $item->setOrderId($this->orderId); 121 | 122 | $sku = $item->getSku(); 123 | $this->items[$sku] = $item; 124 | } 125 | 126 | /** 127 | * @return \UnitedPrototype\GoogleAnalytics\Item[] 128 | */ 129 | public function getItems() { 130 | return $this->items; 131 | } 132 | 133 | /** 134 | * @return string 135 | */ 136 | public function getOrderId() { 137 | return $this->orderId; 138 | } 139 | 140 | /** 141 | * @param string $orderId 142 | */ 143 | public function setOrderId($orderId) { 144 | $this->orderId = $orderId; 145 | 146 | // Update order IDs of all associated items too 147 | foreach($this->items as $item) { 148 | $item->setOrderId($orderId); 149 | } 150 | } 151 | 152 | /** 153 | * @return string 154 | */ 155 | public function getAffiliation() { 156 | return $this->affiliation; 157 | } 158 | 159 | /** 160 | * @param string $affiliation 161 | */ 162 | public function setAffiliation($affiliation) { 163 | $this->affiliation = $affiliation; 164 | } 165 | 166 | /** 167 | * @return float 168 | */ 169 | public function getTotal() { 170 | return $this->total; 171 | } 172 | 173 | /** 174 | * @param float $total 175 | */ 176 | public function setTotal($total) { 177 | $this->total = $total; 178 | } 179 | 180 | /** 181 | * @return float 182 | */ 183 | public function getTax() { 184 | return $this->tax; 185 | } 186 | 187 | /** 188 | * @param float $tax 189 | */ 190 | public function setTax($tax) { 191 | $this->tax = $tax; 192 | } 193 | 194 | /** 195 | * @return float 196 | */ 197 | public function getShipping() { 198 | return $this->shipping; 199 | } 200 | 201 | /** 202 | * @param float $shipping 203 | */ 204 | public function setShipping($shipping) { 205 | $this->shipping = $shipping; 206 | } 207 | 208 | /** 209 | * @return string 210 | */ 211 | public function getCity() { 212 | return $this->city; 213 | } 214 | 215 | /** 216 | * @param string $city 217 | */ 218 | public function setCity($city) { 219 | $this->city = $city; 220 | } 221 | 222 | /** 223 | * @return string 224 | */ 225 | public function getRegion() { 226 | return $this->region; 227 | } 228 | 229 | /** 230 | * @param string $region 231 | */ 232 | public function setRegion($region) { 233 | $this->region = $region; 234 | } 235 | 236 | /** 237 | * @return string 238 | */ 239 | public function getCountry() { 240 | return $this->country; 241 | } 242 | 243 | /** 244 | * @param string $country 245 | */ 246 | public function setCountry($country) { 247 | $this->country = $country; 248 | } 249 | 250 | } 251 | 252 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Config.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | /** 32 | * Note: Doesn't necessarily have to be consistent across requests, as it doesn't 33 | * alter the actual tracking result. 34 | * 35 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/core/GIFRequest.as 36 | */ 37 | class Config { 38 | 39 | /** 40 | * How strict should errors get handled? After all, we do just do some 41 | * tracking stuff here, and errors shouldn't break an application's 42 | * functionality in production. 43 | * RECOMMENDATION: Exceptions during deveopment, warnings in production. 44 | * 45 | * Assign any value of the self::ERROR_SEVERITY_* constants. 46 | * 47 | * @see Tracker::_raiseError() 48 | * @var int 49 | */ 50 | protected $errorSeverity = self::ERROR_SEVERITY_EXCEPTIONS; 51 | 52 | /** 53 | * Ignore all errors completely. 54 | */ 55 | const ERROR_SEVERITY_SILENCE = 0; 56 | /** 57 | * Trigger PHP errors with a E_USER_WARNING error level. 58 | */ 59 | const ERROR_SEVERITY_WARNINGS = 1; 60 | /** 61 | * Throw UnitedPrototype\GoogleAnalytics\Exception exceptions. 62 | */ 63 | const ERROR_SEVERITY_EXCEPTIONS = 2; 64 | 65 | /** 66 | * Whether to just queue all requests on HttpRequest::fire() and actually send 67 | * them on PHP script shutdown after all other tasks are done. 68 | * 69 | * This has two advantages: 70 | * 1) It effectively doesn't affect app performance 71 | * 2) It can e.g. handle custom variables that were set after scheduling a request 72 | * 73 | * @see Internals\Request\HttpRequest::fire() 74 | * @var bool 75 | */ 76 | protected $sendOnShutdown = false; 77 | 78 | /** 79 | * Whether to make asynchronous requests to GA without waiting for any 80 | * response (speeds up doing requests). 81 | * 82 | * @see Internals\Request\HttpRequest::send() 83 | * @var bool 84 | */ 85 | protected $fireAndForget = false; 86 | 87 | /** 88 | * Logging callback, registered via setLoggingCallback(). Will be fired 89 | * whenever a request gets sent out and receives the full HTTP request 90 | * as the first and the full HTTP response (or null if the "fireAndForget" 91 | * option or simulation mode are used) as the second argument. 92 | * 93 | * @var \Closure 94 | */ 95 | protected $loggingCallback; 96 | 97 | /** 98 | * Seconds (float allowed) to wait until timeout when connecting to the 99 | * Google analytics endpoint host 100 | * 101 | * @see Internals\Request\HttpRequest::send() 102 | * @var float 103 | */ 104 | protected $requestTimeout = 1; 105 | 106 | // FIXME: Add SSL support, https://ssl.google-analytics.com 107 | 108 | /** 109 | * Google Analytics tracking request endpoint host. Can be set to null to 110 | * silently simulate (and log) requests without actually sending them. 111 | * 112 | * @see Internals\Request\HttpRequest::send() 113 | * @var string 114 | */ 115 | protected $endPointHost = 'www.google-analytics.com'; 116 | 117 | /** 118 | * Google Analytics tracking request endpoint path 119 | * 120 | * @see Internals\Request\HttpRequest::send() 121 | * @var string 122 | */ 123 | protected $endPointPath = '/__utm.gif'; 124 | 125 | /** 126 | * Whether to anonymize IP addresses within Google Analytics by stripping 127 | * the last IP address block, will be mapped to "aip" parameter 128 | * 129 | * @see Internals\ParameterHolder::$aip 130 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApi_gat.html#_gat._anonymizeIp 131 | * @var bool 132 | */ 133 | protected $anonymizeIpAddresses = false; 134 | 135 | 136 | /** 137 | * @param array $properties 138 | */ 139 | public function __construct(array $properties = array()) { 140 | foreach($properties as $property => $value) { 141 | // PHP doesn't care about case in method names 142 | $setterMethod = 'set' . $property; 143 | 144 | if(method_exists($this, $setterMethod)) { 145 | $this->$setterMethod($value); 146 | } else { 147 | return Tracker::_raiseError('There is no setting "' . $property . '".', __METHOD__); 148 | } 149 | } 150 | } 151 | 152 | /** 153 | * @return int See self::ERROR_SEVERITY_* constants 154 | */ 155 | public function getErrorSeverity() { 156 | return $this->errorSeverity; 157 | } 158 | 159 | /** 160 | * @param int $errorSeverity See self::ERROR_SEVERITY_* constants 161 | */ 162 | public function setErrorSeverity($errorSeverity) { 163 | $this->errorSeverity = $errorSeverity; 164 | } 165 | 166 | /** 167 | * @return bool 168 | */ 169 | public function getSendOnShutdown() { 170 | return $this->sendOnShutdown; 171 | } 172 | 173 | /** 174 | * @param bool $sendOnShutdown 175 | */ 176 | public function setSendOnShutdown($sendOnShutdown) { 177 | $this->sendOnShutdown = $sendOnShutdown; 178 | } 179 | 180 | /** 181 | * @return bool 182 | */ 183 | public function getFireAndForget() { 184 | return $this->fireAndForget; 185 | } 186 | 187 | /** 188 | * @param bool $fireAndForget 189 | */ 190 | public function setFireAndForget($fireAndForget) { 191 | $this->fireAndForget = (bool)$fireAndForget; 192 | } 193 | 194 | /** 195 | * @return \Closure|null 196 | */ 197 | public function getLoggingCallback() { 198 | return $this->loggingCallback; 199 | } 200 | 201 | /** 202 | * @param \Closure $callback 203 | */ 204 | public function setLoggingCallback(\Closure $callback) { 205 | $this->loggingCallback = $callback; 206 | } 207 | 208 | /** 209 | * @return float 210 | */ 211 | public function getRequestTimeout() { 212 | return $this->requestTimeout; 213 | } 214 | 215 | /** 216 | * @param float $requestTimeout 217 | */ 218 | public function setRequestTimeout($requestTimeout) { 219 | $this->requestTimeout = (float)$requestTimeout; 220 | } 221 | 222 | /** 223 | * @return string|null 224 | */ 225 | public function getEndPointHost() { 226 | return $this->endPointHost; 227 | } 228 | 229 | /** 230 | * @param string|null $endPointHost 231 | */ 232 | public function setEndPointHost($endPointHost) { 233 | $this->endPointHost = $endPointHost; 234 | } 235 | 236 | /** 237 | * @return string 238 | */ 239 | public function getEndPointPath() { 240 | return $this->endPointPath; 241 | } 242 | 243 | /** 244 | * @param string $endPointPath 245 | */ 246 | public function setEndPointPath($endPointPath) { 247 | $this->endPointPath = $endPointPath; 248 | } 249 | 250 | /** 251 | * @return bool 252 | */ 253 | public function getAnonymizeIpAddresses() { 254 | return $this->anonymizeIpAddresses; 255 | } 256 | 257 | /** 258 | * @param bool $anonymizeIpAddresses 259 | */ 260 | public function setAnonymizeIpAddresses($anonymizeIpAddresses) { 261 | $this->anonymizeIpAddresses = $anonymizeIpAddresses; 262 | } 263 | 264 | } 265 | 266 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Internals/X10.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics\Internals; 30 | 31 | /** 32 | * This is nearly a 1:1 PHP port of the gaforflash X10 class code. 33 | * 34 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/data/X10.as 35 | */ 36 | class X10 { 37 | 38 | /** 39 | * @var array 40 | */ 41 | protected $projectData = array(); 42 | 43 | 44 | /** 45 | * @var string 46 | */ 47 | protected $KEY = 'k'; 48 | 49 | /** 50 | * @var string 51 | */ 52 | protected $VALUE = 'v'; 53 | 54 | /** 55 | * @var array 56 | */ 57 | protected $SET = array('k', 'v'); 58 | 59 | /** 60 | * Opening delimiter for wrapping a set of values belonging to the same type. 61 | * @var string 62 | */ 63 | protected $DELIM_BEGIN = '('; 64 | 65 | /** 66 | * Closing delimiter for wrapping a set of values belonging to the same type. 67 | * @var string 68 | */ 69 | protected $DELIM_END = ')'; 70 | 71 | /** 72 | * Delimiter between two consecutive num/value pairs. 73 | * @var string 74 | */ 75 | protected $DELIM_SET = '*'; 76 | 77 | /** 78 | * Delimiter between a num and its corresponding value. 79 | * @var string 80 | */ 81 | protected $DELIM_NUM_VALUE = '!'; 82 | 83 | /** 84 | * Mapping of escapable characters to their escaped forms. 85 | * 86 | * @var array 87 | */ 88 | protected $ESCAPE_CHAR_MAP = array( 89 | "'" => "'0", 90 | ')' => "'1", 91 | '*' => "'2", 92 | '!' => "'3", 93 | ); 94 | 95 | /** 96 | * @var int 97 | */ 98 | protected $MINIMUM = 1; 99 | 100 | 101 | /** 102 | * @param int $projectId 103 | * @return bool 104 | */ 105 | protected function hasProject($projectId) { 106 | return isset($this->projectData[$projectId]); 107 | } 108 | 109 | /** 110 | * @param int $projectId 111 | * @param int $num 112 | * @param mixed $value 113 | */ 114 | public function setKey($projectId, $num, $value) { 115 | $this->setInternal($projectId, $this->KEY, $num, $value); 116 | } 117 | 118 | /** 119 | * @param int $projectId 120 | * @param int $num 121 | * @return mixed 122 | */ 123 | public function getKey($projectId, $num) { 124 | return $this->getInternal($projectId, $this->KEY, $num); 125 | } 126 | 127 | /** 128 | * @param int $projectId 129 | */ 130 | public function clearKey($projectId) { 131 | $this->clearInternal($projectId, $this->KEY); 132 | } 133 | 134 | /** 135 | * @param int $projectId 136 | * @param int $num 137 | * @param mixed $value 138 | */ 139 | public function setValue($projectId, $num, $value) { 140 | $this->setInternal($projectId, $this->VALUE, $num, $value); 141 | } 142 | 143 | /** 144 | * @param int $projectId 145 | * @param int $num 146 | * @return mixed 147 | */ 148 | public function getValue($projectId, $num) { 149 | return $this->getInternal($projectId, $this->VALUE, $num); 150 | } 151 | 152 | /** 153 | * @param int $projectId 154 | */ 155 | public function clearValue($projectId) { 156 | $this->clearInternal($projectId, $this->VALUE); 157 | } 158 | 159 | /** 160 | * Shared internal implementation for setting an X10 data type. 161 | * 162 | * @param int $projectId 163 | * @param string $type 164 | * @param int $num 165 | * @param mixed $value 166 | */ 167 | protected function setInternal($projectId, $type, $num, $value) { 168 | if(!isset($this->projectData[$projectId])) { 169 | $this->projectData[$projectId] = array(); 170 | } 171 | if(!isset($this->projectData[$projectId][$type])) { 172 | $this->projectData[$projectId][$type] = array(); 173 | } 174 | 175 | $this->projectData[$projectId][$type][$num] = $value; 176 | } 177 | 178 | /** 179 | * Shared internal implementation for getting an X10 data type. 180 | * 181 | * @param int $projectId 182 | * @param string $type 183 | * @param int $num 184 | * @return mixed 185 | */ 186 | protected function getInternal($projectId, $type, $num) { 187 | if(isset($this->projectData[$projectId][$type][$num])) { 188 | return $this->projectData[$projectId][$type][$num]; 189 | } else { 190 | return null; 191 | } 192 | } 193 | 194 | /** 195 | * Shared internal implementation for clearing all X10 data of a type from a 196 | * certain project. 197 | * 198 | * @param int $projectId 199 | * @param string $type 200 | */ 201 | protected function clearInternal($projectId, $type) { 202 | if(isset($this->projectData[$projectId]) && isset($this->projectData[$projectId][$type])) { 203 | unset($this->projectData[$projectId][$type]); 204 | } 205 | } 206 | 207 | /** 208 | * Escape X10 string values to remove ambiguity for special characters. 209 | * 210 | * @see X10::$escapeCharMap 211 | * @param string $value 212 | * @return string 213 | */ 214 | protected function escapeExtensibleValue($value) { 215 | $result = ''; 216 | 217 | $value = (string)$value; 218 | $length = strlen($value); 219 | for($i = 0; $i < $length; $i++) { 220 | $char = $value[$i]; 221 | 222 | if(isset($this->ESCAPE_CHAR_MAP[$char])) { 223 | $result .= $this->ESCAPE_CHAR_MAP[$char]; 224 | } else { 225 | $result .= $char; 226 | } 227 | } 228 | 229 | return $result; 230 | } 231 | 232 | /** 233 | * Given a data array for a certain type, render its string encoding. 234 | * 235 | * @param array $data 236 | * @return string 237 | */ 238 | protected function renderDataType(array $data) { 239 | $result = array(); 240 | 241 | $lastI = 0; 242 | ksort($data, SORT_NUMERIC); 243 | foreach($data as $i => $entry) { 244 | if(isset($entry)) { 245 | $str = ''; 246 | 247 | // Check if we need to append the number. If the last number was 248 | // outputted, or if this is the assumed minimum, then we don't. 249 | if($i != $this->MINIMUM && $i - 1 != $lastI) { 250 | $str .= $i; 251 | $str .= $this->DELIM_NUM_VALUE; 252 | } 253 | 254 | $str .= $this->escapeExtensibleValue($entry); 255 | $result[] = $str; 256 | } 257 | 258 | $lastI = $i; 259 | } 260 | 261 | return $this->DELIM_BEGIN . implode($this->DELIM_SET, $result) . $this->DELIM_END; 262 | } 263 | 264 | /** 265 | * Given a project array, render its string encoding. 266 | * 267 | * @param array $project 268 | * @return string 269 | */ 270 | protected function renderProject(array $project) { 271 | $result = ''; 272 | 273 | // Do we need to output the type string? As an optimization we do not 274 | // output the type string if it's the first type, or if the previous 275 | // type was present. 276 | $needTypeQualifier = false; 277 | 278 | $length = count($this->SET); 279 | for($i = 0; $i < $length; $i++) { 280 | if(isset($project[$this->SET[$i]])) { 281 | $data = $project[$this->SET[$i]]; 282 | 283 | if($needTypeQualifier) { 284 | $result .= $this->SET[$i]; 285 | } 286 | $result .= $this->renderDataType($data); 287 | $needTypeQualifier = false; 288 | } else { 289 | $needTypeQualifier = true; 290 | } 291 | } 292 | 293 | return $result; 294 | } 295 | 296 | /** 297 | * Generates the URL parameter string for the current internal extensible data state. 298 | * 299 | * @return string 300 | */ 301 | public function renderUrlString() { 302 | $result = ''; 303 | 304 | foreach($this->projectData as $projectId => $project) { 305 | $result .= $projectId . $this->renderProject($project); 306 | } 307 | 308 | return $result; 309 | } 310 | 311 | } 312 | 313 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Campaign.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | use UnitedPrototype\GoogleAnalytics\Internals\Util; 32 | 33 | use DateTime; 34 | 35 | /** 36 | * You should serialize this object and store it in e.g. the user database to keep it 37 | * persistent for the same user permanently (similar to the "__umtz" cookie of 38 | * the GA Javascript client). 39 | */ 40 | class Campaign { 41 | 42 | /** 43 | * See self::TYPE_* constants, will be mapped to "__utmz" parameter. 44 | * 45 | * @see Internals\ParameterHolder::$__utmz 46 | * @var string 47 | */ 48 | protected $type; 49 | 50 | /** 51 | * Time of the creation of this campaign, will be mapped to "__utmz" parameter. 52 | * 53 | * @see Internals\ParameterHolder::$__utmz 54 | * @var DateTime 55 | */ 56 | protected $creationTime; 57 | 58 | /** 59 | * Response Count, will be mapped to "__utmz" parameter. 60 | * 61 | * Is also used to determine whether the campaign is new or repeated, 62 | * which will be mapped to "utmcn" and "utmcr" parameters. 63 | * 64 | * @see Internals\ParameterHolder::$__utmz 65 | * @see Internals\ParameterHolder::$utmcn 66 | * @see Internals\ParameterHolder::$utmcr 67 | * @var int 68 | */ 69 | protected $responseCount = 0; 70 | 71 | /** 72 | * Campaign ID, a.k.a. "utm_id" query parameter for ga.js 73 | * Will be mapped to "__utmz" parameter. 74 | * 75 | * @see Internals\ParameterHolder::$__utmz 76 | * @var int 77 | */ 78 | protected $id; 79 | 80 | /** 81 | * Source, a.k.a. "utm_source" query parameter for ga.js. 82 | * Will be mapped to "utmcsr" key in "__utmz" parameter. 83 | * 84 | * @see Internals\ParameterHolder::$__utmz 85 | * @var string 86 | */ 87 | protected $source; 88 | 89 | /** 90 | * Google AdWords Click ID, a.k.a. "gclid" query parameter for ga.js. 91 | * Will be mapped to "utmgclid" key in "__utmz" parameter. 92 | * 93 | * @see Internals\ParameterHolder::$__utmz 94 | * @var string 95 | */ 96 | protected $gClickId; 97 | 98 | /** 99 | * DoubleClick (?) Click ID. Will be mapped to "utmdclid" key in "__utmz" parameter. 100 | * 101 | * @see Internals\ParameterHolder::$__utmz 102 | * @var string 103 | */ 104 | protected $dClickId; 105 | 106 | /** 107 | * Name, a.k.a. "utm_campaign" query parameter for ga.js. 108 | * Will be mapped to "utmccn" key in "__utmz" parameter. 109 | * 110 | * @see Internals\ParameterHolder::$__utmz 111 | * @var string 112 | */ 113 | protected $name; 114 | 115 | /** 116 | * Medium, a.k.a. "utm_medium" query parameter for ga.js. 117 | * Will be mapped to "utmcmd" key in "__utmz" parameter. 118 | * 119 | * @see Internals\ParameterHolder::$__utmz 120 | * @var string 121 | */ 122 | protected $medium; 123 | 124 | /** 125 | * Terms/Keywords, a.k.a. "utm_term" query parameter for ga.js. 126 | * Will be mapped to "utmctr" key in "__utmz" parameter. 127 | * 128 | * @see Internals\ParameterHolder::$__utmz 129 | * @var string 130 | */ 131 | protected $term; 132 | 133 | /** 134 | * Ad Content Description, a.k.a. "utm_content" query parameter for ga.js. 135 | * Will be mapped to "utmcct" key in "__utmz" parameter. 136 | * 137 | * @see Internals\ParameterHolder::$__utmz 138 | * @var string 139 | */ 140 | protected $content; 141 | 142 | 143 | /** 144 | * @const string 145 | */ 146 | const TYPE_DIRECT = 'direct'; 147 | /** 148 | * @const string 149 | */ 150 | const TYPE_ORGANIC = 'organic'; 151 | /** 152 | * @const string 153 | */ 154 | const TYPE_REFERRAL = 'referral'; 155 | 156 | 157 | /** 158 | * @see createFromReferrer 159 | * @param string $type See TYPE_* constants 160 | */ 161 | public function __construct($type) { 162 | if(!in_array($type, array(self::TYPE_DIRECT, self::TYPE_ORGANIC, self::TYPE_REFERRAL))) { 163 | Tracker::_raiseError('Campaign type has to be one of the Campaign::TYPE_* constant values.', __METHOD__); 164 | } 165 | 166 | $this->type = $type; 167 | 168 | switch($type) { 169 | // See http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/campaign/CampaignManager.as#375 170 | case self::TYPE_DIRECT: 171 | $this->name = '(direct)'; 172 | $this->source = '(direct)'; 173 | $this->medium = '(none)'; 174 | break; 175 | // See http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/campaign/CampaignManager.as#340 176 | case self::TYPE_REFERRAL: 177 | $this->name = '(referral)'; 178 | $this->medium = 'referral'; 179 | break; 180 | // See http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/campaign/CampaignManager.as#280 181 | case self::TYPE_ORGANIC: 182 | $this->name = '(organic)'; 183 | $this->medium = 'organic'; 184 | break; 185 | } 186 | 187 | $this->creationTime = new DateTime(); 188 | } 189 | 190 | /** 191 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/campaign/CampaignManager.as#333 192 | * @param string $url 193 | * @return \UnitedPrototype\GoogleAnalytics\Campaign 194 | */ 195 | public static function createFromReferrer($url) { 196 | $instance = new static(self::TYPE_REFERRAL); 197 | $urlInfo = parse_url($url); 198 | $instance->source = $urlInfo['host']; 199 | $instance->content = $urlInfo['path']; 200 | 201 | return $instance; 202 | } 203 | 204 | /** 205 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/campaign/CampaignTracker.as#153 206 | */ 207 | public function validate() { 208 | // NOTE: gaforflash states that id and gClickId must also be specified, 209 | // but that doesn't seem to be correct 210 | if(!$this->source) { 211 | Tracker::_raiseError('Campaigns need to have at least the "source" attribute defined.', __METHOD__); 212 | } 213 | } 214 | 215 | /** 216 | * @param string $type 217 | */ 218 | public function setType($type) { 219 | $this->type = $type; 220 | } 221 | 222 | /** 223 | * @return string 224 | */ 225 | public function getType() { 226 | return $this->type; 227 | } 228 | 229 | /** 230 | * @param DateTime $creationTime 231 | */ 232 | public function setCreationTime(DateTime $creationTime) { 233 | $this->creationTime = $creationTime; 234 | } 235 | 236 | /** 237 | * @return DateTime 238 | */ 239 | public function getCreationTime() { 240 | return $this->creationTime; 241 | } 242 | 243 | /** 244 | * @param int $esponseCount 245 | */ 246 | public function setResponseCount($responseCount) { 247 | $this->responseCount = (int)$responseCount; 248 | } 249 | 250 | /** 251 | * @return int 252 | */ 253 | public function getResponseCount() { 254 | return $this->responseCount; 255 | } 256 | 257 | /** 258 | * @param int $byAmount 259 | */ 260 | public function increaseResponseCount($byAmount = 1) { 261 | $this->responseCount += $byAmount; 262 | } 263 | 264 | /** 265 | * @param int $id 266 | */ 267 | public function setId($id) { 268 | $this->id = $id; 269 | } 270 | 271 | /** 272 | * @return int 273 | */ 274 | public function getId() { 275 | return $this->id; 276 | } 277 | 278 | /** 279 | * @param string $source 280 | */ 281 | public function setSource($source) { 282 | $this->source = $source; 283 | } 284 | 285 | /** 286 | * @return string 287 | */ 288 | public function getSource() { 289 | return $this->source; 290 | } 291 | 292 | /** 293 | * @param string $gClickId 294 | */ 295 | public function setGClickId($gClickId) { 296 | $this->gClickId = $gClickId; 297 | } 298 | 299 | /** 300 | * @return string 301 | */ 302 | public function getGClickId() { 303 | return $this->gClickId; 304 | } 305 | 306 | /** 307 | * @param string $dClickId 308 | */ 309 | public function setDClickId($dClickId) { 310 | $this->dClickId = $dClickId; 311 | } 312 | 313 | /** 314 | * @return string 315 | */ 316 | public function getDClickId() { 317 | return $this->dClickId; 318 | } 319 | 320 | /** 321 | * @param string $name 322 | */ 323 | public function setName($name) { 324 | $this->name = $name; 325 | } 326 | 327 | /** 328 | * @return string 329 | */ 330 | public function getName() { 331 | return $this->name; 332 | } 333 | 334 | /** 335 | * @param string $medium 336 | */ 337 | public function setMedium($medium) { 338 | $this->medium = $medium; 339 | } 340 | 341 | /** 342 | * @return string 343 | */ 344 | public function getMedium() { 345 | return $this->medium; 346 | } 347 | 348 | /** 349 | * @param string $term 350 | */ 351 | public function setTerm($term) { 352 | $this->term = $term; 353 | } 354 | 355 | /** 356 | * @return string 357 | */ 358 | public function getTerm() { 359 | return $this->term; 360 | } 361 | 362 | /** 363 | * @param string $content 364 | */ 365 | public function setContent($content) { 366 | $this->content = $content; 367 | } 368 | 369 | /** 370 | * @return string 371 | */ 372 | public function getContent() { 373 | return $this->content; 374 | } 375 | 376 | } 377 | 378 | ?> -------------------------------------------------------------------------------- /stylesheets/bootstrap-responsive.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.0.4 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}@media(max-width:767px){.visible-phone{display:inherit!important}.hidden-phone{display:none!important}.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}}@media(min-width:768px) and (max-width:979px){.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:18px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-group>label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.modal{position:absolute;top:10px;right:10px;left:10px;width:auto;margin:0}.modal.fade.in{top:auto}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:auto;margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:20px}.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:28px;margin-left:2.762430939%;*margin-left:2.709239449638298%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:99.999999993%;*width:99.9468085036383%}.row-fluid .span11{width:91.436464082%;*width:91.38327259263829%}.row-fluid .span10{width:82.87292817100001%;*width:82.8197366816383%}.row-fluid .span9{width:74.30939226%;*width:74.25620077063829%}.row-fluid .span8{width:65.74585634900001%;*width:65.6926648596383%}.row-fluid .span7{width:57.182320438000005%;*width:57.129128948638304%}.row-fluid .span6{width:48.618784527%;*width:48.5655930376383%}.row-fluid .span5{width:40.055248616%;*width:40.0020571266383%}.row-fluid .span4{width:31.491712705%;*width:31.4385212156383%}.row-fluid .span3{width:22.928176794%;*width:22.874985304638297%}.row-fluid .span2{width:14.364640883%;*width:14.311449393638298%}.row-fluid .span1{width:5.801104972%;*width:5.747913482638298%}input,textarea,.uneditable-input{margin-left:0}input.span12,textarea.span12,.uneditable-input.span12{width:714px}input.span11,textarea.span11,.uneditable-input.span11{width:652px}input.span10,textarea.span10,.uneditable-input.span10{width:590px}input.span9,textarea.span9,.uneditable-input.span9{width:528px}input.span8,textarea.span8,.uneditable-input.span8{width:466px}input.span7,textarea.span7,.uneditable-input.span7{width:404px}input.span6,textarea.span6,.uneditable-input.span6{width:342px}input.span5,textarea.span5,.uneditable-input.span5{width:280px}input.span4,textarea.span4,.uneditable-input.span4{width:218px}input.span3,textarea.span3,.uneditable-input.span3{width:156px}input.span2,textarea.span2,.uneditable-input.span2{width:94px}input.span1,textarea.span1,.uneditable-input.span1{width:32px}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:30px}.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:28px;margin-left:2.564102564%;*margin-left:2.510911074638298%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145300001%;*width:91.3997999636383%}.row-fluid .span10{width:82.905982906%;*width:82.8527914166383%}.row-fluid .span9{width:74.358974359%;*width:74.30578286963829%}.row-fluid .span8{width:65.81196581200001%;*width:65.7587743226383%}.row-fluid .span7{width:57.264957265%;*width:57.2117657756383%}.row-fluid .span6{width:48.717948718%;*width:48.6647572286383%}.row-fluid .span5{width:40.170940171000005%;*width:40.117748681638304%}.row-fluid .span4{width:31.623931624%;*width:31.5707401346383%}.row-fluid .span3{width:23.076923077%;*width:23.0237315876383%}.row-fluid .span2{width:14.529914530000001%;*width:14.4767230406383%}.row-fluid .span1{width:5.982905983%;*width:5.929714493638298%}input,textarea,.uneditable-input{margin-left:0}input.span12,textarea.span12,.uneditable-input.span12{width:1160px}input.span11,textarea.span11,.uneditable-input.span11{width:1060px}input.span10,textarea.span10,.uneditable-input.span10{width:960px}input.span9,textarea.span9,.uneditable-input.span9{width:860px}input.span8,textarea.span8,.uneditable-input.span8{width:760px}input.span7,textarea.span7,.uneditable-input.span7{width:660px}input.span6,textarea.span6,.uneditable-input.span6{width:560px}input.span5,textarea.span5,.uneditable-input.span5{width:460px}input.span4,textarea.span4,.uneditable-input.span4{width:360px}input.span3,textarea.span3,.uneditable-input.span3{width:260px}input.span2,textarea.span2,.uneditable-input.span2{width:160px}input.span1,textarea.span1,.uneditable-input.span1{width:60px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:18px}.navbar-fixed-bottom{margin-top:18px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 9px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#999;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:6px 15px;font-weight:bold;color:#999;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#222}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:block;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:9px 15px;margin:9px 0;border-top:1px solid #222;border-bottom:1px solid #222;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} 10 | -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Tracker.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | use UnitedPrototype\GoogleAnalytics\Internals\Util; 32 | use UnitedPrototype\GoogleAnalytics\Internals\Request\PageviewRequest; 33 | use UnitedPrototype\GoogleAnalytics\Internals\Request\EventRequest; 34 | use UnitedPrototype\GoogleAnalytics\Internals\Request\TransactionRequest; 35 | use UnitedPrototype\GoogleAnalytics\Internals\Request\ItemRequest; 36 | use UnitedPrototype\GoogleAnalytics\Internals\Request\SocialInteractionRequest; 37 | 38 | class Tracker { 39 | 40 | /** 41 | * Google Analytics client version on which this library is built upon, 42 | * will be mapped to "utmwv" parameter. 43 | * 44 | * This doesn't necessarily mean that all features of the corresponding 45 | * ga.js version are implemented but rather that the requests comply 46 | * with these of ga.js. 47 | * 48 | * @link http://code.google.com/apis/analytics/docs/gaJS/changelog.html 49 | * @const string 50 | */ 51 | const VERSION = '5.2.2'; // As of 15.11.2011 52 | 53 | 54 | /** 55 | * The configuration to use for all tracker instances. 56 | * 57 | * @var \UnitedPrototype\GoogleAnalytics\Config 58 | */ 59 | protected static $config; 60 | 61 | /** 62 | * Google Analytics account ID, e.g. "UA-1234567-8", will be mapped to 63 | * "utmac" parameter 64 | * 65 | * @see Internals\ParameterHolder::$utmac 66 | * @var string 67 | */ 68 | protected $accountId; 69 | 70 | /** 71 | * Host Name, e.g. "www.example.com", will be mapped to "utmhn" parameter 72 | * 73 | * @see Internals\ParameterHolder::$utmhn 74 | * @var string 75 | */ 76 | protected $domainName; 77 | 78 | /** 79 | * Whether to generate a unique domain hash, default is true to be consistent 80 | * with the GA Javascript Client 81 | * 82 | * @link http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html#setAllowHash 83 | * @see Internals\Request\Request::generateDomainHash() 84 | * @var bool 85 | */ 86 | protected $allowHash = true; 87 | 88 | /** 89 | * @var array 90 | */ 91 | protected $customVariables = array(); 92 | 93 | /** 94 | * @var \UnitedPrototype\GoogleAnalytics\Campaign 95 | */ 96 | protected $campaign; 97 | 98 | 99 | /** 100 | * @param string $accountId 101 | * @param string $domainName 102 | * @param \UnitedPrototype\GoogleAnalytics\Config $config 103 | */ 104 | public function __construct($accountId, $domainName, Config $config = null) { 105 | static::setConfig($config ? $config : new Config()); 106 | 107 | $this->setAccountId($accountId); 108 | $this->setDomainName($domainName); 109 | } 110 | 111 | /** 112 | * @return \UnitedPrototype\GoogleAnalytics\Config 113 | */ 114 | public static function getConfig() { 115 | return static::$config; 116 | } 117 | 118 | /** 119 | * @param \UnitedPrototype\GoogleAnalytics\Config $value 120 | */ 121 | public static function setConfig(Config $value) { 122 | static::$config = $value; 123 | } 124 | 125 | /** 126 | * @param string $value 127 | */ 128 | public function setAccountId($value) { 129 | if(!preg_match('/^UA-[0-9]*-[0-9]*$/', $value)) { 130 | static::_raiseError('"' . $value . '" is not a valid Google Analytics account ID.', __METHOD__); 131 | } 132 | 133 | $this->accountId = $value; 134 | } 135 | 136 | /** 137 | * @return string 138 | */ 139 | public function getAccountId() { 140 | return $this->accountId; 141 | } 142 | 143 | /** 144 | * @param string $value 145 | */ 146 | public function setDomainName($value) { 147 | $this->domainName = $value; 148 | } 149 | 150 | /** 151 | * @return string 152 | */ 153 | public function getDomainName() { 154 | return $this->domainName; 155 | } 156 | 157 | /** 158 | * @param bool $value 159 | */ 160 | public function setAllowHash($value) { 161 | $this->allowHash = (bool)$value; 162 | } 163 | 164 | /** 165 | * @return bool 166 | */ 167 | public function getAllowHash() { 168 | return $this->allowHash; 169 | } 170 | 171 | /** 172 | * Equivalent of _setCustomVar() in GA Javascript client. 173 | * 174 | * @link http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html 175 | * @param \UnitedPrototype\GoogleAnalytics\CustomVariable $customVariable 176 | */ 177 | public function addCustomVariable(CustomVariable $customVariable) { 178 | // Ensure that all required parameters are set 179 | $customVariable->validate(); 180 | 181 | $index = $customVariable->getIndex(); 182 | $this->customVariables[$index] = $customVariable; 183 | } 184 | 185 | /** 186 | * @return \UnitedPrototype\GoogleAnalytics\CustomVariable[] 187 | */ 188 | public function getCustomVariables() { 189 | return $this->customVariables; 190 | } 191 | 192 | /** 193 | * Equivalent of _deleteCustomVar() in GA Javascript client. 194 | * 195 | * @param int $index 196 | */ 197 | public function removeCustomVariable($index) { 198 | unset($this->customVariables[$index]); 199 | } 200 | 201 | /** 202 | * @param \UnitedPrototype\GoogleAnalytics\Campaign $campaign Isn't really optional, but can be set to null 203 | */ 204 | public function setCampaign(Campaign $campaign = null) { 205 | if($campaign) { 206 | // Ensure that all required parameters are set 207 | $campaign->validate(); 208 | } 209 | 210 | $this->campaign = $campaign; 211 | } 212 | 213 | /** 214 | * @return \UnitedPrototype\GoogleAnalytics\Campaign|null 215 | */ 216 | public function getCampaign() { 217 | return $this->campaign; 218 | } 219 | 220 | /** 221 | * Equivalent of _trackPageview() in GA Javascript client. 222 | * 223 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApiBasicConfiguration.html#_gat.GA_Tracker_._trackPageview 224 | * @param \UnitedPrototype\GoogleAnalytics\Page $page 225 | * @param \UnitedPrototype\GoogleAnalytics\Session $session 226 | * @param \UnitedPrototype\GoogleAnalytics\Visitor $visitor 227 | */ 228 | public function trackPageview(Page $page, Session $session, Visitor $visitor) { 229 | $request = new PageviewRequest(static::$config); 230 | $request->setPage($page); 231 | $request->setSession($session); 232 | $request->setVisitor($visitor); 233 | $request->setTracker($this); 234 | $request->fire(); 235 | } 236 | 237 | /** 238 | * Equivalent of _trackEvent() in GA Javascript client. 239 | * 240 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEventTracking.html#_gat.GA_EventTracker_._trackEvent 241 | * @param \UnitedPrototype\GoogleAnalytics\Event $event 242 | * @param \UnitedPrototype\GoogleAnalytics\Session $session 243 | * @param \UnitedPrototype\GoogleAnalytics\Visitor $visitor 244 | */ 245 | public function trackEvent(Event $event, Session $session, Visitor $visitor) { 246 | // Ensure that all required parameters are set 247 | $event->validate(); 248 | 249 | $request = new EventRequest(static::$config); 250 | $request->setEvent($event); 251 | $request->setSession($session); 252 | $request->setVisitor($visitor); 253 | $request->setTracker($this); 254 | $request->fire(); 255 | } 256 | 257 | /** 258 | * Combines _addTrans(), _addItem() (indirectly) and _trackTrans() of GA Javascript client. 259 | * Although the naming of "_addTrans()" would suggest multiple possible transactions 260 | * per request, there is just one allowed actually. 261 | * 262 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEcommerce.html#_gat.GA_Tracker_._addTrans 263 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEcommerce.html#_gat.GA_Tracker_._addItem 264 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEcommerce.html#_gat.GA_Tracker_._trackTrans 265 | * 266 | * @param \UnitedPrototype\GoogleAnalytics\Transaction $transaction 267 | * @param \UnitedPrototype\GoogleAnalytics\Session $session 268 | * @param \UnitedPrototype\GoogleAnalytics\Visitor $visitor 269 | */ 270 | public function trackTransaction(Transaction $transaction, Session $session, Visitor $visitor) { 271 | // Ensure that all required parameters are set 272 | $transaction->validate(); 273 | 274 | $request = new TransactionRequest(static::$config); 275 | $request->setTransaction($transaction); 276 | $request->setSession($session); 277 | $request->setVisitor($visitor); 278 | $request->setTracker($this); 279 | $request->fire(); 280 | 281 | // Every item gets a separate request, 282 | // see http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/v4/Tracker.as#312 283 | foreach($transaction->getItems() as $item) { 284 | // Ensure that all required parameters are set 285 | $item->validate(); 286 | 287 | $request = new ItemRequest(static::$config); 288 | $request->setItem($item); 289 | $request->setSession($session); 290 | $request->setVisitor($visitor); 291 | $request->setTracker($this); 292 | $request->fire(); 293 | } 294 | } 295 | 296 | /** 297 | * Equivalent of _trackSocial() in GA Javascript client. 298 | * 299 | * @link http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html#settingUp 300 | * @param \UnitedPrototype\GoogleAnalytics\SocialInteraction $socialInteraction 301 | * @param \UnitedPrototype\GoogleAnalytics\Page $page 302 | * @param \UnitedPrototype\GoogleAnalytics\Session $session 303 | * @param \UnitedPrototype\GoogleAnalytics\Visitor $visitor 304 | */ 305 | public function trackSocial(SocialInteraction $socialInteraction, Page $page, Session $session, Visitor $visitor) { 306 | $request = new SocialInteractionRequest(static::$config); 307 | $request->setSocialInteraction($socialInteraction); 308 | $request->setPage($page); 309 | $request->setSession($session); 310 | $request->setVisitor($visitor); 311 | $request->setTracker($this); 312 | $request->fire(); 313 | } 314 | 315 | /** 316 | * For internal use only. Will trigger an error according to the current 317 | * Config::$errorSeverity setting. 318 | * 319 | * @see Config::$errorSeverity 320 | * @param string $message 321 | * @param string $method 322 | */ 323 | public static function _raiseError($message, $method) { 324 | $method = str_replace(__NAMESPACE__ . '\\', '', $method); 325 | $message = $method . '(): ' . $message; 326 | 327 | $errorSeverity = isset(static::$config) ? static::$config->getErrorSeverity() : Config::ERROR_SEVERITY_EXCEPTIONS; 328 | 329 | switch($errorSeverity) { 330 | case Config::ERROR_SEVERITY_SILENCE: 331 | // Do nothing 332 | break; 333 | case Config::ERROR_SEVERITY_WARNINGS: 334 | trigger_error($message, E_USER_WARNING); 335 | break; 336 | case Config::ERROR_SEVERITY_EXCEPTIONS: 337 | throw new Exception($message); 338 | break; 339 | } 340 | } 341 | 342 | } 343 | 344 | ?> -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Visitor.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics; 30 | 31 | use UnitedPrototype\GoogleAnalytics\Internals\Util; 32 | 33 | use DateTime; 34 | 35 | /** 36 | * You should serialize this object and store it in the user database to keep it 37 | * persistent for the same user permanently (similar to the "__umta" cookie of 38 | * the GA Javascript client). 39 | */ 40 | class Visitor { 41 | 42 | /** 43 | * Unique user ID, will be part of the "__utma" cookie parameter 44 | * 45 | * @see Internals\ParameterHolder::$__utma 46 | * @var int 47 | */ 48 | protected $uniqueId; 49 | 50 | /** 51 | * Time of the very first visit of this user, will be part of the "__utma" 52 | * cookie parameter 53 | * 54 | * @see Internals\ParameterHolder::$__utma 55 | * @var DateTime 56 | */ 57 | protected $firstVisitTime; 58 | 59 | /** 60 | * Time of the previous visit of this user, will be part of the "__utma" 61 | * cookie parameter 62 | * 63 | * @see Internals\ParameterHolder::$__utma 64 | * @see addSession 65 | * @var DateTime 66 | */ 67 | protected $previousVisitTime; 68 | 69 | /** 70 | * Time of the current visit of this user, will be part of the "__utma" 71 | * cookie parameter 72 | * 73 | * @see Internals\ParameterHolder::$__utma 74 | * @see addSession 75 | * @var DateTime 76 | */ 77 | protected $currentVisitTime; 78 | 79 | /** 80 | * Amount of total visits by this user, will be part of the "__utma" 81 | * cookie parameter 82 | * 83 | * @see Internals\ParameterHolder::$__utma 84 | * @var int 85 | */ 86 | protected $visitCount; 87 | 88 | /** 89 | * IP Address of the end user, e.g. "123.123.123.123", will be mapped to "utmip" parameter 90 | * and "X-Forwarded-For" request header 91 | * 92 | * @see Internals\ParameterHolder::$utmip 93 | * @see Internals\Request\HttpRequest::$xForwardedFor 94 | * @var string 95 | */ 96 | protected $ipAddress; 97 | 98 | /** 99 | * User agent string of the end user, will be mapped to "User-Agent" request header 100 | * 101 | * @see Internals\Request\HttpRequest::$userAgent 102 | * @var string 103 | */ 104 | protected $userAgent; 105 | 106 | /** 107 | * Locale string (country part optional), e.g. "de-DE", will be mapped to "utmul" parameter 108 | * 109 | * @see Internals\ParameterHolder::$utmul 110 | * @var string 111 | */ 112 | protected $locale; 113 | 114 | /** 115 | * Visitor's Flash version, e.g. "9.0 r28", will be maped to "utmfl" parameter 116 | * 117 | * @see Internals\ParameterHolder::$utmfl 118 | * @var string 119 | */ 120 | protected $flashVersion; 121 | 122 | /** 123 | * Visitor's Java support, will be mapped to "utmje" parameter 124 | * 125 | * @see Internals\ParameterHolder::$utmje 126 | * @var bool 127 | */ 128 | protected $javaEnabled; 129 | 130 | /** 131 | * Visitor's screen color depth, e.g. 32, will be mapped to "utmsc" parameter 132 | * 133 | * @see Internals\ParameterHolder::$utmsc 134 | * @var string 135 | */ 136 | protected $screenColorDepth; 137 | 138 | /** 139 | * Visitor's screen resolution, e.g. "1024x768", will be mapped to "utmsr" parameter 140 | * 141 | * @see Internals\ParameterHolder::$utmsr 142 | * @var string 143 | */ 144 | protected $screenResolution; 145 | 146 | 147 | /** 148 | * Creates a new visitor without any previous visit information. 149 | */ 150 | public function __construct() { 151 | // ga.js sets all three timestamps to now for new visitors, so we do the same 152 | $now = new DateTime(); 153 | $this->setFirstVisitTime($now); 154 | $this->setPreviousVisitTime($now); 155 | $this->setCurrentVisitTime($now); 156 | 157 | $this->setVisitCount(1); 158 | } 159 | 160 | /** 161 | * Will extract information for the "uniqueId", "firstVisitTime", "previousVisitTime", 162 | * "currentVisitTime" and "visitCount" properties from the given "__utma" cookie 163 | * value. 164 | * 165 | * @see Internals\ParameterHolder::$__utma 166 | * @see Internals\Request\Request::buildCookieParameters() 167 | * @param string $value 168 | * @return $this 169 | */ 170 | public function fromUtma($value) { 171 | $parts = explode('.', $value); 172 | if(count($parts) != 6) { 173 | Tracker::_raiseError('The given "__utma" cookie value is invalid.', __METHOD__); 174 | return $this; 175 | } 176 | 177 | $this->setUniqueId($parts[1]); 178 | $this->setFirstVisitTime(new DateTime('@' . $parts[2])); 179 | $this->setPreviousVisitTime(new DateTime('@' . $parts[3])); 180 | $this->setCurrentVisitTime(new DateTime('@' . $parts[4])); 181 | $this->setVisitCount($parts[5]); 182 | 183 | // Allow chaining 184 | return $this; 185 | } 186 | 187 | /** 188 | * Will extract information for the "ipAddress", "userAgent" and "locale" properties 189 | * from the given $_SERVER variable. 190 | * 191 | * @param array $value 192 | * @return $this 193 | */ 194 | public function fromServerVar(array $value) { 195 | if(!empty($value['REMOTE_ADDR'])) { 196 | $ip = null; 197 | foreach(array('X_FORWARDED_FOR', 'REMOTE_ADDR') as $key) { 198 | if(!empty($value[$key]) && !$ip) { 199 | $ips = explode(',', $value[$key]); 200 | $ip = trim($ips[(count($ips) - 1)]); 201 | 202 | // Double-check if the address has a valid format 203 | if(!preg_match('/^[\d+]{1,3}\.[\d+]{1,3}\.[\d+]{1,3}\.[\d+]{1,3}$/i', $ip)) { 204 | $ip = null; 205 | } 206 | // Exclude private IP address ranges 207 | if(preg_match('#^(?:127\.0\.0\.1|10\.|192\.168\.|172\.(?:1[6-9]|2[0-9]|3[0-1])\.)#', $ip)) { 208 | $ip = null; 209 | } 210 | } 211 | } 212 | 213 | if($ip) { 214 | $this->setIpAddress($ip); 215 | } 216 | } 217 | 218 | if(!empty($value['HTTP_USER_AGENT'])) { 219 | $this->setUserAgent($value['HTTP_USER_AGENT']); 220 | } 221 | 222 | if(!empty($value['HTTP_ACCEPT_LANGUAGE'])) { 223 | $parsedLocales = array(); 224 | if(preg_match_all('/(^|\s*,\s*)([a-zA-Z]{1,8}(-[a-zA-Z]{1,8})*)\s*(;\s*q\s*=\s*(1(\.0{0,3})?|0(\.[0-9]{0,3})))?/i', $value['HTTP_ACCEPT_LANGUAGE'], $matches)) { 225 | $matches[2] = array_map(function($part) { return str_replace('-', '_', $part); }, $matches[2]); 226 | $matches[5] = array_map(function($part) { return $part === '' ? 1 : $part; }, $matches[5]); 227 | $parsedLocales = array_combine($matches[2], $matches[5]); 228 | arsort($parsedLocales, SORT_NUMERIC); 229 | $parsedLocales = array_keys($parsedLocales); 230 | } 231 | 232 | if($parsedLocales) { 233 | $this->setLocale($parsedLocales[0]); 234 | } 235 | } 236 | 237 | // Allow chaining 238 | return $this; 239 | } 240 | 241 | /** 242 | * Generates a hashed value from user-specific properties. 243 | * 244 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/v4/Tracker.as#542 245 | * @return int 246 | */ 247 | protected function generateHash() { 248 | // TODO: Emulate orginal Google Analytics client library generation more closely 249 | $string = $this->userAgent; 250 | $string .= $this->screenResolution . $this->screenColorDepth; 251 | return Util::generateHash($string); 252 | } 253 | 254 | /** 255 | * Generates a unique user ID from the current user-specific properties. 256 | * 257 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/v4/Tracker.as#563 258 | * @return int 259 | */ 260 | protected function generateUniqueId() { 261 | // There seems to be an error in the gaforflash code, so we take the formula 262 | // from http://xahlee.org/js/google_analytics_tracker_2010-07-01_expanded.js line 711 263 | // instead ("&" instead of "*") 264 | return ((Util::generate32bitRandom() ^ $this->generateHash()) & 0x7fffffff); 265 | } 266 | 267 | /** 268 | * @see generateUniqueId 269 | * @param int $value 270 | */ 271 | public function setUniqueId($value) { 272 | if($value < 0 || $value > 0x7fffffff) { 273 | Tracker::_raiseError('Visitor unique ID has to be a 32-bit integer between 0 and ' . 0x7fffffff . '.', __METHOD__); 274 | } 275 | 276 | $this->uniqueId = (int)$value; 277 | } 278 | 279 | /** 280 | * Will be generated on first call (if not set already) to include as much 281 | * user-specific information as possible. 282 | * 283 | * @return int 284 | */ 285 | public function getUniqueId() { 286 | if($this->uniqueId === null) { 287 | $this->uniqueId = $this->generateUniqueId(); 288 | } 289 | return $this->uniqueId; 290 | } 291 | 292 | /** 293 | * Updates the "previousVisitTime", "currentVisitTime" and "visitCount" 294 | * fields based on the given session object. 295 | * 296 | * @param Session $session 297 | */ 298 | public function addSession(Session $session) { 299 | $startTime = $session->getStartTime(); 300 | if($startTime != $this->currentVisitTime) { 301 | $this->previousVisitTime = $this->currentVisitTime; 302 | $this->currentVisitTime = $startTime; 303 | ++$this->visitCount; 304 | } 305 | } 306 | 307 | /** 308 | * @param DateTime $value 309 | */ 310 | public function setFirstVisitTime(DateTime $value) { 311 | $this->firstVisitTime = $value; 312 | } 313 | 314 | /** 315 | * @return DateTime 316 | */ 317 | public function getFirstVisitTime() { 318 | return $this->firstVisitTime; 319 | } 320 | 321 | /** 322 | * @param DateTime $value 323 | */ 324 | public function setPreviousVisitTime(DateTime $value) { 325 | $this->previousVisitTime = $value; 326 | } 327 | 328 | /** 329 | * @return DateTime 330 | */ 331 | public function getPreviousVisitTime() { 332 | return $this->previousVisitTime; 333 | } 334 | 335 | /** 336 | * @param DateTime $value 337 | */ 338 | public function setCurrentVisitTime(DateTime $value) { 339 | $this->currentVisitTime = $value; 340 | } 341 | 342 | /** 343 | * @return DateTime 344 | */ 345 | public function getCurrentVisitTime() { 346 | return $this->currentVisitTime; 347 | } 348 | 349 | /** 350 | * @param int $value 351 | */ 352 | public function setVisitCount($value) { 353 | $this->visitCount = (int)$value; 354 | } 355 | 356 | /** 357 | * @return int 358 | */ 359 | public function getVisitCount() { 360 | return $this->visitCount; 361 | } 362 | 363 | /** 364 | * @param string $value 365 | */ 366 | public function setIpAddress($value) { 367 | $this->ipAddress = $value; 368 | } 369 | 370 | /** 371 | * @return string 372 | */ 373 | public function getIpAddress() { 374 | return $this->ipAddress; 375 | } 376 | 377 | /** 378 | * @param string $value 379 | */ 380 | public function setUserAgent($value) { 381 | $this->userAgent = $value; 382 | } 383 | 384 | /** 385 | * @return string 386 | */ 387 | public function getUserAgent() { 388 | return $this->userAgent; 389 | } 390 | 391 | /** 392 | * @param string $value 393 | */ 394 | public function setLocale($value) { 395 | $this->locale = $value; 396 | } 397 | 398 | /** 399 | * @return string 400 | */ 401 | public function getLocale() { 402 | return $this->locale; 403 | } 404 | 405 | /** 406 | * @param string $value 407 | */ 408 | public function setFlashVersion($value) { 409 | $this->flashVersion = $value; 410 | } 411 | 412 | /** 413 | * @return string 414 | */ 415 | public function getFlashVersion() { 416 | return $this->flashVersion; 417 | } 418 | 419 | /** 420 | * @param bool $value 421 | */ 422 | public function setJavaEnabled($value) { 423 | $this->javaEnabled = (bool)$value; 424 | } 425 | 426 | /** 427 | * @return bool 428 | */ 429 | public function getJavaEnabled() { 430 | return $this->javaEnabled; 431 | } 432 | 433 | /** 434 | * @param int $value 435 | */ 436 | public function setScreenColorDepth($value) { 437 | $this->screenColorDepth = (int)$value; 438 | } 439 | 440 | /** 441 | * @return string 442 | */ 443 | public function getScreenColorDepth() { 444 | return $this->screenColorDepth; 445 | } 446 | 447 | /** 448 | * @param string $value 449 | */ 450 | public function setScreenResolution($value) { 451 | $this->screenResolution = $value; 452 | } 453 | 454 | /** 455 | * @return string 456 | */ 457 | public function getScreenResolution() { 458 | return $this->screenResolution; 459 | } 460 | 461 | } 462 | 463 | ?> -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MMWebFonts 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Fork me on GitHub 32 | 33 | 34 | 51 | 52 | 53 | 55 |
56 |
57 |
58 |

MMWebFonts

59 |

60 | MMWebFonts is a collection of Myanmar web safe unicode fonts. It is easy and quick to use for everyone with a line of code. It supports for Windows, Linux, Mac OSX and iOS 4.0 or later. 61 |

62 |

Just add css external link url in your website. MMWebFonts is a opensource and you can fork on github.

63 |
64 |
65 |
66 | 67 |
68 | 70 |
71 | 74 |
75 |
76 |

History

77 |

Around March 2011 , Myanmar Unicode were ready and blowing up for the blog. However, most of the blogger face the problem with font embed. Most of the cyber cafe didn't install the unicode font. Myanmar 3 is not universal font at this time. For Mac and iOS , we need to use Masterpiece Uni Sans.

78 |

Some of the bloggers wanted to change the unicode. However, they don't know about the font embed technology. So, I created the MMWebFonts for all of the myanmar unicode websites. Now, MMWebFonts has 0.7 requested per second in everyday.

79 |

Read more on saturngod.net ›

80 |
81 | 82 |
83 |

Browser support

84 |

MMWebFonts is tested and supported in major modern browsers like Chrome, Safari, iOS, Internet Explorer, and Firefox.

85 |
    86 |
  •   Chrome 10.0 or later
  • 87 |
  •   Safari 5.0 or later
  • 88 |
  •   Firefox 4.0 or later
  • 89 |
  •   iOS 4.0 or later
  • 90 |
  •   Android Firefox 17 or later
  • 91 | 92 |
93 |
94 | 95 |
96 |

The Problem

97 |

MMWebFonts can't support on Opera and Android. Opera supported font embed but it can't render myanmar unicode font rendering when font embed. Android still have a problem with myanmar unicode.

98 |
    99 |
  • Opera
  • 100 |
  • Android
  • 101 |
102 |
103 | 104 |
105 |
106 | 107 | 108 |
109 | 112 |
113 |
114 |

Supported Font

115 |

MMWebFonts support following font list. 116 |

125 |

If your font is using OFL license and want to embed on MMWebFonts , create issue on MMWebFonts Github issue page.

126 |
127 |
128 |

Font Face

129 |
130 |

Myanmar3 (Myanmar NLP)

131 |

မြန်မာစာသည် တို့စာ။

132 |
133 |

MyMyanmar Universal Font (MyMyanmar)

134 |

မြန်မာစာသည် တို့စာ။

135 |
136 | 137 |

Masterpiece Uni Sans (Masterpiece Uni Sans)

138 |

မြန်မာစာသည် တို့စာ။

139 |
140 | 141 |

Yunghkio (Sai Di)

142 |

မြန်မာစာသည် တို့စာ။

143 |
144 |

Padauk (thanlwinsoft)

145 |

မြန်မာစာသည် တို့စာ။

146 |
147 |

Zawgyi-One (Zawgyi Group)

148 |

ေဇာ္က ကေနသည္။

149 |
150 |

Mon3 Anonta 1 (mon2uni) 151 |

တိ ပိုဲမန်ကၠာ ညံၚ်ပမာထဝ်သြန် ဂွံပတုဲကေၚ်ကာ တိဗ္ၚမန် ပ္ဍဲဇၟန်ဒွက်

152 |
153 |
154 |
155 | 156 | 157 | 158 |
159 | 162 |
163 |
164 |

Choose Font

165 |
166 |
167 | 177 |
178 |
179 |
180 |
181 |

Codes

182 |
186 | 187 |
 <link rel="stylesheet" href='http://mmwebfonts.comquas.com/fonts/?font=myanmar3' />
188 |
@import url('http://MMWebFonts.appspot.com/css?font=myanmar3')
189 |

Font Family

190 |

Add following code in stylesheet font family.

191 |
font-family:Myanmar3,Yunghkio;
192 |
193 |
194 |
195 | 196 | 197 |
198 | 201 |
202 |
203 |

List

204 | MMWebFonts have following plugins 205 |
    206 |
  • Wordpress
  • 207 |
  • Joomla
  • 208 |
  • Drupal
  • 209 |
  • Vanilla 2
  • 210 |
211 |
212 |
213 |

About Plugins

214 |

Wordpress (Saturngod)

215 | 216 |

This plugin will add MMWebFonts link at the header of the wordpress site. You can choose font family in the admin panel.

217 |

Joomla Unicode (Zack)

218 |

This plugin will add MMWebFonts link at the header of the joomla site. This plugin only support Yunghkio now.

219 | 220 |

Joomla Zawgyi (Zack)

221 |

This plugin will add MMWebFonts zawgyi link at the header of the joomla site.

222 | 223 |

Drupal 7 (Everleaner)

224 |

This plugin is only work at Drupal 7.

225 | 226 |

Drupal (Everleaner)

227 |

This plugin will add MMWebFonts Yunghkio unicode link at the header of the drupal site. This plugin is only work at Drupal 6.

228 |

Vanilla 2 (Saturngod)

229 | 230 |

This plugin will add MMWebFonts Yunghkio unicode link at the header of the vanilla 2 forum site.

231 |
232 |
233 |
234 |
235 | 245 | 246 | 247 | 248 | 249 | -------------------------------------------------------------------------------- /fonts/src/GoogleAnalytics/Internals/ParameterHolder.php: -------------------------------------------------------------------------------- 1 | 26 | * @copyright Copyright (c) 2010 United Prototype GmbH (http://unitedprototype.com) 27 | */ 28 | 29 | namespace UnitedPrototype\GoogleAnalytics\Internals; 30 | 31 | use UnitedPrototype\GoogleAnalytics\Tracker; 32 | 33 | /** 34 | * This simple class is mainly meant to be a well-documented overview of all 35 | * possible GA tracking parameters. 36 | * 37 | * @link http://code.google.com/apis/analytics/docs/tracking/gaTrackingTroubleshooting.html#gifParameters 38 | */ 39 | class ParameterHolder { 40 | 41 | // - - - - - - - - - - - - - - - - - General parameters - - - - - - - - - - - - - - - - - 42 | 43 | /** 44 | * Google Analytics client version, e.g. "4.7.2" 45 | * @var string 46 | */ 47 | public $utmwv = Tracker::VERSION; 48 | 49 | /** 50 | * Google Analytics account ID, e.g. "UA-1234567-8" 51 | * @var string 52 | */ 53 | public $utmac; 54 | 55 | /** 56 | * Host Name, e.g. "www.example.com" 57 | * @var string 58 | */ 59 | public $utmhn; 60 | 61 | /** 62 | * Indicates the type of request, which is one of null (for page), "event", 63 | * "tran", "item", "social", "var" (deprecated) or "error" (used by ga.js 64 | * for internal client error logging). 65 | * @var string 66 | */ 67 | public $utmt; 68 | 69 | /** 70 | * Contains the amount of requests done in this session. Added in ga.js v4.9.2. 71 | * @var int 72 | */ 73 | public $utms; 74 | 75 | /** 76 | * Unique ID (random number) generated for each GIF request 77 | * @var int 78 | */ 79 | public $utmn; 80 | 81 | /** 82 | * Contains all cookie values, see below 83 | * @var string 84 | */ 85 | public $utmcc; 86 | 87 | /** 88 | * Extensible Parameter, used for events and custom variables 89 | * @var string 90 | */ 91 | public $utme; 92 | 93 | /** 94 | * Event "non-interaction" parameter. By default, the event hit will impact a visitor's bounce rate. 95 | * By setting this parameter to 1, this event hit will not be used in bounce rate calculations. 96 | * @link http://code.google.com/apis/analytics/docs/gaJS/gaJSApiEventTracking.html 97 | * @var int 98 | */ 99 | public $utmni; 100 | 101 | /** 102 | * Whether to anonymize IP addresses within Google Analytics by stripping 103 | * the last IP address block, either null or 1 104 | * @var int 105 | */ 106 | public $aip; 107 | 108 | /** 109 | * Used for GA-internal statistical client function usage and error tracking, 110 | * not implemented in php-ga as of now, but here for documentation completeness. 111 | * @link http://glucik.blogspot.com/2011/02/utmu-google-analytics-request-parameter.html 112 | * @var string 113 | */ 114 | public $utmu; 115 | 116 | 117 | // - - - - - - - - - - - - - - - - - Page parameters - - - - - - - - - - - - - - - - - 118 | 119 | /** 120 | * Page request URI, e.g. "/path/page.html" 121 | * @var string 122 | */ 123 | public $utmp; 124 | 125 | /** 126 | * Page title 127 | * @var string 128 | */ 129 | public $utmdt; 130 | 131 | /** 132 | * Charset encoding (e.g. "UTF-8") or "-" as default 133 | * @var string 134 | */ 135 | public $utmcs = '-'; 136 | 137 | /** 138 | * Referer URL, e.g. "http://www.example.com/path/page.html", "-" as default 139 | * or "0" for internal referers 140 | * @var string 141 | */ 142 | public $utmr = '-'; 143 | 144 | 145 | // - - - - - - - - - - - - - - - - - Visitor parameters - - - - - - - - - - - - - - - - - 146 | 147 | /** 148 | * IP Address of the end user, e.g. "123.123.123.123", found in GA for Mobile examples, 149 | * but sadly seems to be ignored in normal GA use 150 | * 151 | * @link http://github.com/mptre/php-ga/blob/master/ga.php 152 | * @var string 153 | */ 154 | public $utmip; 155 | 156 | /** 157 | * Visitor's locale string (all lower-case, country part optional), e.g. "de-de" 158 | * @var string 159 | */ 160 | public $utmul; 161 | 162 | /** 163 | * Visitor's Flash version, e.g. "9.0 r28" or "-" as default 164 | * @var string 165 | */ 166 | public $utmfl = '-'; 167 | 168 | /** 169 | * Visitor's Java support, either 0 or 1 or "-" as default 170 | * @var int|string 171 | */ 172 | public $utmje = '-'; 173 | 174 | /** 175 | * Visitor's screen color depth, e.g. "32-bit" 176 | * @var string 177 | */ 178 | public $utmsc; 179 | 180 | /** 181 | * Visitor's screen resolution, e.g. "1024x768" 182 | * @var string 183 | */ 184 | public $utmsr; 185 | 186 | /** 187 | * Visitor tracking cookie parameter. 188 | * 189 | * This cookie is typically written to the browser upon the first visit to your site from that web browser. 190 | * If the cookie has been deleted by the browser operator, and the browser subsequently visits your site, 191 | * a new __utma cookie is written with a different unique ID. 192 | * 193 | * This cookie is used to determine unique visitors to your site and it is updated with each page view. 194 | * Additionally, this cookie is provided with a unique ID that Google Analytics uses to ensure both the 195 | * validity and accessibility of the cookie as an extra security measure. 196 | * 197 | * Expiration: 198 | * 2 years from set/update. 199 | * 200 | * Format: 201 | * __utma=..... 202 | * 203 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/data/UTMA.as 204 | * @var int 205 | */ 206 | public $__utma; 207 | 208 | 209 | // - - - - - - - - - - - - - - - - - Session parameters - - - - - - - - - - - - - - - - - 210 | 211 | /** 212 | * Hit id for revenue per page tracking for AdSense, a random per-session ID 213 | * 214 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/core/DocumentInfo.as#117 215 | * @var int 216 | */ 217 | public $utmhid; 218 | 219 | /** 220 | * Session timeout cookie parameter. 221 | * Will never be sent with requests, but stays here for documentation completeness. 222 | * 223 | * This cookie is used to establish and continue a user session with your site. 224 | * When a user views a page on your site, the Google Analytics code attempts to update this cookie. 225 | * If it does not find the cookie, a new one is written and a new session is established. 226 | * 227 | * Each time a user visits a different page on your site, this cookie is updated to expire in 30 minutes, 228 | * thus continuing a single session for as long as user activity continues within 30-minute intervals. 229 | * 230 | * This cookie expires when a user pauses on a page on your site for longer than 30 minutes. 231 | * You can modify the default length of a user session with the setSessionTimeout() method. 232 | * 233 | * Expiration: 234 | * 30 minutes from set/update. 235 | * 236 | * Format: 237 | * __utmb=... 238 | * 239 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/data/UTMB.as 240 | * @var string 241 | */ 242 | public $__utmb; 243 | 244 | /** 245 | * Session tracking cookie parameter. 246 | * Will never be sent with requests, but stays here for documentation completeness. 247 | * 248 | * This cookie operates in conjunction with the __utmb cookie to determine whether or not 249 | * to establish a new session for the user. 250 | * In particular, this cookie is not provided with an expiration date, 251 | * so it expires when the user exits the browser. 252 | * 253 | * Should a user visit your site, exit the browser and then return to your website within 30 minutes, 254 | * the absence of the __utmc cookie indicates that a new session needs to be established, 255 | * despite the fact that the __utmb cookie has not yet expired. 256 | * 257 | * Expiration: 258 | * Not set. 259 | * 260 | * Format: 261 | * __utmc= 262 | * 263 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/data/UTMC.as 264 | * @var string 265 | */ 266 | public $__utmc; 267 | 268 | 269 | // - - - - - - - - - - - - - - - - - E-Commerce parameters - - - - - - - - - - - - - - - - - 270 | 271 | /** 272 | * Product Code. This is the sku code for a given product, e.g. "989898ajssi" 273 | * @var string 274 | */ 275 | public $utmipc; 276 | 277 | /** 278 | * Product Name, e.g. "T-Shirt" 279 | * @var string 280 | */ 281 | public $utmipn; 282 | 283 | /** 284 | * Unit Price. Value is set to numbers only, e.g. 19.95 285 | * @var float 286 | */ 287 | public $utmipr; 288 | 289 | /** 290 | * Unit Quantity, e.g. 4 291 | * @var int 292 | */ 293 | public $utmiqt; 294 | 295 | /** 296 | * Variations on an item, e.g. "white", "black", "green" etc. 297 | * @var string 298 | */ 299 | public $utmiva; 300 | 301 | /** 302 | * Order ID, e.g. "a2343898" 303 | * @var string 304 | */ 305 | public $utmtid; 306 | 307 | /** 308 | * Affiliation 309 | * @var string 310 | */ 311 | public $utmtst; 312 | 313 | /** 314 | * Total Cost, e.g. 20.00 315 | * @var float 316 | */ 317 | public $utmtto; 318 | 319 | /** 320 | * Tax Cost, e.g. 4.23 321 | * @var float 322 | */ 323 | public $utmttx; 324 | 325 | /** 326 | * Shipping Cost, e.g. 3.95 327 | * @var float 328 | */ 329 | public $utmtsp; 330 | 331 | /** 332 | * Billing City, e.g. "Cologne" 333 | * @var string 334 | */ 335 | public $utmtci; 336 | 337 | /** 338 | * Billing Region, e.g. "North Rhine-Westphalia" 339 | * @var string 340 | */ 341 | public $utmtrg; 342 | 343 | /** 344 | * Billing Country, e.g. "Germany" 345 | * @var string 346 | */ 347 | public $utmtco; 348 | 349 | 350 | // - - - - - - - - - - - - - - - - - Campaign parameters - - - - - - - - - - - - - - - - - 351 | 352 | /** 353 | * Starts a new campaign session. Either utmcn or utmcr is present on any given request, 354 | * but never both at the same time. Changes the campaign tracking data; but does not start 355 | * a new session. Either 1 or not set. 356 | * 357 | * Found in gaforflash but not in ga.js, so we do not use it, but it will stay here for 358 | * documentation completeness. 359 | * 360 | * @deprecated 361 | * @var int 362 | */ 363 | public $utmcn; 364 | 365 | /** 366 | * Indicates a repeat campaign visit. This is set when any subsequent clicks occur on the 367 | * same link. Either utmcn or utmcr is present on any given request, but never both at the 368 | * same time. Either 1 or not set. 369 | * 370 | * Found in gaforflash but not in ga.js, so we do not use it, but it will stay here for 371 | * documentation completeness. 372 | * 373 | * @deprecated 374 | * @var int 375 | */ 376 | public $utmcr; 377 | 378 | /** 379 | * Campaign ID, a.k.a. "utm_id" query parameter for ga.js 380 | * @var string 381 | */ 382 | public $utmcid; 383 | 384 | /** 385 | * Source, a.k.a. "utm_source" query parameter for ga.js 386 | * @var string 387 | */ 388 | public $utmcsr; 389 | 390 | /** 391 | * Google AdWords Click ID, a.k.a. "gclid" query parameter for ga.js 392 | * @var string 393 | */ 394 | public $utmgclid; 395 | 396 | /** 397 | * Not known for sure, but expected to be a DoubleClick Ad Click ID. 398 | * @var string 399 | */ 400 | public $utmdclid; 401 | 402 | /** 403 | * Name, a.k.a. "utm_campaign" query parameter for ga.js 404 | * @var string 405 | */ 406 | public $utmccn; 407 | 408 | /** 409 | * Medium, a.k.a. "utm_medium" query parameter for ga.js 410 | * @var string 411 | */ 412 | public $utmcmd; 413 | 414 | /** 415 | * Terms/Keywords, a.k.a. "utm_term" query parameter for ga.js 416 | * @var string 417 | */ 418 | public $utmctr; 419 | 420 | /** 421 | * Ad Content Description, a.k.a. "utm_content" query parameter for ga.js 422 | * @var string 423 | */ 424 | public $utmcct; 425 | 426 | /** 427 | * Unknown so far. Found in ga.js. 428 | * @var int 429 | */ 430 | public $utmcvr; 431 | 432 | /** 433 | * Campaign tracking cookie parameter. 434 | * 435 | * This cookie stores the type of referral used by the visitor to reach your site, 436 | * whether via a direct method, a referring link, a website search, or a campaign such as an ad or an email link. 437 | * 438 | * It is used to calculate search engine traffic, ad campaigns and page navigation within your own site. 439 | * The cookie is updated with each page view to your site. 440 | * 441 | * Expiration: 442 | * 6 months from set/update. 443 | * 444 | * Format: 445 | * __utmz=.... 446 | * 447 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/data/UTMZ.as 448 | * @var string 449 | */ 450 | public $__utmz; 451 | 452 | 453 | // - - - - - - - - - - - - - - - - - Social Tracking parameters - - - - - - - - - - - - - - - - - 454 | 455 | /** 456 | * The network on which the action occurs (e.g. Facebook, Twitter). 457 | * @var string 458 | */ 459 | public $utmsn; 460 | 461 | /** 462 | * The type of action that happens (e.g. Like, Send, Tweet). 463 | * @var string 464 | */ 465 | public $utmsa; 466 | 467 | /** 468 | * The page URL from which the action occurred. 469 | * @var string 470 | */ 471 | public $utmsid; 472 | 473 | 474 | // - - - - - - - - - - - - - - - - - Google Website Optimizer (GWO) parameters - - - - - - - - - - - - - - - - - 475 | 476 | // TODO: Implementation needed 477 | /** 478 | * Website Optimizer cookie parameter. 479 | * 480 | * This cookie is used by Website Optimizer and only set when Website Optimizer is used in combination 481 | * with GA. See the Google Website Optimizer Help Center for details. 482 | * 483 | * Expiration: 484 | * 2 years from set/update. 485 | * 486 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/data/UTMX.as 487 | * @var string 488 | */ 489 | public $__utmx; 490 | 491 | 492 | // - - - - - - - - - - - - - - - - - Custom Variables parameters (deprecated) - - - - - - - - - - - - - - - - - 493 | 494 | // TODO: Implementation needed? 495 | /** 496 | * Deprecated custom variables cookie parameter. 497 | * 498 | * This cookie parameter is no longer relevant as of migration from setVar() to 499 | * setCustomVar() and hence not supported by this library, but will stay here for 500 | * documentation completeness. 501 | * 502 | * The __utmv cookie passes the information provided via the setVar() method, 503 | * which you use to create a custom user segment. 504 | * 505 | * Expiration: 506 | * 2 years from set/update. 507 | * 508 | * Format: 509 | * __utmv=. 510 | * 511 | * @link http://code.google.com/p/gaforflash/source/browse/trunk/src/com/google/analytics/data/UTMV.as 512 | * @deprecated 513 | * @var string 514 | */ 515 | public $__utmv; 516 | 517 | 518 | /** 519 | * Converts this parameter holder to a pure PHP array, filtering out all properties 520 | * prefixed with an underscore ("_"). 521 | * 522 | * @return array 523 | */ 524 | public function toArray() { 525 | $array = array(); 526 | foreach($this as $property => $value) { 527 | if($property[0] != '_') { 528 | $array[$property] = $value; 529 | } 530 | } 531 | return $array; 532 | } 533 | 534 | } 535 | 536 | ?> -------------------------------------------------------------------------------- /stylesheets/bootstrap-responsive.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.0.4 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | 11 | .clearfix { 12 | *zoom: 1; 13 | } 14 | 15 | .clearfix:before, 16 | .clearfix:after { 17 | display: table; 18 | content: ""; 19 | } 20 | 21 | .clearfix:after { 22 | clear: both; 23 | } 24 | 25 | .hide-text { 26 | font: 0/0 a; 27 | color: transparent; 28 | text-shadow: none; 29 | background-color: transparent; 30 | border: 0; 31 | } 32 | 33 | .input-block-level { 34 | display: block; 35 | width: 100%; 36 | min-height: 28px; 37 | -webkit-box-sizing: border-box; 38 | -moz-box-sizing: border-box; 39 | -ms-box-sizing: border-box; 40 | box-sizing: border-box; 41 | } 42 | 43 | .hidden { 44 | display: none; 45 | visibility: hidden; 46 | } 47 | 48 | .visible-phone { 49 | display: none !important; 50 | } 51 | 52 | .visible-tablet { 53 | display: none !important; 54 | } 55 | 56 | .hidden-desktop { 57 | display: none !important; 58 | } 59 | 60 | @media (max-width: 767px) { 61 | .visible-phone { 62 | display: inherit !important; 63 | } 64 | .hidden-phone { 65 | display: none !important; 66 | } 67 | .hidden-desktop { 68 | display: inherit !important; 69 | } 70 | .visible-desktop { 71 | display: none !important; 72 | } 73 | } 74 | 75 | @media (min-width: 768px) and (max-width: 979px) { 76 | .visible-tablet { 77 | display: inherit !important; 78 | } 79 | .hidden-tablet { 80 | display: none !important; 81 | } 82 | .hidden-desktop { 83 | display: inherit !important; 84 | } 85 | .visible-desktop { 86 | display: none !important ; 87 | } 88 | } 89 | 90 | @media (max-width: 480px) { 91 | .nav-collapse { 92 | -webkit-transform: translate3d(0, 0, 0); 93 | } 94 | .page-header h1 small { 95 | display: block; 96 | line-height: 18px; 97 | } 98 | input[type="checkbox"], 99 | input[type="radio"] { 100 | border: 1px solid #ccc; 101 | } 102 | .form-horizontal .control-group > label { 103 | float: none; 104 | width: auto; 105 | padding-top: 0; 106 | text-align: left; 107 | } 108 | .form-horizontal .controls { 109 | margin-left: 0; 110 | } 111 | .form-horizontal .control-list { 112 | padding-top: 0; 113 | } 114 | .form-horizontal .form-actions { 115 | padding-right: 10px; 116 | padding-left: 10px; 117 | } 118 | .modal { 119 | position: absolute; 120 | top: 10px; 121 | right: 10px; 122 | left: 10px; 123 | width: auto; 124 | margin: 0; 125 | } 126 | .modal.fade.in { 127 | top: auto; 128 | } 129 | .modal-header .close { 130 | padding: 10px; 131 | margin: -10px; 132 | } 133 | .carousel-caption { 134 | position: static; 135 | } 136 | } 137 | 138 | @media (max-width: 767px) { 139 | body { 140 | padding-right: 20px; 141 | padding-left: 20px; 142 | } 143 | .navbar-fixed-top, 144 | .navbar-fixed-bottom { 145 | margin-right: -20px; 146 | margin-left: -20px; 147 | } 148 | .container-fluid { 149 | padding: 0; 150 | } 151 | .dl-horizontal dt { 152 | float: none; 153 | width: auto; 154 | clear: none; 155 | text-align: left; 156 | } 157 | .dl-horizontal dd { 158 | margin-left: 0; 159 | } 160 | .container { 161 | width: auto; 162 | } 163 | .row-fluid { 164 | width: 100%; 165 | } 166 | .row, 167 | .thumbnails { 168 | margin-left: 0; 169 | } 170 | [class*="span"], 171 | .row-fluid [class*="span"] { 172 | display: block; 173 | float: none; 174 | width: auto; 175 | margin-left: 0; 176 | } 177 | .input-large, 178 | .input-xlarge, 179 | .input-xxlarge, 180 | input[class*="span"], 181 | select[class*="span"], 182 | textarea[class*="span"], 183 | .uneditable-input { 184 | display: block; 185 | width: 100%; 186 | min-height: 28px; 187 | -webkit-box-sizing: border-box; 188 | -moz-box-sizing: border-box; 189 | -ms-box-sizing: border-box; 190 | box-sizing: border-box; 191 | } 192 | .input-prepend input, 193 | .input-append input, 194 | .input-prepend input[class*="span"], 195 | .input-append input[class*="span"] { 196 | display: inline-block; 197 | width: auto; 198 | } 199 | } 200 | 201 | @media (min-width: 768px) and (max-width: 979px) { 202 | .row { 203 | margin-left: -20px; 204 | *zoom: 1; 205 | } 206 | .row:before, 207 | .row:after { 208 | display: table; 209 | content: ""; 210 | } 211 | .row:after { 212 | clear: both; 213 | } 214 | [class*="span"] { 215 | float: left; 216 | margin-left: 20px; 217 | } 218 | .container, 219 | .navbar-fixed-top .container, 220 | .navbar-fixed-bottom .container { 221 | width: 724px; 222 | } 223 | .span12 { 224 | width: 724px; 225 | } 226 | .span11 { 227 | width: 662px; 228 | } 229 | .span10 { 230 | width: 600px; 231 | } 232 | .span9 { 233 | width: 538px; 234 | } 235 | .span8 { 236 | width: 476px; 237 | } 238 | .span7 { 239 | width: 414px; 240 | } 241 | .span6 { 242 | width: 352px; 243 | } 244 | .span5 { 245 | width: 290px; 246 | } 247 | .span4 { 248 | width: 228px; 249 | } 250 | .span3 { 251 | width: 166px; 252 | } 253 | .span2 { 254 | width: 104px; 255 | } 256 | .span1 { 257 | width: 42px; 258 | } 259 | .offset12 { 260 | margin-left: 764px; 261 | } 262 | .offset11 { 263 | margin-left: 702px; 264 | } 265 | .offset10 { 266 | margin-left: 640px; 267 | } 268 | .offset9 { 269 | margin-left: 578px; 270 | } 271 | .offset8 { 272 | margin-left: 516px; 273 | } 274 | .offset7 { 275 | margin-left: 454px; 276 | } 277 | .offset6 { 278 | margin-left: 392px; 279 | } 280 | .offset5 { 281 | margin-left: 330px; 282 | } 283 | .offset4 { 284 | margin-left: 268px; 285 | } 286 | .offset3 { 287 | margin-left: 206px; 288 | } 289 | .offset2 { 290 | margin-left: 144px; 291 | } 292 | .offset1 { 293 | margin-left: 82px; 294 | } 295 | .row-fluid { 296 | width: 100%; 297 | *zoom: 1; 298 | } 299 | .row-fluid:before, 300 | .row-fluid:after { 301 | display: table; 302 | content: ""; 303 | } 304 | .row-fluid:after { 305 | clear: both; 306 | } 307 | .row-fluid [class*="span"] { 308 | display: block; 309 | float: left; 310 | width: 100%; 311 | min-height: 28px; 312 | margin-left: 2.762430939%; 313 | *margin-left: 2.709239449638298%; 314 | -webkit-box-sizing: border-box; 315 | -moz-box-sizing: border-box; 316 | -ms-box-sizing: border-box; 317 | box-sizing: border-box; 318 | } 319 | .row-fluid [class*="span"]:first-child { 320 | margin-left: 0; 321 | } 322 | .row-fluid .span12 { 323 | width: 99.999999993%; 324 | *width: 99.9468085036383%; 325 | } 326 | .row-fluid .span11 { 327 | width: 91.436464082%; 328 | *width: 91.38327259263829%; 329 | } 330 | .row-fluid .span10 { 331 | width: 82.87292817100001%; 332 | *width: 82.8197366816383%; 333 | } 334 | .row-fluid .span9 { 335 | width: 74.30939226%; 336 | *width: 74.25620077063829%; 337 | } 338 | .row-fluid .span8 { 339 | width: 65.74585634900001%; 340 | *width: 65.6926648596383%; 341 | } 342 | .row-fluid .span7 { 343 | width: 57.182320438000005%; 344 | *width: 57.129128948638304%; 345 | } 346 | .row-fluid .span6 { 347 | width: 48.618784527%; 348 | *width: 48.5655930376383%; 349 | } 350 | .row-fluid .span5 { 351 | width: 40.055248616%; 352 | *width: 40.0020571266383%; 353 | } 354 | .row-fluid .span4 { 355 | width: 31.491712705%; 356 | *width: 31.4385212156383%; 357 | } 358 | .row-fluid .span3 { 359 | width: 22.928176794%; 360 | *width: 22.874985304638297%; 361 | } 362 | .row-fluid .span2 { 363 | width: 14.364640883%; 364 | *width: 14.311449393638298%; 365 | } 366 | .row-fluid .span1 { 367 | width: 5.801104972%; 368 | *width: 5.747913482638298%; 369 | } 370 | input, 371 | textarea, 372 | .uneditable-input { 373 | margin-left: 0; 374 | } 375 | input.span12, 376 | textarea.span12, 377 | .uneditable-input.span12 { 378 | width: 714px; 379 | } 380 | input.span11, 381 | textarea.span11, 382 | .uneditable-input.span11 { 383 | width: 652px; 384 | } 385 | input.span10, 386 | textarea.span10, 387 | .uneditable-input.span10 { 388 | width: 590px; 389 | } 390 | input.span9, 391 | textarea.span9, 392 | .uneditable-input.span9 { 393 | width: 528px; 394 | } 395 | input.span8, 396 | textarea.span8, 397 | .uneditable-input.span8 { 398 | width: 466px; 399 | } 400 | input.span7, 401 | textarea.span7, 402 | .uneditable-input.span7 { 403 | width: 404px; 404 | } 405 | input.span6, 406 | textarea.span6, 407 | .uneditable-input.span6 { 408 | width: 342px; 409 | } 410 | input.span5, 411 | textarea.span5, 412 | .uneditable-input.span5 { 413 | width: 280px; 414 | } 415 | input.span4, 416 | textarea.span4, 417 | .uneditable-input.span4 { 418 | width: 218px; 419 | } 420 | input.span3, 421 | textarea.span3, 422 | .uneditable-input.span3 { 423 | width: 156px; 424 | } 425 | input.span2, 426 | textarea.span2, 427 | .uneditable-input.span2 { 428 | width: 94px; 429 | } 430 | input.span1, 431 | textarea.span1, 432 | .uneditable-input.span1 { 433 | width: 32px; 434 | } 435 | } 436 | 437 | @media (min-width: 1200px) { 438 | .row { 439 | margin-left: -30px; 440 | *zoom: 1; 441 | } 442 | .row:before, 443 | .row:after { 444 | display: table; 445 | content: ""; 446 | } 447 | .row:after { 448 | clear: both; 449 | } 450 | [class*="span"] { 451 | float: left; 452 | margin-left: 30px; 453 | } 454 | .container, 455 | .navbar-fixed-top .container, 456 | .navbar-fixed-bottom .container { 457 | width: 1170px; 458 | } 459 | .span12 { 460 | width: 1170px; 461 | } 462 | .span11 { 463 | width: 1070px; 464 | } 465 | .span10 { 466 | width: 970px; 467 | } 468 | .span9 { 469 | width: 870px; 470 | } 471 | .span8 { 472 | width: 770px; 473 | } 474 | .span7 { 475 | width: 670px; 476 | } 477 | .span6 { 478 | width: 570px; 479 | } 480 | .span5 { 481 | width: 470px; 482 | } 483 | .span4 { 484 | width: 370px; 485 | } 486 | .span3 { 487 | width: 270px; 488 | } 489 | .span2 { 490 | width: 170px; 491 | } 492 | .span1 { 493 | width: 70px; 494 | } 495 | .offset12 { 496 | margin-left: 1230px; 497 | } 498 | .offset11 { 499 | margin-left: 1130px; 500 | } 501 | .offset10 { 502 | margin-left: 1030px; 503 | } 504 | .offset9 { 505 | margin-left: 930px; 506 | } 507 | .offset8 { 508 | margin-left: 830px; 509 | } 510 | .offset7 { 511 | margin-left: 730px; 512 | } 513 | .offset6 { 514 | margin-left: 630px; 515 | } 516 | .offset5 { 517 | margin-left: 530px; 518 | } 519 | .offset4 { 520 | margin-left: 430px; 521 | } 522 | .offset3 { 523 | margin-left: 330px; 524 | } 525 | .offset2 { 526 | margin-left: 230px; 527 | } 528 | .offset1 { 529 | margin-left: 130px; 530 | } 531 | .row-fluid { 532 | width: 100%; 533 | *zoom: 1; 534 | } 535 | .row-fluid:before, 536 | .row-fluid:after { 537 | display: table; 538 | content: ""; 539 | } 540 | .row-fluid:after { 541 | clear: both; 542 | } 543 | .row-fluid [class*="span"] { 544 | display: block; 545 | float: left; 546 | width: 100%; 547 | min-height: 28px; 548 | margin-left: 2.564102564%; 549 | *margin-left: 2.510911074638298%; 550 | -webkit-box-sizing: border-box; 551 | -moz-box-sizing: border-box; 552 | -ms-box-sizing: border-box; 553 | box-sizing: border-box; 554 | } 555 | .row-fluid [class*="span"]:first-child { 556 | margin-left: 0; 557 | } 558 | .row-fluid .span12 { 559 | width: 100%; 560 | *width: 99.94680851063829%; 561 | } 562 | .row-fluid .span11 { 563 | width: 91.45299145300001%; 564 | *width: 91.3997999636383%; 565 | } 566 | .row-fluid .span10 { 567 | width: 82.905982906%; 568 | *width: 82.8527914166383%; 569 | } 570 | .row-fluid .span9 { 571 | width: 74.358974359%; 572 | *width: 74.30578286963829%; 573 | } 574 | .row-fluid .span8 { 575 | width: 65.81196581200001%; 576 | *width: 65.7587743226383%; 577 | } 578 | .row-fluid .span7 { 579 | width: 57.264957265%; 580 | *width: 57.2117657756383%; 581 | } 582 | .row-fluid .span6 { 583 | width: 48.717948718%; 584 | *width: 48.6647572286383%; 585 | } 586 | .row-fluid .span5 { 587 | width: 40.170940171000005%; 588 | *width: 40.117748681638304%; 589 | } 590 | .row-fluid .span4 { 591 | width: 31.623931624%; 592 | *width: 31.5707401346383%; 593 | } 594 | .row-fluid .span3 { 595 | width: 23.076923077%; 596 | *width: 23.0237315876383%; 597 | } 598 | .row-fluid .span2 { 599 | width: 14.529914530000001%; 600 | *width: 14.4767230406383%; 601 | } 602 | .row-fluid .span1 { 603 | width: 5.982905983%; 604 | *width: 5.929714493638298%; 605 | } 606 | input, 607 | textarea, 608 | .uneditable-input { 609 | margin-left: 0; 610 | } 611 | input.span12, 612 | textarea.span12, 613 | .uneditable-input.span12 { 614 | width: 1160px; 615 | } 616 | input.span11, 617 | textarea.span11, 618 | .uneditable-input.span11 { 619 | width: 1060px; 620 | } 621 | input.span10, 622 | textarea.span10, 623 | .uneditable-input.span10 { 624 | width: 960px; 625 | } 626 | input.span9, 627 | textarea.span9, 628 | .uneditable-input.span9 { 629 | width: 860px; 630 | } 631 | input.span8, 632 | textarea.span8, 633 | .uneditable-input.span8 { 634 | width: 760px; 635 | } 636 | input.span7, 637 | textarea.span7, 638 | .uneditable-input.span7 { 639 | width: 660px; 640 | } 641 | input.span6, 642 | textarea.span6, 643 | .uneditable-input.span6 { 644 | width: 560px; 645 | } 646 | input.span5, 647 | textarea.span5, 648 | .uneditable-input.span5 { 649 | width: 460px; 650 | } 651 | input.span4, 652 | textarea.span4, 653 | .uneditable-input.span4 { 654 | width: 360px; 655 | } 656 | input.span3, 657 | textarea.span3, 658 | .uneditable-input.span3 { 659 | width: 260px; 660 | } 661 | input.span2, 662 | textarea.span2, 663 | .uneditable-input.span2 { 664 | width: 160px; 665 | } 666 | input.span1, 667 | textarea.span1, 668 | .uneditable-input.span1 { 669 | width: 60px; 670 | } 671 | .thumbnails { 672 | margin-left: -30px; 673 | } 674 | .thumbnails > li { 675 | margin-left: 30px; 676 | } 677 | .row-fluid .thumbnails { 678 | margin-left: 0; 679 | } 680 | } 681 | 682 | @media (max-width: 979px) { 683 | body { 684 | padding-top: 0; 685 | } 686 | .navbar-fixed-top, 687 | .navbar-fixed-bottom { 688 | position: static; 689 | } 690 | .navbar-fixed-top { 691 | margin-bottom: 18px; 692 | } 693 | .navbar-fixed-bottom { 694 | margin-top: 18px; 695 | } 696 | .navbar-fixed-top .navbar-inner, 697 | .navbar-fixed-bottom .navbar-inner { 698 | padding: 5px; 699 | } 700 | .navbar .container { 701 | width: auto; 702 | padding: 0; 703 | } 704 | .navbar .brand { 705 | padding-right: 10px; 706 | padding-left: 10px; 707 | margin: 0 0 0 -5px; 708 | } 709 | .nav-collapse { 710 | clear: both; 711 | } 712 | .nav-collapse .nav { 713 | float: none; 714 | margin: 0 0 9px; 715 | } 716 | .nav-collapse .nav > li { 717 | float: none; 718 | } 719 | .nav-collapse .nav > li > a { 720 | margin-bottom: 2px; 721 | } 722 | .nav-collapse .nav > .divider-vertical { 723 | display: none; 724 | } 725 | .nav-collapse .nav .nav-header { 726 | color: #999999; 727 | text-shadow: none; 728 | } 729 | .nav-collapse .nav > li > a, 730 | .nav-collapse .dropdown-menu a { 731 | padding: 6px 15px; 732 | font-weight: bold; 733 | color: #999999; 734 | -webkit-border-radius: 3px; 735 | -moz-border-radius: 3px; 736 | border-radius: 3px; 737 | } 738 | .nav-collapse .btn { 739 | padding: 4px 10px 4px; 740 | font-weight: normal; 741 | -webkit-border-radius: 4px; 742 | -moz-border-radius: 4px; 743 | border-radius: 4px; 744 | } 745 | .nav-collapse .dropdown-menu li + li a { 746 | margin-bottom: 2px; 747 | } 748 | .nav-collapse .nav > li > a:hover, 749 | .nav-collapse .dropdown-menu a:hover { 750 | background-color: #222222; 751 | } 752 | .nav-collapse.in .btn-group { 753 | padding: 0; 754 | margin-top: 5px; 755 | } 756 | .nav-collapse .dropdown-menu { 757 | position: static; 758 | top: auto; 759 | left: auto; 760 | display: block; 761 | float: none; 762 | max-width: none; 763 | padding: 0; 764 | margin: 0 15px; 765 | background-color: transparent; 766 | border: none; 767 | -webkit-border-radius: 0; 768 | -moz-border-radius: 0; 769 | border-radius: 0; 770 | -webkit-box-shadow: none; 771 | -moz-box-shadow: none; 772 | box-shadow: none; 773 | } 774 | .nav-collapse .dropdown-menu:before, 775 | .nav-collapse .dropdown-menu:after { 776 | display: none; 777 | } 778 | .nav-collapse .dropdown-menu .divider { 779 | display: none; 780 | } 781 | .nav-collapse .navbar-form, 782 | .nav-collapse .navbar-search { 783 | float: none; 784 | padding: 9px 15px; 785 | margin: 9px 0; 786 | border-top: 1px solid #222222; 787 | border-bottom: 1px solid #222222; 788 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 789 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 790 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 791 | } 792 | .navbar .nav-collapse .nav.pull-right { 793 | float: none; 794 | margin-left: 0; 795 | } 796 | .nav-collapse, 797 | .nav-collapse.collapse { 798 | height: 0; 799 | overflow: hidden; 800 | } 801 | .navbar .btn-navbar { 802 | display: block; 803 | } 804 | .navbar-static .navbar-inner { 805 | padding-right: 10px; 806 | padding-left: 10px; 807 | } 808 | } 809 | 810 | @media (min-width: 980px) { 811 | .nav-collapse.collapse { 812 | height: auto !important; 813 | overflow: visible !important; 814 | } 815 | } 816 | -------------------------------------------------------------------------------- /js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap.js by @fat & @mdo 3 | * Copyright 2012 Twitter, Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0.txt 5 | */ 6 | !function(a){a(function(){"use strict",a.support.transition=function(){var a=function(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},c;for(c in b)if(a.style[c]!==undefined)return b[c]}();return a&&{end:a}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger(b=a.Event("close"));if(b.isDefaultPrevented())return;e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=c,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(b){return b||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(a){return a||(this.paused=!0),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this,j=a.Event("slide");this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h]();if(e.hasClass("active"))return;if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(j);if(j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})}else{this.$element.trigger(j);if(j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=a.extend({},a.fn.carousel.defaults,typeof c=="object"&&c);e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():f.interval&&e.cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b,c,d,e;if(this.transitioning)return;b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find("> .accordion-group > .in");if(d&&d.length){e=d.data("collapse");if(e&&e.transitioning)return;d.collapse("hide"),e||d.data("collapse",null)}this.$element[b](0),this.transition("addClass",a.Event("show"),"shown"),this.$element[b](this.$element[0][c])},hide:function(){var b;if(this.transitioning)return;b=this.dimension(),this.reset(this.$element[b]()),this.transition("removeClass",a.Event("hide"),"hidden"),this.$element[b](0)},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[a!==null?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){c.type=="show"&&e.reset(),e.transitioning=0,e.$element.trigger(d)};this.$element.trigger(c);if(c.isDefaultPrevented())return;this.transitioning=1,this.$element[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e,f,g;if(c.is(".disabled, :disabled"))return;return f=c.attr("data-target"),f||(f=c.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,"")),e=a(f),e.length||(e=c.parent()),g=e.hasClass("open"),d(),g||e.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown",".dropdown form",function(a){a.stopPropagation()}).on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('