本文整理汇总了PHP中FormElement::display方法的典型用法代码示例。如果您正苦于以下问题:PHP FormElement::display方法的具体用法?PHP FormElement::display怎么用?PHP FormElement::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormElement
的用法示例。
在下文中一共展示了FormElement::display方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* display input Element
* $arrParam accept ["value"] to corresponding value
*/
function display($arrParam = array())
{
if (empty($arrParam)) {
$arrParam = $this->options;
}
if (!isset($this->cssErrorName)) {
$this->cssErrorName = $this->template->name;
}
printf('<tr');
if ($this->class !== null) {
printf(' class="%s"', $this->class);
}
if ($this->style !== null) {
printf(' style="%s"', $this->style);
}
printf('><td class="label" width="%s" ', $this->firstColWidth);
print displayErrorCss($this->cssErrorName);
print 'style = "text-align: right;">';
//if we got a tooltip, we show it
if ($this->tooltip) {
print "<a href=\"#\" class=\"tooltip\">" . $this->desc . "<span>" . $this->tooltip . "</span></a>";
} else {
print $this->desc;
}
print '</td><td>';
// set hidden form with old_value for each TrFormElement field
if (isset($arrParam["value"])) {
// if checkbox
if ($arrParam["value"] == "checked") {
$old_value = "on";
} else {
$old_value = $arrParam["value"];
}
} else {
$old_value = "";
}
if (is_object($this->template)) {
$field_name = $this->template->name;
} else {
if (is_array($this->template)) {
$field_name = $this->template["name"];
} else {
$field_name = "";
}
}
if ($field_name && is_string($old_value)) {
print '<input type="hidden" name="old_' . $field_name . '" value="' . $old_value . '" />';
}
// display real field
parent::display($arrParam);
if (isset($arrParam["extra"])) {
print " " . $arrParam["extra"];
}
print "</td></tr>";
}
示例2: display
/**
* display input Element
* $arrParam accept ["value"] to corresponding value
*/
function display($arrParam = array())
{
if (empty($arrParam)) {
$arrParam = $this->options;
}
if (!isset($this->cssErrorName)) {
$this->cssErrorName = $this->template->name;
}
if ($this->rowNum % 2) {
print '
<tr class="alternate"><td width="50%" ';
} else {
print '<tr><td ';
}
print displayErrorCss($this->cssErrorName);
print 'style = "text-align: left;">';
if ($this->tab) {
print '<dd>';
}
//if we got a tooltip, we show it
if ($this->tooltip) {
print "<a href=\"#\" class=\"tooltip\">" . $this->desc . "<span>" . $this->tooltip . "</span></a>";
} else {
if (!isset($this->template)) {
print '<h2>' . $this->desc . '</h2>';
} else {
print $this->desc;
}
}
print '</td><td style = "text-align: left;">';
if (isset($this->template)) {
if (!empty($this->arrparam)) {
parent::display($this->arrparam);
} else {
parent::display($arrParam);
}
}
if (isset($arrParam["extra"])) {
print " " . $arrParam["extra"];
}
print "</td></tr>\n ";
}
示例3: array
if (isset($_POST[$name])) {
$arr = $_POST[$name];
} else {
$arr = array();
}
if (isset($_POST['del'])) {
if (count($arr) > 1) {
unset($arr[$_POST['del']]);
} else {
if (count($arr) == 1) {
$arr[$_POST['del']] = '';
}
}
} else {
$arr[] = '';
}
$arr = array_values($arr);
global $aclArray;
if (!isset($aclArray)) {
/*
* When this template is reloaded, we loose $aclArray, and this triggesr a PHP warning on some PHP version.
* We can safely set it to an empty array.
*/
$aclArray = array();
}
$mtpl = new MultipleInputTpl($name, urldecode($_POST['desc']), true);
$mtpl->setRegexp(stripslashes(rawurldecode($_POST['regexp'])));
$fe = new FormElement(_T($name), $mtpl);
$fe->setCssError($name);
$fe->display($arr);
示例4: array
}
global $__TPLref;
$__TPLref["autocomplete"] = "admin";
renderTPL("groups");
?>
</table>
<?php
if (!isset($customParameters) || empty($customParameters)) {
$customParameters = array('');
}
$cp = new MultipleInputTpl("customparameters", _("Custom parameters"));
$cp->setRegexp('/^[a-z: _]+[ ]*=.*$/');
$cpf = new FormElement(_("Custom parameters"), $cp);
$cpf->display($customParameters);
?>
</div>
<?php
if ($_GET["action"] == "add") {
?>
<input name="bcreate" type="submit" class="btnPrimary" value="<?php
echo _T("Create");
?>
" />
<?php
} else {
?>
<input name="share" type="hidden" value="<?php
示例5: display
function display($arrParam = array()) {
if (empty($arrParam)) $arrParam = $this->options;
if ($this->key==0) {
$desc = $this->desc;
} else {
$desc = '';
}
if ($this->ajaxPage == ""){
$this->ajaxPage = "includes/FormGenerator/MultipleInput.tpl.php";
}
// set hidden form with old_value for each DeletableTrFormElement field
// set a random old_value if some field has been created
if($this->new) {
$old_value = uniqid();
}
else if(isset($arrParam["value"])) {
$old_value = $arrParam["value"];
}
else {
$old_value = "";
}
if(is_object($this->template)) {
$field_name = $this->template->name;
}
else if(is_array($this->template)) {
$field_name = $this->template["name"];
}
else {
$field_name = "";
}
if ($field_name) {
print '<input type="hidden" name="old_'.$field_name.'" value="'.$old_value.'" />';
}
print '<tr><td width="40%" ';
print displayErrorCss($this->cssErrorName);
print 'style = "text-align: right;">';
//if we got a tooltip, we show it
if ($this->tooltip) {
print "<a href=\"#\" class=\"tooltip\">".$desc."<span>".$this->tooltip."</span></a>";
} else {
print $desc;
}
print '</td><td>';
// reald field display
FormElement::display($arrParam);
print '<input name="bdel" type="submit" class="btnSecondary" value="'._("Delete").'" onclick="
new Ajax.Updater(\''.$this->name.'\',\''.$this->ajaxPage.'\',
{ parameters: Form.serialize($(\'' . $this->formId . '\'))+\'&minputname='.$this->name.'&del='.$this->key.'&desc='.urlencode($this->desc) . '&regexp='.rawurlencode($this->template->regexp) . '\' }); return false;"/>';
print '</td></tr>';
}