當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ProjectSettings::getFieldIndex方法代碼示例

本文整理匯總了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);
}
開發者ID:aagusti,項目名稱:padl-tng,代碼行數:25,代碼來源:commonfunctions.php

示例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];
開發者ID:sdev1,項目名稱:CloudStockEnquiry,代碼行數:31,代碼來源:fulltext.php

示例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 {
開發者ID:aagusti,項目名稱:padl-tng,代碼行數:31,代碼來源:searchsuggest.php


注:本文中的ProjectSettings::getFieldIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。