當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SugarView::getMenu方法代碼示例

本文整理匯總了PHP中SugarView::getMenu方法的典型用法代碼示例。如果您正苦於以下問題:PHP SugarView::getMenu方法的具體用法?PHP SugarView::getMenu怎麽用?PHP SugarView::getMenu使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SugarView的用法示例。


在下文中一共展示了SugarView::getMenu方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMenu

 /**
  * @see SugarView::getMenu()
  */
 public function getMenu($module = null)
 {
     global $mod_strings, $current_language;
     if (empty($module)) {
         $module = $_REQUEST['import_module'];
     }
     $old_mod_strings = $mod_strings;
     $mod_strings = return_module_language($current_language, $module);
     $returnMenu = parent::getMenu($module);
     $mod_strings = $old_mod_strings;
     return $returnMenu;
 }
開發者ID:MexinaD,項目名稱:SuiteCRM,代碼行數:15,代碼來源:view.error.php

示例2: testMenuExistsCanFindModuleMenuAndModuleExtMenu

    /**
     * @ticket 43497
     */
    public function testMenuExistsCanFindModuleMenuAndModuleExtMenu()
    {
        // Create module menu
        if ($fh = @fopen("modules/{$this->_moduleName}/Menu.php", 'w+')) {
            $string = <<<EOQ
<?php
\$module_menu[]=Array("index.php?module=Import&action=foo&import_module=Accounts&return_module=Accounts&return_action=index","Foo","Foo", 'Accounts');
?>
EOQ;
            fputs($fh, $string);
            fclose($fh);
        }
        // Create module ext menu
        sugar_mkdir("custom/modules/{$this->_moduleName}/Ext/Menus/", null, true);
        if ($fh = @fopen("custom/modules/{$this->_moduleName}/Ext/Menus/menu.ext.php", 'w+')) {
            $string = <<<EOQ
<?php
\$module_menu[]=Array("index.php?module=Import&action=bar&import_module=Accounts&return_module=Accounts&return_action=index","Foo","Foo", 'Accounts');
?>
EOQ;
            fputs($fh, $string);
            fclose($fh);
        }
        $view = new SugarView();
        $module_menu = $view->getMenu($this->_moduleName);
        $found_custom_menu = false;
        $found_custom_menu_twice = false;
        $found_menu = false;
        $found_menu_twice = false;
        foreach ($module_menu as $key => $menu_entry) {
            foreach ($menu_entry as $id => $menu_item) {
                if (preg_match('/action=foo/', $menu_item)) {
                    if ($found_menu) {
                        $found_menu_twice = true;
                    }
                    $found_menu = true;
                }
                if (preg_match('/action=bar/', $menu_item)) {
                    if ($found_custom_menu) {
                        $found_custom_menu_twice = true;
                    }
                    $found_custom_menu = true;
                }
            }
        }
        $this->assertTrue($found_menu, "Assert that menu was detected");
        $this->assertFalse($found_menu_twice, "Assert that menu item wasn't duplicated");
        $this->assertTrue($found_custom_menu, "Assert that custom menu was detected");
        $this->assertFalse($found_custom_menu_twice, "Assert that custom menu item wasn't duplicated");
    }
開發者ID:jgera,項目名稱:sugarcrm_dev,代碼行數:53,代碼來源:LoadMenuTest.php

示例3: testgetMenu

 public function testgetMenu()
 {
     //error_reporting(E_ALL);
     $SugarView = new SugarView();
     //execute the method and check if it works and throws an exception if no module is provided
     //it creates memory Fatal errors which causes PHPunit to crash so we will skip this scenario
     /*
         	try {
         		//check first with invalid value and test if it throws an exception
         		$menu = $SugarView->getMenu();
         		//$this->assertTrue(is_array($menu));
         		 
         	} catch (Exception $e) {
         		$this->assertTrue(TRUE);
         		//$this->fail();
         	} */
     //check with valid value and check if it returns an array.
     $menu = $SugarView->getMenu('Users');
     $this->assertTrue(is_array($menu));
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:20,代碼來源:SugarViewTest.php


注:本文中的SugarView::getMenu方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。