本文整理汇总了PHP中SugarApplication::getErrorMessages方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarApplication::getErrorMessages方法的具体用法?PHP SugarApplication::getErrorMessages怎么用?PHP SugarApplication::getErrorMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarApplication
的用法示例。
在下文中一共展示了SugarApplication::getErrorMessages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayHeader
//.........这里部分代码省略.........
$ss->assign("LOGOUT_LABEL", key($value['linkinfo']));
//key value for first element.
continue;
}
foreach ($value as $linkattribute => $attributevalue) {
// get the main link info
if ($linkattribute == 'linkinfo') {
$gcls[$key] = array("LABEL" => key($attributevalue), "URL" => current($attributevalue), "SUBMENU" => array());
if (substr($gcls[$key]["URL"], 0, 11) == "javascript:") {
$gcls[$key]["ONCLICK"] = substr($gcls[$key]["URL"], 11);
$gcls[$key]["URL"] = "javascript:void(0)";
}
}
// and now the sublinks
if ($linkattribute == 'submenu' && is_array($attributevalue)) {
foreach ($attributevalue as $submenulinkkey => $submenulinkinfo) {
$gcls[$key]['SUBMENU'][$submenulinkkey] = array("LABEL" => key($submenulinkinfo), "URL" => current($submenulinkinfo));
}
if (substr($gcls[$key]['SUBMENU'][$submenulinkkey]["URL"], 0, 11) == "javascript:") {
$gcls[$key]['SUBMENU'][$submenulinkkey]["ONCLICK"] = substr($gcls[$key]['SUBMENU'][$submenulinkkey]["URL"], 11);
$gcls[$key]['SUBMENU'][$submenulinkkey]["URL"] = "javascript:void(0)";
}
}
}
}
$ss->assign("GCLS", $gcls);
$ss->assign("SEARCH", isset($_REQUEST['query_string']) ? $_REQUEST['query_string'] : '');
if ($this->action == "EditView" || $this->action == "Login") {
$ss->assign("ONLOAD", 'onload="set_focus()"');
}
$ss->assign("AUTHENTICATED", isset($_SESSION["authenticated_user_id"]));
$ss->assign("ISPRINT", isset($_REQUEST['print']));
//this will be used by header.tpl to hide the megamenu bar when its 'print' view
// get other things needed for page style popup
if (isset($_SESSION["authenticated_user_id"])) {
// get the current user name and id
$ss->assign("CURRENT_USER", $current_user->full_name == '' || !showFullName() ? $current_user->user_name : $current_user->full_name);
$ss->assign("CURRENT_USER_ID", $current_user->id);
// get the last viewed records
$tracker = BeanFactory::getBean('Trackers');
$history = $tracker->get_recently_viewed($current_user->id);
$ss->assign("recentRecords", $this->processRecentRecords($history));
}
$bakModStrings = $mod_strings;
$imageURL = SugarThemeRegistry::current()->getImageURL("dashboard.png");
$homeImage = "<img src='{$imageURL}'>";
$ss->assign("homeImage", $homeImage);
global $mod_strings;
$mod_strings = $bakModStrings;
/******************DC MENU*********************/
// DEPRECATED since 7.0, will be removed from 7.2
// if(!empty($current_user->id) && !$this->_getOption('view_print')){
// require_once('include/DashletContainer/DCFactory.php');
// require_once('include/SugarSearchEngine/SugarSearchEngineFactory.php');
// $dcm = DCFactory::getContainer(null, 'DCMenu');
// $notifData = $dcm->getNotifications();
// $dcjs = getVersionedScript('include/DashletContainer/Containers/DCMenu.js');
// $ss->assign('NOTIFCLASS', $notifData['class']);
// $ss->assign('NOTIFCODE', $notifData['code']);
// $ss->assign('NOTIFICON', $notifData['icon']);
// $ss->assign('DCSCRIPT', $dcm->getScript());
// $ss->assign('ICONSEARCH', $dcm->getSearchIcon());
// $ss->assign('DCACTIONS',$dcm->getMenus());
// $ss->assign('PICTURE', $current_user->picture);
// $ftsAutocompleteEnable = TRUE;
// $searchEngine = SugarSearchEngineFactory::getInstance();
// if( ($searchEngine instanceOf SugarSearchEngine) || (isset($GLOBALS['sugar_config']['full_text_engine'])
// && isset($GLOBALS['sugar_config']['full_text_engine']['disable_autocomplete']) && $GLOBALS['sugar_config']['full_text_engine']['disable_autocomplete'] )
// )
// $ftsAutocompleteEnable = FALSE;
//
// if (SugarSearchEngineAbstractBase::isSearchEngineDown()) {
// $ftsAutocompleteEnable = false;
// }
// $ss->assign('FTS_AUTOCOMPLETE_ENABLE', $ftsAutocompleteEnable);
// $ss->assign('AJAX', isset($_REQUEST['ajax_load'])?$_REQUEST['ajax_load']:"0");
// $ss->assign('ACTION', isset($_REQUEST['action'])?$_REQUEST['action']:"");
// $ss->assign('FULL', isset($_REQUEST['full'])?$_REQUEST['full']:"false");
// if(is_admin($GLOBALS['current_user'])){
// $ss->assign('ISADMIN', true);
// } else {
// $ss->assign('ISADMIN', false);
// }
// $ss->assign('SUGAR_DCJS', $dcjs);
// //$ss->assign('SUGAR_DCMENU', $data['html']);
// }
/******************END DC MENU*********************/
$headerTpl = $themeObject->getTemplate('header.tpl');
if (inDeveloperMode()) {
$ss->clear_compiled_tpl($headerTpl);
}
$ss->display($headerTpl);
$this->includeClassicFile('modules/Administration/DisplayWarnings.php');
$errorMessages = SugarApplication::getErrorMessages();
if (!empty($errorMessages)) {
foreach ($errorMessages as $error_message) {
echo '<p class="error">' . $error_message . '</p>';
}
}
}
示例2: displayHeader
//.........这里部分代码省略.........
foreach ($groupTabs as $tabIdx => $tabData) {
$topTabs = $tabData['modules'];
if (!is_array($topTabs)) {
$topTabs = array();
}
$extraTabs = array();
// Split it in to the tabs that go across the top, and the ones that are on the extra menu.
if (count($topTabs) > $max_tabs) {
$extraTabs = array_splice($topTabs, $max_tabs);
}
// Make sure the current module is accessable through one of the top tabs
if (!isset($topTabs[$moduleTab])) {
// Nope, we need to add it.
// First, take it out of the extra menu, if it's there
if (isset($extraTabs[$moduleTab])) {
unset($extraTabs[$moduleTab]);
}
if (count($topTabs) >= $max_tabs - 1) {
// We already have the maximum number of tabs, so we need to shuffle the last one
// from the top to the first one of the extras
$lastElem = array_splice($topTabs, $max_tabs - 1);
$extraTabs = $lastElem + $extraTabs;
}
if (!empty($moduleTab)) {
$topTabs[$moduleTab] = $app_list_strings['moduleList'][$moduleTab];
}
}
/*
// This was removed, but I like the idea, so I left the code in here in case we decide to turn it back on
// If we are using group tabs, add all the "hidden" tabs to the end of the extra menu
if ( $usingGroupTabs ) {
foreach($fullModuleList as $moduleKey => $module ) {
if ( !isset($topTabs[$moduleKey]) && !isset($extraTabs[$moduleKey]) ) {
$extraTabs[$moduleKey] = $module;
}
}
}
*/
// Get a unique list of the top tabs so we can build the popup menus for them
foreach ($topTabs as $moduleKey => $module) {
$topTabList[$moduleKey] = $module;
}
$groupTabs[$tabIdx]['modules'] = $topTabs;
$groupTabs[$tabIdx]['extra'] = $extraTabs;
}
}
if (isset($topTabList) && is_array($topTabList)) {
// Adding shortcuts array to menu array for displaying shortcuts associated with each module
$shortcutTopMenu = array();
foreach ($topTabList as $module_key => $label) {
global $mod_strings;
$mod_strings = return_module_language($current_language, $module_key);
foreach ($this->getMenu($module_key) as $key => $menu_item) {
$shortcutTopMenu[$module_key][$key] = array("URL" => $menu_item[0], "LABEL" => $menu_item[1], "MODULE_NAME" => $menu_item[2], "IMAGE" => $themeObject->getImage($menu_item[2], "border='0' align='absmiddle'", null, null, '.gif', $menu_item[1]), "ID" => $menu_item[2] . "_link");
}
}
$ss->assign("groupTabs", $groupTabs);
$ss->assign("shortcutTopMenu", $shortcutTopMenu);
$ss->assign('USE_GROUP_TABS', $usingGroupTabs);
// This is here for backwards compatibility, someday, somewhere, it will be able to be removed
$ss->assign("moduleTopMenu", $groupTabs[$app_strings['LBL_TABGROUP_ALL']]['modules']);
$ss->assign("moduleExtraMenu", $groupTabs[$app_strings['LBL_TABGROUP_ALL']]['extra']);
}
if (isset($extraTabs) && is_array($extraTabs)) {
// Adding shortcuts array to extra menu array for displaying shortcuts associated with each module
$shortcutExtraMenu = array();
foreach ($extraTabs as $module_key => $label) {
global $mod_strings;
$mod_strings = return_module_language($current_language, $module_key);
foreach ($this->getMenu($module_key) as $key => $menu_item) {
$shortcutExtraMenu[$module_key][$key] = array("URL" => $menu_item[0], "LABEL" => $menu_item[1], "MODULE_NAME" => $menu_item[2], "IMAGE" => $themeObject->getImage($menu_item[2], "border='0' align='absmiddle'", null, null, '.gif', $menu_item[1]), "ID" => $menu_item[2] . "_link");
}
}
$ss->assign("shortcutExtraMenu", $shortcutExtraMenu);
}
if (!empty($current_user)) {
$ss->assign("max_tabs", $current_user->getPreference("max_tabs"));
}
$imageURL = SugarThemeRegistry::current()->getImageURL("dashboard.png");
$homeImage = "<img src='{$imageURL}'>";
$ss->assign("homeImage", $homeImage);
global $mod_strings;
$mod_strings = $bakModStrings;
$headerTpl = $themeObject->getTemplate('header.tpl');
if (inDeveloperMode()) {
$ss->clear_compiled_tpl($headerTpl);
}
if ($retModTabs) {
return $ss->fetch($themeObject->getTemplate('_headerModuleList.tpl'));
} else {
$ss->display($headerTpl);
$this->includeClassicFile('modules/Administration/DisplayWarnings.php');
$errorMessages = SugarApplication::getErrorMessages();
if (!empty($errorMessages)) {
foreach ($errorMessages as $error_message) {
echo '<p class="error">' . $error_message . '</p>';
}
}
}
}
示例3: testgetErrorMessages
public function testgetErrorMessages()
{
//execute the method and check if it returns a array.
$errorMessages = SugarApplication::getErrorMessages();
$this->assertTrue(is_array($errorMessages));
}