本文整理汇总了PHP中ProjectSettings::getFieldIndex方法的典型用法代码示例。如果您正苦于以下问题:PHP ProjectSettings::getFieldIndex方法的具体用法?PHP ProjectSettings::getFieldIndex怎么用?PHP ProjectSettings::getFieldIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectSettings
的用法示例。
在下文中一共展示了ProjectSettings::getFieldIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetLookupFieldsIndexes
function GetLookupFieldsIndexes($pSet, $field)
{
$lookupTable = $pSet->getLookupTable($field);
$lookupType = $pSet->getLookupType($field);
$displayFieldName = $pSet->getDisplayField($field);
$linkFieldName = $pSet->getLinkField($field);
$linkAndDisplaySame = $linkFieldName == $displayFieldName;
if ($lookupType == LT_QUERY) {
$lookupPSet = new ProjectSettings($lookupTable);
$linkFieldIndex = $lookupPSet->getFieldIndex($linkFieldName) - 1;
if ($linkAndDisplaySame) {
$displayFieldIndex = $linkFieldIndex;
} else {
if ($pSet->getCustomDisplay($field)) {
$displayFieldIndex = $lookupPSet->getCustomExpressionIndex($pSet->_table, $field);
} else {
$displayFieldIndex = $lookupPSet->getFieldIndex($displayFieldName) - 1;
}
}
} else {
$linkFieldIndex = 0;
$displayFieldIndex = $linkAndDisplaySame ? 0 : 1;
}
return array("linkFieldIndex" => $linkFieldIndex, "displayFieldIndex" => $displayFieldIndex);
}
示例2: exit
exit(0);
}
require_once "include/" . $table . "_variables.php";
$pSet = new ProjectSettings(GetTableByShort($table), $pageType);
$cipherer = new RunnerCipherer(GetTableByShort($table), $pSet);
$_connection = $cman->byTable($strTableName);
if (!$pSet->checkFieldPermissions($field)) {
$returnJSON = array("success" => false, "error" => 'Error: You have not permission for read this text');
echo printJSON($returnJSON);
return;
}
if (!$gQuery->HasGroupBy()) {
// Do not select any fields except current (full text) field.
// If query has 'group by' clause then other fields are used in it and we may not simply cut 'em off.
// Just don't do anything in that case.
$gQuery->RemoveAllFieldsExcept($pSet->getFieldIndex($field));
}
$keysArr = $pSet->getTableKeys();
$keys = array();
foreach ($keysArr as $ind => $k) {
$keys[$k] = postvalue("key" . ($ind + 1));
}
$where = KeyWhere($keys);
$sql = $gQuery->gSQLWhere($where);
$qResult = $_connection->query($sql);
if (!$qResult || !($data = $cipherer->DecryptFetchedArray($qResult->fetchAssoc()))) {
$returnJSON = array("success" => false, "error" => 'Error: Wrong SQL query');
echo printJSON($returnJSON);
return;
}
$fieldValue = $data[$field];
示例3: EditControlsContainer
}
}
$controls = new EditControlsContainer(null, $pSet, PAGE_LIST, $cipherer);
// proccess fields and create sql
foreach ($allSearchFields as $f) {
$fType = $pSet->getFieldType($f);
// filter fields by type
if (!IsCharType($fType) && !IsNumberType($fType) && !IsGuid($fType) || in_array($f, $detailKeys)) {
continue;
} else {
}
// get suggest for field
if (($searchField == '' || $searchField == GoodFieldName($f)) && $pSet->checkFieldPermissions($f)) {
$where = "";
$having = "";
if (!$gQuery->IsAggrFuncField($pSet->getFieldIndex($f) - 1)) {
$where = $searchClauseObj->getSuggestWhere($controls->getControl($f), $suggestAllContent, $searchFor);
} elseif ($gQuery->IsAggrFuncField($pSet->getFieldIndex($f) - 1)) {
$having = $searchClauseObj->getSuggestWhere($controls->getControl($f), $suggestAllContent, $searchFor);
}
if (!strlen($where) && !strlen($having)) {
continue;
}
// prepare common vals
$where = whereAdd($where . $masterWhere, $strSecuritySql);
$distinct = "DISTINCT";
$sqlHead = "SELECT " . $distinct . " " . GetFullFieldName($f) . " ";
if ($gQuery->HasGroupBy()) {
$strSQL = $gQuery->gSQLWhere_having_fromQuery("", $where, $having);
$strSQL = "SELECT DISTINCT st." . AddFieldWrappers($f) . " from (" . $strSQL . ") st";
} else {