X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Findex.php;h=498f2fb31614eebf15753295ac24213579ae8184;hb=cec12fb078b118f5d16d1988a1df0216caac01af;hp=9a7665b1e27d58c6724c90aad0b8ab32ad8afa78;hpb=03002883141b5e751650f5a28812456c2aa5f054;p=brisk.git
diff --git a/web/index.php b/web/index.php
index 9a7665b..498f2fb 100644
--- a/web/index.php
+++ b/web/index.php
@@ -237,12 +237,71 @@ function poll_dom() {
return '';
}
-function index_main(&$brisk, $transp_type, &$header_out, $addr, $get, $post, $cookie)
+function sidebanners_init($sidebanner_idx)
+{
+ for ($i = 0 ; $i < count($sidebanner_idx) ; $i++) {
+ printf(" sidebanner_init(%d);\n", $i);
+ }
+}
+
+function sidebanners_render($sidebanner, $sidebanner_idx)
+{
+ $sb_n = count($sidebanner_idx);
+ if ($sb_n == 0) {
+ return;
+ }
+
+ if ($sb_n == 1) {
+ printf("
");
+ }
+
+ for ($i = 0 ; $i < $sb_n ; $i++) {
+ $idx = $sidebanner_idx[$i];
+ $sb = $sidebanner[$idx];
+ if (!array_key_exists('link', $sb)
+ || !array_key_exists('title', $sb)
+ || !array_key_exists('icon_big', $sb)) {
+ continue;
+ }
+ $sb_type = (array_key_exists('type', $sb) ? $sb['type'] : 'meeting');
+ if (array_key_exists('icon', $sb)) {
+ $sb_icon = $sb['icon'];
+ }
+ else {
+ if ($sb_type == 'meeting') {
+ if ($sb_n < 3) {
+ $sb_icon = 'img/brisk_meeting60.gif';
+ }
+ else {
+ $sb_icon = 'img/brisk_meeting35.gif';
+ }
+ }
+ else {
+ // no standard icon for other type of events please add them
+ continue;
+ }
+ }
+ $sb_dx = (array_key_exists('dx', $sb) ? $sb['dx'] : 100);
+ $sb_dy = (array_key_exists('dy', $sb) ? $sb['dy'] : -230);
+
+ printf('
\n");
printf($brisk_vertical_menu, '', '');
- if ($G_with_sidebanner xor $G_with_sidebanner2) {
- printf(" "); - } - - if ($G_with_sidebanner) { - printf("%s", $G_sidebanner); - } - - - if ($G_with_sidebanner2) { - printf("%s", $G_sidebanner2); - } + sidebanners_render($G_sidebanner, $G_sidebanner_idx); printf(" | ");
?>
@@ -1086,13 +1138,7 @@ else {
if ($G_with_topbanner) {
printf(" topbanner_init();\n");
}
- if ($G_with_sidebanner) {
- printf(" sidebanner_init();\n");
- }
- if ($G_with_sidebanner2) {
- printf(" sidebanner2_init();\n");
- }
-
+ sidebanners_init($G_sidebanner_idx);
?>
sess = "";
xstm = new xynt_streaming(window, "", 80, 2, null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd.php', function(com){eval(com);});
@@ -1152,19 +1198,7 @@ if ($is_login) {
printf("
|