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


PHP PMA_getLinkForRelationalDisplayField函數代碼示例

本文整理匯總了PHP中PMA_getLinkForRelationalDisplayField函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_getLinkForRelationalDisplayField函數的具體用法?PHP PMA_getLinkForRelationalDisplayField怎麽用?PHP PMA_getLinkForRelationalDisplayField使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_getLinkForRelationalDisplayField函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetLinkForRelationalDisplayField

 /**
  * Test for PMA_getLinkForRelationalDisplayField
  *
  * @return void
  */
 public function testGetLinkForRelationalDisplayField()
 {
     $GLOBALS['cfg']['ServerDefault'] = 1;
     $_SESSION['tmpval']['relational_display'] = 'K';
     $map = array();
     $map['f']['foreign_db'] = 'information_schema';
     $map['f']['foreign_table'] = 'TABLES';
     $map['f']['foreign_field'] = 'f';
     $result = PMA_getLinkForRelationalDisplayField($map, 'f', "=1", "a>", "b<");
     $this->assertEquals('<a href="sql.php?db=information_schema&amp;table=TABLES&amp;pos=0&amp;' . 'sql_query=SELECT+%2A+FROM+%60information_schema%60.%60TABLES%60+WHERE' . '+%60f%60%3D1&amp;lang=en&amp;token=token" title="a&gt;">b&lt;</a>', $result);
     $_SESSION['tmpval']['relational_display'] = 'D';
     $result = PMA_getLinkForRelationalDisplayField($map, 'f', "=1", "a>", "b<");
     $this->assertEquals('<a href="sql.php?db=information_schema&amp;table=TABLES&amp;pos=0&amp;' . 'sql_query=SELECT+%2A+FROM+%60information_schema%60.%60TABLES%60+WHERE' . '+%60f%60%3D1&amp;lang=en&amp;token=token" title="b&lt;">a&gt;</a>', $result);
 }
開發者ID:kfjihailong,項目名稱:phpMyAdmin,代碼行數:19,代碼來源:PMA_insert_edit_test.php

示例2: PMA_getForeigners

  * transformed fields, if they were edited. After that, output the correct
  * link/transformed value and exit
  *
  * Logic taken from libraries/DisplayResults.class.php
  */
 if (isset($_REQUEST['rel_fields_list']) && $_REQUEST['rel_fields_list'] != '') {
     $map = PMA_getForeigners($db, $table, '', 'both');
     $relation_fields = array();
     parse_str($_REQUEST['rel_fields_list'], $relation_fields);
     // loop for each relation cell
     /** @var array $relation_fields */
     foreach ($relation_fields as $cell_index => $curr_rel_field) {
         foreach ($curr_rel_field as $relation_field => $relation_field_value) {
             $where_comparison = "='" . $relation_field_value . "'";
             $dispval = PMA_getDisplayValueForForeignTableColumn($where_comparison, $map, $relation_field);
             $extra_data['relations'][$cell_index] = PMA_getLinkForRelationalDisplayField($map, $relation_field, $where_comparison, $dispval, $relation_field_value);
         }
     }
     // end of loop for each relation cell
 }
 if (isset($_REQUEST['do_transformations']) && $_REQUEST['do_transformations'] == true) {
     $edited_values = array();
     parse_str($_REQUEST['transform_fields_list'], $edited_values);
     if (!isset($extra_data)) {
         $extra_data = array();
     }
     $transformation_types = array("input_transformation", "transformation");
     foreach ($mime_map as $transformation) {
         $column_name = $transformation['column_name'];
         foreach ($transformation_types as $type) {
             $file = PMA_securePath($transformation[$type]);
開發者ID:altesien,項目名稱:FinalProject,代碼行數:31,代碼來源:tbl_replace.php

示例3: array

        $relation_fields = array();
        parse_str($_REQUEST['rel_fields_list'], $relation_fields);

        // loop for each relation cell
        /** @var array $relation_fields */
        foreach ($relation_fields as $cell_index => $curr_rel_field) {
            foreach ($curr_rel_field as $relation_field => $relation_field_value) {
                $where_comparison = "='" . $relation_field_value . "'";
                $dispval = PMA_getDisplayValueForForeignTableColumn(
                    $where_comparison, $map, $relation_field
                );

                $extra_data['relations'][$cell_index]
                    = PMA_getLinkForRelationalDisplayField(
                        $map, $relation_field, $where_comparison,
                        $dispval, $relation_field_value
                    );
            }
        }   // end of loop for each relation cell
    }
    if (isset($_REQUEST['do_transformations'])
        && $_REQUEST['do_transformations'] == true
    ) {
        $edited_values = array();
        parse_str($_REQUEST['transform_fields_list'], $edited_values);

        if (! isset($extra_data)) {
            $extra_data = array();
        }
        $transformation_types = array(
            "input_transformation",
開發者ID:nijel,項目名稱:phpmyadmin,代碼行數:31,代碼來源:tbl_replace.php


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