view.wizard.php

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

PHP
437
字号
<?php/********************************************************************************* * SugarCRM is a customer relationship management program developed by * SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc. *  * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License version 3 as published by the * Free Software Foundation with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. *  * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more * details. *  * You should have received a copy of the GNU General Public License along with * this program; if not, see http://www.gnu.org/licenses or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. *  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com. *  * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. *  * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by SugarCRM". ********************************************************************************/require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;require_once ('modules/ModuleBuilder/Module/StudioModule.php') ;require_once ('include/MVC/View/SugarView.php') ;class ModuleBuilderViewWizard extends SugarView{	var $actions = '' ;	function ModuleBuilderViewWizard ()	{		$this->editModule = (! empty ( $_REQUEST [ 'view_module' ] )) ? $_REQUEST [ 'view_module' ] : null ;		$this->layouts = (! empty ( $_REQUEST [ 'layouts' ] )) ? $_REQUEST [ 'layouts' ] : null ;		$this->subpanels = (! empty ( $_REQUEST [ 'subpanels' ] )) ? $_REQUEST [ 'subpanels' ] : null ;		$this->search = (! empty ( $_REQUEST [ 'search' ] )) ? $_REQUEST [ 'search' ] : null ;		$this->dashlet = (!empty ($_REQUEST[ 'dashlet'])) ? $_REQUEST['dashlet'] : null;		$this->assistant = array ( 'group' => 'main' , 'key' => 'studioWelcome' ) ;		$this->buttons = array(); // initialize so that modules without subpanels for example don't result in this being unset and causing problems in the smarty->assign	}	function display ()	{		$GLOBALS [ 'log' ]->debug ( "in Wizard display" ) ;		$this->ajax = new AjaxCompose ( ) ;		$smarty = new Sugar_Smarty ( ) ;		if (isset ( $_REQUEST [ 'MB' ] ))		{			$this->processMB ( $this->ajax ) ;		} else		{				$this->processStudio ( $this->ajax ) ;		}		global $image_path ;		$smarty->assign ( 'buttons', $this->buttons ) ;		$smarty->assign ( 'image_path', $image_path ) ;		$smarty->assign ( "title", $this->title ) ;		$smarty->assign ( "question", $this->question ) ;		$smarty->assign ( "defaultHelp", $this->help ) ;		$smarty->assign ( "actions", $this->actions ) ;		$this->ajax->addSection ( 'center', $this->title, $smarty->fetch ( 'modules/ModuleBuilder/tpls/wizard.tpl' ) ) ;		/////////////////////////		//ASSISTANT		global $current_user ;		$smarty->assign ( 'assistant', $this->assistant ) ;		$userPref = $current_user->getPreference ( 'mb_assist', 'Assistant' ) ;		if (! $userPref)			$userPref = "na" ;		$smarty->assign ( 'userPref', $userPref ) ;		///////////////////////		//ASSISTANT		echo $this->ajax->getJavascript () ;	}	function processStudio ( $ajax )	{		//      $GLOBALS['log']->debug("in processStudio");		global $mod_strings ;		if (isset ( $this->editModule ))		{			global $app_list_strings ;			$moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ;			$this->translatedEditModule = $moduleNames [ strtolower ( $this->editModule ) ] ;		}		$this->ajax->addCrumb ( $mod_strings [ 'LBL_STUDIO' ], 'ModuleBuilder.main("studio")' ) ;		if (! isset ( $this->editModule ))		{			//Studio Select Module Page			$this->generateStudioModuleButtons () ;			$this->question = $mod_strings [ 'LBL_QUESTION_EDIT' ] ;			$this->title = $mod_strings [ 'LBL_STUDIO' ] ;			$this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"" . $mod_strings [ 'LBL_BTN_EXPORT' ] . '">' ;			$this->help = 'studioHelp' ;		} else if (isset ( $this->layouts ))		{			//Studio Select Layout page			$this->generateViewButtons () ;			$this->title = "{$this->translatedEditModule} {$mod_strings['LBL_LAYOUTS']}" ;			$this->question = $mod_strings [ 'LBL_QUESTION_LAYOUT' ] ;			$this->help = 'layoutsHelp' ;			$this->ajax->addCrumb ( $this->translatedEditModule, '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&view_module=' . $this->editModule . '")' ) ;			$this->assistant [ 'key' ] = 'viewlayouts' ;			$this->assistant [ 'group' ] = 'module' ;		} else if (isset ( $this->subpanels ))		{			//Studio Select Subpanel page.			$this->generateSubpanelButtons () ;			$this->title = $this->translatedEditModule . " " . $mod_strings [ 'LBL_SUBPANELS' ] ;			$this->question = $mod_strings [ 'LBL_QUESTION_SUBPANEL' ] ;			$this->ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' ) ;			$this->ajax->addCrumb ( $mod_strings [ 'LBL_SUBPANELS' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&subpanels=1&view_module=' . $this->editModule . '")' ) ;			$this->help = 'subpanelHelp' ;		} else if (isset ( $this->search ))		{			//Studio Select Search Layout page.			$this->generateSearchButtons () ;			$this->title = $this->translatedEditModule . " " . $mod_strings['LBL_SEARCH'];			$this->question = $mod_strings [ 'LBL_QUESTION_SEARCH' ] ;			$this->ajax->addCrumb ( $this->translatedEditModule, '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&view_module=' . $this->editModule . '")' ) ;			$this->ajax->addCrumb ( $mod_strings [ 'LBL_SEARCH' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&search=1&view_module=' . $this->editModule . '")' ) ;			$this->help = 'searchHelp' ;		} else		{			//Studio Edit Module Page			$module = new StudioModule ( $this->editModule ) ;			$this->generateModuleWizardButtons () ;			$this->question = $mod_strings [ 'LBL_QUESTION_MODULE' ] ;			$this->title = $mod_strings [ 'LBL_EDIT' ] . " " . $this->translatedEditModule ;			$this->help = 'moduleHelp' ;			$this->ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' ) ;		}	}

⌨️ 快捷键说明

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