本文整理汇总了PHP中Fields::getFieldsByModule方法的典型用法代码示例。如果您正苦于以下问题:PHP Fields::getFieldsByModule方法的具体用法?PHP Fields::getFieldsByModule怎么用?PHP Fields::getFieldsByModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields::getFieldsByModule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEditFields
public function getEditFields($treeId, $moduleId)
{
$return = array();
$data = array();
$temp = array();
$sql = 'SELECT *, ' . $moduleId . ' AS module FROM {{data}} WHERE tree=' . $treeId . ' AND type NOT IN(\'' . implode('\',\'', Fields::$featuresField) . '\') ORDER BY num';
$additional = DB::getAll($sql);
foreach ($additional as $item) {
$temp[] = $item['path'];
}
$data = Work::getFields($moduleId);
$sql = 'SELECT *, ' . $moduleId . ' AS module FROM {{catalog}} WHERE tree=' . $treeId . '';
$catalog = DB::getRow($sql);
foreach ($data as $key => $item) {
if (in_array($item['path'], OneSSA::$catalogStandart)) {
$data[$key][Fields::$types[$item['type']]['type']] = $catalog[$item['path']];
} else {
if (in_array($data[$key]['path'], $temp)) {
unset($data[$key]);
}
}
}
$data = array_merge($data, $additional);
if (Funcs::$prop['fieldsort'] == 0) {
return $data;
} else {
$fields = Fields::getFieldsByModule($moduleId);
foreach ($fields as $field) {
foreach ($data as $item) {
if ($field['path'] == $item['path']) {
$return[] = $item;
}
}
}
return $return;
}
}
示例2: getOutFieldsByTree
public function getOutFieldsByTree($opt = 0)
{
$modul = Module::getModuleByTree(Funcs::$uri[2], 0);
if ($modul['type'] == 'struct') {
$sql = '
SELECT {{tree}}.id FROM {{tree}}
INNER JOIN {{catalog}} ON {{catalog}}.tree={{tree}}.id
WHERE parent=' . Funcs::$uri[2] . '
ORDER BY num LIMIT 0,1
';
if (DB::getOne($sql)) {
$modul = Module::getModuleByPath(str_replace('struct_', '', $modul['path']));
}
}
if (!$modul['id']) {
return array();
}
if ($opt == 0) {
$list = array_merge(Fields::$fieldsStandart, Fields::getFieldsByModule($modul['id']));
foreach ($list as $key => $item) {
if (in_array($item['path'], OneSSA::$catalogStandart)) {
$list[$key]['isCatalog'] = true;
}
}
return $list;
} else {
return Fields::getFieldsByModule($modul['id']);
}
}
示例3: getEditFields
public function getEditFields($treeId, $moduleId)
{
$return = array();
$data = array();
$temp = array();
$sql = 'SELECT *, ' . $moduleId . ' AS module FROM {{data}} WHERE tree=' . $treeId . ' ORDER BY num';
$additional = DB::getAll($sql);
foreach ($additional as $item) {
$temp[] = $item['path'];
}
$data = Work::getFields($moduleId);
$sql = 'SELECT * FROM {{fields}} WHERE module=' . $moduleId . ' AND innerf=1 ORDER BY num';
$fields = DB::getRow($sql);
foreach ($data as $key => $item) {
/*if(in_array($item['path'],Fields::$catalogStandart)){
$data[$key][Fields::$types[$item['type']]['type']]=$fields[$item['path']];
}else{*/
if (in_array($data[$key]['path'], $temp)) {
unset($data[$key]);
}
//}
}
$data = array_merge($data, $additional);
if (Funcs::$prop['fieldsort'] == 0) {
return $data;
} else {
$fields = Fields::getFieldsByModule($moduleId);
foreach ($fields as $field) {
foreach ($data as $item) {
if ($field['path'] == $item['path']) {
$return[] = $item;
}
}
}
return $return;
}
}
示例4: getWorkFields
public static function getWorkFields($id)
{
$data = array();
$module = Module::getModuleByTree($id);
$reserveFieldsList = Fields::getFieldsByModule($module['id']);
foreach ($reserveFieldsList as $item) {
$reserveFields[$item['path']] = true;
}
$fields = Fields::getFieldsByTree($id);
if ($fields['video']) {
$data[] = $fields['video'];
}
if ($fields['pics']) {
$data[] = $fields['pics'];
}
$data[] = $fields['fulltext'];
foreach ($fields as $key => $item) {
if (!isset($reserveFields[$key])) {
$data[$key] = $item;
}
}
return $data;
}