本文整理汇总了PHP中ConnectorUtils::getConnectorButtonScript方法的典型用法代码示例。如果您正苦于以下问题:PHP ConnectorUtils::getConnectorButtonScript方法的具体用法?PHP ConnectorUtils::getConnectorButtonScript怎么用?PHP ConnectorUtils::getConnectorButtonScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConnectorUtils
的用法示例。
在下文中一共展示了ConnectorUtils::getConnectorButtonScript方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_sugarvar_connector
function smarty_function_sugarvar_connector($params, &$smarty)
{
$displayParams = $smarty->get_template_vars('displayParams');
if (!isset($displayParams['module'])) {
$smarty->trigger_error("sugarvar_connector: missing 'module' parameter");
$GLOBALS['log']->error("sugarvar_connector: missing 'module' parameter");
return;
}
require_once 'include/connectors/utils/ConnectorUtils.php';
echo ConnectorUtils::getConnectorButtonScript($displayParams, $smarty);
}
示例2: smarty_function_sugar_evalcolumn
/**
* Smarty {sugar_evalcolumn} function plugin
*
* Type: function<br>
* Name: sugar_evalcolumn<br>
* Purpose: evaluate a string by substituting values in the rowData parameter. Used for ListViews<br>
*
* @author Wayne Pan {wayne at sugarcrm.com
* @param array
* @param Smarty
*/
function smarty_function_sugar_evalcolumn($params, &$smarty)
{
if (!isset($params['colData']['field'])) {
if (empty($params['colData'])) {
$smarty->trigger_error("evalcolumn: missing 'colData' parameter");
}
if (!isset($params['colData']['field'])) {
$smarty->trigger_error("evalcolumn: missing 'colData.field' parameter");
}
return;
}
if (empty($params['colData']['field'])) {
return;
}
$params['var'] = $params['colData']['field'];
if (isset($params['toJSON'])) {
$json = getJSONobj();
$params['var'] = $json->encode($params['var']);
}
if (!empty($params['var']['assign'])) {
return '{$' . $params['colData']['field']['name'] . '}';
} else {
$code = $params['var']['customCode'];
if (isset($params['tabindex']) && preg_match_all("'(<[ ]*?)(textarea|input|select)([^>]*?)(>)'si", $code, $matches, PREG_PATTERN_ORDER)) {
$str_replace = array();
$tabindex = ' tabindex="' . $params['tabindex'] . '" ';
foreach ($matches[3] as $match) {
$str_replace[$match] = $tabindex . $match;
}
$code = str_replace(array_keys($str_replace), array_values($str_replace), $code);
}
if (!empty($params['var']['displayParams']['enableConnectors'])) {
require_once 'include/connectors/utils/ConnectorUtils.php';
$code .= ' ' . ConnectorUtils::getConnectorButtonScript($params['var']['displayParams'], $smarty);
}
return $code;
}
}
示例3: smarty_function_sugar_evalcolumn
/**
* Smarty {sugar_evalcolumn} function plugin
*
* Type: function<br>
* Name: sugar_evalcolumn<br>
* Purpose: evaluate a string by substituting values in the rowData parameter. Used for ListViews<br>
*
* @author Wayne Pan {wayne at sugarcrm.com
* @param array
* @param Smarty
*/
function smarty_function_sugar_evalcolumn($params, &$smarty)
{
if (!isset($params['colData']['field'])) {
if (empty($params['colData'])) {
$smarty->trigger_error("evalcolumn: missing 'colData' parameter");
}
if (!isset($params['colData']['field'])) {
$smarty->trigger_error("evalcolumn: missing 'colData.field' parameter");
}
return;
}
if (empty($params['colData']['field'])) {
return;
}
$params['var'] = $params['colData']['field'];
if (isset($params['toJSON'])) {
$json = getJSONobj();
$params['var'] = $json->encode($params['var']);
}
if (!empty($params['var']['assign'])) {
return '{$' . $params['colData']['field']['name'] . '}';
} else {
$code = $params['var']['customCode'];
if (isset($params['tabindex']) && preg_match_all("'(<[ ]*?)(textarea|input|select)([^>]*?)(>)'si", $code, $matches, PREG_PATTERN_ORDER)) {
$str_replace = array();
$tabindex = ' tabindex="' . $params['tabindex'] . '" ';
foreach ($matches[3] as $match) {
$str_replace[$match] = $tabindex . $match;
}
$code = str_replace(array_keys($str_replace), array_values($str_replace), $code);
}
// Add a string replace to swap out @@FIELD@@ for the actual field,
// we can't do this through customCode directly because the sugar_field smarty function returns smarty code to run on the second pass
if (!empty($code) && strpos($code, '@@FIELD@@') !== FALSE) {
// First we need to fetch extra data about the field
// sfp == SugarFieldParams
$sfp = $params;
$sfp['parentFieldArray'] = 'fields';
$vardefs = $smarty->get_template_vars('fields');
$sfp['vardef'] = $vardefs[$params['colData']['field']['name']];
$sfp['displayType'] = 'EditView';
$sfp['displayParams'] = $params['colData']['field']['displayParams'];
$sfp['typeOverride'] = $params['colData']['field']['type'];
$sfp['formName'] = $smarty->get_template_vars('form_name');
$fieldText = smarty_function_sugar_field($sfp, $smarty);
$code = str_replace('@@FIELD@@', $fieldText, $code);
}
//eggsurplus bug 28321: add support for rendering customCode AND normal field rendering
if (!empty($params['var']['displayParams']['enableConnectors']) && empty($params['var']['customCodeRenderField'])) {
require_once 'include/connectors/utils/ConnectorUtils.php';
$code .= ' ' . ConnectorUtils::getConnectorButtonScript($params['var']['displayParams'], $smarty);
}
return $code;
}
}