本文整理汇总了PHP中Fields::getOutFieldsByTree方法的典型用法代码示例。如果您正苦于以下问题:PHP Fields::getOutFieldsByTree方法的具体用法?PHP Fields::getOutFieldsByTree怎么用?PHP Fields::getOutFieldsByTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields::getOutFieldsByTree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTree
function getTree($module = '')
{
$items = array();
$sql = 'SELECT * FROM {{tree}} WHERE id=' . Funcs::$uri[2] . '';
$data = DB::getRow($sql);
$sql = 'SELECT modul2 FROM {{relations}} WHERE modul1=\'tree\' AND id1=' . Funcs::$uri[2] . ' AND id2=0';
$path = DB::getOne($sql);
if ($path) {
$sql = 'SELECT * FROM {{modules}} WHERE path=\'' . $path . '\'';
$moduleraz = DB::getRow($sql);
}
$sql = 'SELECT modul2 FROM {{relations}} WHERE modul1=\'tree\' AND id1=' . Funcs::$uri[2] . ' AND id2=1';
$path = DB::getOne($sql);
$sql = 'SELECT * FROM {{modules}} WHERE path=\'' . $path . '\'';
$module = DB::getRow($sql);
if (!$moduleraz) {
$moduleraz = $module;
}
$data['module'] = $module;
$data['moduleraz'] = $moduleraz;
$data['list'] = array();
$order = 'num';
if (trim($_GET['sort']) != '') {
$order = $_GET['sort'] . ' ' . (isset($_GET['desc']) ? 'DESC' : '');
}
if (strpos($data['moduleraz']['path'], 'struct_') !== false && is_numeric($_GET['ve'])) {
$sql = '
SELECT {{tree}}.* FROM {{tree}}
LEFT JOIN {{catalog}} ON {{tree}}.id={{catalog}}.tree
WHERE {{tree}}.parent=' . Funcs::$uri[2] . ' AND {{catalog}}.vendor=' . $_GET['ve'] . ' ORDER BY {{tree}}' . $order . '
';
} else {
$sql = 'SELECT * FROM {{tree}} WHERE parent=' . Funcs::$uri[2] . ' ORDER BY ' . $order . '';
}
$items = DB::getPagi($sql);
$fields = Fields::getOutFieldsByTree(1);
foreach ($items as $item) {
$sql = 'SELECT modul2 FROM {{relations}} WHERE modul1=\'tree\' AND id1=' . $item['id'] . ' AND id2=1';
$path = DB::getOne($sql);
$sql = 'SELECT * FROM {{modules}} WHERE path=\'' . $path . '\'';
$module = DB::getRow($sql);
$item['udate'] = date('d.m.Y H:i:s', strtotime($item['udate']));
$item['module'] = array('id' => $module['id'], 'name' => $module['name'], 'path' => $module['path'], 'type' => $module['type']);
foreach ($fields as $field) {
$text = OutFieldWidget::run($item['id'], $field, $data['module']);
if ($field['type'] == 'editor') {
if (strlen(strip_tags($text)) > 50) {
$text = substr(strip_tags($text), 0, strpos(strip_tags($text), ' ', 50)) . '...';
} else {
$text = strip_tags($text);
}
}
$item['fields'][$field['path']] = $text;
}
$data['list'][] = $item;
}
return $data;
}
示例2: foreach
</div>
</div>
</div>
<section class="popup popup_sections-settings jsSectionsSettingsPopup">
<div class="ltContainer ltFullWidth">
<div class="ltRow">
<header class="popup_sections-settings_header">
<span class="button_select-all jsSelectAll">Выбрать все</span> <span class="button_clear-all jsClearAll">Очистить</span>
</header>
</div>
<div class="ltRow jsScrollContainer">
<div class="jsScrollWrapper">
<div class="jsScroll beigeOverflow">
<ul class="popup_sections-settings_list">
<?php
foreach (Fields::getOutFieldsByTree() as $key => $item) {
?>
<li class="popup_sections-settings_option">
<label class="form_label selectColumn">
<input type="checkbox" class="selectColumnCheckbox <?php
if ($key === 'tree_name') {
?>
selectColumnCheckboxName<?php
}
?>
" value="<?php
echo $item['path'];
?>
" <?php
if (in_array($item['path'], Funcs::getUserOptions())) {
?>