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


PHP ConnectorUtils::getConnectorButtonScript方法代码示例

本文整理汇总了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);
}
开发者ID:omusico,项目名称:sugar_work,代码行数:11,代码来源:function.sugarvar_connector.php

示例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 .= '&nbsp;' . ConnectorUtils::getConnectorButtonScript($params['var']['displayParams'], $smarty);
        }
        return $code;
    }
}
开发者ID:klr2003,项目名称:sourceread,代码行数:49,代码来源:function.sugar_evalcolumn.php

示例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 .= '&nbsp;' . ConnectorUtils::getConnectorButtonScript($params['var']['displayParams'], $smarty);
        }
        return $code;
    }
}
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:66,代码来源:function.sugar_evalcolumn.php


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