当前位置: 首页>>代码示例>>PHP>>正文


PHP SugarController类代码示例

本文整理汇总了PHP中SugarController的典型用法代码示例。如果您正苦于以下问题:PHP SugarController类的具体用法?PHP SugarController怎么用?PHP SugarController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SugarController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getController

 /**
  * Obtain an instance of the correct controller.
  * 
  * @return an instance of SugarController
  */
 function getController($module)
 {
     $class = ucfirst($module) . 'Controller';
     if (file_exists('custom/modules/' . $module . '/controller.php')) {
         $customClass = 'Custom' . $class;
         require_once 'custom/modules/' . $module . '/controller.php';
         if (class_exists($customClass)) {
             $controller = new $customClass();
         } else {
             if (class_exists($class)) {
                 $controller = new $class();
             }
         }
     } elseif (file_exists('modules/' . $module . '/controller.php')) {
         require_once 'modules/' . $module . '/controller.php';
         if (class_exists($class)) {
             $controller = new $class();
         }
     } else {
         $controller = new SugarController();
     }
     //setup the controller
     $controller->setup($module);
     return $controller;
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:30,代码来源:ControllerFactory.php

示例2: display

 function display()
 {
     $this->dv->process();
     echo '<style type="text/css">@import url("custom/modules/ACLRoles/styles/securitygroups.css"); </style>';
     $file = SugarController::getActionFilename($this->action);
     $this->includeClassicFile('modules/' . $this->module . '/' . $file . '.php');
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:7,代码来源:view.classic.php

示例3: getController

 /**
  * Obtain an instance of the correct controller.
  *
  * @return an instance of SugarController
  */
 function getController($module)
 {
     if (SugarAutoLoader::requireWithCustom("modules/{$module}/controller.php")) {
         $class = SugarAutoLoader::customClass(ucfirst($module) . 'Controller');
     } else {
         SugarAutoLoader::requireWithCustom('include/MVC/Controller/SugarController.php');
         $class = SugarAutoLoader::customClass('SugarController');
     }
     if (class_exists($class, false)) {
         $controller = new $class();
     }
     if (empty($controller)) {
         $controller = new SugarController();
     }
     //setup the controller
     $controller->setup($module);
     return $controller;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:23,代码来源:ControllerFactory.php

示例4: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     // Call SugarController::getActionFilename to handle case sensitive file names
     $file = SugarController::getActionFilename($this->action);
     $classic = SugarAutoLoader::existingCustomOne('modules/' . $this->module . '/' . $file . '.php');
     if ($classic) {
         $this->includeClassicFile($classic);
         return true;
     }
     return false;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:14,代码来源:view.classic.php

示例5: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     // Call SugarController::getActionFilename to handle case sensitive file names
     $file = SugarController::getActionFilename($this->action);
     if (file_exists('custom/modules/' . $this->module . '/' . $file . '.php')) {
         $this->includeClassicFile('custom/modules/' . $this->module . '/' . $file . '.php');
         return true;
     } elseif (file_exists('modules/' . $this->module . '/' . $file . '.php')) {
         $this->includeClassicFile('modules/' . $this->module . '/' . $file . '.php');
         return true;
     }
     return false;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:16,代码来源:view.classic.php

示例6: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     if ($this->bean instanceof SugarBean && isset($this->view_object_map['remap_action']) && !$this->bean->ACLAccess($this->view_object_map['remap_action'])) {
         ACLController::displayNoAccess(true);
         return false;
     }
     // Call SugarController::getActionFilename to handle case sensitive file names
     $file = SugarController::getActionFilename($this->action);
     $classic_file = SugarAutoLoader::existingCustomOne('modules/' . $this->module . '/' . $file . '.php');
     if ($classic_file) {
         $this->includeClassicFile($classic_file);
         return true;
     }
     return false;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:18,代码来源:view.classic.php

示例7: process

 function process()
 {
     if (!is_admin($GLOBALS['current_user']) && in_array($this->action, $this->admin_actions)) {
         $this->hasAccess = false;
     }
     parent::process();
 }
开发者ID:nartnik,项目名称:sugarcrm_test,代码行数:7,代码来源:controller.php

示例8: execute

 /**
  * Perform execution of the application. This method is called from index2.php
  *
  * @param Request $request
  */
 function execute(Request $request)
 {
     global $sugar_config;
     if (!empty($sugar_config['default_module'])) {
         $this->default_module = $sugar_config['default_module'];
     }
     $module = $this->default_module;
     if (!empty($_REQUEST['module'])) {
         $module = $_REQUEST['module'];
     }
     insert_charset_header();
     $this->setupPrint();
     $this->controller = ControllerFactory::getController($module);
     // if the entry point is defined to not need auth, then don't authenicate
     if (!$request->has('entryPoint') || $this->controller->checkEntryPointRequiresAuth($request->query('entryPoint'))) {
         $this->loadUser();
         $this->ACLFilter();
         $this->preProcess();
         $this->getController()->preProcess();
         $this->checkHTTPReferer();
     }
     SugarThemeRegistry::buildRegistry();
     $this->loadLanguages();
     $this->checkDatabaseVersion();
     $this->loadDisplaySettings();
     $this->loadLicense();
     $this->loadGlobals();
     $this->setupResourceManagement($module);
     $this->getController()->execute();
     sugar_cleanup();
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:36,代码来源:SugarApplication.php

示例9: pre_save

 public function pre_save()
 {
     require_once 'include/upload_file.php';
     $upload_file = new UploadFile('filename_file');
     if (isset($_FILES['filename_file']) && $upload_file->confirm_upload()) {
         $filename = $upload_file->get_stored_file_name();
         $file_ext = $upload_file->file_ext;
         if (empty($this->bean->id)) {
             $this->bean->id = create_guid();
             $this->bean->new_with_id = true;
         }
         $account = null;
         if (isset($_POST['xphotobucketaccount_id'])) {
             $account = BeanFactory::getBean('xPhotobucketAccounts', $_POST['xphotobucketaccount_id']);
         }
         // $resp = $account->upload_media('image', $upload_file->temp_file_location, "{$this->bean->id}.{$file_ext}", $_POST['name']);
         $resp = $account->upload_media('base64', base64_encode(file_get_contents($upload_file->temp_file_location)), "{$this->bean->id}.{$file_ext}", $_POST['name']);
         $this->bean->browse_url = $resp['browseurl'];
         $this->bean->image_url = $resp['url'];
         $this->bean->thumb_url = $resp['thumb'];
     } else {
         echo "Upload file error";
         sugar_cleanup(true);
     }
     parent::pre_save();
 }
开发者ID:sunmo,项目名称:snowlotus,代码行数:26,代码来源:controller.php

示例10: process

 public function process()
 {
     if (!is_admin($GLOBALS['current_user']) && !is_admin_for_module($GLOBALS['current_user'], 'Contracts')) {
         $this->hasAccess = false;
     }
     parent::process();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:7,代码来源:controller.php

示例11:

 function action_listview()
 {
     if ($_REQUEST['state_in_chart']) {
         $this->correctStateFilterFromChart();
     }
     parent::action_listview();
 }
开发者ID:pixprod,项目名称:Regoluna-Invoices-for-SugarCRM,代码行数:7,代码来源:controller.php

示例12: preProcess

 public function preProcess()
 {
     parent::preProcess();
     global $current_user;
     if (!$current_user->isAdmin()) {
         sugar_die("Non-admin users are not allowed to access the admin area.");
     }
 }
开发者ID:mihir-parikh,项目名称:sugarcrm_playground,代码行数:8,代码来源:controller.php

示例13: post_delete

 protected function post_delete()
 {
     if (!empty($_REQUEST['return_url'])) {
         $_REQUEST['return_url'] = urldecode($_REQUEST['return_url']);
         $this->redirect_url = $_REQUEST['return_url'];
     } else {
         parent::post_delete();
     }
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:9,代码来源:controller.php

示例14: process

 function process()
 {
     $GLOBALS['log']->info(get_class($this) . ":");
     global $current_user;
     $access = $current_user->getDeveloperModules();
     if ($current_user->isAdmin() || $current_user->isDeveloperForAnyModule() && !isset($_REQUEST['view_module']) && (isset($_REQUEST['action']) && $_REQUEST['action'] != 'package') || isset($_REQUEST['view_module']) && (in_array($_REQUEST['view_module'], $access) || empty($_REQUEST['view_module'])) || isset($_REQUEST['type']) && ($_REQUEST['type'] == 'dropdowns' && $current_user->isDeveloperForAnyModule() || $_REQUEST['type'] == 'studio' && displayStudioForCurrentUser() == true)) {
         $this->hasAccess = true;
     } else {
         $this->hasAccess = false;
     }
     parent::process();
 }
开发者ID:butschster,项目名称:sugarcrm_dev,代码行数:12,代码来源:controller.php

示例15: process

 function process()
 {
     $GLOBALS['log']->info(get_class($this) . ":");
     global $current_user;
     $access = get_admin_modules_for_user($current_user);
     if (is_admin($current_user) || is_admin_for_any_module($current_user) && !isset($_REQUEST['view_module']) && (isset($_REQUEST['action']) && $_REQUEST['action'] != 'package') || isset($_REQUEST['view_module']) && (in_array($_REQUEST['view_module'], $access) || empty($_REQUEST['view_module'])) || isset($_REQUEST['type']) && ($_REQUEST['type'] == 'dropdowns' && is_admin_for_any_module($current_user) || $_REQUEST['type'] == 'studio' && displayStudioForCurrentUser() == true)) {
         $this->hasAccess = true;
     } else {
         $this->hasAccess = false;
     }
     parent::process();
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:12,代码来源:controller.php


注:本文中的SugarController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。