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


PHP FormElement::display方法代码示例

本文整理汇总了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 "&nbsp;" . $arrParam["extra"];
     }
     print "</td></tr>";
 }
开发者ID:neoclust,项目名称:mmc,代码行数:59,代码来源:FormGenerator.php

示例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 "&nbsp;" . $arrParam["extra"];
     }
     print "</td></tr>\n        ";
 }
开发者ID:sebastiendu,项目名称:mmc,代码行数:46,代码来源:editacl.php

示例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);
开发者ID:sebastiendu,项目名称:mmc,代码行数:30,代码来源:MultipleInput.tpl.php

示例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 
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:details.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 . '\'))+\'&amp;minputname='.$this->name.'&amp;del='.$this->key.'&amp;desc='.urlencode($this->desc) . '&amp;regexp='.rawurlencode($this->template->regexp) . '\' }); return false;"/>';

        print '</td></tr>';

    }
开发者ID:neoclust,项目名称:mmc,代码行数:58,代码来源:network2.inc.php


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