當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。