X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=themes%2Fdefault%2Frenderer.php;h=252dbfb840712807305573dbdbe53e53ab14fa77;hb=fc24ee893402902fc58632dabb5d7c2594e191d0;hp=473cf82f279063963f8a6cfb6991212e02c23ead;hpb=d567a10b7925c8bb97c734e213d6651a979af29d;p=fa-stable.git diff --git a/themes/default/renderer.php b/themes/default/renderer.php index 473cf82f..252dbfb8 100644 --- a/themes/default/renderer.php +++ b/themes/default/renderer.php @@ -9,11 +9,23 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ + class renderer { + function get_icon($category) + { + global $path_to_root, $show_menu_category_icons; + + if ($show_menu_category_icons) + $img = $category == '' ? 'right.gif' : $category.'.png'; + else + $img = 'right.gif'; + return "  "; + } + function wa_header() { - page(_("Main Menu"), false, true); + page(_($help_context = "Main Menu"), false, true); } function wa_footer() @@ -24,11 +36,6 @@ function menu_header($title, $no_menu, $is_index) { global $path_to_root, $help_base_url, $db_connections; - - // you can owerride the table styles from config.php here, if you want. - //global $table_style, $table_style2; - //$table_style = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'"; - //$table_style2 = "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'"; echo "\n"; echo "\n"; echo "
\n"; @@ -38,79 +45,87 @@ echo "\n"; echo "\n"; echo "\n"; - echo "
\n"; + echo "\n"; // tabs if (!$no_menu) { $applications = $_SESSION['App']->applications; $local_path_to_root = $path_to_root; - $img = ""._(  "; - $himg = ""._(  "; $sel_app = $_SESSION['sel_app']; - echo "
"; - echo "
"; + echo "
"; + echo "
"; foreach($applications as $app) { - $acc = access_string($app->name); - echo "id ? "class='selected' " : ""). - "href='$local_path_to_root/index.php?application=".$app->id. - SID ."'$acc[1]>" .$acc[0] . ""; + if ($_SESSION["wa_current_user"]->check_application_access($app)) + { + $acc = access_string($app->name); + echo "" .$acc[0] . ""; + } } echo "
"; echo "
"; - echo ""; - echo ""; + // top status bar + $img = ""._(  "; + $himg = ""._(  "; + echo "
" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "
"; + echo ""; $indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif"; - echo ""; - echo " "; + echo "
" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "" . _("Preferences") . "   \n"; - echo " " . _("Change password") . "   \n"; + echo "" . _("Preferences") . "   \n"; + echo " " . _("Change password") . "   \n"; if ($help_base_url != null) { - echo "$himg" . _("Help") . "   "; + echo "$himg" . _("Help") . "   "; } - echo "$img" . _("Logout") . "   "; + echo "$img" . _("Logout") . "   "; + echo "
"; echo "
"; } echo "
"; - if ($title && !$no_menu && !$is_index) + if ($no_menu) + echo "
"; + elseif ($title && !$is_index) { - echo "
" + echo "
$title
" ."" ."
$title" .(user_hints() ? "" : '') ."
"; } - - if (!$is_index) - echo "
"; - } function menu_footer($no_menu, $is_index) { - global $version, $allow_demo_mode, $app_title, $power_url, $power_by, $path_to_root; + global $version, $allow_demo_mode, $app_title, $power_url, + $power_by, $path_to_root, $Pagehelp, $Ajax; include_once($path_to_root . "/includes/date_functions.inc"); - if ($no_menu == false) + echo "
\n"; // 'main_page' + if ($no_menu == false) // bottom status line { if ($is_index) - echo "\n"; + echo "
\n"; else - echo "
\n"; + echo "
\n"; echo ""; - if (isset($_SESSION['wa_current_user'])) - echo "\n"; + if (isset($_SESSION['wa_current_user'])) { + $phelp = implode('; ', $Pagehelp); + echo "\n"; + $Ajax->addUpdate(true, 'hotkeyshelp', $phelp); + echo ""; + } echo "
" . Today() . " | " . Now() . "" . Today() . " | " . Now() . "".$phelp."
\n"; } - echo "
\n"; - echo "\n"; + echo " \n"; // 'callout_main' if ($no_menu == false) { echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -130,10 +145,20 @@ global $path_to_root; $selected_app = $waapp->get_selected_application(); + if (!$_SESSION["wa_current_user"]->check_application_access($selected_app)) + return; - $img = "  "; + if (method_exists($selected_app, 'render_index')) + { + $selected_app->render_index(); + return; + } + + echo ""; foreach ($selected_app->modules as $module) { + if (!$_SESSION["wa_current_user"]->check_module_access($module)) + continue; // image echo ""; // values @@ -146,15 +171,18 @@ foreach ($module->lappfunctions as $appfunction) { - if ($_SESSION["wa_current_user"]->can_access_page($appfunction->access)) + $img = $this->get_icon($appfunction->category); + if ($appfunction->label == "") + echo " 
"; + elseif ($_SESSION["wa_current_user"]->can_access_page($appfunction->access)) { - if ($appfunction->label == "") - echo " 
"; - else - { - $lnk = access_string($appfunction->label); - echo "$img$lnk[0]
"; - } + echo $img.menu_link($appfunction->link, $appfunction->label)."
\n"; + } + elseif (!$_SESSION["wa_current_user"]->hide_inaccessible_menu_items()) + { + echo $img.'' + .access_string($appfunction->label, true) + ."
\n"; } } echo ""; @@ -163,15 +191,18 @@ echo ""; @@ -179,9 +210,7 @@ echo "
"; } - echo ""; - } - } - + } +} ?> \ No newline at end of file