X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=themes%2Fdefault%2Frenderer.php;h=e32cbb46876460cd79495dce09593d8a09bfbaa1;hb=0489317205141deaecefe3a7243d11a3e38a51d0;hp=5ba820da3ea10bf85c6bc2b50bc6d3e67a5bc1bc;hpb=d2cc0860eccf02eaefcd90731ac3af141a841529;p=fa-stable.git diff --git a/themes/default/renderer.php b/themes/default/renderer.php index 5ba820da..e32cbb46 100644 --- a/themes/default/renderer.php +++ b/themes/default/renderer.php @@ -9,11 +9,22 @@ 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(_($help_context = "Main Menu"), false, true); } @@ -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"; @@ -50,11 +57,13 @@ 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 "
"; @@ -63,14 +72,14 @@ echo "" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . ""; $indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif"; echo ""; - echo " " . _("Preferences") . "   \n"; - echo " " . _("Change password") . "   \n"; + echo " " . _("Preferences") . "   \n"; + echo " " . _("Change password") . "   \n"; if ($help_base_url != null) { echo "$himg" . _("Help") . "   "; } - echo "$img" . _("Logout") . "   "; + echo "$img" . _("Logout") . "   "; echo ""; echo ""; } @@ -135,10 +144,12 @@ global $path_to_root; $selected_app = $waapp->get_selected_application(); - - $img = "  "; + if (!$_SESSION["wa_current_user"]->check_application_access($selected_app)) + return; foreach ($selected_app->modules as $module) { + if (!$_SESSION["wa_current_user"]->check_module_access($module)) + continue; // image echo ""; // values @@ -151,13 +162,14 @@ foreach ($module->lappfunctions as $appfunction) { + $img = $this->get_icon($appfunction->category); if ($appfunction->label == "") echo " 
"; elseif ($_SESSION["wa_current_user"]->can_access_page($appfunction->access)) { echo $img.menu_link($appfunction->link, $appfunction->label)."
\n"; } - else + elseif (!$_SESSION["wa_current_user"]->hide_inaccessible_menu_items()) { echo $img.'' .access_string($appfunction->label, true) @@ -170,13 +182,14 @@ echo ""; foreach ($module->rappfunctions as $appfunction) { + $img = $this->get_icon($appfunction->category); if ($appfunction->label == "") echo " 
"; elseif ($_SESSION["wa_current_user"]->can_access_page($appfunction->access)) { echo $img.menu_link($appfunction->link, $appfunction->label)."
\n"; } - else + elseif (!$_SESSION["wa_current_user"]->hide_inaccessible_menu_items()) { echo $img.'' .access_string($appfunction->label, true) @@ -187,10 +200,11 @@ } echo ""; - } - + } echo ""; } - } + } + + ?> \ No newline at end of file