本文整理匯總了PHP中PMA_BS_CreateReferenceLink函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_BS_CreateReferenceLink函數的具體用法?PHP PMA_BS_CreateReferenceLink怎麽用?PHP PMA_BS_CreateReferenceLink使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了PMA_BS_CreateReferenceLink函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PMA_displayTableBody
//.........這裏部分代碼省略.........
$bs_reference_exists = $allBSTablesExist = FALSE;
// load PMA configuration
$PMA_Config = $_SESSION['PMA_Config'];
// if PMA configuration exists
if ($PMA_Config) {
// load BS variables
$pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
// if BS plugins exist
if ($pluginsExist) {
// load BS databases
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
// if BS db array and specified db string not empty and valid
if (!empty($bs_tables) && strlen($db) > 0) {
$bs_tables = $bs_tables[$db];
if (isset($bs_tables)) {
$allBSTablesExist = TRUE;
// check if BS tables exist for given database
foreach ($bs_tables as $table_key => $bs_tbl) {
if (!$bs_tables[$table_key]['Exists']) {
$allBSTablesExist = FALSE;
break;
}
}
}
}
}
}
// if necessary BS tables exist
if ($allBSTablesExist) {
$bs_reference_exists = PMA_BS_ReferenceExists($row[$i], $db);
}
// if valid BS reference exists
if ($bs_reference_exists) {
$blobtext = PMA_BS_CreateReferenceLink($row[$i], $db);
} else {
$blobtext = PMA_handle_non_printable_contents('BLOB', isset($row[$i]) ? $row[$i] : '', $transform_function, $transform_options, $default_function, $meta);
}
$vertical_display['data'][$row_no][$i] = ' <td align="left"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $blobtext . '</td>';
unset($blobtext);
// not binary:
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} elseif ($row[$i] != '') {
// garvin: if a transform function for blob is set, none of these replacements will be made
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P') {
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
}
// loic1: displays all space characters, 4 space
// characters for tabulations and <cr>/<lf>
$row[$i] = $default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $meta);
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $row[$i] . '</td>' . "\n";
} else {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"> </td>' . "\n";
}
}
// n o t n u m e r i c a n d n o t B L O B
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} elseif ($row[$i] != '') {
// loic1: support blanks in the key
$relation_id = $row[$i];
// nijel: Cut all fields to $GLOBALS['cfg']['LimitChars']
// lem9: (unless it's a link-type transformation)
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P' && !strpos($transform_function, 'link') === true) {
示例2: PMA_BS_CreateReferenceLink
}
// end if (isset($bs_tables))
}
// end if (!empty($bs_tables) && strlen($db) > 0)
}
// end if ($pluginsExist)
}
// end if ($requiredTblType == strtolower ($tbl_type))
}
// end if (!empty($PMA_Config))
}
// end if (isset ($tbl_type) && strlen ($tbl_type) > 0)
if ($bs_reference_exists) {
echo '<input type="hidden" name="remove_blob_ref_' . $field['Field_md5'] . $vkey . '" value="' . $data . '" />';
echo '<input type="checkbox" name="remove_blob_repo_' . $field['Field_md5'] . $vkey . '" /> ' . $strBLOBRepositoryRemove . "<br />";
echo PMA_BS_CreateReferenceLink($data, $db);
echo "<br />";
} else {
echo $strBinaryDoNotEdit;
if (isset($data)) {
$data_size = PMA_formatByteDown(strlen(stripslashes($data)), 3, 1);
echo ' (' . $data_size[0] . ' ' . $data_size[1] . ')';
unset($data_size);
}
echo "\n";
}
// end if ($bs_reference_exists)
?>
<input type="hidden" name="fields_type<?php
echo $field_name_appendix;
?>
示例3: PMA_displayTableBody
//.........這裏部分代碼省略.........
if (!empty($sql_query)) {
$_url_params['sql_query'] = $url_sql_query;
}
$transform_options['wrapper_link'] = PMA_generate_common_url($_url_params);
// n u m e r i c
if ($meta->numeric == 1) {
// if two fields have the same name (this is possible
// with self-join queries, for example), using $meta->name
// will show both fields NULL even if only one is NULL,
// so use the $pointer
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = PMA_buildNullDisplay($class, $condition_field, $meta, 'align="right"');
} elseif ($row[$i] != '') {
$nowrap = ' nowrap';
$where_comparison = ' = ' . $row[$i];
$vertical_display['data'][$row_no][$i] = '<td align="right"' . PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $map, $row[$i], $transform_function, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated);
} else {
$vertical_display['data'][$row_no][$i] = PMA_buildEmptyDisplay($class, $condition_field, $meta, 'align="right"');
}
// b l o b
} elseif (stristr($meta->type, 'BLOB')) {
// PMA_mysql_fetch_fields returns BLOB in place of
// TEXT fields type so we have to ensure it's really a BLOB
$field_flags = PMA_DBI_field_flags($dt_result, $i);
// remove 'inline_edit' from $class as we can't edit binary data.
$class = str_replace('inline_edit', '', $class);
if (stristr($field_flags, 'BINARY')) {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = PMA_buildNullDisplay($class, $condition_field, $meta);
} else {
// for blobstreaming
// if valid BS reference exists
if (PMA_BS_IsPBMSReference($row[$i], $db)) {
$blobtext = PMA_BS_CreateReferenceLink($row[$i], $db);
} else {
$blobtext = PMA_handle_non_printable_contents('BLOB', isset($row[$i]) ? $row[$i] : '', $transform_function, $transform_options, $default_function, $meta, $_url_params);
}
$vertical_display['data'][$row_no][$i] = PMA_buildValueDisplay($class, $condition_field, $blobtext);
unset($blobtext);
}
// not binary:
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = PMA_buildNullDisplay($class, $condition_field, $meta);
} elseif ($row[$i] != '') {
// if a transform function for blob is set, none of these replacements will be made
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P') {
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
$is_field_truncated = true;
}
// displays all space characters, 4 space
// characters for tabulations and <cr>/<lf>
$row[$i] = $default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $meta);
$vertical_display['data'][$row_no][$i] = PMA_buildValueDisplay($class, $condition_field, $row[$i]);
} else {
$vertical_display['data'][$row_no][$i] = PMA_buildEmptyDisplay($class, $condition_field, $meta);
}
}
// g e o m e t r y
} elseif ($meta->type == 'geometry') {
$geometry_text = PMA_handle_non_printable_contents('GEOMETRY', isset($row[$i]) ? $row[$i] : '', $transform_function, $transform_options, $default_function, $meta);
// remove 'inline_edit' from $class as we can't edit geometry data.
$class = str_replace('inline_edit', '', $class);
$vertical_display['data'][$row_no][$i] = PMA_buildValueDisplay($class, $condition_field, $geometry_text);
unset($geometry_text);
// n o t n u m e r i c a n d n o t B L O B