当前位置: 首页>>代码示例>>PHP>>正文


PHP Sugar_Smarty::clear_compiled_tpl方法代码示例

本文整理汇总了PHP中Sugar_Smarty::clear_compiled_tpl方法的典型用法代码示例。如果您正苦于以下问题:PHP Sugar_Smarty::clear_compiled_tpl方法的具体用法?PHP Sugar_Smarty::clear_compiled_tpl怎么用?PHP Sugar_Smarty::clear_compiled_tpl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sugar_Smarty的用法示例。


在下文中一共展示了Sugar_Smarty::clear_compiled_tpl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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>';
             }
         }
     }
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:101,代码来源:SugarView.php

示例2: change_color


//.........这里部分代码省略.........
                    $allThemes[$dirName]['fontSelect'] .= '</ul></span>';
                }
            }
            $json = getJSONobj();
            $ss->assign('allThemes', $json->encode($allThemes));
            $ss->assign("CURRENTTHEME_NAME", $themeObject->name);
            $ss->assign("CURRENTTHEME_DESCRIPTION", $themeObject->description);
            $ss->assign("CURRENTTHEME_FONTSELECT", $allThemes[$themeObject->dirName]['fontSelect']);
            $ss->assign("CURRENTTHEME_COLORSELECT", $allThemes[$themeObject->dirName]['colorSelect']);
            // get the current user name and id
            $ss->assign("CURRENT_USER", $current_user->first_name != '' ? $current_user->first_name : $current_user->user_name);
            $ss->assign("CURRENT_USER_ID", $current_user->id);
            // get the last viewed records
            $tracker = new Tracker();
            $history = $tracker->get_recently_viewed($current_user->id);
            foreach ($history as $key => $row) {
                $history[$key]['item_summary_short'] = getTrackerSubstring($row['item_summary']);
                $history[$key]['image'] = SugarThemeRegistry::current()->getImage($row['module_name'], 'border="0" align="absmiddle" alt="' . $row['item_summary'] . '"');
            }
            $ss->assign("recentRecords", $history);
            // new record
            require_once "modules/" . $this->module . "/Forms.php";
            if ($this->action == "index" && function_exists('get_new_record_form')) {
                $ss->assign("NEW_RECORD", get_new_record_form());
            }
            // Get preference for shortcuts and last_viewed list placement
            $last_view_swap = $current_user->getPreference('swap_last_viewed');
            if (!isset($last_view_swap)) {
                $last_view_swap = $GLOBALS['sugar_config']['default_swap_last_viewed'];
            }
            $ss->assign("LEFT_FORM_LAST_VIEWED", $last_view_swap);
            $shortcuts_swap = $current_user->getPreference('swap_shortcuts');
            if (!isset($shortcuts_swap)) {
                $shortcuts_swap = $GLOBALS['sugar_config']['default_swap_shortcuts'];
            }
            $ss->assign("LEFT_FORM_SHORTCUTS", !$shortcuts_swap);
        }
        if (isset($_SESSION["authenticated_user_id"]) || $sugar_config['login_nav']) {
            // get the module list
            $moduleTopMenu = array();
            $max_tabs = $current_user->getPreference('max_tabs');
            if (!isset($max_tabs) || $max_tabs <= 0) {
                $max_tabs = $GLOBALS['sugar_config']['default_max_tabs'];
            }
            $user_navigation_paradigm = $current_user->getPreference('navigation_paradigm');
            if (!isset($user_navigation_paradigm)) {
                $user_navigation_paradigm = $GLOBALS['sugar_config']['default_navigation_paradigm'];
            }
            if ($user_navigation_paradigm == 'gm') {
                require_once 'include/GroupedTabs/GroupedTabStructure.php';
                $groupedTabsClass = new GroupedTabStructure();
                $modules = query_module_access_list($current_user);
                $ss->assign('groupTabs', $groupedTabsClass->get_tab_structure(get_val_array($modules)));
                $ss->assign('moduleNames', $app_list_strings['moduleList']);
                $ss->assign('defaultFirst', !in_array($this->module, $modules));
                $ss->assign('USE_GROUP_TABS', true);
            } else {
                $moduleExtraMenu = array();
                $i = 1;
                foreach (query_module_access_list($current_user) as $module) {
                    // Bug 25948 - Check for the module being in the moduleList
                    if (isset($app_list_strings['moduleList'][$module])) {
                        if ($i < $max_tabs) {
                            $moduleTopMenu[$module] = $app_list_strings['moduleList'][$module];
                        } else {
                            $moduleExtraMenu[$module] = $app_list_strings['moduleList'][$module];
                        }
                        ++$i;
                    }
                }
                // Now, we'll push the current module into the end of top menu list if it's not
                // already there. In addition, we'll preserve this last entry for this session
                // until a new value is added there.
                if (isset($moduleTopMenu[$this->module])) {
                    if (isset($_SESSION['moreTab']) && isset($app_list_strings['moduleList'][$_SESSION['moreTab']])) {
                        $moduleTopMenu[$_SESSION['moreTab']] = $app_list_strings['moduleList'][$_SESSION['moreTab']];
                        unset($moduleExtraMenu[$_SESSION['moreTab']]);
                    } else {
                        $moduleTopMenu += array_slice($moduleExtraMenu, 0, 1);
                        array_shift($moduleExtraMenu);
                    }
                } elseif (isset($moduleExtraMenu[$this->module])) {
                    $_SESSION['moreTab'] = $this->module;
                    $moduleTopMenu[$_SESSION['moreTab']] = $app_list_strings['moduleList'][$_SESSION['moreTab']];
                    unset($moduleExtraMenu[$_SESSION['moreTab']]);
                } elseif (isset($_SESSION['moreTab']) && isset($app_list_strings['moduleList'][$_SESSION['moreTab']])) {
                    $moduleTopMenu[$_SESSION['moreTab']] = $app_list_strings['moduleList'][$_SESSION['moreTab']];
                    unset($moduleExtraMenu[$_SESSION['moreTab']]);
                }
                $ss->assign("moduleTopMenu", $moduleTopMenu);
                $ss->assign("moduleExtraMenu", $moduleExtraMenu);
            }
        }
        $headerTpl = $themeObject->getTemplate('header.tpl');
        if (isset($GLOBALS['sugar_config']['developerMode']) && $GLOBALS['sugar_config']['developerMode']) {
            $ss->clear_compiled_tpl($headerTpl);
        }
        $ss->display($headerTpl);
        $this->includeClassicFile('modules/Administration/DisplayWarnings.php');
    }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:101,代码来源:SugarView.php

