本文整理汇总了PHP中Forms::renderSearchPanel方法的典型用法代码示例。如果您正苦于以下问题:PHP Forms::renderSearchPanel方法的具体用法?PHP Forms::renderSearchPanel怎么用?PHP Forms::renderSearchPanel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forms
的用法示例。
在下文中一共展示了Forms::renderSearchPanel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderForm
//.........这里部分代码省略.........
}
}
echo '<div class="form-group">';
echo $default_label;
echo '<div class="col-sm-' . $collength . '">';
if (strlen($field[3]) > 0) {
echo '<select id="' . $field[0] . '" name="' . $field[0] . '" class="form-control">';
$list = Utility::getList($field[3], $tenantID, 0);
foreach ($list as $r) {
$selected = "";
if ($id > 0 && $r[0] == $entity[$field[0]] || $id == 0 && $r[0] == $parentid) {
$selected = "selected";
}
echo '<option value="' . $r[0] . '"' . $selected . '>' . $r[1] . '</option>';
}
echo '</select>';
} else {
$fieldname = $class->friendlyName($field[0]);
$searchPanelId = 'search' . ucfirst($field[0]);
$displayValueKey = $field[0] . 'Name';
$displayValue = "";
if ($id > 0 && key_exists($displayValueKey, $entity)) {
$displayValue = $entity[$displayValueKey];
} else {
if ($id > 0 && $entity[$field[0]] > 0) {
$displayValue = $field[5] . ' #' . $entity[$field[0]];
}
}
echo '<input id="search' . ucfirst($field[5]) . 'Value" name="' . $field[0] . '" type="hidden" value="' . $value . '">';
echo '<div class="input-group"><input id="search' . ucfirst($field[5]) . 'Placeholder" type="text" class="form-control" value="' . $displayValue . '" readonly>';
echo '<span class="input-group-addon btn btn-default" id="' . $searchPanelId . 'Button" onclick="searchForLinkedEntity(\'' . $field[5] . '\',\'' . $searchPanelId . '\');"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></span>';
echo '<span class="input-group-addon btn btn-default" id="' . $searchPanelId . 'Remove" onclick="removeLinkedEntity(\'' . $field[5] . '\');"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></span>';
echo '</div>';
Forms::renderSearchPanel($searchPanelId, $fieldname, $field[5], $tenantID);
}
echo '</div>';
if (isset($field[4]) && $field[4]) {
echo '<a href="#add' . $field[0] . '" onclick="addSubEntity(\'add' . $field[0] . '\');">Add New</a>';
}
echo '</span></div>';
break;
case "image":
//echo '<div class="row">';
//echo '<span class="label">' . $field[0] . ':</span>';
//echo '<span class="input"><input id="file' . $field[0] . '" name="file" type="file" placeholder="'. $field[0] .'" value="' . $value . '" readonly></span>';
echo '<input id="txt' . $field[0] . '" name="' . $field[0] . '" type="hidden" value=""/>';
//echo '</div>';
$hasImage = true;
break;
case "viewonly":
echo '<div class="form-group">';
echo $default_label;
echo ' <span class="">' . $value . '</span>';
echo '</div>';
break;
case "hidden":
if ($class->isParentId($field[0])) {
$value = $parentid;
}
echo '<input type="hidden" id="txt' . $field[0] . '" name="' . $field[0] . '" value="' . $value . '"/>';
break;
case "childentities":
echo '<div class="panel panel-info">';
echo ' <div class="panel-heading"><div class="col-sm-2">' . ucfirst($field[0]) . '</div>';
$subform = '';
echo ' <button type="button" class="btn btn-default" onclick="createChildEntity(\'' . $field[2] . '\', \'' . Config::$service_path . '\');">';