当前位置: 首页>>代码示例>>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;未经允许,请勿转载。