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


PHP getJSPath函数代码示例

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


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

示例1: getInstance

    /**
     * Returns the Javascript necessary to initialize a TinyMCE instance for a given <textarea> or <div>
     * @param string target Comma delimited list of DOM ID's, <textarea id='someTarget'>
     * @return string 
     */
    function getInstance($targets = "")
    {
        global $json;
        if (empty($json)) {
            $json = getJSONobj();
        }
        $config = $this->defaultConfig;
        $config['elements'] = $targets;
        $config['theme_advanced_buttons1'] = $this->buttonConfig;
        $config['theme_advanced_buttons2'] = $this->buttonConfig2;
        $config['theme_advanced_buttons3'] = $this->buttonConfig3;
        $jsConfig = $json->encode($config);
        $instantiateCall = '';
        if (!empty($targets)) {
            $exTargets = explode(",", $targets);
            foreach ($exTargets as $instance) {
                //$instantiateCall .= "tinyMCE.execCommand('mceAddControl', false, document.getElementById('{$instance}'));\n";
            }
        }
        $path = getJSPath('include/javascript/tiny_mce/tiny_mce.js');
        $ret = <<<eoq
<script type="text/javascript" language="Javascript" src="{$path}"></script>

<script type="text/javascript" language="Javascript">
tinyMCE.init({$jsConfig});
\t{$instantiateCall}\t
</script>

eoq;
        return $ret;
    }
开发者ID:klr2003,项目名称:sourceread,代码行数:36,代码来源:SugarTinyMCE.php

示例2: smarty_function_sugar_getjspath

/**
 * Smarty {sugar_include} function plugin
 *
 * Type:     function<br>
 * Name:     sugar_include<br>
 * Purpose:  Handles rendering the global file includes from the metadata files defined
 *           in templateMeta=>includes.
 * 
 * @author Collin Lee {clee@sugarcrm.com}
 * @param array
 * @param Smarty
 */
function smarty_function_sugar_getjspath($params, &$smarty)
{
    if (!isset($params['file'])) {
        $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file');
    }
    return getJSPath($params['file']);
}
开发者ID:klr2003,项目名称:sourceread,代码行数:19,代码来源:function.sugar_getjspath.php

