本文整理汇总了PHP中Utility::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::getList方法的具体用法?PHP Utility::getList怎么用?PHP Utility::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::getList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
< <div id="mapOptions" class="mapOptions">
<p class="center">Show Only:</p>
<form id="displayOptionsForm">
<?php
/* to do: add logic to remember users settings across page loads */
$categories = Utility::getRequestVariable('categories', '');
if (strlen($categories) > 0) {
$cat_array = explode(',', $categories);
}
foreach (Utility::getList('categories', $tenantID, $userID) as $category) {
$selected = '';
if (strlen($categories) > 0) {
if (in_array($category['id'], $cat_array, false)) {
$selected = ' checked';
}
}
echo '<div class="checkbox">';
echo ' <label><input type="checkbox" class="categoryInput" value="' . $category['id'] . '" name="' . $category['name'] . '"' . $selected . '> ';
echo '<img src="' . $category['icon'] . '">' . $category['name'] . '</label>';
echo '</div>';
}
?>
</form>
</div>
示例2:
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 id="manageTenantsHeader" class="modal-title">Manage User Tenants</h4>
</div>
<div id="manageTenantsAnchor" class="modal-body">Loading form . . .</div>
<div class="modal-footer">
<div id="manageTenants-message" class="alert alert-danger hidden">
<a class="close_link" href="#" onclick="hideElement('message');"></a>
<span id='manageTenants-message_text'>Message goes here.</span>
</div>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" onclick="saveUserTenants();">Save</button>
<select id="role-select" class="hidden">
<?php
$roles = Utility::getList('roles', $tenantID, $userID);
for ($i = 0; $i < count($roles); $i++) {
echo '<option value="' . $roles[$i] . '">' . $roles[$i] . '</option>';
}
?>
</select>
</div>
</div>
</div>
</div>
<?php
include 'partials/childEditModal.php';
?>
<?php
include Config::$root_path . '/partials/footer.php';
示例3: renderForm
public static function renderForm($class, $entity, $id, $tenantID, $parentid)
{
$fieldarray = $class->getFields();
$hasImage = false;
foreach ($fieldarray as $field) {
$value = '';
if ($id > 0 && isset($entity[$field[0]])) {
$value = $entity[$field[0]];
}
$required = $class->isRequiredField($field[0]) ? 'required' : '';
$readonly = '';
if (!$class->isUpdatableField($field[0])) {
$readonly = ' readonly';
}
$default_label = '<label class="col-sm-3 control-label" for="txt' . $field[0] . '">' . $class->friendlyName($field[0]) . ':</label>';
if ($class->isClickableUrl($field[0])) {
// add link to label
$url = 'getElementById(\'txt' . $class->getName() . ucfirst($field[0]) . '\').value';
$default_label = '<a onclick="window.open(' . $url . ');" target="_blank">' . $default_label . '</a>';
}
if ($class->hasCustomEditControl($field[0])) {
echo '<p>' . $class->getCustomEditControl($field[0], $value, $id) . '</p>';
} else {
switch ($field[1]) {
case "string":
$maxlen = '';
$collength = 6;
$indented = "";
if (count($field) > 3 && $field[3] == "html") {
$collength = 12;
$indented = " indent";
$default_label = "";
echo '<div class="col-sm-12"><label class="col-sm-3" for="txt' . $field[0] . '"> ' . $class->friendlyName($field[0]) . ':</label></div>';
}
echo '<div id="field_' . $field[0] . '" class="form-group">';
if (count($field) > 2 && $field[2] > 0) {
// add a max-length validator
$maxlen = 'maxlength="' . $field[2] . '"';
if ($field[2] < 50) {
$collength = 2;
}
}
echo $default_label;
echo ' <div class="col-sm-' . $collength . $indented . '">';
if (count($field) > 3 && $field[3] == "html") {
// special handling for HTML content
echo ' <textarea rows="16" cols="400" id="txt' . $class->getName() . ucfirst($field[0]) . '" name="' . $field[0] . '" class="form-control" placeholder="' . $class->friendlyName($field[0]) . '" ' . $maxlen . ' ' . $required . '>';
echo $value . '</textarea>';
} elseif (count($field) > 2 && ($field[2] > 200 || $field[2] == 0)) {
// length of 0 indicates an unlimited (text) field
echo ' <textarea rows="4" cols="200" id="txt' . $class->getName() . ucfirst($field[0]) . '" name="' . $field[0] . '" class="form-control" placeholder="' . $class->friendlyName($field[0]) . '" ' . $maxlen . ' ' . $required . '>';
echo $value . '</textarea>';
} else {
echo ' <input id="txt' . $class->getName() . ucfirst($field[0]) . '" name="' . $field[0] . '" type="text" class="form-control" placeholder="' . $class->friendlyName($field[0]) . '" value="' . $value . '" ' . $maxlen . ' ' . $required . $readonly . '/>';
if ($class->isRequiredField($field[0])) {
echo '<span class="glyphicon form-control-feedback glyphicon-asterisk" aria-hidden="true"></span>';
}
}
echo ' </div>';
echo ' <div class="help-block with-errors"></div>';
echo '</div>';
break;
case "date":
echo '<div class="form-group">';
echo $default_label;
echo ' <div class="col-sm-6"><input id="txt' . $field[0] . '" name="' . $field[0] . '" type="text" class="form-control" placeholder="' . $field[0] . '" value="' . $value . '"/></div>';
echo ' <div class="help-block with-errors"></div>';
echo '</div>';
break;
case "number":
case "decimal":
echo '<div class="form-group">';
echo $default_label;
$css_class = $field[2] < 10 ? 'col-sm-1' : 'col-sm-2';
echo ' <div class="' . $css_class . '"><input id="txt' . $class->getName() . ucfirst($field[0]) . '" name="' . $field[0] . '" type="text" class="form-control" placeholder="' . $field[0] . '" value="' . $value . '"/></div>';
echo ' <div class="help-block with-errors"></div>';
echo '</div>';
break;
case "boolean":
echo '<div class="form-group">';
echo $default_label;
$css_class = 'col-sm-1';
$checked = $value ? 'checked' : '';
echo ' <div class="' . $css_class . '"><input id="txt' . $class->getName() . ucfirst($field[0]) . '" name="' . $field[0] . '" type="checkbox" class="form-control" ' . $checked . '/></div>';
echo ' <div class="help-block with-errors"></div>';
echo '</div>';
break;
case "picklist":
echo '<div class="form-group">';
echo $default_label;
$size = $field[2] < 4 && $field[2] > 0 ? 'col-sm-1' : 'col-sm-6';
echo '<div class="' . $size . '"><select id="txt' . $class->getName() . ucfirst($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]]) {
$selected = "selected";
}
echo '<option value="' . $r[0] . '"' . $selected . '>' . $r[1] . '</option>';
}
//.........这里部分代码省略.........
示例4: renderOptions
public static function renderOptions($listID, $tenantID, $userID, $selectedID)
{
// takes the requested list and uses it to render the Options markup
// use to populate a select control
// if selectedID is specialized, any item matching that ID will be flagged as the selected item
$optionList = Utility::getList($listID, $tenantID, $userID);
if (!$optionList) {
// no list to render
echo "<option>--No values--</option>";
return false;
} else {
foreach ($optionList as $o) {
echo '<option value="' . $o[0] . '"';
if ($selectedID && $selectedID == $o[0]) {
echo ' selected';
}
echo '>' . $o[1];
echo "</option>";
}
}
}