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


PHP ViewFactory::_loadConfig方法代碼示例

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


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

示例1: loadView

 /**
  * load the correct view
  *
  * @param string         $type View Type
  *
  * @param string         $module
  * @param SugarBean|null $bean
  * @param array          $view_object_map
  * @param string         $target_module
  *
  * @return SugarView
  */
 public static function loadView($type = 'default', $module, SugarBean $bean = null, array $view_object_map = [], $target_module = '')
 {
     $type = strtolower($type);
     //first let's check if the module handles this view
     $view = null;
     //Check to see if we should load a custom parent view instance
     loadParentView($type);
     if (!empty($target_module)) {
         if (file_exists($path = DOCROOT . "custom/modules/{$target_module}/views/view.{$type}.php")) {
             $view = ViewFactory::_buildFromFile($path, $bean, $view_object_map, $type, $target_module);
         } else {
             if (file_exists($path = DOCROOT . "modules/{$target_module}/views/view.{$type}.php")) {
                 $view = ViewFactory::_buildFromFile($path, $bean, $view_object_map, $type, $target_module);
             }
         }
     }
     if (!isset($view)) {
         if (file_exists($path = DOCROOT . "custom/modules/{$module}/views/view.{$type}.php")) {
             $view = ViewFactory::_buildFromFile($path, $bean, $view_object_map, $type, $module);
         } else {
             if (file_exists($path = DOCROOT . "modules/{$module}/views/view.{$type}.php")) {
                 $view = ViewFactory::_buildFromFile($path, $bean, $view_object_map, $type, $module);
             } else {
                 if (file_exists($path = DOCROOT . "custom/include/MVC/View/views/view.{$type}.php")) {
                     $view = ViewFactory::_buildFromFile($path, $bean, $view_object_map, $type, $module);
                 } else {
                     if (file_exists($path = DOCROOT . "include/MVC/View/views/view.{$type}.php")) {
                         //it appears Sugar does have the proper logic for this file.
                         $view = ViewFactory::_buildFromFile($path, $bean, $view_object_map, $type, $module);
                     }
                 }
             }
         }
     }
     // Default to SugarView if still nothing found/built
     if (is_null($view)) {
         $view = new SugarView();
     }
     ViewFactory::_loadConfig($view, $type);
     return $view;
 }
開發者ID:butschster,項目名稱:sugarcrm_dev,代碼行數:53,代碼來源:ViewFactory.php

示例2: loadView

 /**
  * load the correct view
  * @param string $type View Type
  * @return valid view
  */
 function loadView($type = 'default', $module, $bean = null, $view_object_map = array(), $target_module = '')
 {
     $type = strtolower($type);
     //first let's check if the module handles this view
     $view = null;
     //Check to see if we should load a custom parent view instance
     loadParentView($type);
     if (!empty($target_module)) {
         $view_file = SugarAutoLoader::existingCustomOne('modules/' . $target_module . '/views/view.' . $type . '.php');
         $view_module = $target_module;
     } else {
         $view_module = $module;
     }
     if (empty($view_file)) {
         $view_file = SugarAutoLoader::existingCustomOne('modules/' . $module . '/views/view.' . $type . '.php');
     }
     if (empty($view_file)) {
         $view_file = SugarAutoLoader::existingCustomOne('include/MVC/View/views/view.' . $type . '.php');
     }
     if (!empty($view_file)) {
         $view = ViewFactory::_buildFromFile($view_file, $bean, $view_object_map, $type, $view_module);
     }
     if (empty($view)) {
         // Default to SugarView if still nothing found/built
         $view = new SugarView();
     }
     ViewFactory::_loadConfig($view, $type);
     return $view;
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:34,代碼來源:ViewFactory.php

示例3: loadView

 /**
  * load the correct view
  * @param string $type View Type
  * @return valid view
  */
 function loadView($type = 'default', $module, $bean = null, $view_object_map = array())
 {
     $type = strtolower($type);
     //first let's check if the module handles this view
     $view = null;
     if (file_exists('custom/modules/' . $module . '/views/view.' . $type . '.php')) {
         $view = ViewFactory::_buildFromFile('custom/modules/' . $module . '/views/view.' . $type . '.php', $bean, $view_object_map, $type, $module);
     } else {
         if (file_exists('modules/' . $module . '/views/view.' . $type . '.php')) {
             $view = ViewFactory::_buildFromFile('modules/' . $module . '/views/view.' . $type . '.php', $bean, $view_object_map, $type, $module);
         } else {
             if (file_exists('custom/include/MVC/View/views/view.' . $type . '.php')) {
                 $view = ViewFactory::_buildFromFile('custom/include/MVC/View/views/view.' . $type . '.php', $bean, $view_object_map, $type, $module);
             } else {
                 //if the module does not handle this view, then check if Sugar handles it OOTB
                 $file = 'include/MVC/View/views/view.' . $type . '.php';
                 if (file_exists($file)) {
                     //it appears Sugar does have the proper logic for this file.
                     $view = ViewFactory::_buildFromFile($file, $bean, $view_object_map, $type, $module);
                 }
             }
         }
     }
     // Default to SugarView if still nothing found/built
     if (!isset($view)) {
         $view = new SugarView();
     }
     ViewFactory::_loadConfig($view, $type);
     return $view;
 }
開發者ID:klr2003,項目名稱:sourceread,代碼行數:35,代碼來源:ViewFactory.php

示例4: testShowSubpanelsSettingForPrint

 public function testShowSubpanelsSettingForPrint()
 {
     $viewClass = 'ViewDetail';
     $type = 'detail';
     $view = new $viewClass();
     $view->module = 'Cases';
     ViewFactory::_loadConfig($view, $type);
     $_REQUEST['print'] = true;
     $view->preDisplay();
     $this->assertFalse($view->options['show_subpanels'], 'show_subpanels should be false for print');
 }
開發者ID:thsonvt,項目名稱:sugarcrm_dev,代碼行數:11,代碼來源:Bug47572Test.php

示例5: test_loadConfig

 public function test_loadConfig()
 {
     //check with a invalid module, method must not change the view options.
     $view = ViewFactory::loadView('default', '');
     $options = $view->options;
     ViewFactory::_loadConfig($view, 'default');
     $this->assertSame($options, $view->options);
     //check with a valid module which does not implement it's own view config. method must not change the view options.
     $view = ViewFactory::loadView('detail', 'Users');
     $options = $view->options;
     ViewFactory::_loadConfig($view, 'detail');
     $this->assertSame($options, $view->options);
     //check with a valid module which implement it's own view config. method still must not change the view options because it needs.
     $view = ViewFactory::loadView('area_detail_map', 'jjwg_Areas');
     $view->module = 'jjwg_Areas';
     $options = $view->options;
     ViewFactory::_loadConfig($view, 'area_detail_map');
     $this->assertSame($options, $view->options);
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:19,代碼來源:ViewFactoryTest.php


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