示例3: display

 /**
  * @see DashletGenericChart::display()
  */
 public function display()
 {
     require_once 'modules/Campaigns/Charts.php';
     $roi_chart = new campaign_charts();
     $chartStr = $roi_chart->campaign_response_roi($GLOBALS['app_list_strings']['roi_type_dom'], $GLOBALS['app_list_strings']['roi_type_dom'], $this->campaign_id[0], null, true, true, true, $this->id);
     $returnStr = '<script type="text/javascript" src="' . getJSPath('include/javascript/swfobject.js') . '"></script>' . $chartStr;
     return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $returnStr . '</div><br />';
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:11,代码来源:CampaignROIChartDashlet.php

示例4: generate_header

 function generate_header()
 {
     $ret = "<link rel='stylesheet' href='{$this->tree_style}'>\n";
     foreach ($this->_header_files as $filename) {
         $ret .= "<script language='JavaScript' src='" . getJSPath($filename) . "'></script>\n";
     }
     return $ret;
 }
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:8,代码来源:Tree.php

示例5: smarty_function_overlib_includes

/**
 * smarty_function_overlib_includes
 * This is the constructor for the Smarty plugin.
 * 
 * @param $params The runtime Smarty key/value arguments
 * @param $smarty The reference to the Smarty object used in this invocation 
 */
function smarty_function_overlib_includes($params, &$smarty)
{
    $path = getJSPath('include/javascript/sugar_grp_overlib.js');
    return <<<EOHTML
<!-- begin includes for overlib -->
<script type="text/javascript" src="{$path}"></script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000"></div>
<!-- end includes for overlib -->
EOHTML;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:17,代码来源:function.overlib_includes.php

示例6: display

 /**
  * @see SugarView::display()
  */
 public function display()
 {
     global $current_user, $mod_strings, $app_list_strings, $sugar_config, $locale, $sugar_version;
     if (!is_admin($current_user)) {
         sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
     }
     $themeObject = SugarThemeRegistry::current();
     $configurator = new Configurator();
     $sugarConfig = SugarConfig::getInstance();
     $focus = new Administration();
     $focus->retrieveSettings();
     $ut = $GLOBALS['current_user']->getPreference('ut');
     if (empty($ut)) {
         $this->ss->assign('SKIP_URL', 'index.php?module=Users&action=Wizard&skipwelcome=1');
     } else {
         $this->ss->assign('SKIP_URL', 'index.php?module=Home&action=index');
     }
     // Always mark that we have got past this point
     $focus->saveSetting('system', 'adminwizard', 1);
     $css = $themeObject->getCSS();
     $favicon = $themeObject->getImageURL('sugar_icon.ico', false);
     $this->ss->assign('FAVICON_URL', getJSPath($favicon));
     $this->ss->assign('SUGAR_CSS', $css);
     $this->ss->assign('MOD_USERS', return_module_language($GLOBALS['current_language'], 'Users'));
     $this->ss->assign('CSS', '<link rel="stylesheet" type="text/css" href="' . SugarThemeRegistry::current()->getCSSURL('wizard.css') . '" />');
     $this->ss->assign('LANGUAGES', get_languages());
     $this->ss->assign('config', $sugar_config);
     $this->ss->assign('SUGAR_VERSION', $sugar_version);
     $this->ss->assign('settings', $focus->settings);
     $this->ss->assign('exportCharsets', get_select_options_with_id($locale->getCharsetSelect(), $sugar_config['default_export_charset']));
     $this->ss->assign('getNameJs', $locale->getNameJs());
     $this->ss->assign('NAMEFORMATS', $locale->getUsableLocaleNameOptions($sugar_config['name_formats']));
     $this->ss->assign('JAVASCRIPT', get_set_focus_js() . get_configsettings_js());
     $this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
     $this->ss->assign('mail_smtptype', $focus->settings['mail_smtptype']);
     $this->ss->assign('mail_smtpserver', $focus->settings['mail_smtpserver']);
     $this->ss->assign('mail_smtpport', $focus->settings['mail_smtpport']);
     $this->ss->assign('mail_smtpuser', $focus->settings['mail_smtpuser']);
     $this->ss->assign('mail_smtppass', $focus->settings['mail_smtppass']);
     $this->ss->assign('mail_smtpauth_req', $focus->settings['mail_smtpauth_req'] ? "checked='checked'" : '');
     $this->ss->assign('MAIL_SSL_OPTIONS', get_select_options_with_id($app_list_strings['email_settings_for_ssl'], $focus->settings['mail_smtpssl']));
     $this->ss->assign('notify_allow_default_outbound_on', !empty($focus->settings['notify_allow_default_outbound']) && $focus->settings['notify_allow_default_outbound'] == 2 ? 'CHECKED' : '');
     $this->ss->assign('THEME', SugarThemeRegistry::current()->__toString());
     // get javascript
     ob_start();
     $this->options['show_javascript'] = true;
     $this->renderJavascript();
     $this->options['show_javascript'] = false;
     $this->ss->assign("SUGAR_JS", ob_get_contents() . $themeObject->getJS());
     ob_end_clean();
     $this->ss->assign('langHeader', get_language_header());
     $this->ss->assign('START_PAGE', !empty($_REQUEST['page']) ? $_REQUEST['page'] : 'welcome');
     $this->ss->display('modules/Configurator/tpls/adminwizard.tpl');
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:57,代码来源:view.adminwizard.php

示例7: smarty_function_popup_init

/**
 * Smarty {popup_init} function plugin
 *
 * Type:     function<br>
 * Name:     popup_init<br>
 * Purpose:  initialize overlib
 * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
 *          (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param array
 * @param Smarty
 * @return string
 */
function smarty_function_popup_init($params, &$smarty)
{
    $zindex = 1000;
    if (!empty($params['zindex'])) {
        $zindex = $params['zindex'];
    }
    if (!empty($params['src'])) {
        return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:' . $zindex . ';"></div>' . "\n" . '<script type="text/javascript" language="JavaScript" src="' . getJSPath($params['src']) . '"></script>' . "\n";
    } else {
        $smarty->trigger_error("popup_init: missing src parameter");
    }
}
开发者ID:klr2003,项目名称:sourceread,代码行数:25,代码来源:function.popup_init.php

示例8: getInstance

    /**
     * Returns the Javascript necessary to initialize a TinyMCE instance for a given <textarea> or <div>
     *
     * @param string target Comma delimited list of DOM ID's, <textarea id='someTarget'>
     *
     * @return string
     */
    function getInstance($targets = "")
    {
        global $json;
        if (empty($json)) {
            $json = getJSONobj();
        }
        $config = $this->defaultConfig;
        //include tinymce lang file
        $lang = substr($GLOBALS['current_language'], 0, 2);
        if (SugarAutoLoader::existing('include/javascript/tiny_mce/langs/' . $lang . '.js')) {
            $config['language'] = $lang;
        }
        $config['directionality'] = SugarThemeRegistry::current()->directionality;
        $config['elements'] = $targets;
        $config['theme_advanced_buttons1'] = $this->buttonConfigs['default']['buttonConfig'];
        $config['theme_advanced_buttons2'] = $this->buttonConfigs['default']['buttonConfig2'];
        $config['theme_advanced_buttons3'] = $this->buttonConfigs['default']['buttonConfig3'];
        $jsConfig = $json->encode($config);
        $instantiateCall = '';
        if (!empty($targets)) {
            $exTargets = explode(",", $targets);
            foreach ($exTargets as $instance) {
                //$instantiateCall .= "tinyMCE.execCommand('mceAddControl', false, document.getElementById('{$instance}'));\n";
            }
        }
        $path = getJSPath('include/javascript/tiny_mce/tiny_mce.js');
        $ret = <<<eoq
<script type="text/javascript" language="Javascript" src="{$path}"></script>

<script type="text/javascript" language="Javascript">
<!--
if (!SUGAR.util.isTouchScreen()) {
    tinyMCE.init({$jsConfig});
\t{$instantiateCall}
}
else {
eoq;
        $exTargets = explode(",", $targets);
        foreach ($exTargets as $instance) {
            $ret .= <<<eoq
    document.getElementById('{$instance}').style.width = '100%';
    document.getElementById('{$instance}').style.height = '100px';
eoq;
        }
        $ret .= <<<eoq
}
-->
</script>

eoq;
        return $ret;
    }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:59,代码来源:SugarTinyMCE.php

示例9: smarty_function_ext_includes

function smarty_function_ext_includes($params, &$smarty)
{
    $ret = '<link rel="stylesheet" type="text/css" href="' . getJSPath("themes/default/ext/resources/css/ext-all.css") . '" />' . '<link rel="stylesheet" type="text/css" href="' . getJSPath("themes/default/ext/resources/css/xtheme-gray.css") . '" />';
    global $theme;
    if (is_dir("themes/{$theme}/ext/resources/css")) {
        $cssDir = opendir("themes/{$theme}/ext/resources/css");
        while (($file = readdir($cssDir)) !== false) {
            if (strcasecmp(substr($file, -4), '.css' == 0)) {
                $ret .= "<link rel='stylesheet' type='text/css' href='" . getJSPath("themes/{$theme}/ext/resources/css/{$file}") . "' />";
            }
        }
    }
    return $ret;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:14,代码来源:function.ext_includes.php

示例10: getInstance

    /**
     * Returns the Javascript necessary to initialize a TinyMCE instance for a given <textarea> or <div>
     * @param string target Comma delimited list of DOM ID's, <textarea id='someTarget'>
     * @return string 
     */
    function getInstance($targets = "")
    {
        global $json;
        if (empty($json)) {
            $json = getJSONobj();
        }
        $config = $this->defaultConfig;
        $config['elements'] = $targets;
        $config['theme_advanced_buttons1'] = $this->buttonConfigs['default']['buttonConfig'];
        $config['theme_advanced_buttons2'] = $this->buttonConfigs['default']['buttonConfig2'];
        $config['theme_advanced_buttons3'] = $this->buttonConfigs['default']['buttonConfig3'];
        $jsConfig = $json->encode($config);
        $instantiateCall = '';
        if (!empty($targets)) {
            $exTargets = explode(",", $targets);
            foreach ($exTargets as $instance) {
                //$instantiateCall .= "tinyMCE.execCommand('mceAddControl', false, document.getElementById('{$instance}'));\n";
            }
        }
        $path = getJSPath('include/javascript/tiny_mce/tiny_mce.js');
        $ret = <<<eoq
<script type="text/javascript" language="Javascript" src="{$path}"></script>

<script type="text/javascript" language="Javascript">
<!--
if (!SUGAR.util.isTouchScreen()) {
    tinyMCE.init({$jsConfig});
\t{$instantiateCall}\t
}
else {
eoq;
        $exTargets = explode(",", $targets);
        foreach ($exTargets as $instance) {
            $ret .= <<<eoq
    document.getElementById('{$instance}').style.width = '100%';
    document.getElementById('{$instance}').style.height = '100px';
eoq;
        }
        $ret .= <<<eoq
}
-->
</script>

eoq;
        return $ret;
    }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:51,代码来源:SugarTinyMCE.php

示例11: template_cal_tabs

function template_cal_tabs($args)
{
    global $mod_strings, $sugar_version, $sugar_config;
    $tabs = array('day', 'week', 'month', 'year', 'shared');
    if ($args['view'] != 'day') {
        echo '<script type="text/javascript" src="' . getJSPath('include/javascript/sugar_grp_overlib.js') . '"></script>
			<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>';
    }
    ?>
<table id="cal_tabs" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php 
    $time_arr = array();
    foreach ($tabs as $tab) {
        ?>
<input type="button" <?php 
        if ($args['view'] == $tab) {
            ?>
selected="selected" <?php 
        }
        ?>
 value=" <?php 
        echo $mod_strings["LBL_" . $args['calendar']->get_view_name($tab)];
        ?>
 " id="<?php 
        echo $tab;
        ?>
_tab_id" title="<?php 
        echo $mod_strings["LBL_" . $args['calendar']->get_view_name($tab)];
        ?>
" onclick="window.location.href='index.php?module=Calendar&action=index&view=<?php 
        echo $tab;
        echo $args['calendar']->date_time->get_date_str();
        ?>
'">&nbsp;
<?php 
    }
    ?>
</td>
</tr>
</table>

<?php 
}
开发者ID:rgauss,项目名称:sugarcrm_dev,代码行数:45,代码来源:templates_calendar.php

示例12: smarty_function_sugar_include

/**
 * Smarty {sugar_include} function plugin
 *
 * Type:     function<br>
 * Name:     sugar_include<br>
 * Purpose:  Handles rendering the global file includes from the metadata files defined
 *           in templateMeta=>includes.
 * 
 * @author Collin Lee {clee@sugarcrm.com}
 * @param array
 * @param Smarty
 */
function smarty_function_sugar_include($params, &$smarty)
{
    global $app_strings;
    if (isset($params['type']) && $params['type'] == 'php') {
        if (!isset($params['file'])) {
            $smarty->trigger_error($app_strings['ERR_MISSING_REQUIRED_FIELDS'] . 'include');
        }
        $includeFile = $params['file'];
        if (!file_exists($includeFile)) {
            $smarty->trigger_error($app_strings['ERR_NO_SUCH_FILE'] . ': ' . $includeFile);
        }
        ob_start();
        require $includeFile;
        $output_html = ob_get_contents();
        ob_end_clean();
        echo $output_html;
    } else {
        if (isset($params['type']) && $params['type'] == 'smarty') {
            return $smarty->fetch($params['file']);
        } else {
            if (is_array($params['include'])) {
                $code = '';
                foreach ($params['include'] as $include) {
                    if (isset($include['file'])) {
                        $file = $include['file'];
                        if (preg_match('/[\\.]js$/si', $file)) {
                            $code .= "<script src=\"" . getJSPath($include['file']) . "\"></script>";
                        } else {
                            if (preg_match('/[\\.]php$/si', $file)) {
                                require_once $file;
                            }
                        }
                    }
                }
                //foreach
                return $code;
            }
        }
    }
    //if
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:53,代码来源:function.sugar_include.php

示例13: process_page

    /**
     *
     */
    function process_page()
    {
        global $theme;
        global $mod_strings;
        global $app_strings;
        global $currentModule;
        global $app_list_strings, $sugar_version, $sugar_config;
        $output_html = "<script type=\"text/javascript\" src=\"" . getJSPath('include/javascript/sugar_3.js') . "\"></script>";
        $where = '';
        if (empty($_REQUEST[$currentModule . '_' . strtoupper($this->_popupMeta['moduleMain']) . '_offset'])) {
            $_POST[$currentModule . '_' . strtoupper($this->_popupMeta['moduleMain']) . '_offset'] = '';
        }
        if (empty($_REQUEST['saved_associated_data'])) {
            $_POST['saved_associated_data'] = '';
        }
        $where = $this->_get_where_clause();
        // CREATE STUFF
        if ($this->_create) {
            $formBase = new $this->_popupMeta['create']['formBaseClass']();
            if (isset($_REQUEST['doAction']) && $_REQUEST['doAction'] == 'save') {
                $formBase->handleSave('', false, true);
            }
            $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
            $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
            $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
            // TODO: cleanup the construction of $addform
            $prefix = empty($this->_popupMeta['create']['getFormBodyParams'][0]) ? '' : $this->_popupMeta['create']['getFormBodyParams'][0];
            $mod = empty($this->_popupMeta['create']['getFormBodyParams'][1]) ? '' : $this->_popupMeta['create']['getFormBodyParams'][1];
            $formBody = empty($this->_popupMeta['create']['getFormBodyParams'][2]) ? '' : $this->_popupMeta['create']['getFormBodyParams'][2];
            $getFormMethod = empty($this->_popupMeta['create']['getFormMethod']) ? 'getFormBody' : $this->_popupMeta['create']['getFormMethod'];
            $formbody = $formBase->{$getFormMethod}($prefix, $mod, $formBody);
            $addform = '<table><tr><td nowrap="nowrap" valign="top">' . str_replace('<br>', '</td><td nowrap="nowrap" valign="top">&nbsp;', $formbody) . '</td></tr></table>' . '<input type="hidden" name="action" value="Popup" />';
            $formSave = <<<EOQ
\t\t\t<input type="hidden" name="create" value="true">
\t\t\t<input type="hidden" name="popup" value="true">
\t\t\t<input type="hidden" name="to_pdf" value="true">
\t\t\t<input type="hidden" name="return_module" value="{$currentModule}">
\t\t\t<input type="hidden" name="return_action" value="Popup">
\t\t\t<input type="submit" name="button" class="button" title="{$lbl_save_button_title}" value="  {$lbl_save_button_label}  " />
\t\t\t<input type="button" name="button" class="button" title="{$app_strings['LBL_CANCEL_BUTTON_TITLE']}" accesskey="{$app_strings['LBL_CANCEL_BUTTON_KEY']}" value="{$app_strings['LBL_CANCEL_BUTTON_LABEL']}" onclick="toggleDisplay('addform');" />
EOQ;
            // if metadata contains custom inputs for the quickcreate
            if (!empty($this->_popupMeta['customInput']) && is_array($this->_popupMeta['customInput'])) {
                foreach ($this->_popupMeta['customInput'] as $key => $value) {
                    $formSave .= '<input type="hidden" name="' . $key . '" value="' . $value . '">\\n';
                }
            }
            $createButtonTranslation = translate($this->_popupMeta['create']['createButton']);
            $createButton = <<<EOQ
\t\t\t<input type="button" id="showAdd" name="showAdd" class="button" value="{$createButtonTranslation}" onclick="toggleDisplay('addform');" />
EOQ;
            $addformheader = get_form_header($createButtonTranslation, $formSave, false);
        }
        // END CREATE STUFF
        // search request inputs
        $searchInputs = array();
        foreach ($this->_popupMeta['searchInputs'] as $input) {
            $searchInputs[$input] = empty($_REQUEST[$input]) ? '' : $_REQUEST[$input];
        }
        $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
        $hide_clear_button = empty($_REQUEST['hide_clear_button']) && empty($this->_hide_clear_button) ? false : true;
        $button = '<script>eval("var request_data = " + window.document.forms[\'popup_query_form\'].request_data.value);</script>';
        if (isset($_REQUEST['mass'])) {
            foreach (array_unique($_REQUEST['mass']) as $record) {
                $button .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
            }
        }
        //START:FOR MULTI-SELECT
        $multi_select = false;
        if (!empty($_REQUEST['mode']) && strtoupper($_REQUEST['mode']) == 'MULTISELECT') {
            $multi_select = true;
            $button .= "<input type='hidden' name='mode' value='MultiSelect'>";
            $button .= "<input type='button' name='button' class='button' onclick=\"send_back_selected('{$currentModule}',document.MassUpdate,'mass[]','" . $app_strings['ERR_NOTHING_SELECTED'] . "', request_data.field_to_name_array);\" title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' value='  " . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "  ' />\n";
        }
        //END:FOR MULTI-SELECT
        if (!$hide_clear_button) {
            $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' value='  " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . "  ' />\n";
        }
        $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  ' />\n";
        if (isset($this->_popupMeta['templateForm'])) {
            $form = new XTemplate($this->_popupMeta['templateForm']);
        } else {
            $form = new XTemplate('modules/' . $currentModule . '/Popup_picker.html');
        }
        $form->assign('MOD', $mod_strings);
        $form->assign('APP', $app_strings);
        $form->assign('THEME', $theme);
        $form->assign('MODULE_NAME', $currentModule);
        $form->assign('request_data', $request_data);
        // CREATE STUFF
        if ($this->_create) {
            $form->assign('CREATEBUTTON', $createButton);
            $form->assign('ADDFORMHEADER', $addformheader);
            $form->assign('ADDFORM', $addform);
        }
        // CREATE STUFF
        if (isset($this->_popupMeta['className'])) {
//.........这里部分代码省略.........
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:101,代码来源:Popup_picker.php

示例14: 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

示例15: insert_popup_header

/**
 * Create a header for a popup.
 *
 * @todo refactor this into the base Popup_Picker class
 *
 * @param  $theme string the name of the current theme, ignorred to use SugarThemeRegistry::current() instead.
 * @return string HTML
 */
function insert_popup_header($theme = null)
{
    global $app_strings, $sugar_config;
    $charset = isset($app_strings['LBL_CHARSET']) ? $app_strings['LBL_CHARSET'] : $sugar_config['default_charset'];
    $themeCSS = SugarThemeRegistry::current()->getCSS();
    echo <<<EOHTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="{$charset}">
<title>{$app_strings['LBL_BROWSER_TITLE']}</title>
{$themeCSS}
EOHTML;
    echo '<script type="text/javascript" src="' . getJSPath('include/javascript/sugar_grp1_yui.js') . '"></script>';
    echo '<script type="text/javascript" src="' . getJSPath('include/javascript/sugar_grp1.js') . '"></script>';
    echo <<<EOHTML
</head>
<body class="popupBody">
EOHTML;
}
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:28,代码来源:layout_utils.php


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