X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=themes%2Fdefault%2Frenderer.php;h=53c2ea4410fdf07301891eb245eca56a7674268b;hb=7561718ee5113232ce917f63085d272884b0929c;hp=aaee7125ccff889b85c497fae961ef5b99e534f3;hpb=d9b4de9d7e9d3ba77f6ece752fd6cc988effd8f1;p=fa-stable.git diff --git a/themes/default/renderer.php b/themes/default/renderer.php index aaee7125..53c2ea44 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, $SysPrefs; + + if ($SysPrefs->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); } @@ -24,7 +35,7 @@ function menu_header($title, $no_menu, $is_index) { - global $path_to_root, $help_base_url, $db_connections; + global $path_to_root, $SysPrefs, $db_connections; echo "\n"; echo "\n"; echo "
\n"; @@ -34,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 ""; + 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 . "
" . $db_connections[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) + if ($SysPrefs->help_base_url != null) { echo "$himg" . _("Help") . "   "; } - echo "$img" . _("Logout") . "   "; + echo "$img" . _("Logout") . "   "; echo "
"; echo "
"; } @@ -86,11 +100,11 @@ function menu_footer($no_menu, $is_index) { - global $version, $allow_demo_mode, $app_title, $power_url, - $power_by, $path_to_root, $Pagehelp, $Ajax; + global $version, $path_to_root, $Pagehelp, $Ajax, $SysPrefs; 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"; @@ -103,25 +117,21 @@ $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"; + echo "\n"; echo "\n"; - if ($allow_demo_mode==true) - { - echo "\n"; - //echo "\n"; - echo "\n"; - } echo "

\n"; } } @@ -131,10 +141,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 @@ -147,13 +167,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) @@ -166,13 +187,14 @@ echo "
"; } - echo ""; - } - } - -?> \ No newline at end of file + } +}