本文整理汇总了PHP中getVersionedPath函数的典型用法代码示例。如果您正苦于以下问题:PHP getVersionedPath函数的具体用法?PHP getVersionedPath怎么用?PHP getVersionedPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getVersionedPath函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
if (!file_exists(SUGAR_SMARTY_DIR)) {
mkdir_recursive(SUGAR_SMARTY_DIR, true);
}
if (!file_exists(SUGAR_SMARTY_DIR . 'templates_c')) {
mkdir_recursive(SUGAR_SMARTY_DIR . 'templates_c', true);
}
if (!file_exists(SUGAR_SMARTY_DIR . 'configs')) {
mkdir_recursive(SUGAR_SMARTY_DIR . 'configs', true);
}
if (!file_exists(SUGAR_SMARTY_DIR . 'cache')) {
mkdir_recursive(SUGAR_SMARTY_DIR . 'cache', true);
}
$this->template_dir = '.';
$this->compile_dir = SUGAR_SMARTY_DIR . 'templates_c';
$this->config_dir = SUGAR_SMARTY_DIR . 'configs';
$this->cache_dir = SUGAR_SMARTY_DIR . 'cache';
$this->request_use_auto_globals = true;
// to disable Smarty from using long arrays
if (file_exists('custom/include/Smarty/plugins')) {
$plugins_dir[] = 'custom/include/Smarty/plugins';
}
$plugins_dir[] = 'include/Smarty/plugins';
$this->plugins_dir = $plugins_dir;
$this->assign("VERSION_MARK", getVersionedPath(''));
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:28,代码来源:Sugar_Smarty.php
示例2: process
/**
* Processes / setups the template
* assigns all things to the template like mod_srings and app_strings
*
*/
function process()
{
global $current_language, $app_strings, $sugar_version, $sugar_config, $timedate, $theme;
$module_strings = return_module_language($current_language, $this->module);
$this->ss->assign('SUGAR_VERSION', $sugar_version);
$this->ss->assign('JS_CUSTOM_VERSION', $sugar_config['js_custom_version']);
$this->ss->assign('VERSION_MARK', getVersionedPath(''));
$this->ss->assign('THEME', $theme);
$this->ss->assign('APP', $app_strings);
$this->ss->assign('MOD', $module_strings);
}
开发者ID:omusico,项目名称:sugar_work,代码行数:16,代码来源:EditView.php
示例3: Sugar_Smarty
function Sugar_Smarty()
{
if (!file_exists(SUGAR_SMARTY_DIR)) {
mkdir_recursive(SUGAR_SMARTY_DIR, true);
}
if (!file_exists(SUGAR_SMARTY_DIR . 'templates_c')) {
mkdir_recursive(SUGAR_SMARTY_DIR . 'templates_c', true);
}
if (!file_exists(SUGAR_SMARTY_DIR . 'configs')) {
mkdir_recursive(SUGAR_SMARTY_DIR . 'configs', true);
}
if (!file_exists(SUGAR_SMARTY_DIR . 'cache')) {
mkdir_recursive(SUGAR_SMARTY_DIR . 'cache', true);
}
$this->template_dir = '.';
$this->compile_dir = SUGAR_SMARTY_DIR . 'templates_c';
$this->config_dir = SUGAR_SMARTY_DIR . 'configs';
$this->cache_dir = SUGAR_SMARTY_DIR . 'cache';
$this->request_use_auto_globals = true;
// to disable Smarty from using long arrays
// Smarty will create subdirectories under the compiled templates and cache directories
$this->use_sub_dirs = true;
if (empty(self::$_plugins_dir)) {
self::$_plugins_dir = array();
if (SugarAutoLoader::fileExists('custom/include/SugarSmarty/plugins')) {
self::$_plugins_dir[] = 'custom/include/SugarSmarty/plugins';
}
if (SugarAutoLoader::fileExists('custom/vendor/Smarty/plugins')) {
self::$_plugins_dir[] = 'custom/vendor/Smarty/plugins';
}
self::$_plugins_dir[] = 'include/SugarSmarty/plugins';
self::$_plugins_dir[] = 'vendor/Smarty/plugins';
}
$this->plugins_dir = self::$_plugins_dir;
$this->assign("VERSION_MARK", getVersionedPath(''));
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:36,代码来源:Sugar_Smarty.php
示例4: die
* Copyright (C) SugarCRM Inc. All rights reserved.
*/
// $Id: license.php 54512 2010-02-12 19:13:35Z jmertic $
global $sugar_version, $js_custom_version;
if (!isset($install_script) || !$install_script) {
die('Unable to process script directly.');
}
// setup session variables (and their defaults) if this page has not yet been submitted
if (!isset($_SESSION['license_submitted']) || !$_SESSION['license_submitted']) {
$_SESSION['setup_license_accept'] = false;
}
$checked = isset($_SESSION['setup_license_accept']) && !empty($_SESSION['setup_license_accept']) ? 'checked="on"' : '';
require_once "install/install_utils.php";
$license_file = getLicenseContents("LICENSE");
$langHeader = get_language_header();
$versionToken = getVersionedPath(null);
$out = <<<EOQ
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html {$langHeader}>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_LICENSE_ACCEPTANCE']}</title>
<link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
<link rel="stylesheet" href="install/install.css" type="text/css">
<script src="cache/include/javascript/sugar_grp1_yui.js?v={$versionToken}"></script>
<script type="text/javascript">
<!--
if ( YAHOO.env.ua )
UA = YAHOO.env.ua;
-->
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:license.php
示例5: getQuickCreateForm
/**
* Renders the QuickCreate form from Smarty and returns HTML
* @param array $vars request variable global
* @param object $email Fetched email object
* @param bool $addToAddressBook
* @return array
*/
function getQuickCreateForm($vars, $email, $addToAddressBookButton = false)
{
require_once "include/EditView/EditView2.php";
global $app_strings;
global $mod_strings;
global $current_user;
global $beanList;
global $beanFiles;
global $current_language;
//Setup the current module languge
$mod_strings = return_module_language($current_language, $_REQUEST['qc_module']);
$bean = $beanList[$_REQUEST['qc_module']];
$class = $beanFiles[$bean];
require_once $class;
$focus = new $bean();
$people = array('Contact', 'Lead');
$emailAddress = array();
// people
if (in_array($bean, $people)) {
// lead specific
$focus->lead_source = 'Email';
$focus->lead_source_description = trim($email->name);
$from = isset($email->from_name) && !empty($email->from_name) ? $email->from_name : $email->from_addr;
if (isset($_REQUEST['sugarEmail']) && !empty($_REQUEST['sugarEmail'])) {
if ($email->status == "sent") {
$from = isset($email->to_addrs_names) && !empty($email->to_addrs_names) ? $email->to_addrs_names : $email->to_addrs;
} else {
$from = isset($email->from_name) && !empty($email->from_name) ? $email->from_name : $email->from_addr_name;
}
}
$name = explode(" ", trim($from));
$address = trim(array_pop($name));
$address = str_replace(array("<", ">", "<", ">"), "", $address);
$emailAddress[] = array('email_address' => $address, 'primary_address' => 1, 'invalid_email' => 0, 'opt_out' => 0, 'reply_to_address' => 1);
$focus->email1 = $address;
if (!empty($name)) {
$focus->last_name = trim(array_pop($name));
foreach ($name as $first) {
if (!empty($focus->first_name)) {
$focus->first_name .= " ";
}
$focus->first_name .= trim($first);
}
}
} else {
// bugs, cases, tasks
$focus->name = trim($email->name);
}
$focus->description = trim(strip_tags($email->description));
$focus->assigned_user_id = $current_user->id;
$EditView = new EditView();
$EditView->ss = new Sugar_Smarty();
//MFH BUG#20283 - checks for custom quickcreate fields
$EditView->setup($_REQUEST['qc_module'], $focus, 'custom/modules/' . $focus->module_dir . '/metadata/editviewdefs.php', 'include/EditView/EditView.tpl');
$EditView->process();
$EditView->render();
$EditView->defs['templateMeta']['form']['buttons'] = array('email2save' => array('id' => 'e2AjaxSave', 'customCode' => '<input type="button" class="button" value=" ' . $app_strings['LBL_SAVE_BUTTON_LABEL'] . ' " onclick="SUGAR.email2.detailView.saveQuickCreate(false);" />'), 'email2saveandreply' => array('id' => 'e2SaveAndReply', 'customCode' => '<input type="button" class="button" value=" ' . $app_strings['LBL_EMAIL_SAVE_AND_REPLY'] . ' " onclick="SUGAR.email2.detailView.saveQuickCreate(\'reply\');" />'), 'email2cancel' => array('id' => 'e2cancel', 'customCode' => '<input type="button" class="button" value=" ' . $app_strings['LBL_EMAIL_CANCEL'] . ' " onclick="SUGAR.email2.detailView.quickCreateDialog.hide();" />'));
if ($addToAddressBookButton) {
$EditView->defs['templateMeta']['form']['buttons']['email2saveAddToAddressBook'] = array('id' => 'e2addToAddressBook', 'customCode' => '<input type="button" class="button" value=" ' . $app_strings['LBL_EMAIL_ADDRESS_BOOK_SAVE_AND_ADD'] . ' " onclick="SUGAR.email2.detailView.saveQuickCreate(true);" />');
}
//Get the module language for javascript
if (!is_file(sugar_cached('jsLanguage/') . $_REQUEST['qc_module'] . '/' . $GLOBALS['current_language'] . '.js')) {
require_once 'include/language/jsLanguage.php';
jsLanguage::createModuleStringsCache($_REQUEST['qc_module'], $GLOBALS['current_language']);
}
$jsLanguage = getVersionedScript("cache/jsLanguage/{$_REQUEST['qc_module']}/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
$EditView->view = 'EmailQCView';
$EditView->defs['templateMeta']['form']['headerTpl'] = 'include/EditView/header.tpl';
$EditView->defs['templateMeta']['form']['footerTpl'] = 'include/EditView/footer.tpl';
$meta = array();
$meta['html'] = $jsLanguage . $EditView->display(false, true);
$meta['html'] = str_replace("src='" . getVersionedPath('include/SugarEmailAddress/SugarEmailAddress.js') . "'", '', $meta['html']);
$meta['emailAddress'] = $emailAddress;
$mod_strings = return_module_language($current_language, 'Emails');
return $meta;
}
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:83,代码来源:EmailUI.php
示例6: getJSPath
function getJSPath($relative_path, $additional_attrs = '')
{
if (defined('TEMPLATE_URL')) {
$relative_path = SugarTemplateUtilities::getWebPath($relative_path);
}
return getVersionedPath($relative_path) . (!empty($additional_attrs) ? "&{$additional_attrs}" : "");
}
开发者ID:pikkoui,项目名称:suitecrm,代码行数:7,代码来源:utils.php
示例7: parse
function parse($bname)
{
global $sugar_version, $sugar_config;
$this->assign('SUGAR_VERSION', $GLOBALS['js_version_key']);
$this->assign('JS_CUSTOM_VERSION', $sugar_config['js_custom_version']);
$this->assign('VERSION_MARK', getVersionedPath(''));
if (empty($this->blocks[$bname])) {
return;
}
$copy = $this->blocks[$bname];
if (!isset($this->blocks[$bname])) {
$this->set_error("parse: blockname [{$bname}] does not exist");
}
preg_match_all("/\\{([A-Za-z0-9\\._]+?)}/", $this->blocks[$bname], $var_array);
$var_array = $var_array[1];
foreach ($var_array as $k => $v) {
$sub = explode(".", $v);
if ($sub[0] == "_BLOCK_") {
unset($sub[0]);
$bname2 = implode(".", $sub);
if (isset($this->parsed_blocks[$bname2])) {
$var = $this->parsed_blocks[$bname2];
} else {
$var = null;
}
$nul = !isset($this->NULL_BLOCK[$bname2]) ? $this->NULL_BLOCK[""] : $this->NULL_BLOCK[$bname2];
$var = empty($var) ? $nul : trim($var);
// Commented out due to regular expression issue with '$' in replacement string.
//$copy=preg_replace("/\{".$v."\}/","$var",$copy);
// This should be faster and work better for '$'
$copy = str_replace("{" . $v . "}", $var, $copy);
} else {
$var = $this->VARS;
foreach ($sub as $k1 => $v1) {
if (is_array($var) && isset($var[$v1])) {
$var = $var[$v1];
} else {
$var = null;
}
}
$nul = !isset($this->NULL_STRING[$v]) ? $this->NULL_STRING[""] : $this->NULL_STRING[$v];
$var = !isset($var) ? $nul : $var;
// Commented out due to regular expression issue with '$' in replacement string.
//$copy=preg_replace("/\{$v\}/","$var",$copy);
// This should be faster and work better for '$'
// this was periodically returning an array to string conversion error....
if (!is_array($var)) {
$copy = str_replace("{" . $v . "}", $var, $copy);
}
}
}
if (isset($this->parsed_blocks[$bname])) {
$this->parsed_blocks[$bname] .= $copy;
} else {
$this->parsed_blocks[$bname] = $copy;
}
// reset sub-blocks
if ($this->AUTORESET && !empty($this->sub_blocks[$bname])) {
reset($this->sub_blocks[$bname]);
foreach ($this->sub_blocks[$bname] as $v) {
$this->reset($v);
}
}
}
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:64,代码来源:xtpl.php
示例8: getStringUrls
/**
* Returns a list of URL's pointing to json-encoded versions of the strings
*
* @param boolean $ordered is a flag that determines $app_list_strings should be key => value pairs or tuples
* @return array
*/
public function getStringUrls($ordered = false)
{
$languageList = array_keys(get_languages());
sugar_mkdir(sugar_cached('api/metadata'), null, true);
$fileList = array();
foreach ($languageList as $language) {
$fileList[$language] = $this->getLangUrl($language, $ordered);
}
$urlList = array();
foreach ($fileList as $lang => $file) {
// Get the hash for this lang file so we can append it to the URL.
// This fixes issues where lang strings or list strings change but
// don't force a metadata refresh
$urlList[$lang] = getVersionedPath($this->getUrlForCacheFile($file), $GLOBALS['sugar_config']['js_lang_version'], true);
}
$urlList['default'] = $GLOBALS['sugar_config']['default_language'];
return $urlList;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:24,代码来源:MetaDataManager.php
示例9: display
/**
* display
* This method makes the Smarty variable assignments and theautocomplete_ajax'vars the
* generated view.
* @param $showTitle boolean value indicating whether or not to show a title on the resulting page
* @param $ajaxSave boolean value indicating whether or not the operation is an Ajax save request
* @return HTML display for view as String
*/
function display($showTitle = true, $ajaxSave = false)
{
global $mod_strings, $sugar_config, $app_strings, $app_list_strings, $theme, $current_user;
if (isset($this->defs['templateMeta']['javascript'])) {
if (is_array($this->defs['templateMeta']['javascript'])) {
//$this->th->ss->assign('externalJSFile', 'modules/' . $this->module . '/metadata/editvewdefs.js');
$this->th->ss->assign('externalJSFile', $this->defs['templateMeta']['javascript']);
} else {
$this->th->ss->assign('scriptBlocks', $this->defs['templateMeta']['javascript']);
}
}
$this->th->ss->assign('id', $this->fieldDefs['id']['value']);
$this->th->ss->assign('offset', $this->offset + 1);
$this->th->ss->assign('APP', $app_strings);
$this->th->ss->assign('MOD', $mod_strings);
$this->th->ss->assign('fields', $this->fieldDefs);
$this->th->ss->assign('sectionPanels', $this->sectionPanels);
$this->th->ss->assign('config', $sugar_config);
$this->th->ss->assign('returnModule', $this->returnModule);
$this->th->ss->assign('returnAction', $this->returnAction);
$this->th->ss->assign('returnId', $this->returnId);
$this->th->ss->assign('isDuplicate', $this->isDuplicate);
$this->th->ss->assign('def', $this->defs);
$this->th->ss->assign('useTabs', isset($this->defs['templateMeta']['useTabs']) ? $this->defs['templateMeta']['useTabs'] : false);
$this->th->ss->assign('maxColumns', isset($this->defs['templateMeta']['maxColumns']) ? $this->defs['templateMeta']['maxColumns'] : 2);
$this->th->ss->assign('module', $this->module);
$this->th->ss->assign('headerTpl', isset($this->defs['templateMeta']['form']['headerTpl']) ? $this->defs['templateMeta']['form']['headerTpl'] : 'include/' . $this->view . '/header.tpl');
$this->th->ss->assign('footerTpl', isset($this->defs['templateMeta']['form']['footerTpl']) ? $this->defs['templateMeta']['form']['footerTpl'] : 'include/' . $this->view . '/footer.tpl');
$this->th->ss->assign('current_user', $current_user);
$this->th->ss->assign('bean', $this->focus);
$this->th->ss->assign('isAuditEnabled', $this->focus->is_AuditEnabled());
$this->th->ss->assign('gridline', $current_user->getPreference('gridline') == 'on' ? '1' : '0');
$this->th->ss->assign('VERSION_MARK', getVersionedPath(''));
global $js_custom_version;
global $sugar_version;
$this->th->ss->assign('SUGAR_VERSION', $sugar_version);
$this->th->ss->assign('JS_CUSTOM_VERSION', $js_custom_version);
//this is used for multiple forms on one page
if (!empty($this->formName)) {
$form_id = $this->formName;
$form_name = $this->formName;
} else {
$form_id = $this->view;
$form_name = $this->view;
}
if ($ajaxSave && empty($this->formName)) {
$form_id = 'form_' . $this->view . '_' . $this->module;
$form_name = $form_id;
$this->view = $form_name;
//$this->defs['templateMeta']['form']['buttons'] = array();
//$this->defs['templateMeta']['form']['buttons']['ajax_save'] = array('id' => 'AjaxSave', 'customCode'=>'<input type="button" class="button" value="Save" onclick="this.form.action.value=\'AjaxFormSave\';return saveForm(\''.$form_name.'\', \'multiedit_form_{$module}\', \'Saving {$module}...\');"/>');
}
$form_name = $form_name == 'QuickCreate' ? "QuickCreate_{$this->module}" : $form_name;
$form_id = $form_id == 'QuickCreate' ? "QuickCreate_{$this->module}" : $form_id;
if (isset($this->defs['templateMeta']['preForm'])) {
$this->th->ss->assign('preForm', $this->defs['templateMeta']['preForm']);
}
if (isset($this->defs['templateMeta']['form']['closeFormBeforeCustomButtons'])) {
$this->th->ss->assign('closeFormBeforeCustomButtons', $this->defs['templateMeta']['form']['closeFormBeforeCustomButtons']);
}
if (isset($this->defs['templateMeta']['form']['enctype'])) {
$this->th->ss->assign('enctype', 'enctype="' . $this->defs['templateMeta']['form']['enctype'] . '"');
}
//for SugarFieldImage, we must set form enctype to "multipart/form-data"
foreach ($this->fieldDefs as $field) {
if (isset($field['type']) && $field['type'] == 'image') {
$this->th->ss->assign('enctype', 'enctype="multipart/form-data"');
break;
}
}
$this->th->ss->assign('showDetailData', $this->showDetailData);
$this->th->ss->assign('showSectionPanelsTitles', $this->showSectionPanelsTitles);
$this->th->ss->assign('form_id', $form_id);
$this->th->ss->assign('form_name', $form_name);
$this->th->ss->assign('set_focus_block', get_set_focus_js());
$this->th->ss->assign('form', isset($this->defs['templateMeta']['form']) ? $this->defs['templateMeta']['form'] : null);
$this->th->ss->assign('includes', isset($this->defs['templateMeta']['includes']) ? $this->defs['templateMeta']['includes'] : null);
$this->th->ss->assign('view', $this->view);
//Calculate time & date formatting (may need to calculate this depending on a setting)
global $timedate;
$this->th->ss->assign('CALENDAR_DATEFORMAT', $timedate->get_cal_date_format());
$this->th->ss->assign('USER_DATEFORMAT', $timedate->get_user_date_format());
$time_format = $timedate->get_user_time_format();
$this->th->ss->assign('TIME_FORMAT', $time_format);
$date_format = $timedate->get_cal_date_format();
$time_separator = ':';
if (preg_match('/\\d+([^\\d])\\d+([^\\d]*)/s', $time_format, $match)) {
$time_separator = $match[1];
}
// Create Smarty variables for the Calendar picker widget
$t23 = strpos($time_format, '23') !== false ? '%H' : '%I';
if (!isset($match[2]) || $match[2] == '') {
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:101,代码来源:EditView2.php
示例10: display
/**
* display
* This method makes the Smarty variable assignments and then displays the
* generated view.
* @param $showTitle boolean value indicating whether or not to show a title on the resulting page
* @param $ajaxSave boolean value indicating whether or not the operation is an Ajax save request
* @return HTML display for view as String
*/
function display($showTitle = true, $ajaxSave = false)
{
global $mod_strings, $sugar_config, $app_strings, $app_list_strings, $theme, $current_user;
if (isset($this->defs['templateMeta']['javascript'])) {
if (is_array($this->defs['templateMeta']['javascript'])) {
//$this->th->ss->assign('externalJSFile', 'modules/' . $this->module . '/metadata/editvewdefs.js');
$this->th->ss->assign('externalJSFile', $this->defs['templateMeta']['javascript']);
} else {
$this->th->ss->assign('scriptBlocks', $this->defs['templateMeta']['javascript']);
}
}
$this->th->ss->assign('id', $this->fieldDefs['id']['value']);
$this->th->ss->assign('offset', $this->offset + 1);
$this->th->ss->assign('APP', $app_strings);
$this->th->ss->assign('MOD', $mod_strings);
$this->th->ss->assign('fields', $this->fieldDefs);
$this->th->ss->assign('sectionPanels', $this->sectionPanels);
$this->th->ss->assign('config', $sugar_config);
$this->th->ss->assign('returnModule', $this->returnModule);
$this->th->ss->assign('returnAction', $this->returnAction);
$this->th->ss->assign('returnId', $this->returnId);
$this->th->ss->assign('isDuplicate', $this->isDuplicate);
$this->th->ss->assign('def', $this->defs);
$this->th->ss->assign('useTabs', isset($this->defs['templateMeta']['useTabs']) && isset($this->defs['templateMeta']['tabDefs']) ? $this->defs['templateMeta']['useTabs'] : false);
$this->th->ss->assign('maxColumns', isset($this->defs['templateMeta']['maxColumns']) ? $this->defs['templateMeta']['maxColumns'] : 2);
$this->th->ss->assign('module', $this->module);
$this->th->ss->assign('headerTpl', isset($this->defs['templateMeta']['form']['headerTpl']) ? $this->defs['templateMeta']['form']['headerTpl'] : 'include/' . $this->view . '/header.tpl');
$this->th->ss->assign('footerTpl', isset($this->defs['templateMeta']['form']['footerTpl']) ? $this->defs['templateMeta']['form']['footerTpl'] : 'include/' . $this->view . '/footer.tpl');
$this->th->ss->assign('current_user', $current_user);
$this->th->ss->assign('bean', $this->focus);
$this->th->ss->assign('isAuditEnabled', $this->focus->is_AuditEnabled());
$this->th->ss->assign('gridline', $current_user->getPreference('gridline') == 'on' ? '1' : '0');
$this->th->ss->assign('tabDefs', isset($this->defs['templateMeta']['tabDefs']) ? $this->defs['templateMeta']['tabDefs'] : false);
$this->th->ss->assign('VERSION_MARK', getVersionedPath(''));
global $js_custom_version;
global $sugar_version;
$this->th->ss->assign('SUGAR_VERSION', $sugar_version);
$this->th->ss->assign('JS_CUSTOM_VERSION', $js_custom_version);
//this is used for multiple forms on one page
if (!empty($this->formName)) {
$form_id = $this->formName;
$form_name = $this->formName;
} else {
$form_id = $this->view;
$form_name = $this->view;
}
if ($ajaxSave && empty($this->formName)) {
$form_id = 'form_' . $this->view . '_' . $this->module;
$form_name = $form_id;
$this->view = $form_name;
//$this->defs['templateMeta']['form']['buttons'] = array();
//$this->defs['templateMeta']['form']['buttons']['ajax_save'] = array('id' => 'AjaxSave', 'customCode'=>'<input type="button" class="button" value="Save" onclick="this.form.action.value=\'AjaxFormSave\';return saveForm(\''.$form_name.'\', \'multiedit_form_{$module}\', \'Saving {$module}...\');"/>');
}
$form_name = $form_name == 'QuickCreate' ? "QuickCreate_{$this->module}" : $form_name;
$form_id = $form_id == 'QuickCreate' ? "QuickCreate_{$this->module}" : $form_id;
if (isset($this->defs['templateMeta']['preForm'])) {
$this->th->ss->assign('preForm', $this->defs['templateMeta']['preForm']);
}
if (isset($this->defs['templateMeta']['form']['closeFormBeforeCustomButtons'])) {
$this->th->ss->assign('closeFormBeforeCustomButtons', $this->defs['templateMeta']['form']['closeFormBeforeCustomButtons']);
}
if (isset($this->defs['templateMeta']['form']['enctype'])) {
$this->th->ss->assign('enctype', 'enctype="' . $this->defs['templateMeta']['form']['enctype'] . '"');
}
//for SugarFieldImage, we must set form enctype to "multipart/form-data"
foreach ($this->fieldDefs as $field) {
if (isset($field['type']) && $field['type'] == 'image') {
$this->th->ss->assign('enctype', 'enctype="multipart/form-data"');
break;
}
}
$this->th->ss->assign('showDetailData', $this->showDetailData);
$this->th->ss->assign('showSectionPanelsTitles', $this->showSectionPanelsTitles);
$this->th->ss->assign('form_id', $form_id);
$this->th->ss->assign('form_name', $form_name);
$this->th->ss->assign('set_focus_block', get_set_focus_js());
$this->th->ss->assign('form', isset($this->defs['templateMeta']['form']) ? $this->defs['templateMeta']['form'] : null);
$this->th->ss->assign('includes', isset($this->defs['templateMeta']['includes']) ? $this->defs['templateMeta']['includes'] : null);
$this->th->ss->assign('view', $this->view);
//Calculate time & date formatting (may need to calculate this depending on a setting)
global $timedate;
$this->th->ss->assign('CALENDAR_DATEFORMAT', $timedate->get_cal_date_format());
$this->th->ss->assign('USER_DATEFORMAT', $timedate->get_user_date_format());
$time_format = $timedate->get_user_time_format();
$this->th->ss->assign('TIME_FORMAT', $time_format);
$date_format = $timedate->get_cal_date_format();
$time_separator = ':';
if (preg_match('/\\d+([^\\d])\\d+([^\\d]*)/s', $time_format, $match)) {
$time_separator = $match[1];
}
// Create Smarty variables for the Calendar picker widget
$t23 = strpos($time_format, '23') !== false ? '%H' : '%I';
//.........这里部分代码省略.........
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:101,代码来源:EditView2.php
示例11: createSprites
//.........这里部分代码省略.........
// add sprites based upon determined coordinates
foreach ($dirs as $dir => $files) {
if (!$this->silentRun) {
$msg = string_format($mod_strings['LBL_SPRITES_PROCESSING_DIR'], array($dir));
$GLOBALS['log']->debug($msg);
$this->logMessage($msg);
}
foreach ($files as $file => $info) {
if ($im = $this->loadImage($dir, $file, $info['type'])) {
// coordinates
$dst_x = $sp->spriteMatrix[$dir . '/' . $file]['x'];
$dst_y = $sp->spriteMatrix[$dir . '/' . $file]['y'];
imagecopy($this->spriteImg, $im, $dst_x, $dst_y, 0, 0, $info['x'], $info['y']);
imagedestroy($im);
if (!$this->silentRun) {
$msg = string_format($mod_strings['LBL_SPRITES_ADDED'], array("{$dir}/{$file}"));
$GLOBALS['log']->debug($msg);
$this->logMessage($msg);
}
}
}
}
// dir & filenames
if ($isRepeat) {
$outputDir = sugar_cached("sprites/Repeatable");
$spriteFileName = "{$name}.png";
$cssFileName = "{$this->fileName}.css";
$metaFileName = "{$this->fileName}.meta.php";
$nameSpace = "Repeatable";
} else {
$outputDir = sugar_cached("sprites/{$name}");
$spriteFileName = "{$this->fileName}.png";
$cssFileName = "{$this->fileName}.css";
$metaFileName = "{$this->fileName}.meta.php";
$nameSpace = "{$name}";
}
// directory structure
if (!is_dir(sugar_cached("sprites/{$nameSpace}"))) {
sugar_mkdir(sugar_cached("sprites/{$nameSpace}"), 0775, true);
}
// save sprite image
// Unfortunately, in PHP before 5.4 imagepng can not save to streams, so we need to do a little trick here
$temp = tempnam($outputDir, "sprites");
imagepng($this->spriteImg, $temp, $this->pngCompression, $this->pngFilter);
copy($temp, "{$outputDir}/{$spriteFileName}");
unlink($temp);
imagedestroy($this->spriteImg);
/* generate css & metadata */
$head = '';
$body = '';
$metadata = '';
foreach ($sp->spriteSrc as $id => $info) {
// sprite id
$hash_id = md5($id);
// header
$head .= "span.spr_{$hash_id},\n";
// image size
$w = $info['x'];
$h = $info['y'];
// image offset
$offset_x = $sp->spriteMatrix[$id]['x'];
$offset_y = $sp->spriteMatrix[$id]['y'];
// sprite css
$body .= "/* {$id} */\nspan.spr_{$hash_id} {\nwidth: {$w}px;\nheight: {$h}px;\nbackground-position: -{$offset_x}px -{$offset_y}px;\n}\n";
$metadata .= '$sprites["' . $id . '"] = array ("class"=>"' . $hash_id . '","width"=>"' . $w . '","height"=>"' . $h . '");' . "\n";
}
// common css header
require_once 'include/utils.php';
$bg_path = getVersionedPath('index.php') . '&entryPoint=getImage&imageName=' . $spriteFileName . '&spriteNamespace=' . $nameSpace;
$head = rtrim($head, "\n,") . " {background: url('../../../{$bg_path}'); no-repeat;display:inline-block;}\n";
// append mode for repeatable sprites
$fileMode = $isRepeat ? 'a' : 'w';
// save css
$css_content = "\n/* autogenerated sprites - {$name} */\n" . $head . $body;
if ($this->cssMinify) {
$css_content = cssmin::minify($css_content);
}
$fh = fopen("{$outputDir}/{$cssFileName}", $fileMode);
fwrite($fh, $css_content);
fclose($fh);
/* save metadata */
$add_php_tag = file_exists("{$outputDir}/{$metaFileName}") && $isRepeat ? false : true;
$fh = fopen("{$outputDir}/{$metaFileName}", $fileMode);
if ($add_php_tag) {
fwrite($fh, '<?php');
}
fwrite($fh, "\n/* sprites metadata - {$name} */\n");
fwrite($fh, $metadata . "\n");
fclose($fh);
// if width & height
} else {
if (!$this->silentRun) {
$msg = string_format($mod_strings['LBL_SPRITES_ADDED'], array($name));
$GLOBALS['log']->debug($msg);
$this->logMessage($msg);
}
}
}
return true;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:SugarSpriteBuilder.php
示例12: yahooJS
function yahooJS()
{
$custom_module = $_SESSION['studio']['module'];
$custom_type = $this->curType;
$v = getVersionedPath('');
return <<<EOQ
\t\t<style type='text/css'>
\t\t.slot {
\t\tborder-width:1px;border-color:#999999;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
\t}
\t.slotB {
\tborder-width:0;cursor:move;
\t}
\t</style>
\t<!-- Namespace source file -->
\t<script type="text/javascript" src="modules/Studio/JSTransaction.js?v={$v}" ></script>
\t<script>
\tvar jstransaction = new JSTransaction();
\t</script>
\t<!-- Drag and Drop source file -->
\t<script type="text/javascript" src="include/javascript/yui/build/dragdrop/dragdrop.js?v={$v}" ></script>
\t<script type="text/javascript" src="modules/Studio/studiodd.js?v={$v}" ></script>
\t<script type="text/javascript" src="modules/Studio/studio.js?v={$v}" ></script>
\t<script>
\tvar yahooSlots = [];
\tfunction dragDropInit(){
\tYAHOO.util.DDM.mode = YAHOO.util.DDM.POINT;
\tfor(mj = 0; mj <= {$this->yahooSlotCount}; mj++){
\tyahooSlots["slot" + mj] = new ygDDSlot("slot" + mj, "studio");
\t}
\tfor(mj = 0; mj < dyn_field_count; mj++){
\tyahooSlots["dyn_field_" + mj] = new ygDDSlot("dyn_field_" + mj, "studio");
\t}
\t// initPointMode();
\tyahooSlots['s_field_delete'] = new YAHOO.util.DDTarget("s_field_delete", 'studio');
\t}
\tYAHOO.util.Event.addListener(window, "load", dragDropInit);
\tvar custom_module = '{$custom_module}';
\tvar custom_view = '{$custom_type}';
\t\t\t</script>
EOQ;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:55,代码来源:StudioParser.php
示例13: getQuickCreateForm
/**
* Renders the QuickCreate form from Smarty and returns HTML
* @param array $vars request variable global
* @param object $email Fetched email object
* @param bool $addToAddressBook
* @return array
*/
function getQuickCreateForm($vars, $email, $addToAddressBookButton = false)
{
require_once "include/EditView/EditView2.php";
global $app_strings;
global $mod_strings;
global $current_user;
global $current_language;
$module = $_REQUEST['qc_module'];
$beanName = BeanFactory::getBeanName($module);
//Setup the current module languge
$mod_strings = return_module_language($current_language, $module);
$focus = BeanFactory::getBean($module);
$people = array('Contact', 'Lead');
$emailAddress = array();
// people
if (in_array($beanName, $people)) {
// lead specific
$focus->lead_source = 'Email';
$focus->lead_source_description = trim($email->name);
$from = isset($email->from_name) && !empty($email->from_name) ? $email->from_name : $email->from_addr;
if (isset($_REQUEST['sugarEmail']) && !empty($_REQUEST['sugarEmail'])) {
if ($email->status == "sent") {
$from = isset($email->to_addrs_names) && !empty($email->to_addrs_names) ? $email->to_addrs_names : $email->to_addrs;
} else {
$from = isset($email->from_name) && !empty($email->from_name) ? $email->from_name : $email->from_addr_name;
}
}
$name = explode(" ", trim($from));
$address = trim(array_pop($name));
$address = str_replace(array("<", ">", "<", ">"), "", $address);
$emailAddress[] = array('email_address' => $address, 'primary_address' => 1, 'invalid_email' => 0, 'opt_out' => 0, 'reply_to_address' => 1);
$focus->email1 = $address;
if (!empty($name)) {
$focus->last_name = trim(array_pop($name));
foreach ($name as $first) {
if (!empty($focus->first_name)) {
$focus->first_name .= " ";
}
$focus->first_name .= trim($first);
}
}
} else {
// case & bug specific
$focus->source = 'InboundEmail';
// bugs, cases, tasks
$focus->name = trim($email->name);
}
$focus->description = trim(strip_tags($email->description));
$focus->assigned_user_id = $current_user->id;
$focus->team_id = $current_user->default_team;
$EditView = new EditView();
$EditView->ss = new Sugar_Smarty();
//MFH BUG#20283 - checks for custom quickcreate fields
$EditView->setup($module, $focus, SugarAutoLoader::loadWithMetafiles($module, 'editviewdefs'));
$EditView->process();
$EditView->render();
$EditView->defs['templateMeta']['form']['buttons'] = array('email2save' => array('id' => 'e2AjaxSave', 'customCode' => '<input type="button" class="button" value=" ' . $app_strings['LBL_SAVE_BUTTON_LABEL'] . ' " onclick="SUGAR.email2.detailView.saveQuickCreate(false);" />'), 'email2saveandreply' => array('id' => 'e2SaveAndReply', 'customCode' => '<input type="button" class="button" value=" ' . $app_strings['LBL_EMAIL_SAVE_AND_REPLY'] . ' " onclick="SUGAR.email2.detailView.saveQuickCreate(\'reply\');" />'), 'email2cancel' => array('id' => 'e2cancel', 'customCode' => '<input type="button" class="button" value=" ' . $app_strings['LBL_EMAIL_CANCEL'] . ' " onclick="SUGAR.email2.detailView.quickCreateDialog.hide();" />'));
if ($addToAddressBookButton) {
$EditView->defs['templateMeta']['form']['buttons']['email2saveAddToAddressBook'] = array('id' => 'e2addToAddressBook', 'customCode' => '<input type="button" class="button" value=" ' . $app_strings['LBL_EMAIL_ADDRESS_BOOK_SAVE_AND_ADD'] . ' " onclick="SUGAR.email2.detailView.saveQuickCreate(true);" />');
}
//Get the module language for javascript
if (!is_file(sugar_cached('jsLanguage/') . "{$module}/{$GLOBALS['current_language']}.js")) {
require_once 'include/language/jsLanguage.php';
jsLanguage::createModuleStringsCache($module, $GLOBALS['current_language']);
}
$jsLanguage = getVersionedScript("cache/jsLanguage/{$module}/{$GLOBALS['current_language']}.js", $GLOBALS['sugar_config']['js_lang_version']);
if ($focus->object_name == 'Contact') {
$admin = Administration::getSettings();
if (empty($admin->settings['portal_on']) || !$admin->settings['portal_on']) {
unset($EditView->sectionPanels[strtoupper('lbl_portal_information')]);
} else {
$jsLanguage .= getVersionedScript("modules/Contacts/Contact.js");
$jsLanguage .= getVersionedScript("modules/Contacts/QuickCreateEmailContact.js");
$jsLanguage .= <<<EOQ
\t\t\t <script language="javascript">
\t\t\t\t addToValidateComparison('form_EmailQCView_Contacts', 'portal_password', 'varchar', false, SUGAR.language.get('app_strings', 'ERR_SQS_NO_MATCH_FIELD') + SUGAR.language.get('Contacts', 'LBL_PORTAL_PASSWORD'), 'portal_password1');
\t\t addToValidateVerified('form_EmailQCView_Contacts', 'portal_name_verified', 'bool', false, SUGAR.language.get('app_strings', 'ERR_EXISTING_PORTAL_USERNAME'));
\t\t YAHOO.util.Event.on('portal_name', 'blur', validatePortalName);
\t\t\t\t YAHOO.util.Event.on('portal_name', 'keydown', handleKeyDown);
\t\t\t </script>
EOQ;
}
}
$EditView->view = 'EmailQCView';
$EditView->defs['templateMeta']['form']['headerTpl'] = 'include/EditView/header.tpl';
$EditView->defs['templateMeta']['form']['footerTpl'] = 'include/EditView/footer.tpl';
$meta = array();
$meta['html'] = $jsLanguage . $EditView->display(false, true);
$meta['html'] = str_replace("src='" . getVersionedPath('include/SugarEmailAddress/SugarEmailAddress.js') . "'", '', $meta['html']);
$meta['emailAddress'] = $emailAddress;
$mod_strings = return_module_language($current_language, 'Emails');
return $meta;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:100,代码来源:EmailUI.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_
|
请发表评论