本文整理汇总了PHP中ViewFactory::loadView方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewFactory::loadView方法的具体用法?PHP ViewFactory::loadView怎么用?PHP ViewFactory::loadView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewFactory
的用法示例。
在下文中一共展示了ViewFactory::loadView方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processView
private function processView()
{
$view = ViewFactory::loadView($this->view, $this->module, $this->bean, $this->view_object_map, $this->target_module);
$GLOBALS['current_view'] = $view;
if (!empty($this->bean) && !$this->bean->ACLAccess($view->type) && $view->type != 'list') {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if (isset($this->errors)) {
$view->errors = $this->errors;
}
$view->process();
}
示例2: 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);
}
示例3: display
function display()
{
global $mod_strings, $export_module, $current_language, $theme, $current_user;
echo get_module_title("Activities", $mod_strings['LBL_MODULE_TITLE'], true);
$mod_strings = return_module_language($current_language, 'Calls');
// Overload the export module since the user got here by clicking the "Activities" tab
$export_module = "Calls";
$_REQUEST['module'] = 'Calls';
$controller = ControllerFactory::getController('Calls');
$controller->loadBean();
$controller->preProcess();
$controller->process();
//Manipulate view directly to not display header, js and footer again
$view = ViewFactory::loadView($controller->view, $controller->module, $controller->bean, $controller->view_object_map);
$view->options['show_header'] = false;
$view->options['show_title'] = false;
$view->options['show_javascript'] = false;
$view->process();
die;
}
示例4: testLoadView
public function testLoadView()
{
$view = ViewFactory::loadView('detail', 'Contacts');
$className = get_class($view);
$this->assertEquals($className, 'ContactsViewDetail', 'Ensure that we load the right view for Contacts');
}
示例5: setupOriginalEditView
protected function setupOriginalEditView()
{
global $mod_strings;
if (isset($this->bean) && isset($this->th->ss)) {
$mod_strings = array_merge($mod_strings, return_module_language($GLOBALS['current_language'], $this->bean->module_name));
$moduleView = ViewFactory::loadView('edit', $this->bean->module_dir, $this->bean);
$moduleView->bean = $this->bean;
$moduleView->ss = $this->th->ss;
$moduleView->ss->assign("exclude_default_footer", true);
//Set the view to use an Empty Sugarview to prevent the display of any data. We only want to populate
//the bean and smarty template
$mockEv = new SugarView();
$mockEv->isDuplicate = false;
$moduleView->ev = $mockEv;
$moduleView->display();
//Include the JSLanguage for both pmse_Inbox and the target module
echo $moduleView->_getModLanguageJS();
$moduleView->module = $this->bean->module_dir;
echo $moduleView->_getModLanguageJS();
}
}
示例6: setupMyView
protected function setupMyView()
{
global $current_user;
$GLOBALS['module'] = 'Users';
$GLOBALS['action'] = 'EditView';
$_REQUEST['action'] = $GLOBALS['action'];
$view = ViewFactory::loadView('edit', 'Users', $current_user, array('bean' => $current_user), '');
$view->preDisplay();
return $view;
}
示例7: addPhoneNumValidation
public function addPhoneNumValidation($event, $args)
{
//_ppl('action===>'.$GLOBALS['app']->controller->action);
//EditView, Quickedit
//Quickcreate
//_ppl('view ===>'. $GLOBALS['app']->controller->view);
//edit, quickedit
//quickcreate
if ($GLOBALS['app']->controller->view == 'edit' || $GLOBALS['app']->controller->view == 'quickedit' || $GLOBALS['app']->controller->view == 'quickcreate') {
$bean = $GLOBALS['app']->controller->bean;
$view = ViewFactory::loadView($GLOBALS['app']->controller->view, $GLOBALS['app']->controller->module, $GLOBALS['app']->controller->bean, $GLOBALS['app']->controller->view_object_map, $GLOBALS['app']->controller->target_module);
$metadata_file = $view->getMetaDataFile();
//$view->preDisplay();
$view_name = 'EditView';
$form_name = 'EditView';
if ($GLOBALS['app']->controller->view == 'quickedit' || $GLOBALS['app']->controller->view == 'quickcreate') {
$view_name = 'QuickCreate';
$form_name = 'form_DCQuickCreate_' . $bean->module_dir;
// locate the best viewdefs to use: 1. custom/module/quickcreatedefs.php 2. module/quickcreatedefs.php 3. custom/module/editviewdefs.php 4. module/editviewdefs.php
$base = 'modules/' . $bean->module_dir . '/metadata/';
$source = 'custom/' . $base . strtolower($view_name) . 'defs.php';
if (file_exists($source)) {
$metadata_file = $source;
} else {
$source = $base . strtolower($view_name) . 'defs.php';
if (file_exists($source)) {
$metadata_file = $source;
}
}
}
//EditView, form_DCQuickCreate_Accounts,
$fields_in_view = $this->getFieldsInViewDefs($bean, $metadata_file, $view_name);
//_ppl($fields_in_view);
$javascript_str = '';
//_ppl('metadata file -----> '. $metadata_file);
foreach ($bean->field_defs as $field_name => $field_def) {
if (isset($field_def['type']) && !empty($field_def['type']) && $field_def['type'] == 'phone' && $fields_in_view[$field_name]) {
$msg = 'Invalid Value: This phone number format is not recognized. Please check the country and number.';
$javascript_str .= "addToValidateCallback('{$form_name}', '{$field_name}', 'callback', false, '{$msg}', {$field_name}_onblur);";
}
}
$javascript_str = '<script type="text/javascript">' . $javascript_str . '</script>';
//_ppl($javascript_str);
//echo $javascript->getScript();
//_ppl('module name ===>'. $bean->module_dir);
if ($GLOBALS['app']->controller->view != 'quickedit') {
echo $javascript_str;
} else {
$captured = ob_get_clean();
$json_obj = json_decode($captured);
if ($json_obj) {
ob_end_clean();
ob_start();
$json_obj->html = $json_obj->html . $javascript_str;
echo json_encode($json_obj);
}
//echo json_encode(array('title'=> $this->bean->name, 'url'=>'index.php?module=' . $this->bean->module_dir . '&action=DetailView&record=' . $this->bean->id ,'html'=> $captured, 'eval'=>true));
}
} else {
echo '';
}
}
示例8: get_left_form_footer
/**
* Create HTML to display formatted form footer of form in the left pane.
*
* @deprecated use ViewSidequickcreate::getLeftFormHeader() instead
*
* @return string HTML
*/
function get_left_form_footer()
{
$view = ViewFactory::loadView('sidequickcreate', $GLOBALS['module']);
return $view->getLeftFormFooter();
}