X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=themes%2Fdefault%2Frenderer.php;h=ae0cb59e544856495578bc93f9844235975e435a;hb=fbf51ab0febfd0885620abcab8738339d156ff45;hp=cde08ae3125cac429721e3099a2bae9a89262b5b;hpb=cf7be1f00c6abe59755286e0c3108d9d3c0356da;p=fa-stable.git diff --git a/themes/default/renderer.php b/themes/default/renderer.php index cde08ae3..ae0cb59e 100644 --- a/themes/default/renderer.php +++ b/themes/default/renderer.php @@ -9,12 +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() { -// add_js_ufile("themes/default/renderer.js"); - page(_("Main Menu"), false, true); + page(_($help_context = "Main Menu"), false, true); } function wa_footer() @@ -25,10 +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,39 +45,42 @@ 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 "
"; foreach($applications as $app) { - $acc = access_string($app->name); - echo "id ? - ("class='selected'") : "") - ." href='$local_path_to_root/index.php?application=".$app->id - ."'$acc[1]>" .$acc[0] . ""; + if ($_SESSION["wa_current_user"]->check_application_access($app)) + { + $acc = access_string($app->name); + echo "" .$acc[0] . ""; + } } echo "
"; echo "
"; + // top status bar + $img = ""._(  "; + $himg = ""._(  "; echo ""; echo ""; $indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif"; 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 "
"; } @@ -94,7 +104,8 @@ $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"; @@ -107,15 +118,15 @@ $Ajax->addUpdate(true, 'hotkeyshelp', $phelp); echo ""; } - echo "
".$phelp."
\n"; + echo "
\n"; } - echo "\n"; + echo " \n"; // 'callout_main' echo "\n"; if ($no_menu == false) { echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -135,10 +146,20 @@ global $path_to_root; $selected_app = $waapp->get_selected_application(); + if (!$_SESSION["wa_current_user"]->check_application_access($selected_app)) + return; + + if (method_exists($selected_app, 'render_index')) + { + $selected_app->render_index(); + return; + } - $img = "  "; + echo ""; foreach ($selected_app->modules as $module) { + if (!$_SESSION["wa_current_user"]->check_module_access($module)) + continue; // image echo ""; // values @@ -151,13 +172,19 @@ 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 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 ""; if (sizeof($module->rappfunctions) > 0) @@ -165,22 +192,26 @@ echo ""; } echo "
"; } - echo ""; - } - } - + } +} ?> \ No newline at end of file