示例3: 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>';
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:SugarView.php

示例4: displayHeader


//.........这里部分代码省略.........
         $max_tabs = $current_user->getPreference('max_tabs');
         if (!isset($max_tabs) || $max_tabs <= 0) {
             $max_tabs = $GLOBALS['sugar_config']['default_max_tabs'];
         }
         $user_navigation_paradigm = $current_user->getPreference('navigation_paradigm');
         if (!isset($user_navigation_paradigm)) {
             $user_navigation_paradigm = $GLOBALS['sugar_config']['default_navigation_paradigm'];
         }
         // Need to figure out what tab this module belongs to, most modules have their own tabs, but there are exceptions.
         if (!empty($_REQUEST['module_tab'])) {
             $moduleTab = $_REQUEST['module_tab'];
         } elseif (isset($GLOBALS['moduleTabMap'][$this->module])) {
             $moduleTab = $GLOBALS['moduleTabMap'][$this->module];
         } else {
             $moduleTab = $this->module;
         }
         $ss->assign('MODULE_TAB', $moduleTab);
         if ($user_navigation_paradigm == 'gm' && isset($themeObject->group_tabs) && $themeObject->group_tabs) {
             require_once 'include/GroupedTabs/GroupedTabStructure.php';
             $groupedTabsClass = new GroupedTabStructure();
             $modules = query_module_access_list($current_user);
             //handle with submoremodules
             $max_subtabs = $current_user->getPreference('max_subtabs');
             if (!isset($max_subtabs) || $max_subtabs <= 0) {
                 $max_subtabs = $GLOBALS['sugar_config']['default_max_subtabs'];
             }
             $subMoreModules = false;
             $groupTabs = $groupedTabsClass->get_tab_structure(get_val_array($modules));
             foreach ($groupTabs as $key => $groupTab) {
                 $count = count($groupTab['modules']);
                 if ($count > $max_subtabs) {
                     for ($i = $max_subtabs - 1; $i < $count; $i++) {
                         if (!isset($groupTabs[$key]['modules'][$i])) {
                             continue;
                         }
                         $subMoreModules[$key]['modules'][$i] = $groupTabs[$key]['modules'][$i];
                         unset($groupTabs[$key]['modules'][$i]);
                     }
                 }
             }
             $ss->assign('groupTabs', $groupTabs);
             $ss->assign('subMoreModules', $subMoreModules);
             $ss->assign('moduleNames', $app_list_strings['moduleList']);
             $ss->assign('defaultFirst', !in_array($moduleTab, $modules));
             $ss->assign('parentTab', !empty($_REQUEST['parentTab']) ? $_REQUEST['parentTab'] : false);
             $ss->assign('USE_GROUP_TABS', true);
         } else {
             $moduleExtraMenu = array();
             $i = 1;
             foreach (query_module_access_list($current_user) as $module) {
                 // Bug 25948 - Check for the module being in the moduleList
                 if (isset($app_list_strings['moduleList'][$module])) {
                     if ($i < $max_tabs) {
                         $moduleTopMenu[$module] = $app_list_strings['moduleList'][$module];
                     } else {
                         $moduleExtraMenu[$module] = $app_list_strings['moduleList'][$module];
                     }
                     ++$i;
                 }
             }
             $iFrame = new iFrame();
             $frames = $iFrame->lookup_frames('tab');
             foreach ($frames as $key => $values) {
                 if ($i < $max_tabs) {
                     $moduleTopMenu[$key] = $values;
                 } else {
                     $moduleExtraMenu[$key] = $values;
                 }
                 ++$i;
             }
             // Now, we'll push the current module into the end of top menu list if it's not
             // already there. In addition, we'll preserve this last entry for this session
             // until a new value is added there.
             if (isset($moduleTopMenu[$moduleTab])) {
                 if (isset($_SESSION['moreTab']) && isset($app_list_strings['moduleList'][$_SESSION['moreTab']])) {
                     $moduleTopMenu[$_SESSION['moreTab']] = $app_list_strings['moduleList'][$_SESSION['moreTab']];
                     unset($moduleExtraMenu[$_SESSION['moreTab']]);
                 } else {
                     $moduleTopMenu += array_slice($moduleExtraMenu, 0, 1);
                     array_shift($moduleExtraMenu);
                 }
             } elseif (isset($moduleExtraMenu[$moduleTab])) {
                 $_SESSION['moreTab'] = $moduleTab;
                 $moduleTopMenu[$_SESSION['moreTab']] = $app_list_strings['moduleList'][$_SESSION['moreTab']];
                 unset($moduleExtraMenu[$_SESSION['moreTab']]);
             } elseif (isset($_SESSION['moreTab']) && isset($app_list_strings['moduleList'][$_SESSION['moreTab']])) {
                 $moduleTopMenu[$_SESSION['moreTab']] = $app_list_strings['moduleList'][$_SESSION['moreTab']];
                 unset($moduleExtraMenu[$_SESSION['moreTab']]);
             }
             $ss->assign("moduleTopMenu", $moduleTopMenu);
             $ss->assign("moduleExtraMenu", $moduleExtraMenu);
         }
     }
     $headerTpl = $themeObject->getTemplate('header.tpl');
     if (isset($GLOBALS['sugar_config']['developerMode']) && $GLOBALS['sugar_config']['developerMode']) {
         $ss->clear_compiled_tpl($headerTpl);
     }
     $ss->display($headerTpl);
     $this->includeClassicFile('modules/Administration/DisplayWarnings.php');
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:101,代码来源:SugarView.php


注:本文中的Sugar_Smarty::clear_compiled_tpl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。