3 $jsDir="../../ricoClient/js/"; // directory containing Rico's javascript files
\r
4 $cssDir="../../ricoClient/css/"; // directory containing Rico's css files
\r
5 $imgDir="../../ricoClient/images/"; // directory containing Rico's image files
\r
7 $grid_striping=true; // apply row striping to LiveGrids?
\r
8 $checkQueryString = true; // load settings from QueryString? true for demo, false for production
\r
9 $LoadBaseLib = true; // load base Javascript library (prototype, jQuery, etc)?
\r
10 $jQuery_theme_path = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/";
\r
12 if ($checkQueryString) {
\r
13 $ricoLib=$_GET['lib'];
\r
14 $ricoTheme=$_GET["theme"];
\r
15 $ricoLogging=isset($_GET["log"]);
\r
17 // set your production values here
\r
18 $ricoLib="proto_min.js"; // base library
\r
19 $ricoTheme="j-ui-lightness"; // jquery themes start with j-, rico themes start with r-
\r
24 LoadLib($ricoLib, $LoadBaseLib);
\r
26 LoadTheme($ricoTheme);
\r
30 function WriteStyles() {
\r
31 global $imgDir,$ricoTheme;
\r
32 echo "<style type='text/css'>\n";
\r
33 //For Each ctrl As Control In Page.Controls
\r
34 // If TypeOf (ctrl) Is GridBase Then writer.Write(CType(ctrl, GridBase).GridRules())
\r
35 // If TypeOf (ctrl) Is LiveGrid Then writer.Write(CType(ctrl, LiveGrid).ColumnRules())
\r
37 if ($ricoTheme=="r-grayedout") {
\r
38 echo ".Rico_accTitle, .ricoTitle, table.ricoLiveGrid thead th, table.ricoLiveGrid thead td, tr.ricoLG_hdg td, tr.ricoLG_hdg th {\n";
\r
39 echo " background-position: left center;\n";
\r
40 echo " background-repeat: repeat-x;\n";
\r
41 echo " background-image: url('" . $imgDir . "grayedout.gif');\n";
\r
44 echo ".ricoLG_Resize {\n";
\r
45 echo " background-repeat: repeat;\n";
\r
46 echo " background-image: url('" . $imgDir . "resize.gif');\n";
\r
48 echo ".rico-icon {\n";
\r
49 echo " background-repeat: no-repeat;\n";
\r
50 echo " background-image: url('" . $imgDir . "ricoIcons.gif');\n";
\r
57 function SetConfig() {
\r
58 global $ricoLogging;
\r
59 echo "\n<script type='text/javascript'>\n";
\r
60 echo "Rico_CONFIG = {\n";
\r
61 if ($ricoLogging) echo "enableLogging: true,\n";
\r
67 function LoadLib($baseLib, $baseLoadFlag) {
\r
69 if ($baseLoadFlag) {
\r
70 if (strpos($baseLib,"/") === false) {
\r
71 echo "<script src='".$jsDir.$baseLib."' type='text/javascript'></script>\n";
\r
73 echo "<script src='http://ajax.googleapis.com/ajax/libs/".$baseLib."' type='text/javascript'></script>\n";
\r
76 requireRicoJS("2" . substr($baseLib,0,3));
\r
77 requireRicoJS("_min");
\r
78 requireRicoCSS("rico");
\r
82 // -------------------------------------------------------------
\r
83 // Check languages accepted by browser
\r
84 // and see if there is a match
\r
85 // -------------------------------------------------------------
\r
86 function setLang() {
\r
88 $lang=strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"]);
\r
89 $arLang=explode(",",$lang);
\r
90 for ($i=0; $i<count($arLang); $i++) {
\r
91 $lang2=strtolower(substr(trim($arLang[$i]),0,2));
\r
92 if ($lang2=='en') break; // already included
\r
93 $fname=$transDir."ricoLocale_".$lang2.".js";
\r
94 if (file_exists($fname)) {
\r
95 echo "<script src='".$fname."' type='text/javascript'></script>\n";
\r
103 // "j-ui-lightness" for a Themeroller theme
\r
104 // "r-greenHdg" for a native Rico theme
\r
105 function LoadTheme($theme) {
\r
106 global $cssDir,$grid_striping,$jQuery_theme_path;
\r
107 $prefix=substr($theme,0,1);
\r
108 $theme=substr($theme,2);
\r
111 requireRicoJS("Themeroller");
\r
112 echo "<link type='text/css' rel='Stylesheet' href='" . $jQuery_theme_path . $theme."/jquery-ui.css' />\n";
\r
115 requireRicoCSS($theme);
\r
118 if ($grid_striping) {
\r
119 echo "<link type='text/css' rel='stylesheet' href='".$cssDir."striping_".$theme.".css' />\n";
\r
123 function requireRicoJS($filename) {
\r
125 echo "<script src='".$jsDir."rico".$filename.".js' type='text/javascript'></script>\n";
\r
128 function requireRicoCSS($filename) {
\r
130 echo "<link href='".$cssDir.$filename.".css' type='text/css' rel='stylesheet' />\n";
\r