當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。