function menu_header($title, $no_menu, $is_index) { global $path_to_root, $help_base_url, $db_connections; if (!$no_menu) { $context = array(); $context['themePath'] = $path_to_root . '/themes/' . user_theme(); $context['selected_application'] = $_SESSION['sel_app']; $context['applications'] = array(); $local_path_to_root = $path_to_root; $applications = $_SESSION['App']->applications; foreach ($applications as $app) { if ($_SESSION["wa_current_user"]->check_application_access($app)) { $acc = access_string($app->name); $context['applications'][] = array('id' => $app->id, 'link' => $local_path_to_root . '/index.php?application=' . $app->id, 'name' => $acc[0], 'class' => $app->id == $_SESSION['sel_app'] ? 'active' : '', 'accessKey' => $acc[1]); } } $navBar = ThemeBootstrap::get()->render('nav.twig.html', $context); echo $navBar; // top status bar $context = array('rootPath' => $local_path_to_root, 'companyName' => $db_connections[$_SESSION["wa_current_user"]->company]["name"], 'serverName' => $_SERVER['SERVER_NAME'], 'userDisplayName' => $_SESSION["wa_current_user"]->name, 'userName' => $_SESSION["wa_current_user"]->username, 'ajaxIndicator' => "{$path_to_root}/themes/" . user_theme() . "/images/ajax-loader.gif"); $statusBar = ThemeBootstrap::get()->renderBlock('page.twig.html', 'status', $context); echo $statusBar; } // echo "</td></tr></table>"; // if ($no_menu) // echo "<br>"; // elseif ($title && ! $is_index) { // echo "<center><table id='title'><tr><td width='100%' class='titletext'>$title</td>" . "<td align=right>" . (user_hints() ? "<span id='hints'></span>" : '') . "</td>" . "</tr></table></center>"; // } }
function display() { global $path_to_root; include_once $path_to_root . "/themes/" . user_theme() . "/renderer.php"; $this->init(); $rend = new renderer(); $rend->wa_header(); $rend->display_applications($this); $rend->wa_footer(); $this->renderer =& $rend; }
function menu_header($title, $no_menu, $is_index) { global $path_to_root, $help_base_url, $db_connections, $app_title, $version; $sel_app = $_SESSION['sel_app']; echo "<div id='content'>\n"; if (!$no_menu) { $applications = $_SESSION['App']->applications; echo "<div id='top'>\n"; echo "<p>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</p>\n"; echo "<ul>\n"; echo " <li><a class='shortcut' href='{$path_to_root}/admin/display_prefs.php?'>" . _("Preferences") . "</a></li>\n"; echo " <li><a class='shortcut' href='{$path_to_root}/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a></li>\n"; if ($help_base_url != null) { echo " <li><a target = '_blank' onclick=" . '"' . "javascript:openWindow(this.href,this.target); return false;" . '" ' . "href='" . help_url() . "'>" . _("Help") . "</a></li>"; } echo " <li><a class='shortcut' href='{$path_to_root}/access/logout.php?'>" . _("Logout") . "</a></li>"; echo "</ul>\n"; echo "</div>\n"; echo "<div id='logo'>\n"; $indicator = "{$path_to_root}/themes/" . user_theme() . "/images/ajax-loader.gif"; echo "<h1>{$app_title} {$version}<span style='padding-left:280px;'><img id='ajaxmark' src='{$indicator}' align='center' style='visibility:hidden;'></span></h1>\n"; echo "<p id='slogan'>" . _("Theme:") . " " . user_theme() . "</p>\n"; echo "</div>\n"; $local_path_to_root = $path_to_root; echo "<ul id='_tabs'>\n"; foreach ($applications as $app) { $acc = access_string($app->name); echo "<li><a class='" . ($sel_app == $app->id ? 'selected' : 'menu_tab') . "' href='{$local_path_to_root}/index.php?application=" . $app->id . "'{$acc['1']}>" . $acc[0] . "</a></li>\n"; } echo "</ul>\n"; } echo "<div id='wrapper'>\n"; if ($no_menu) { echo "<br>"; } elseif ($title && !$is_index) { echo "<center><table id='title'><tr><td width='100%' class='titletext'>{$title}</td>" . "<td align=right>" . (user_hints() ? "<span id='hints'></span>" : '') . "</td>" . "</tr></table></center>"; } }
function menu_footer($no_menu, $is_index) { 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"; echo "</td></tr></table>\n"; // 'main_page' if ($no_menu == false) { if ($is_index) { echo "<table class='bottomBar'>\n"; } else { echo "<table class='bottomBar2'>\n"; } echo "<tr>"; if (isset($_SESSION['wa_current_user'])) { $phelp = implode('; ', $Pagehelp); echo "<td class='bottomBarCell'>" . Today() . " | " . Now() . "</td>\n"; $Ajax->addUpdate(true, 'hotkeyshelp', $phelp); echo "<td id='hotkeyshelp'>" . $phelp . "</td>"; } echo "</tr></table>\n"; } echo "</td></tr> </table>\n"; // 'callout_main' if ($no_menu == false) { echo "<table align='center' id='footer'>\n"; echo "<tr>\n"; echo "<td align='center' class='footer'><a target='_blank' href='{$power_url}' tabindex='-1'><font color='#ffffff'>{$app_title} {$version} - " . _("Theme:") . " " . user_theme() . " - " . show_users_online() . "</font></a></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align='center' class='footer'><a target='_blank' href='{$power_url}' tabindex='-1'><font color='#ffff00'>{$power_by}</font></a></td>\n"; echo "</tr>\n"; if ($allow_demo_mode == true) { echo "<tr>\n"; //echo "<td><br><div align='center'><a href='http://sourceforge.net'><img src='http://sourceforge.net/sflogo.php?group_id=89967&type=5' alt='SourceForge.net Logo' width='210' height='62' border='0' align='center' /></a></div></td>\n"; echo "</tr>\n"; } echo "</table><br><br>\n"; } }
function pager_button($name, $value, $enabled = true, $icon = false) { global $path_to_root; return "<button " . ($enabled ? '' : 'disabled') . " class=\"navibutton\" type=\"submit\"" . " name=\"{$name}\" id=\"{$name}\" value=\"{$value}\">" . ($icon ? "<img src='{$path_to_root}/themes/" . user_theme() . "/images/" . $icon . "'>" : '') . "<span>{$value}</span></button>\n"; }
/* The array $thoseps is set up in config.php for modifications possible separators can be added by modifying the array definition by editing that file */ decseps_list_row(_("Decimal Separator:"), "dec_sep", user_dec_sep()); /* The array $decseps is set up in config.php for modifications possible separators can be added by modifying the array definition by editing that file */ if (!isset($_POST['language'])) { $_POST['language'] = $_SESSION['language']->code; } table_section_title(_("Language")); languages_list_row(_("Language:"), 'language', $_POST['language']); table_section(2); table_section_title(_("Miscellaneous")); check_row(_("Show hints for new users:"), 'show_hints', user_hints()); check_row(_("Show GL Information:"), 'show_gl', user_show_gl_info()); check_row(_("Show Item Codes:"), 'show_codes', user_show_codes()); themes_list_row(_("Theme:"), "theme", user_theme()); /* The array $themes is set up in config.php for modifications possible separators can be added by modifying the array definition by editing that file */ pagesizes_list_row(_("Page Size:"), "page_size", user_pagesize()); tab_list_row(_("Start-up Tab"), 'startup_tab', user_startup_tab()); /* The array $pagesizes is set up in config.php for modifications possible separators can be added by modifying the array definition by editing that file */ if (!isset($_POST['print_profile'])) { $_POST['print_profile'] = user_print_profile(); } print_profiles_list_row(_("Printing profile") . ':', 'print_profile', null, _('Browser printing support')); check_row(_("Use popup window to display reports:"), 'rep_popup', user_rep_popup(), false, _('Set this option to on if your browser directly supports pdf files')); check_row(_("Use icons instead of text links:"), 'graphic_links', user_graphic_links(), false, _('Set this option to on for using icons instead of text links')); text_row_ex(_("Query page size:"), 'query_size', 5, 5, '', user_query_size()); check_row(_("Remember last document date:"), 'sticky_doc_date', sticky_doc_date(), false, _('If set document date is remembered on subsequent documents, otherwise default is current date')); end_outer_table(1);
function menu_footer($no_menu, $is_index) { 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"; echo "</div>"; // column echo "</td></tr><tr><td colspan='2'>"; if ($no_menu == false) { if ($is_index) { echo "<table class=bottomBar>\n"; } else { echo "<table class=bottomBar2>\n"; } echo "<tr>"; if (isset($_SESSION['wa_current_user'])) { $phelp = implode('; ', $Pagehelp); echo "<td class=bottomBarCell>" . Today() . " | " . Now() . "</td>\n"; $Ajax->addUpdate(true, 'hotkeyshelp', $phelp); echo "<td id='hotkeyshelp'>" . $phelp . "</td>"; } echo "</tr></table>\n"; } echo "</td></tr></table></td>\n"; echo "</table>\n"; if ($no_menu == false) { echo "<table align='center' id='footer'>\n"; echo "<tr>\n"; echo "<td align='center' class='footer'><a target='_blank' href='{$power_url}'><font color='#ffffff'>{$app_title} {$version} - " . _("Theme:") . " " . user_theme() . " - " . show_users_online() . "</font></a></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td align='center' class='footer'><a target='_blank' href='{$power_url}'><font color='#ffff00'>{$power_by}</font></a></td>\n"; echo "</tr>\n"; if ($allow_demo_mode == true) { echo "<tr>\n"; echo "</tr>\n"; } echo "</table><br><br>\n"; } }
function menu_footer($no_menu, $is_index) { global $path_to_root, $power_url, $power_by, $version, $db_connections; include_once $path_to_root . "/includes/date_functions.inc"; if (!$no_menu) { echo "</div>\n"; } // fa-content echo "</div>\n"; // fa-body if (!$no_menu) { echo "<div class='fa-footer'>\n"; if (isset($_SESSION['wa_current_user'])) { echo "<span class='power'><a target='_blank' href='{$power_url}'>{$power_by} {$version}</a></span>\n"; echo "<span class='date'>" . Today() . " " . Now() . "</span>\n"; echo "<span class='date'>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . "</span>\n"; echo "<span class='date'>" . $_SERVER['SERVER_NAME'] . "</span>\n"; echo "<span class='date'>" . $_SESSION["wa_current_user"]->name . "</span>\n"; echo "<span class='date'>" . _("Theme:") . " " . user_theme() . "</span>\n"; echo "<span class='date'>" . show_users_online() . "</span>\n"; } echo "</div>\n"; // footer } echo "</div>\n"; // fa-main }
function menu_header($title, $no_menu, $is_index) { global $path_to_root, $help_base_url, $db_connections; $local_path_to_root = $path_to_root; global $leftmenu_save, $app_title, $version; // Build screen header $leftmenu_save = ""; $sel_app = $_SESSION['sel_app']; echo "<div id='maincontainer'> \n"; echo "<div id='topsection'> \n"; echo " <div class='innertube'> \n"; echo " <h1>" . $app_title . " " . $version . "</h1>\n"; echo " </div>\n"; echo " <div id='topinfo'>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . show_users_online() . "</div>\n"; echo " <div id='iconlink'>"; // Logout on main window only if (!$no_menu) { echo " <a class='shortcut' href='{$local_path_to_root}/access/logout.php?'><img src='{$local_path_to_root}/themes/grayblue/images/system-shutdown.png' title='" . _("Logout") . "' /></a>"; } // Popup help if ($help_base_url != null) { echo "<a target = '_blank' onclick=" . '"' . "javascript:openWindow(this.href,this.target); return false;" . '" ' . "href='" . help_url() . "'><img src='{$local_path_to_root}/themes/grayblue/images/help-browser.png' title='" . _("Help") . "' /></a>\n"; } echo " </div>\n"; // iconlink echo " </div>\n"; if (!$no_menu) { $applications = $_SESSION['App']->applications; $leftmenu_save .= "<div id='leftcolumn'>\n"; $leftmenu_save .= " <div id='ddblueblockmenu'>\n"; $leftmenu_save .= " <div class='menutitle'>Applications</div>\n"; $leftmenu_save .= " <ul>\n"; foreach ($applications as $app) { $acc = access_string($app->name); $leftmenu_save .= " <li>\n"; $leftmenu_save .= " <a class='" . ($sel_app == $app->id ? 'selected' : 'menu_tab') . "'href='{$local_path_to_root}/index.php?application=" . $app->id . SID . "'{$acc['1']}>" . $acc[0] . "</a>\n"; if ($sel_app == $app->id) { $curr_app_name = $acc[0]; $curr_app_link = $app->id; } $leftmenu_save .= " </li>\n"; } $leftmenu_save .= " </ul>\n"; $leftmenu_save .= " <div class='menutitle'>" . $_SESSION["wa_current_user"]->name . "</div>\n"; $leftmenu_save .= " <ul>\n"; $leftmenu_save .= " <li><a class='shortcut' href='{$local_path_to_root}/admin/display_prefs.php?'>" . _("Preferences") . "</a></li>\n"; $leftmenu_save .= " <li><a class='shortcut' href='{$local_path_to_root}/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a></li>\n"; $leftmenu_save .= " <li><a class='shortcut' href='{$local_path_to_root}/access/logout.php?'>" . _("Logout") . "</a></li>\n"; $leftmenu_save .= " </ul>\n"; $leftmenu_save .= " </div>\n"; $leftmenu_save .= "</div>\n"; } echo "\n<div id='contentwrapper'>\n"; if ($title && !$no_menu) { echo " <div id='contentcolumn'>\n"; echo " <div class='innertube'>\n"; echo user_hints() ? "<span id='hints' style='float:right;'></span>" : ""; echo " <p class='breadcrumb'>\n"; echo " <a class='shortcut' href='{$local_path_to_root}/index.php?application=" . $curr_app_link . SID . "'>" . $curr_app_name . "</a>\n"; if ($no_menu) { echo "<br>"; } elseif ($title && !$is_index) { echo " <a href='#'>" . $title . "</a>\n"; } $indicator = "{$path_to_root}/themes/" . user_theme() . "/images/ajax-loader.gif"; echo " <span style='padding-left:200px;'><img id='ajaxmark' src='{$indicator}' align='center' style='visibility:hidden;'></span>"; echo " </p>\n"; } }
function menu_header($title, $no_menu, $is_index) { global $path_to_root, $help_base_url, $db_connections; if (!$no_menu) { echo "<script type='text/javascript' src='{$path_to_root}/themes/erp/js/jquery-1.3.2.js'></script>\n"; echo "<script type='text/javascript' src='{$path_to_root}/themes/erp/js/jquery-ui-1.7.2.custom.min.js'></script>\n"; echo "<script type='text/javascript' src='{$path_to_root}/themes/erp/js/jquery.json-2.2.min.js'></script>\n"; echo "<script type='text/javascript' src='{$path_to_root}/themes/erp/js/dashboard.js'></script>\n"; echo "<script type='text/javascript' src='https://www.google.com/jsapi'></script>\n"; } add_access_extensions(); echo "<table class='callout_main' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<tr>\n"; echo "<td colspan='2' rowspan='2'>\n"; echo "<table class='main_page' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<tr>\n"; echo "<td>\n"; echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<tr>\n"; echo "<td class='quick_menu'>\n"; if (!$no_menu) { $applications = $_SESSION['App']->applications; $local_path_to_root = $path_to_root; $img = "<img src='{$local_path_to_root}/themes/erp/images/login.gif' width='14' height='14' border='0' alt='" . _('Logout') . "'> "; $himg = "<img src='{$local_path_to_root}/themes/erp/images/help.gif' width='14' height='14' border='0' alt='" . _('Help') . "'> "; $sel_app = $_SESSION['sel_app']; echo "<table cellpadding=0 cellspacing=0 width='100%'><tr>"; echo "<td id='logotab'><span><img src='{$local_path_to_root}/themes/erp/images/logo2.png' align='center'></span></td>"; echo "<td><div class=tabs>"; $imag = array('orders' => 'sales.png', 'AP' => 'purchase.png', 'stock' => 'inventory.png', 'manuf' => 'manufacture.png', 'proj' => 'dimension.png', 'GL' => 'bank.png', 'payroll' => 'payroll.png', 'system' => 'setup.png'); foreach ($applications as $app) { if ($_SESSION["wa_current_user"]->check_application_access($app)) { if ($sel_app == $app->id) { $sel_application = $app; } $acc = access_string($app->name); $mg = "<image src = '{$local_path_to_root}/themes/erp/images/" . $imag[$app->id] . "' align='center'>"; echo "<a class='" . ($sel_app == $app->id ? 'selected' : 'menu_tab') . "' href='{$local_path_to_root}/index.php?application=" . $app->id . "'{$acc['1']}>" . $mg . "</a>"; } } echo "<a class='shortcut' href='{$local_path_to_root}/access/logout.php?'><image src = '{$local_path_to_root}/themes/erp/images/logout.png' align='center'></a>"; echo "</div>"; echo "</td></tr></table>"; //echo "<table class=logoutBar>"; //echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>"; $indicator = "{$path_to_root}/themes/" . user_theme() . "/images/ajax-loader.gif"; //echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>"; //echo " <td class='logoutBarRight'><a class='shortcut' href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a> \n"; //echo " <a class='shortcut' href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a> \n"; if ($help_base_url != null) { echo "{$himg}<a target = '_blank' onclick=" . '"' . "javascript:openWindow(this.href,this.target); return false;" . '" ' . "href='" . help_url() . "'>" . _("Help") . "</a> "; } //echo "$img<a class='shortcut' href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> "; //echo "</td></tr></table>"; echo "</td></tr></table>"; echo "</td></tr><tr><td>\n"; //echo "<script language='javascript'>\$(document).ready(function(){\$('#fa-submenu').hoverAccordion({activateItem:1,speed:'fast'});});</script>"; echo "<script language='javascript'>" . "\$(document).ready(function()\n" . "{\n" . "\$('#fa-submenu p.menu_head').click(function()\n" . "{\n" . "\$(this).css({backgroundImage:'none'}).next('div.menu_body').slideDown(300).siblings('div.menu_body').slideUp('slow');\n" . "\$(this).siblings().css({backgroundImage:'url({$local_path_to_root}/themes/erp/images/collapse2.png)'});\n" . "});\n" . "\$('#first').css({backgroundImage:'none'}).next('div.menu_body').slideDown('fast').siblings('div.menu_body').slideUp('fast');" . "});\n</script>"; echo "<table width='100%'><tr><td valign='top' width='20%'>"; echo "<div style='display:block;'>\n"; echo "<div id='fa-submenu' class='menu_list'>\n"; $first = "id='first'"; foreach ($sel_application->modules as $module) { if ($module->name == "Transactions") { $mg = "<image src = '{$local_path_to_root}/themes/erp/images/transactions.png' align='center'>"; echo "<p " . $first . " class='menu_head'>" . $mg . " " . $module->name . "</p>\n"; } if ($module->name == "Inquiries and Reports") { $mg = "<image src = '{$local_path_to_root}/themes/erp/images/inquiries.png' align='center'>"; echo "<p " . $first . " class='menu_head'>" . $mg . " " . $module->name . "</p>\n"; } if ($module->name == "Maintenance") { $mg = "<image src = '{$local_path_to_root}/themes/erp/images/maintenance.png' align='center'>"; echo "<p " . $first . " class='menu_head'>" . $mg . " " . $module->name . "</p>\n"; } if ($module->name == "Pricing and Costs") { $mg = "<image src = '{$local_path_to_root}/themes/erp/images/price.png' align='center'>"; echo "<p " . $first . " class='menu_head'>" . $mg . " " . $module->name . "</p>\n"; } if ($module->name == "Company Setup") { $mg = "<image src = '{$local_path_to_root}/themes/erp/images/company.png' align='center'>"; echo "<p " . $first . " class='menu_head'>" . $mg . " " . $module->name . "</p>\n"; } if ($module->name == "Miscellaneous") { $mg = "<image src = '{$local_path_to_root}/themes/erp/images/miscellaneous.png' align='center'>"; echo "<p " . $first . " class='menu_head'>" . $mg . " " . $module->name . "</p>\n"; } //echo "<p ".$first." class='menu_head'>".$module->name."</p>\n"; echo "<div class='menu_body'>\n"; $first = ""; $apps = array(); foreach ($module->lappfunctions as $appfunction) { $apps[] = $appfunction; } foreach ($module->rappfunctions as $appfunction) { $apps[] = $appfunction; } $application = array(); foreach ($apps as $application) { $lnk = access_string($application->label); if ($_SESSION["wa_current_user"]->can_access_page($application->access)) { if ($application->label != "") { echo "<a href='" . $path_to_root . "/" . $application->link . "'>" . $lnk[0] . "</a>"; } } elseif (!$_SESSION["wa_current_user"]->hide_inaccessible_menu_items()) { echo "<a href='#' class='disabled'>" . $lnk[0] . "</a>"; } } echo "</div>"; } echo "</div>"; // submenu echo "</div >\n"; echo "</td><td valign='top'>"; echo "<script>\n\n var toggle = function(th) {\n if (th.value == '-') th.value='+';\n else th.value = '-'\n\n var mydiv = document.getElementById('newpost');\n \n if (mydiv.style.display === 'block' || mydiv.style.display === '') \n mydiv.style.display = 'none'; \n else \n mydiv.style.display = 'block'\n }"; echo "</script>"; echo "<div class='bindiv'><input type='submit' id='btn' value='-' onclick='return toggle(this);'></input>"; echo "<div id='newpost' class='tracking'>"; if ($sel_app == "orders") { include $path_to_root . "/themes/erp/help/sales_help.php"; } if ($sel_app == "AP") { include $path_to_root . "/themes/erp/help/purchase_help.php"; } if ($sel_app == "stock") { include $path_to_root . "/themes/erp/help/inventory_help.php"; } if ($sel_app == "manuf") { include $path_to_root . "/themes/erp/help/manufacturing_help.php"; } if ($sel_app == "proj") { include $path_to_root . "/themes/erp/help/tracking_help.php"; } if ($sel_app == "GL") { include $path_to_root . "/themes/erp/help/banking_help.php"; } if ($sel_app == "system") { include $path_to_root . "/themes/erp/help/setup_help.php"; } if ($sel_app == "payroll") { include $path_to_root . "/themes/erp/help/payroll_help.php"; } echo "</div>"; } if ($no_menu) { echo "</td></tr></table>"; echo "<br>"; } elseif ($title && !$is_index) { // here starts form echo "<div class='dataform'>"; echo "<center><table id='title'><tr><td width='100%' class='titletext'>{$title}</td>" . "<td align=right>" . (user_hints() ? "<span id='hints'></span>" : '') . "</td>" . "</tr></table></center>"; } }
function date_cells($label, $name, $title = null, $check = null, $inc_days = 0, $inc_months = 0, $inc_years = 0, $params = null, $submit_on_change = false) { global $use_date_picker, $path_to_root, $Ajax; if (!isset($_POST[$name]) || $_POST[$name] == "") { if ($inc_years == 1001) { $_POST[$name] = null; } else { $dd = Today(); if ($inc_days != 0) { $dd = add_days($dd, $inc_days); } if ($inc_months != 0) { $dd = add_months($dd, $inc_months); } if ($inc_years != 0) { $dd = add_years($dd, $inc_years); } $_POST[$name] = $dd; } } if ($use_date_picker) { $calc_image = file_exists("{$path_to_root}/themes/" . user_theme() . "/images/cal.gif") ? "{$path_to_root}/themes/" . user_theme() . "/images/cal.gif" : "{$path_to_root}/themes/default/images/cal.gif"; $post_label = "<a tabindex='-1' href=\"javascript:date_picker(document.getElementsByName('{$name}')[0]);\">" . "\t<img src='{$calc_image}' width='15' height='15' border='0' alt='" . _('Click Here to Pick up the date') . "'></a>\n"; } else { $post_label = ""; } $class = $submit_on_change ? 'date active form-control' : 'date form-control'; $aspect = $check ? 'aspect="cdate"' : ''; if ($check && get_post($name) != Today()) { $aspect .= ' style="color:#FF0000"'; } default_focus($name); $size = user_date_format() > 3 ? 11 : 10; $controlAsString = "<div class=\"input-group\">" . "<input type=\"text\" name=\"{$name}\" class=\"{$class}\" {$aspect} size=\"{$size}\" maxlength=\"12\" value=\"" . $_POST[$name] . "\"" . ($title ? " title='{$title}'" : '') . " > " . "<span class=\"input-group-addon\">{$post_label}</span>" . "</div>"; View::get()->addControl(View::controlFromRenderedString(View::CONTROL_DATE, $label, $controlAsString)); // CONTROL_DATE? CP 2014-11 $Ajax->addUpdate($name, $name, $_POST[$name]); }
function add_edit_combo($type) { global $path_to_root, $popup_editors, $use_icon_for_editkey; if (!isset($use_icon_for_editkey) || $use_icon_for_editkey == 0) { return ""; } // Derive theme path $theme_path = $path_to_root . '/themes/' . user_theme(); $key = $popup_editors[$type][1]; $onclick = "onclick=\"javascript:callEditor({$key}); return false;\""; $img = "<img width='12' height='12' border='0' alt='Add/Edit' title='Add/Edit' src='{$theme_path}/images/" . ICON_EDIT . "'>"; return "<a target = '_blank' href='#' {$onclick} tabindex='-1'>{$img}</a>"; }