getImageURL('blank.gif'); $printImageURL = SugarThemeRegistry::current()->getImageURL("print.gif"); $helpImageURL = SugarThemeRegistry::current()->getImageURL("help.gif"); $is_min_max = strpos($other_text,"_search.gif"); if($is_min_max !== false) $form_title = "{$other_text} {$form_title}"; $the_form = <<

{$form_title}

EOHTML; $keywords = array("/class=\"button\"/","/class='button'/","/class=button/","/<\/form>/"); $match=""; foreach ($keywords as $left) if (preg_match($left,$other_text)) $match = true; if ($other_text && $match) { $the_form .= << $other_text EOHTML; if ($show_help) { $the_form .= ""; if ($_REQUEST['action'] != "EditView") { $the_form .= << Print   {$app_strings['LNK_PRINT']} EOHTML; } $the_form .= << Help   {$app_strings['LNK_HELP']} EOHTML; } } else { if ($other_text && $is_min_max === false) { $the_form .= << $other_text EOHTML; } else { $the_form .= << EOHTML; } if ($show_help) { $the_form .= ""; if ($_REQUEST['action'] != "EditView") { $the_form .= << Print   {$app_strings['LNK_PRINT']} EOHTML; } $the_form .= << Help   {$app_strings['LNK_HELP']} EOHTML; } } $the_form .= << EOHTML; return $the_form; } /** * Wrapper function for the get_module_title function, which is mostly used for pre-MVC modules. * * @deprecated use SugarView::getModuleTitle() for MVC modules, or getClassicModuleTitle() for non-MVC modules * * @param $module string to next to the title. Typically used for form buttons. * @param $module_title string to display as the module title * @param $show_help boolean which determines if the print and help links are shown. * @return string HTML */ function get_module_title( $module, $module_title, $show_create, $count=0 ) { global $sugar_version, $sugar_flavor, $server_unique_key, $current_language, $action; global $app_strings; $the_title = "
\n

"; $module = preg_replace("/ /","",$module); $iconPath = ""; if(is_file(SugarThemeRegistry::current()->getImageURL('icon_'.$module.'_32.png',false))) { $iconPath = SugarThemeRegistry::current()->getImageURL('icon_'.$module.'_32.png'); } else if (is_file(SugarThemeRegistry::current()->getImageURL('icon_'.ucfirst($module).'_32.png',false))) { $iconPath = SugarThemeRegistry::current()->getImageURL('icon_'.ucfirst($module).'_32.png'); } if (!empty($iconPath)) { if (SugarThemeRegistry::current()->directionality == "ltr") { $the_title .= ""; $the_title .= ($count >= 1) ? SugarView::getBreadCrumbSymbol() : ""; $the_title .= $module_title; } else { $the_title .= $module_title; $the_title .= ($count > 1) ? SugarView::getBreadCrumbSymbol() : ""; $the_title .= ""; } } else { $the_title .= $module_title; } $the_title .= "

\n"; if ($show_create) { $the_title .= ""; $createRecordURL = SugarThemeRegistry::current()->getImageURL('create-record.gif'); $url = ajaxLink("index.php?module=$module&action=EditView&return_module=$module&return_action=DetailView"); $the_title .= << {$GLOBALS[ {$GLOBALS['app_strings']['LNK_CREATE']} EOHTML; $the_title .= ''; } $the_title .= "
\n"; return $the_title; } /** * Handles displaying the header for classic view modules * * @param $module string to next to the title. Typically used for form buttons. * @param array $params optional, params to display in the breadcrumb, overriding SugarView::_getModuleTitleParams() * These should be in the form of array('label' => '', 'link' => ''); * the first breadcrumb should be index at 0, and built from there e.g. * * array( * 'Contacts', * 'John Smith', * 'Edit', * ); * * would display as: * * Contacts >> John Smith >> Edit * * @param $show_help boolean which determines if the print and help links are shown. * @return string HTML */ function getClassicModuleTitle( $module, $params, $show_create, $index_url_override="") { global $sugar_version, $sugar_flavor, $server_unique_key, $current_language, $action; global $app_strings; $module_title = ''; $count = count($params); $index = 0; $module = preg_replace("/ /","",$module); $iconPath = ""; $the_title = "
\n

"; if(!empty($GLOBALS['app_list_strings']['moduleList'][$module])) $moduleName = $GLOBALS['app_list_strings']['moduleList'][$module]; else $moduleName = $module; if(is_file(SugarThemeRegistry::current()->getImageURL('icon_'.$module.'_32.png',false))) { $iconPath = SugarThemeRegistry::current()->getImageURL('icon_'.$module.'_32.png'); } else if (is_file(SugarThemeRegistry::current()->getImageURL('icon_'.ucfirst($module).'_32.png',false))) { $iconPath = SugarThemeRegistry::current()->getImageURL('icon_'.ucfirst($module).'_32.png'); } if (!empty($iconPath)) { $url = (!empty($index_url_override)) ? $index_url_override : "index.php?module={$module}&action=index"; array_unshift ($params,""); } $new_params = array(); $i = 0; foreach ($params as $value) { if ((!is_null($value)) && ($value !== "")) { $new_params[$i] = $value; $i++; } } if(SugarThemeRegistry::current()->directionality == "rtl") { $new_params = array_reverse($new_params); } $module_title = join(SugarView::getBreadCrumbSymbol(),$new_params); $the_title .= $module_title."

\n"; if ($show_create) { $the_title .= ""; $createRecordURL = SugarThemeRegistry::current()->getImageURL('create-record.gif'); $url = ajaxLink("index.php?module=$module&action=EditView&return_module=$module&return_action=DetailView"); $the_title .= << {$GLOBALS[ {$GLOBALS['app_strings']['LNK_CREATE']} EOHTML; $the_title .= ''; } $the_title .= "
\n"; return $the_title; } /** * Create a header for a popup. * * @todo refactor this into the base Popup_Picker class * * @param $theme string the name of the current theme, ignorred to use SugarThemeRegistry::current() instead. * @return string HTML */ function insert_popup_header( $theme = null ) { global $app_strings, $sugar_config; $charset = isset($app_strings['LBL_CHARSET']) ? $app_strings['LBL_CHARSET'] : $sugar_config['default_charset']; $themeCSS = SugarThemeRegistry::current()->getCSS(); echo << {$app_strings['LBL_BROWSER_TITLE']} {$themeCSS} EOHTML; echo ''; echo ''; echo << EOHTML; } /** * Create a footer for a popup. * * @todo refactor this into the base Popup_Picker class * * @return string HTML */ function insert_popup_footer() { echo << EOQ; }