本文整理汇总了PHP中BxTemplFormView::beginBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP BxTemplFormView::beginBlock方法的具体用法?PHP BxTemplFormView::beginBlock怎么用?PHP BxTemplFormView::beginBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxTemplFormView
的用法示例。
在下文中一共展示了BxTemplFormView::beginBlock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showJoinForm
function showJoinForm()
{
//echoDbg( $this -> aValues );exit;
$aFormAttrs = array('id' => 'join_form', 'onsubmit' => 'return validateJoinForm(this);');
$aTableAttrs = array('id' => 'join_form_table');
$aFormParams = array('hidden' => $this->genHiddenFieldsArray());
$aTableParams = array('double' => $this->bCoupleEnabled, 'second_enabled' => $this->bCouple);
$aTableParams['headers'] = array('', _t('_First Person'), _t('_Second Person'));
$aTableParams['headers_add'] = 'class="header form_second_col"' . ($this->bCouple ? '' : ' style="display: none;"');
$aButtons = array(array('type' => 'submit', 'value' => _t('_Submit'), 'class' => 'input_submit'));
/* @var $oForm BxTemplFormView */
$oForm = new BxTemplFormView('join_form');
$oForm->begin($aFormAttrs, $aTableAttrs, $aFormParams, $aTableParams);
$aBlocks = $this->oPF->aArea[$this->iPage];
foreach ($aBlocks as $aBlock) {
$oForm->beginBlock(_t($aBlock['Caption']));
foreach ($aBlock['Items'] as $aItem) {
$aCol0 = array();
$aCol0['Type'] = $aItem['Type'];
$aCol0['Name'] = $aItem['Type'] == 'system' ? $aItem['Name'] : $aItem['Name'] . '[0]';
$aCol0['Mandatory'] = $aItem['Mandatory'];
$aCol0['Control'] = $aItem['Control'];
$aCol0['Values'] = $aItem['Values'];
$aCol0['UseLKey'] = $aItem['UseLKey'];
$aCol0['Caption'] = _t($aItem['Caption']);
$aCol0['Desc'] = _t($aItem['Desc'], $aItem['Min'], $aItem['Max']);
if ($aCol0['Desc'] == $aItem['Desc']) {
$aCol0['Desc'] = '';
}
// set value
if (isset($this->aValues[0][$aItem['Name']])) {
$aCol0['Value'] = $this->aValues[0][$aItem['Name']];
} elseif ($aItem['Name'] == 'Couple') {
$aCol0['Value'] = $this->bCouple;
}
// set error
if (isset($this->aErrors[0][$aItem['Name']])) {
$aCol0['Error'] = $this->aErrors[0][$aItem['Name']];
}
// check second person's field
if ($this->bCoupleEnabled and !in_array($aItem['Name'], $this->aCoupleMutualItems)) {
$aCol1 = array();
$aCol1['Type'] = $aItem['Type'];
$aCol1['Name'] = $aItem['Name'] . '[1]';
$aCol1['Control'] = $aItem['Control'];
$aCol1['Values'] = $aItem['Values'];
$aCol1['UseLKey'] = $aItem['UseLKey'];
// set value
if (isset($this->aValues[1][$aItem['Name']])) {
$aCol1['Value'] = $this->aValues[1][$aItem['Name']];
}
// set error
if (isset($this->aErrors[1][$aItem['Name']])) {
$aCol1['Error'] = $this->aValues[1][$aItem['Name']];
}
$oForm->addRow($aCol0, $aCol1);
} else {
$oForm->addRow($aCol0);
}
}
$oForm->endBlock();
}
$oForm->end($aButtons);
echo $oForm->getCode();
//boonex id
/* if( getParam( 'enable_get_boonex_id' ) )
{
global $tmpl;
echo "<div class=\"import_boonex_id\">";
$action = "boonex";
$text = '<div class="boonex_id">' . _t( '_Import BoonEx ID' ) . '</div>';
$table = "Profiles";
$login_page = "{$site['url']}member.php";
$join_page = "{$site['url']}join_form.php";
$forgot_page = '';
$template = "{$dir['root']}templates/tmpl_{$tmpl}/join_login_form.html";
echo LoginForm( $text,$action,$table,$login_page,$forgot_page,$template );
echo "</div>";
} */
}
示例2: showEditForm
function showEditForm($sStatusText)
{
//echoDbg( $this -> aValues );exit;
$aFormAttrs = array('id' => 'edit_form', 'onsubmit' => 'return validateEditForm(this);');
$aTableAttrs = array('id' => 'edit_form_table', 'action' => $_SERVER['PHP_SELF']);
$aFormParams = array('hidden' => array('ID' => $this->iProfileID, 'do_submit' => '1'));
$aTableParams = array('double' => $this->bCouple, 'second_enabled' => $this->bCouple);
$aTableParams['headers'] = array('', _t('_First Person'), _t('_Second Person'));
$aTableParams['headers_add'] = 'class="header form_second_col"' . ($this->bCouple ? '' : ' style="display: none;"');
$aButtons = array(array('type' => 'submit', 'value' => _t('_Save'), 'class' => 'input_submit'));
/* @var $oForm BxTemplFormView */
$oForm = new BxTemplFormView('edit_form');
$oForm->begin($aFormAttrs, $aTableAttrs, $aFormParams, $aTableParams);
foreach ($this->aBlocks as $aBlock) {
$oForm->beginBlock(_t($aBlock['Caption']));
foreach ($aBlock['Items'] as $aItem) {
$aCol0 = array();
$aCol0['Type'] = $aItem['Type'];
$aCol0['Name'] = $aItem['Type'] == 'system' ? $aItem['Name'] : $aItem['Name'] . '[0]';
$aCol0['Mandatory'] = $aItem['Type'] == 'pass' ? false : $aItem['Mandatory'];
$aCol0['Control'] = $aItem['Control'];
$aCol0['Values'] = $aItem['Values'];
$aCol0['UseLKey'] = $aItem['UseLKey'];
$aCol0['Caption'] = _t($aItem['Caption']);
$aCol0['Desc'] = _t($aItem['Desc']);
if ($aCol0['Desc'] == $aItem['Desc']) {
$aCol0['Desc'] = '';
}
// set value
if (isset($this->aValues[0][$aItem['Name']])) {
$aCol0['Value'] = $this->aValues[0][$aItem['Name']];
} elseif ($aItem['Name'] == 'Couple') {
$aCol0['Value'] = $this->bCouple;
}
// set error
if (isset($this->aErrors[0][$aItem['Name']])) {
$aCol0['Error'] = $this->aErrors[0][$aItem['Name']];
}
// check second person's field
if ($this->bCouple and !in_array($aItem['Name'], $this->aCoupleMutualFields)) {
$aCol1 = array();
$aCol1['Type'] = $aItem['Type'];
$aCol1['Name'] = $aItem['Name'] . '[1]';
$aCol1['Control'] = $aItem['Control'];
$aCol1['Values'] = $aItem['Values'];
$aCol1['UseLKey'] = $aItem['UseLKey'];
// set value
if (isset($this->aValues[1][$aItem['Name']])) {
$aCol1['Value'] = $this->aValues[1][$aItem['Name']];
}
// set error
if (isset($this->aErrors[1][$aItem['Name']])) {
$aCol1['Error'] = $this->aValues[1][$aItem['Name']];
}
//echoDbg( $aCol0 );
$oForm->addRow($aCol0, $aCol1);
} else {
$oForm->addRow($aCol0);
}
}
$oForm->endBlock();
}
$oForm->end($aButtons);
if ($sStatusText) {
echo '<div class="notice_text">' . _t($sStatusText) . "</div>";
}
echo $oForm->getCode();
}