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


PHP smarty_function_sugar_field函数代码示例

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


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

示例1: ob_get_contents

     $this->assign('url', ob_get_contents());
     ob_end_clean();
     echo '<';
     echo is_array($_tmp = @$this->_tpl_vars['pageData']['tag'][$this->_tpl_vars['id']][$this->_tpl_vars['params']['ACLTag']]) ? $this->_run_mod_handler('default', true, $_tmp, @$this->_tpl_vars['pageData']['tag'][$this->_tpl_vars['id']]['MAIN']) : smarty_modifier_default($_tmp, @$this->_tpl_vars['pageData']['tag'][$this->_tpl_vars['id']]['MAIN']);
     echo ' href="';
     echo smarty_function_sugar_ajax_url(array('url' => $this->_tpl_vars['url']), $this);
     echo '">';
 }
 echo '';
 if ($this->_tpl_vars['params']['customCode']) {
     echo '';
     echo smarty_function_sugar_evalcolumn_old(array('var' => $this->_tpl_vars['params']['customCode'], 'rowData' => $this->_tpl_vars['rowData']), $this);
     echo '';
 } else {
     echo '';
     echo smarty_function_sugar_field(array('parentFieldArray' => $this->_tpl_vars['rowData'], 'vardef' => $this->_tpl_vars['params'], 'displayType' => 'ListView', 'field' => $this->_tpl_vars['col']), $this);
     echo '';
 }
 echo '';
 if (empty($this->_tpl_vars['rowData'][$this->_tpl_vars['col']]) && empty($this->_tpl_vars['params']['customCode'])) {
     echo '&nbsp;';
 }
 echo '';
 if ($this->_tpl_vars['params']['link'] && !$this->_tpl_vars['params']['customCode']) {
     echo '</';
     echo is_array($_tmp = @$this->_tpl_vars['pageData']['tag'][$this->_tpl_vars['id']][$this->_tpl_vars['params']['ACLTag']]) ? $this->_run_mod_handler('default', true, $_tmp, @$this->_tpl_vars['pageData']['tag'][$this->_tpl_vars['id']]['MAIN']) : smarty_modifier_default($_tmp, @$this->_tpl_vars['pageData']['tag'][$this->_tpl_vars['id']]['MAIN']);
     echo '>';
 }
 echo '';
 if ($this->_tpl_vars['col'] == 'NAME' || $this->_tpl_vars['params']['bold']) {
     echo '</b>';
开发者ID:Terraxx,项目名称:kepmezo,代码行数:31,代码来源:%%78^786^7862BF8C%%ListViewGeneric.tpl.php

示例2: smarty_function_sugar_evalcolumn

                                ?>
				{counter name="panelFieldCount"}
				<?php 
                                echo smarty_function_sugar_evalcolumn(array('var' => $this->_tpl_vars['colData']['field']['customCode'], 'colData' => $this->_tpl_vars['colData'], 'accesskey' => $this->_tpl_vars['ACCKEY'], 'tabindex' => $this->_tpl_vars['tabindex']), $this);
                                ?>

			<?php 
                            } elseif ($this->_tpl_vars['fields'][$this->_tpl_vars['colData']['field']['name']]) {
                                ?>
				{counter name="panelFieldCount"}
			    <?php 
                                echo $this->_tpl_vars['colData']['displayParams'];
                                ?>

				<?php 
                                echo smarty_function_sugar_field(array('parentFieldArray' => 'fields', 'accesskey' => $this->_tpl_vars['ACCKEY'], 'tabindex' => $this->_tpl_vars['tabindex'], 'vardef' => $this->_tpl_vars['fields'][$this->_tpl_vars['colData']['field']['name']], 'displayType' => 'EditView', 'displayParams' => $this->_tpl_vars['colData']['field']['displayParams'], 'typeOverride' => $this->_tpl_vars['colData']['field']['type'], 'formName' => $this->_tpl_vars['form_name'], 'module' => $this->_tpl_vars['module']), $this);
                                ?>

			<?php 
                            }
                            ?>
	<?php 
                            if (!empty($this->_tpl_vars['colData']['field']['customCode']) && !empty($this->_tpl_vars['colData']['field']['customCodeRenderField'])) {
                                ?>
	    {counter name="panelFieldCount"}
	    <?php 
                                echo smarty_function_sugar_evalcolumn(array('var' => $this->_tpl_vars['colData']['field']['customCode'], 'colData' => $this->_tpl_vars['colData'], 'tabindex' => $this->_tpl_vars['tabindex']), $this);
                                ?>

    <?php 
                            }
开发者ID:kulaginds,项目名称:SugarCRMTest,代码行数:31,代码来源:%%FA^FA9^FA908702%%EditView.tpl.php

示例3: unset

                                            ?>

				        <?php 
                                        }
                                        ?>
				    <?php 
                                    }
                                }
                                unset($_from);
                                ?>
				<?php 
                            } elseif ($this->_tpl_vars['fields'][$this->_tpl_vars['colData']['field']['name']]) {
                                ?>
					{counter name="panelFieldCount"}
					<?php 
                                echo smarty_function_sugar_field(array('parentFieldArray' => 'fields', 'vardef' => $this->_tpl_vars['fields'][$this->_tpl_vars['colData']['field']['name']], 'displayType' => 'DetailView', 'displayParams' => $this->_tpl_vars['colData']['field']['displayParams'], 'typeOverride' => $this->_tpl_vars['colData']['field']['type']), $this);
                                ?>

				<?php 
                            }
                            ?>
				<?php 
                            if (!empty($this->_tpl_vars['colData']['field']['customCode']) && $this->_tpl_vars['colData']['field']['customCodeRenderField']) {
                                ?>
				    {counter name="panelFieldCount"}
				    <span id="<?php 
                                echo $this->_tpl_vars['colData']['field']['name'];
                                ?>
" class="sugar_field"><?php 
                                echo smarty_function_sugar_evalcolumn(array('var' => $this->_tpl_vars['colData']['field'], 'colData' => $this->_tpl_vars['colData']), $this);
                                ?>
开发者ID:kulaginds,项目名称:SugarCRMTest,代码行数:31,代码来源:%%24^248^248C46CA%%DetailView.tpl.php

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


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