view.wizard.php

来自「SugarCRM5.1 开源PHP客户关系管理系统」· PHP 代码 · 共 437 行 · 第 1/2 页

PHP
437
字号
	function processMB ( $ajax )	{		$GLOBALS [ 'log' ]->debug ( "in processMB" ) ;		global $mod_strings ;		$this->editModule = $_REQUEST [ 'view_module' ] ;		$ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ;		if (! isset ( $_REQUEST [ 'view_package' ] ))		{			sugar_die ( "no ModuleBuilder package set" ) ;		}		$this->package = $_REQUEST [ 'view_package' ] ;		$ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package=' . $this->package . '")' ) ;		$ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;		//ModuleBuilder Select Subpanel		if (isset ( $_REQUEST [ 'subpanel' ] ))		{			$this->generateMBSubpanelButtons () ;			$ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;			$ajax->addCrumb ( $mod_strings [ 'LBL_SUBPANELS' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&MB=1&subpanels=1&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;		} else if (isset ( $this->search ))		{			//MB Select Search Layout page.			$this->generateMBSearchButtons () ;			$this->title = $this->editModule . " " . $mod_strings [ 'LBL_SEARCH' ] ;			$this->question = $mod_strings [ 'LBL_QUESTION_SEARCH' ] ;			$ajax->addCrumb ( $mod_strings [ 'LBL_LAYOUTS' ], 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;			$ajax->addCrumb ( $mod_strings [ 'LBL_SEARCH_FORMS' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&MB=1&search=1&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;			$this->help = "searchHelp" ;		}		else if (isset( $this->dashlet )){			$this->generateMBDashletButtons ();			$this->title = $this->editModule ." " .$mod_strings['LBL_DASHLET'];			$this->question = $mod_strings [ 'LBL_QUESTION_DASHLET' ] ;			//$this->ajax->addCrumb ( $mod_strings['LBL_QUESTION_DASHLET'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' ) ;			$this->ajax->addCrumb ( $mod_strings [ 'LBL_LAYOUTS' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ;			$this->ajax->addCrumb ( $mod_strings [ 'LBL_DASHLET' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&dashlet=1&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ;			$this->help = 'dashletHelp' ;		} else		{			$ajax->addCrumb ( $mod_strings [ 'LBL_LAYOUTS' ], 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ;			$this->generateMBViewButtons () ;			$this->title = $this->editModule . " " . $mod_strings [ 'LBL_LAYOUTS' ] ;			$this->question = $mod_strings [ 'LBL_QUESTION_LAYOUT' ] ;			$this->help = "layoutsHelp" ;		}	}	function generateStudioModuleButtons ()	{		require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ;		$sb = new StudioBrowser ( ) ;		$sb->loadModules () ;		$nodes = $sb->getNodes () ;		$this->buttons = array ( ) ;		//$GLOBALS['log']->debug(print_r($nodes,true));		foreach ( $nodes as $module )		{			$this->buttons [ $module [ 'name' ] ] = array ( 'action' => "ModuleBuilder.getContent('" . $module [ 'action' ] . "')" , 'imageTitle' => ucfirst ( $module [ 'module' ] ) , 'size' => '48' ) ;		}	}	function generateModuleWizardButtons ()	{		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_LABELS' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=editLabels&view_module=" . $this->editModule . "')" , 'imageTitle' => 'Labels' , 'size' => '48' , 'help' => 'labelsBtn' ) ;		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_FIELDS' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=modulefields&view_package=studio&view_module=" . $this->editModule . "')" , 'imageTitle' => 'Fields' , 'size' => '48' , 'help' => 'fieldsBtn' ) ;		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_LAYOUTS' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=wizard&layouts=1&view_module=" . $this->editModule . "')" , 'imageTitle' => 'Layouts' , 'size' => '48' , 'help' => 'layoutsBtn' ) ;        $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_RELATIONSHIPS' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=relationships&view_module=" . $this->editModule . "')" , 'imageTitle' => 'Relationships' , 'size' => '48' , 'help' => 'relationshipsBtn' ) ;		$module = new StudioModule ( $this->editModule ) ;		if (count( $module->subpanels ) > 0)		{			$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_SUBPANELS' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=wizard&subpanels=1&view_module=" . $this->editModule . "')" , 'imageTitle' => 'Subpanels' , 'size' => '48' , 'help' => 'subpanelBtn' ) ;		}	}	function generateViewButtons ()	{		$this->module = new StudioModule ( $this->editModule ) ;		foreach ( $this->module->views as $file => $view )		{			$viewType = ($view [ 'type' ] == 'list') ? "ListView" : ucfirst ( $view [ 'type' ] ) ;			$this->buttons [ $view [ 'name' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=editLayout&view_module={$this->editModule}&view=$viewType')" , 'imageTitle' => $viewType , 'help' => "viewBtn{$viewType}" , 'size' => '48' ) ;		}		if (isset ( $this->module->search ))		{			$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_SEARCH' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=wizard&search=1&view_module={$this->editModule}')" , 'imageTitle' => 'SearchForm' , 'help' => "searchBtn" , 'size' => '48' ) ;		}	}	function generateMBViewButtons ()	{		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_EDITVIEW' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=editLayout&view=editView&view_module={$this->editModule}&view_package={$this->package}')" , 'imageTitle' => 'EditView', 'help'=>'viewBtnEditView' ) ;		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DETAILVIEW' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=editLayout&view=detailView&view_module={$this->editModule}&view_package={$this->package}')" , 'imageTitle' => 'DetailView', 'help'=>'viewBtnListView'  ) ;		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=editLayout&view=ListView&view_module={$this->editModule}&view_package={$this->package}')" , 'imageTitle' => 'ListView', 'help'=>'viewBtnListView' ) ;		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_SEARCH' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=wizard&search=1&view_module={$this->editModule}&view_package={$this->package}')" , 'imageTitle' => 'SearchForm' , 'help'=> 'searchBtn' ) ;		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DASHLET' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=wizard&dashlet=1&view_module={$this->editModule}&view_package={$this->package}')" , 'imageTitle' => 'Dashlet', 'help'=>'viewBtnDashlet' ) ;	}	function generateSubpanelButtons ()	{		$this->module = new StudioModule ( $this->editModule ) ;		foreach ( $this->module->subpanels as $panel => $pname )		{			$this->buttons [ $pname ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=editLayout&view_module={$this->editModule}&view=listView&subpanel={$panel}&subpanelLabel={$pname}')" , 'imageTitle' => $pname , 'imageName' => $pname, 'altImageName' => 'Subpanels', 'size' => '48' ) ;		}	}	function generateSearchButtons ()	{		$this->module = new StudioModule ( $this->editModule ) ;		foreach ( $this->module->search as $title => $searchLayout )		{			$name = str_replace ( ' ', '', $title ) ;			$this->buttons [ $title ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&action=editLayout&view_module={$this->editModule}&view={$searchLayout}')" , 'imageTitle' => $title , 'imageName' => $name , 'help' => "{$name}Btn" , 'size' => '48' ) ;		}	}	function generateMBDashletButtons() {		$this->buttons [ $GLOBALS ['mod_strings' ]['LBL_DASHLETLISTVIEW']] = array('action'=> "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=editLayout&view=dashlet&view_module={$this->editModule}&view_package={$this->package}')", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn');		$this->buttons [ $GLOBALS ['mod_strings' ]['LBL_DASHLETSEARCHVIEW']] = array('action'=> "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=editLayout&view=dashletsearch&view_module={$this->editModule}&view_package={$this->package}')", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch','help'=> 'DashletSearchViewBtn');	}	function generateMBSearchButtons ()	{		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_BASIC' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=basic_search')" , 'imageTitle' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BASIC_SEARCH' ] , 'imageName' => 'BasicSearch','help' => "BasicSearchBtn" ) ;		$this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_ADVANCED' ] ] = array ( 'action' => "ModuleBuilder.getContent('module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=advanced_search')" , 'imageTitle' => $GLOBALS [ 'mod_strings' ] [ 'LBL_ADVANCED_SEARCH' ] , 'imageName' => 'AdvancedSearch','help' => "AdvancedSearchBtn" ) ;
	}	function generateMBSubpanelButtons ()	{	}}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?