• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP inDeveloperMode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getDefaultPortalSettings

 /**
  * Gets the default Portal settings.
  *
  * @return array the array containing default Portal settings.
  */
 private function getDefaultPortalSettings()
 {
     $portalConfig = array('platform' => 'portal', 'debugSugarApi' => true, 'logLevel' => 'ERROR', 'logWriter' => 'ConsoleWriter', 'logFormatter' => 'SimpleFormatter', 'metadataTypes' => array(), 'defaultModule' => 'Cases', 'orderByDefaults' => array('Cases' => array('field' => 'case_number', 'direction' => 'desc'), 'Bugs' => array('field' => 'bug_number', 'direction' => 'desc'), 'Notes' => array('field' => 'date_modified', 'direction' => 'desc'), 'KBDocuments' => array('field' => 'date_modified', 'direction' => 'desc')));
     if (inDeveloperMode()) {
         $portalConfig['logLevel'] = 'DEBUG';
     }
     return $portalConfig;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:13,代码来源:parser.portalconfig.php


示例2: loadDictionaryFromStorage

 /**
  * Load a dictionary for a particular api
  * @internal
  * @param string $apiType The api type for the dictionary you want to load ("Rest" or "Soap")
  * @return array The data stored in saveDictionaryToStorage()
  */
 protected function loadDictionaryFromStorage($apiType)
 {
     $dictFile = $this->cacheDir . 'ServiceDictionary.' . $apiType . '.php';
     if (!file_exists($dictFile) || inDeveloperMode()) {
         // No stored service dictionary, I need to build them
         $this->buildAllDictionaries();
     }
     require $dictFile;
     return $apiDictionary[$apiType];
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:16,代码来源:ServiceDictionary.php


示例3: createLanguageFile

 /**
  * Called from VardefManager to allow for caching a lang file for a module
  * @param module - the name of the module we are working with
  * @param templates - an array of templates this module uses
  */
 public static function createLanguageFile($module, $templates = array('default'), $refresh = false)
 {
     global $mod_strings, $current_language;
     if (inDeveloperMode() || !empty($_SESSION['developerMode'])) {
         $refresh = true;
     }
     $temp_mod_strings = $mod_strings;
     $lang = $current_language;
     if (empty($lang)) {
         $lang = $GLOBALS['sugar_config']['default_language'];
     }
     if (empty(self::$createdModules[$module]) && ($refresh || !file_exists(sugar_cached('modules/') . $module . '/language/' . $lang . '.lang.php'))) {
         $loaded_mod_strings = array();
         $loaded_mod_strings = LanguageManager::loadTemplateLanguage($module, $templates, $lang, $loaded_mod_strings);
         self::$createdModules[$module] = true;
         LanguageManager::refreshLanguage($module, $lang, $loaded_mod_strings);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:23,代码来源:LanguageManager.php


示例4: setup

 public function setup()
 {
     $themedef = array();
     include 'themes/' . SugarTestThemeUtilities::createAnonymousTheme() . '/themedef.php';
     $this->_themeDef = $themedef;
     SugarThemeRegistry::add($this->_themeDef);
     $this->_themeObject = SugarThemeRegistry::get($this->_themeDef['dirName']);
     $themedef = array();
     include 'themes/' . SugarTestThemeUtilities::createAnonymousChildTheme($this->_themeObject->__toString()) . '/themedef.php';
     $this->_themeDefChild = $themedef;
     SugarThemeRegistry::add($this->_themeDefChild);
     $this->_themeObjectChild = SugarThemeRegistry::get($this->_themeDefChild['dirName']);
     // test assumes developerMode is off, so css minifying happens
     if (inDeveloperMode()) {
         $this->_olddeveloperMode = $GLOBALS['sugar_config']['developerMode'];
     }
     $GLOBALS['sugar_config']['developerMode'] = false;
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:18,代码来源:SugarThemeTest.php


示例5: jsParser

 protected function jsParser()
 {
     if (inDeveloperMode()) {
         return $this->text;
     }
     //If the JSMIn extension is loaded, use that as it can be as much as 1000x faster than JShrink
     if (extension_loaded("jsmin")) {
         return @jsmin($this->text);
     }
     if (!empty($GLOBALS['sugar_config']['uglify'])) {
         $descriptorspec = array(0 => array("pipe", "r"), 1 => array("pipe", "w"));
         $process = proc_open($GLOBALS['sugar_config']['uglify'], $descriptorspec, $pipes);
         if (is_resource($process)) {
             fwrite($pipes[0], $this->text);
             fclose($pipes[0]);
             $out = stream_get_contents($pipes[1]);
             fclose($pipes[1]);
             proc_close($process);
             return $out;
         }
     }
     require_once 'jssource/Minifier.php';
     return JShrink\Minifier::minify($this->text);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:24,代码来源:jsmin.php


示例6: preDisplay

 /**
  * This method checks to see if the configuration file exists and, if not, creates one by default
  *
  */
 public function preDisplay()
 {
     global $app_strings;
     //Rebuild config file if it doesn't exist
     if (!file_exists($this->configFile)) {
         ModuleInstaller::handleBaseConfig();
     }
     $this->ss->assign("configFile", $this->configFile);
     $config = ModuleInstaller::getBaseConfig();
     $this->ss->assign('configHash', md5(serialize($config)));
     $sugarSidecarPath = ensureJSCacheFilesExist();
     $this->ss->assign("sugarSidecarPath", $sugarSidecarPath);
     // TODO: come up with a better way to deal with the various JS files
     // littered in sidecar.tpl.
     $voodooFile = 'custom/include/javascript/voodoo.js';
     if (SugarAutoLoader::fileExists($voodooFile)) {
         $this->ss->assign('voodooFile', $voodooFile);
     }
     //Load sidecar theme css
     $theme = new SidecarTheme();
     $this->ss->assign("css_url", $theme->getCSSURL());
     $this->ss->assign("developerMode", inDeveloperMode());
     //Loading label
     $this->ss->assign('LBL_LOADING', $app_strings['LBL_ALERT_TITLE_LOADING']);
     $this->ss->assign('LBL_ENABLE_JAVASCRIPT', $app_strings['LBL_ENABLE_JAVASCRIPT']);
     $slFunctionsPath = inDeveloperMode() ? "cache/Expressions/functions_cache_debug.js" : "cache/Expressions/functions_cache.js";
     if (!is_file($slFunctionsPath)) {
         $GLOBALS['updateSilent'] = true;
         include "include/Expressions/updatecache.php";
     }
     $this->ss->assign("SLFunctionsPath", $slFunctionsPath);
     if (!empty($this->authorization)) {
         $this->ss->assign('appPrefix', $config['env'] . ":" . $config['appId'] . ":");
         $this->ss->assign('authorization', $this->authorization);
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:40,代码来源:SidecarView.php


示例7: checkError

 /**
  * Checks for database not being connected
  *
  * @param  string $msg        message to prepend to the error message
  * @param  bool   $dieOnError true if we want to die immediately on error
  * @return bool
  */
 public function checkError($msg = '', $dieOnError = false)
 {
     $userMsg = inDeveloperMode() ? "{$msg}: " : "";
     if (!isset($this->database)) {
         $GLOBALS['log']->error("Database Is Not Connected");
         if ($this->dieOnError || $dieOnError) {
             sugar_die($userMsg . "Database Is Not Connected");
         } else {
             $this->last_error = $userMsg . "Database Is Not Connected";
         }
         return true;
     }
     return false;
 }
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:21,代码来源:DBManager.php


示例8: getModuleField

function getModuleField($module, $fieldname, $aow_field, $view = 'EditView', $value = '', $alt_type = '')
{
    global $current_language, $app_strings, $app_list_strings, $current_user, $beanFiles, $beanList;
    // use the mod_strings for this module
    $mod_strings = return_module_language($current_language, $module);
    // set the filename for this control
    $file = create_cache_directory('modules/AOW_WorkFlow/') . $module . $view . $alt_type . $fieldname . '.tpl';
    if (!is_file($file) || inDeveloperMode() || !empty($_SESSION['developerMode'])) {
        if (!isset($vardef)) {
            require_once $beanFiles[$beanList[$module]];
            $focus = new $beanList[$module]();
            $vardef = $focus->getFieldDefinition($fieldname);
        }
        $displayParams = array();
        //$displayParams['formName'] = 'EditView';
        // if this is the id relation field, then don't have a pop-up selector.
        if ($vardef['type'] == 'relate' && $vardef['id_name'] == $vardef['name']) {
            $vardef['type'] = 'varchar';
        }
        if (isset($vardef['precision'])) {
            unset($vardef['precision']);
        }
        //$vardef['precision'] = $locale->getPrecedentPreference('default_currency_significant_digits', $current_user);
        //TODO Fix datetimecomebo
        //temp work around
        if ($vardef['type'] == 'datetimecombo') {
            $vardef['type'] = 'datetime';
        }
        // trim down textbox display
        if ($vardef['type'] == 'text') {
            $vardef['rows'] = 2;
            $vardef['cols'] = 32;
        }
        // create the dropdowns for the parent type fields
        if ($vardef['type'] == 'parent_type') {
            $vardef['type'] = 'enum';
        }
        if ($vardef['type'] == 'link') {
            $vardef['type'] = 'relate';
            $vardef['rname'] = 'name';
            $vardef['id_name'] = $vardef['name'] . '_id';
            if ((!isset($vardef['module']) || $vardef['module'] == '') && $focus->load_relationship($vardef['name'])) {
                $vardef['module'] = $focus->{$vardef}['name']->getRelatedModuleName();
            }
        }
        //check for $alt_type
        if ($alt_type != '') {
            $vardef['type'] = $alt_type;
        }
        // remove the special text entry field function 'getEmailAddressWidget'
        if (isset($vardef['function']) && ($vardef['function'] == 'getEmailAddressWidget' || $vardef['function']['name'] == 'getEmailAddressWidget')) {
            unset($vardef['function']);
        }
        if (isset($vardef['name']) && ($vardef['name'] == 'date_entered' || $vardef['name'] == 'date_modified')) {
            $vardef['name'] = 'aow_temp_date';
        }
        // load SugarFieldHandler to render the field tpl file
        static $sfh;
        if (!isset($sfh)) {
            require_once 'include/SugarFields/SugarFieldHandler.php';
            $sfh = new SugarFieldHandler();
        }
        $contents = $sfh->displaySmarty('fields', $vardef, $view, $displayParams);
        // Remove all the copyright comments
        $contents = preg_replace('/\\{\\*[^\\}]*?\\*\\}/', '', $contents);
        if ($view == 'EditView' && ($vardef['type'] == 'relate' || $vardef['type'] == 'parent')) {
            $contents = str_replace('"' . $vardef['id_name'] . '"', '{/literal}"{$fields.' . $vardef['name'] . '.id_name}"{literal}', $contents);
            $contents = str_replace('"' . $vardef['name'] . '"', '{/literal}"{$fields.' . $vardef['name'] . '.name}"{literal}', $contents);
        }
        // hack to disable one of the js calls in this control
        if (isset($vardef['function']) && ($vardef['function'] == 'getCurrencyDropDown' || $vardef['function']['name'] == 'getCurrencyDropDown')) {
            $contents .= "{literal}<script>function CurrencyConvertAll() { return; }</script>{/literal}";
        }
        // Save it to the cache file
        if ($fh = @sugar_fopen($file, 'w')) {
            fputs($fh, $contents);
            fclose($fh);
        }
    }
    // Now render the template we received
    $ss = new Sugar_Smarty();
    // Create Smarty variables for the Calendar picker widget
    global $timedate;
    $time_format = $timedate->get_user_time_format();
    $date_format = $timedate->get_cal_date_format();
    $ss->assign('USER_DATEFORMAT', $timedate->get_user_date_format());
    $ss->assign('TIME_FORMAT', $time_format);
    $time_separator = ":";
    $match = array();
    if (preg_match('/\\d+([^\\d])\\d+([^\\d]*)/s', $time_format, $match)) {
        $time_separator = $match[1];
    }
    $t23 = strpos($time_format, '23') !== false ? '%H' : '%I';
    if (!isset($match[2]) || $match[2] == '') {
        $ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . "%M");
    } else {
        $pm = $match[2] == "pm" ? "%P" : "%p";
        $ss->assign('CALENDAR_FORMAT', $date_format . ' ' . $t23 . $time_separator . "%M" . $pm);
    }
    $ss->assign('CALENDAR_FDOW', $current_user->get_first_day_of_week());
//.........这里部分代码省略.........
开发者ID:isrealconsulting,项目名称:ic-suite,代码行数:101,代码来源:aow_utils.php


示例9: checkTemplate

 function checkTemplate($cacheRowFile)
 {
     if (inDeveloperMode() || !empty($_SESSION['developerMode'])) {
         return false;
     }
     return file_exists($cacheRowFile);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:7,代码来源:ViewSugarFieldCollection.php


示例10: getJSURL

 /**
  * Returns the URL for an image in the current theme. If not found in the current theme, will revert
  * to looking in the base theme.
  *
  * @param  string $jsFileName js file name
  * @param  bool   $returnURL if true, returns URL with unique image mark, otherwise returns path to the file
  * @return string path to js file
  */
 public function getJSURL($jsFileName, $returnURL = true)
 {
     if (isset($this->_jsCache[$jsFileName]) && sugar_is_file(sugar_cached($this->_jsCache[$jsFileName]))) {
         if ($returnURL) {
             return getJSPath("cache/" . $this->_jsCache[$jsFileName]);
         } else {
             return sugar_cached($this->_jsCache[$jsFileName]);
         }
     }
     $jsFileContents = '';
     $fullFileName = $this->getJSPath() . '/' . $jsFileName;
     $defaultFileName = $this->getDefaultJSPath() . '/' . $jsFileName;
     if (isset($this->parentTheme) && SugarThemeRegistry::get($this->parentTheme) instanceof SugarTheme && ($filename = SugarThemeRegistry::get($this->parentTheme)->getJSURL($jsFileName, false)) != '' && !in_array($jsFileName, $this->ignoreParentFiles)) {
         $jsFileContents .= file_get_contents($filename);
     } else {
         if (sugar_is_file($defaultFileName)) {
             $jsFileContents .= file_get_contents($defaultFileName);
         }
         if (sugar_is_file('custom/' . $defaultFileName)) {
             $jsFileContents .= file_get_contents('custom/' . $defaultFileName);
         }
     }
     if (sugar_is_file($fullFileName)) {
         $jsFileContents .= file_get_contents($fullFileName);
     }
     if (sugar_is_file('custom/' . $fullFileName)) {
         $jsFileContents .= file_get_contents('custom/' . $fullFileName);
     }
     if (empty($jsFileContents)) {
         $GLOBALS['log']->warn("Javascript File {$jsFileName} not found");
         return false;
     }
     // create the cached file location
     $jsFilePath = create_cache_directory($fullFileName);
     // minify the js
     if (!inDeveloperMode() && !sugar_is_file(str_replace('.js', '-min.js', $jsFilePath))) {
         $jsFileContents = SugarMin::minify($jsFileContents);
         $jsFilePath = str_replace('.js', '-min.js', $jsFilePath);
         $fullFileName = str_replace('.js', '-min.js', $fullFileName);
     }
     // now write the js to cache
     sugar_file_put_contents($jsFilePath, $jsFileContents);
     $this->_jsCache[$jsFileName] = $fullFileName;
     if ($returnURL) {
         return getJSPath("cache/" . $fullFileName);
     }
     return sugar_cached($fullFileName);
 }
开发者ID:BMLP,项目名称:memoryhole-ansible,代码行数:56,代码来源:SugarTheme.php


示例11: checkTemplate

 /**
  * Checks if a template exists
  *
  * @param module string module name
  * @param view string view need (eg DetailView, EditView, etc)
  */
 function checkTemplate($module, $view, $checkFormName = false, $formName = '')
 {
     if (inDeveloperMode() || !empty($_SESSION['developerMode'])) {
         return false;
     }
     $view = $checkFormName ? $formName : $view;
     return file_exists($this->cacheDir . $this->templateDir . $module . '/' . $view . '.tpl');
 }
开发者ID:vsanth,项目名称:dynamic-crm,代码行数:14,代码来源:TemplateHandler.php


示例12: loadFullAPIList

 /**
  * Get the list of available APIs
  * @param bool $forceRebuild
  * @param bool $ignoreDisabled Should we ignore disabled status?
  * @return array
  */
 public static function loadFullAPIList($forceRebuild = false, $ignoreDisabled = false)
 {
     if (inDeveloperMode()) {
         static $beenHereBefore = false;
         if (!$beenHereBefore) {
             $forceRebuild = true;
             $beenHereBefore = true;
         }
     }
     $cached = sugar_cached('include/externalAPI.cache.php');
     if (!$forceRebuild && file_exists($cached)) {
         // Already have a cache file built, no need to rebuild
         require $cached;
         return $ignoreDisabled ? $fullAPIList : self::filterAPIList($fullAPIList);
     }
     $apiFullList = array();
     $meetingPasswordList = array();
     $needUrlList = array();
     $baseDirList = array('include/externalAPI/', 'custom/include/externalAPI/');
     foreach ($baseDirList as $baseDir) {
         $dirList = glob($baseDir . '*', GLOB_ONLYDIR);
         foreach ($dirList as $dir) {
             if ($dir == $baseDir . '.' || $dir == $baseDir . '..' || $dir == $baseDir . 'Base') {
                 continue;
             }
             $apiName = str_replace($baseDir, '', $dir);
             if (file_exists($dir . '/ExtAPI' . $apiName . '.php')) {
                 $apiFullList[$apiName]['className'] = 'ExtAPI' . $apiName;
                 $apiFullList[$apiName]['file'] = $dir . '/' . $apiFullList[$apiName]['className'] . '.php';
             }
             if (file_exists($dir . '/ExtAPI' . $apiName . '_cstm.php')) {
                 $apiFullList[$apiName]['className'] = 'ExtAPI' . $apiName . '_cstm';
                 $apiFullList[$apiName]['file_cstm'] = $dir . '/' . $apiFullList[$apiName]['className'] . '.php';
             }
         }
     }
     $optionList = array('supportedModules', 'useAuth', 'requireAuth', 'supportMeetingPassword', 'docSearch', 'authMethod', 'oauthFixed', 'needsUrl', 'canInvite', 'sendsInvites', 'sharingOptions', 'connector', 'oauthParams', 'restrictUploadsByExtension');
     foreach ($apiFullList as $apiName => $apiOpts) {
         require_once $apiOpts['file'];
         if (!empty($apiOpts['file_cstm'])) {
             require_once $apiOpts['file_cstm'];
         }
         $className = $apiOpts['className'];
         $apiClass = new $className();
         foreach ($optionList as $opt) {
             if (isset($apiClass->{$opt})) {
                 $apiFullList[$apiName][$opt] = $apiClass->{$opt};
             }
         }
         // Special handling for the show/hide of the Meeting Password field, we need to create a dropdown for the Sugar Logic code.
         if (isset($apiClass->supportMeetingPassword) && $apiClass->supportMeetingPassword == true) {
             $meetingPasswordList[$apiName] = $apiName;
         }
     }
     create_cache_directory('/include/');
     $cached_tmp = sugar_cached('include/externalAPI.cache-tmp.php');
     $fd = fopen($cached_tmp, 'w');
     fwrite($fd, "<" . "?php\n//This file is auto generated by " . basename(__FILE__) . "\n\$fullAPIList = " . var_export($apiFullList, true) . ";\n\n");
     fclose($fd);
     rename($cached_tmp, $cached);
     $fd = fopen(sugar_cached('include/externalAPI.cache-tmp.js'), 'w');
     fwrite($fd, "//This file is auto generated by " . basename(__FILE__) . "\nSUGAR.eapm = " . json_encode($apiFullList) . ";\n\n");
     fclose($fd);
     rename(sugar_cached('include/externalAPI.cache-tmp.js'), sugar_cached('include/externalAPI.cache.js'));
     if (!isset($GLOBALS['app_list_strings']['extapi_meeting_password']) || is_array($GLOBALS['app_list_strings']['extapi_meeting_password']) && count(array_diff($meetingPasswordList, $GLOBALS['app_list_strings']['extapi_meeting_password'])) != 0) {
         // Our meeting password list is different... we need to do something about this.
         require_once 'modules/Administration/Common.php';
         $languages = get_languages();
         foreach ($languages as $lang => $langLabel) {
             $contents = return_custom_app_list_strings_file_contents($lang);
             $new_contents = replace_or_add_dropdown_type('extapi_meeting_password', $meetingPasswordList, $contents);
             save_custom_app_list_strings_contents($new_contents, $lang);
         }
     }
     return $ignoreDisabled ? $apiFullList : self::filterAPIList($apiFullList);
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:82,代码来源:ExternalAPIFactory.php


示例13: getBacktraceData

/**
 * Getting backtrace information for called function
 * @param $function
 * @return bool | array
 */
function getBacktraceData($function)
{
    if (inDeveloperMode()) {
        $backtrace = debug_backtrace();
        foreach ($backtrace as $backtraceItem) {
            if ($backtraceItem['function'] == $function) {
                return $backtraceItem;
            }
        }
    }
    return false;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:17,代码来源:utils.php


示例14: _displayJavascript

    /**
     * Called from process(). This method will display the correct javascript.
     */
    protected function _displayJavascript()
    {
        global $locale, $sugar_config, $timedate;
        if ($this->_getOption('show_javascript')) {
            if (!$this->_getOption('show_header')) {
                $langHeader = get_language_header();
                echo <<<EOHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html {$langHeader}>
<head>
EOHTML;
            }
            $js_vars = array("sugar_cache_dir" => "cache/");
            if (isset($this->bean->module_dir)) {
                $js_vars['module_sugar_grp1'] = $this->bean->module_dir;
            }
            if (isset($_REQUEST['action'])) {
                $js_vars['action_sugar_grp1'] = $_REQUEST['action'];
            }
            echo '<script>jscal_today = 1000*' . $timedate->asUserTs($timedate->getNow()) . '; if(typeof app_strings == "undefined") app_strings = new Array();</script>';
            // Make sure the necessary cache files are in place
            $jsFiles = array("sugar_grp1.js", "sugar_grp1_yui.js", "sugar_grp1_jquery.js");
            ensureJSCacheFilesExist($jsFiles);
            echo getVersionedScript('cache/include/javascript/sugar_grp1_jquery.js');
            echo getVersionedScript('cache/include/javascript/sugar_grp1_yui.js');
            echo getVersionedScript('cache/include/javascript/sugar_grp1.js');
            $version_mark = getVersionedPath(null);
            echo '<script>SUGAR = SUGAR || {}; SUGAR.VERSION_MARK = ' . json_encode($version_mark) . ';</script>';
            // output necessary config js in the top of the page
            $config_js = $this->getSugarConfigJS();
            if (!empty($config_js)) {
                echo "<script>\n" . implode("\n", $config_js) . "</script>\n";
            }
            // CSRF form token
            echo $this->getCsrfFormTokenJscript();
            if (isset($sugar_config['email_sugarclient_listviewmaxselect'])) {
                echo "<script>SUGAR.config.email_sugarclient_listviewmaxselect = {$GLOBALS['sugar_config']['email_sugarclient_listviewmaxselect']};</script>";
            }
            $image_server = defined('TEMPLATE_URL') ? TEMPLATE_URL . '/' : '';
            echo '<script type="text/javascript">SUGAR.themes.image_server="' . $image_server . '";</script>';
            // cn: bug 12274 - create session-stored key to defend against CSRF
            echo '<script type="text/javascript">var name_format = "' . $locale->getLocaleFormatMacro() . '";</script>';
            echo self::getJavascriptValidation();
            if (!is_file(sugar_cached('jsLanguage/') . $GLOBALS['current_language'] . '.js')) {
                require_once 'include/language/jsLanguage.php';
                jsLanguage::createAppStringsCache($GLOBALS['current_language']);
            }
            echo getVersionedScript('cache/jsLanguage/' . $GLOBALS['current_language'] . '.js', $GLOBALS['sugar_config']['js_lang_version']);
            echo $this->_getModLanguageJS();
            echo getVersionedScript('include/javascript/productTour.js');
            if (isset($sugar_config['disc_client']) && $sugar_config['disc_client']) {
                echo getVersionedScript('modules/Sync/headersync.js');
            }
            if (!is_file(sugar_cached("Expressions/functions_cache.js"))) {
                $GLOBALS['updateSilent'] = true;
                include "include/Expressions/updatecache.php";
            }
            if (inDeveloperMode()) {
                echo getVersionedScript('cache/Expressions/functions_cache_debug.js');
            } else {
                echo getVersionedScript('cache/Expressions/functions_cache.js');
            }
            require_once "include/Expressions/DependencyManager.php";
            echo "\n" . '<script type="text/javascript">' . DependencyManager::getJSUserVariables($GLOBALS['current_user']) . "</script>\n";
            //echo out the $js_vars variables as javascript variables
            echo "<script type='text/javascript'>\n";
            foreach ($js_vars as $var => $value) {
                echo "var {$var} = '{$value}';\n";
            }
            echo "</script>\n";
        }
    }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:75,代码来源:SugarView.php


示例15: getConnectors

 /**
  * getConnectors
  * Returns an Array of the connectors that have been loaded into the system
  * along with attributes pertaining to each connector.
  *
  * @param boolean $refresh boolean flag indicating whether or not to force rewriting the file; defaults to false
  * @returns mixed $connectors Array of the connector entries found
  */
 public static function getConnectors($refresh = false)
 {
     if (inDeveloperMode()) {
         $refresh = true;
     }
     if (!empty(self::$connectors_cache) && !$refresh) {
         return self::$connectors_cache;
     }
     //define paths
     $src1 = 'modules/Connectors/connectors/sources';
     $src2 = 'custom/modules/Connectors/connectors/sources';
     $src3 = 'custom/modules/Connectors/metadata';
     $src4 = 'custom/modules/Connectors/metadata/connectors.php';
     $connectors = array();
     if ($refresh || !SugarAutoLoader::existing($src4)) {
         $sources = array_merge(self::getSources($src1), self::getSources($src2));
         if (!file_exists($src3)) {
             mkdir_recursive($src3);
         }
         if (file_exists($src4)) {
             require $src4;
             //define connectors if it doesn't exist or is not an array
             if (!isset($connectors) || !is_array($connectors)) {
                 $err_str = string_format($GLOBALS['app_strings']['ERR_CONNECTOR_NOT_ARRAY'], array($src4));
                 $GLOBALS['log']->error($err_str);
             }
             $sources = array_merge($sources, $connectors);
         }
         if (!self::saveConnectors($sources, $src4)) {
             return array();
         }
     }
     //if
     require $src4;
     self::$connectors_cache = $connectors;
     return $connectors;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:45,代码来源:ConnectorUtils.php


示例16: getConnectors

 /**
  * getConnectors
  * Returns an Array of the connectors that have been loaded into the system
  * along with attributes pertaining to each connector.
  *
  * @param boolean $refresh boolean flag indicating whether or not to force rewriting the file; defaults to false
  * @returns mixed $connectors Array of the connector entries found
  */
 public static function getConnectors($refresh = false)
 {
     if (inDeveloperMode()) {
         $refresh = true;
     }
     if (!empty(self::$connectors_cache) && !$refresh) {
         return self::$connectors_cache;
     }
     //define paths
     $src1 = 'modules/Connectors/connectors/sources';
     $src2 = 'custom/modules/Connectors/connectors/sources';
     $src3 = 'custom/modules/Connectors/metadata';
     $src4 = 'custom/modules/Connectors/metadata/connectors.php';
     //if this is a templated environment, then use utilities to get the proper paths
     if (defined('TEMPLATE_URL')) {
         $src1 = SugarTemplateUtilities::getFilePath($src1);
         $src2 = SugarTemplateUtilities::getFilePath($src2);
         $src3 = SugarTemplateUtilities::getFilePath($src3);
         $src4 = SugarTemplateUtilities::getFilePath($src4);
     }
     if ($refresh || !file_exists($src4)) {
         $sources = array_merge(self::getSources($src1), self::getSources($src2));
         if (!file_exists($src3)) {
             mkdir_recursive($src3);
         }
         if (file_exists($src4)) {
             require $src4;
             //define connectors if it doesn't exist or is not an array
             if (!isset($connectors) || !is_array($connectors)) {
                 $connectors = array();
                 $err_str = string_format($GLOBALS['app_strings']['ERR_CONNECTOR_NOT_ARRAY'], array($src4));
                 $GLOBALS['log']->error($err_str);
             }
             $sources = array_merge($sources, $connectors);
         }
         if (!self::saveConnectors($sources, $src4)) {
             return array();
         }
     }
     //if
     require $src4;
     self::$connectors_cache = $connectors;
     return $connectors;
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:52,代码来源:ConnectorUtils.php


示例17: buildJavascriptComponentFile

 /**
  * Builds the javascript file used by the clients
  *
  * @param array $data The metadata to build from
  * @param boolean $onlyReturnModuleComponents Indicator to return only module
  *                                            components
  * @return string A url to the file that was just built
  */
 protected function buildJavascriptComponentFile(&$data, $onlyReturnModuleComponents = false)
 {
     $platform = $this->platforms[0];
     $js = "(function(app) {\n SUGAR.jssource = {";
     $compJS = $this->buildJavascriptComponentSection($data);
     if (!$onlyReturnModuleComponents) {
         $js .= $compJS;
     }
     if (!empty($data['modules'])) {
         if (!empty($compJS) && !$onlyReturnModuleComponents) {
             $js .= ",";
         }
         $js .= "\n\t\"modules\":{";
         $allModuleJS = '';
         //Grab the keys this way rather than through $key => $value to preserve pass by reference for $data
         $modules = array_keys($data['modules']);
         foreach ($modules as $module) {
             $moduleJS = $this->buildJavascriptComponentSection($data['modules'][$module], true);
             if (!empty($moduleJS)) {
                 $allModuleJS .= ",\n\t\t\"{$module}\":{{$moduleJS}}";
             }
         }
         //Chop off the first comma in $allModuleJS
         $js .= substr($allModuleJS, 1);
         $js .= "\n\t}";
     }
     $js .= "}})(SUGAR.App);";
     $hash = md5($js);
     //If we are going to be using uglify to minify our JS, we should minify the entire file rather than each component separately.
     if (!inDeveloperMode() && SugarMin::isMinifyFast()) {
         $js = SugarMin::minify($js);
     }
     $path = "cache/javascript/{$platform}/components_{$hash}.js";
     if (!file_exists($path)) {
         mkdir_recursive(dirname($path));
         sugar_file_put_contents_atomic($path, $js);
     }
     return $this->getUrlForCacheFile($path);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:47,代码来源:MetaDataManager.php


示例18: __construct

 /**
  * Constructor for the bean, it performs following tasks:
  *
  * 1. Initalized a database connections
  * 2. Load the vardefs for the module implemeting the class. cache the entries
  *    if needed
  * 3. Setup row-level security preference
  * All implementing classes  must call this constructor using the parent::__construct()
  *
  */
 public function __construct()
 {
     // FIXME: this will be removed, needed for ensuring BeanFactory is always used
     //$this->checkBacktrace();
     global $dictionary, $current_user;
     $this->db = DBManagerFactory::getInstance();
     if (empty($this->module_name)) {
         $this->module_name = $this->module_dir;
     }
     if (isset($this->disable_team_security)) {
         $this->disable_row_level_security = $this->disable_team_security;
     }
     // Verify that current user is not null then do an ACL check.  The current user check is to support installation.
     if (!$this->disable_row_level_security && !empty($current_user->id) && (is_admin($current_user) || $this->bean_implements('ACL') && (ACLAction::getUserAccessLevel($current_user->id, $this->module_dir, 'access') == ACL_ALLOW_ENABLED && (ACLAction::getUserAccessLevel($current_user->id, $this->module_dir, 'admin') == ACL_ALLOW_ADMIN || ACLAction::getUserAccessLevel($current_user->id, $this->module_dir, 'admin') == ACL_ALLOW_ADMIN_DEV)))) {
         $this->disable_row_level_security = true;
     }
     if (false == $this->disable_vardefs && (empty(self::$loadedDefs[$this->object_name]) || !empty($GLOBALS['reload_vardefs']))) {
         $refresh = inDeveloperMode() || !empty($_SESSION['developerMode']);
         if ($refresh && !empty(VardefManager::$inReload["{$this->module_dir}:{$this->object_name}"])) {
             // if we're already reloading this vardef, no need to do it again
             $refresh = false;
         }
         VardefManager::loadVardef($this->module_dir, $this->object_name, $refresh, array("bean" => $this));
         // build $this->column_fields from the field_defs if they exist
         if (!empty($dictionary[$this->object_name]['fields'])) {
             foreach ($dictionary[$this->object_name]['fields'] as $key => $value_array) {
                 $column_fields[] = $key;
                 if (!empty($value_array['required']) && !empty($value_array['name'])) {
                     $this->required_fields[$value_array['name']] = 1;
                 }
             }
             $this->column_fields = $column_fields;
         }
         //setup custom fields
         if (!isset($this->custom_fields) && empty($this->disable_custom_fields)) {
             $this->setupCustomFields($this->module_dir);
         }
         //load up field_arrays from CacheHandler;
         if (empty($this->list_fields)) {
             $this->list_fields = $this->_loadCachedArray($this->module_dir, $this->object_name, 'list_fields');
         }
         if (empty($this->column_fields)) {
             $this->column_fields = $this->_loadCachedArray($this->module_dir, $this->object_name, 'column_fields');
         }
         if (empty($this->required_fields)) {
             $this->required_fields = $this->_loadCachedArray($this->module_dir, $this->object_name, 'required_fields');
         }
         if (isset($GLOBALS['dictionary'][$this->object_name]) && !$this->disable_vardefs) {
             $this->field_name_map = $dictionary[$this->object_name]['fields'];
             $this->field_defs = $dictionary[$this->object_name]['fields'];
             if (isset($dictionary[$this->object_name]['name_format_map'])) {
                 $this->name_format_map = $dictionary[$this->object_name]['name_format_map'];
             }
             if (!empty($dictionary[$this->object_name]['optimistic_locking'])) {
                 $this->optimistic_lock = true;
             }
             if (isset($dictionary[$this->object_name]['importable'])) {
                 $this->importable = isTruthy($dictionary[$this->object_name]['importable']);
             }
         }
         self::$loadedDefs[$this->object_name]['column_fields'] =& $this->column_fields;
         self::$loadedDefs[$this->object_name]['list_fields'] =& $this->list_fields;
         self::$loadedDefs[$this->object_name]['required_fields'] =& $this->required_fields;
         self::$loadedDefs[$this->object_name]['field_name_map'] =& $this->field_name_map;
         self::$loadedDefs[$this->object_name]['field_defs'] =& $this->field_defs;
         self::$loadedDefs[$this->object_name]['name_format_map'] =& $this->name_format_map;
     } else {
         $this->column_fields =& self::$loadedDefs[$this->object_name]['column_fields'];
         $this->list_fields =& self::$loadedDefs[$this->object_name]['list_fields'];
         $this->required_fields =& self::$loadedDefs[$this->object_name]['required_fields'];
         $this->field_name_map =& self::$loadedDefs[$this->object_name]['field_name_map'];
         $this->field_defs =& self::$loadedDefs[$this->object_name]['field_defs'];
         $this->name_format_map =& self::$loadedDefs[$this->object_name]['name_format_map'];
         $this->added_custom_field_defs = true;
         if (!isset($this->custom_fields) && empty($this->disable_custom_fields)) {
             $this->setupCustomFields($this->module_dir, false);
         }
         if (!empty($dictionary[$this->object_name]['optimistic_locking'])) {
             $this->optimistic_lock = true;
         }
     }
     // Verify that current user is not null then do an ACL check.  The current user check is to support installation.
     if (!$this->disable_row_level_security && !empty($current_user->id) && !isset($this->disable_team_security) && !SugarACL::checkAccess($this->module_dir, 'team_security', array('bean' => $this))) {
         // We can disable team security for this module
         $this->disable_row_level_security = true;
     }
     if ($this->bean_implements('ACL')) {
         $this->acl_fields = isset($dictionary[$this->object_name]['acl_fields']) && $dictionary[$this->object_name]['acl_fields'] === false ? false : true;
         if (!empty($current_user->id)) {
             ACLField::loadUserFields($this->module_dir, $this->object_name, $current_user->id);
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:SugarBean.php


示例19: loadVardef


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP inLink函数代码示例发布时间:2022-05-15
下一篇:
PHP inArray函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap