当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_Tracker::isTracked方法代码示例

本文整理汇总了PHP中PMA_Tracker::isTracked方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Tracker::isTracked方法的具体用法?PHP PMA_Tracker::isTracked怎么用?PHP PMA_Tracker::isTracked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA_Tracker的用法示例。


在下文中一共展示了PMA_Tracker::isTracked方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_getHtmlForActionLinks

/**
 * Get the HTML links for action links
 * Actions are, Browse, Search, Browse table label, empty table
 *
 * @param array   $current_table            current table
 * @param boolean $table_is_view            Is table view or not
 * @param string  $tbl_url_query            table url query
 * @param array   $titles                   titles and icons for action links
 * @param string  $truename                 table name
 * @param boolean $db_is_information_schema is database information schema or not
 * @param string  $url_query                url query
 *
 * @return array ($browse_table, $search_table, $browse_table_label, $empty_table,
 *                $tracking_icon)
 */
function PMA_getHtmlForActionLinks($current_table, $table_is_view, $tbl_url_query, $titles, $truename, $db_is_information_schema, $url_query)
{
    $empty_table = '';
    if ($current_table['TABLE_ROWS'] > 0 || $table_is_view) {
        $may_have_rows = true;
    } else {
        $may_have_rows = false;
    }
    $browse_table = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">';
    if ($may_have_rows) {
        $browse_table .= $titles['Browse'];
    } else {
        $browse_table .= $titles['NoBrowse'];
    }
    $browse_table .= '</a>';
    $search_table = '<a href="tbl_select.php?' . $tbl_url_query . '">';
    if ($may_have_rows) {
        $search_table .= $titles['Search'];
    } else {
        $search_table .= $titles['NoSearch'];
    }
    $search_table .= '</a>';
    $browse_table_label = '<a href="sql.php?' . $tbl_url_query . '&amp;pos=0">' . $truename . '</a>';
    if (!$db_is_information_schema) {
        $empty_table = '<a ';
        if ($GLOBALS['cfg']['AjaxEnable']) {
            $empty_table .= 'class="truncate_table_anchor"';
        }
        $empty_table .= ' href="sql.php?' . $tbl_url_query . '&amp;sql_query=';
        $empty_table .= urlencode('TRUNCATE ' . PMA_Util::backquote($current_table['TABLE_NAME']));
        $empty_table .= '&amp;message_to_show=' . urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($current_table['TABLE_NAME']))) . '">';
        if ($may_have_rows) {
            $empty_table .= $titles['Empty'];
        } else {
            $empty_table .= $titles['NoEmpty'];
        }
        $empty_table .= '</a>';
        // truncating views doesn't work
        if ($table_is_view) {
            $empty_table = '&nbsp;';
        }
    }
    $tracking_icon = '';
    if (PMA_Tracker::isActive()) {
        if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) {
            $tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&amp;table=' . $truename . '">' . PMA_Util::getImage('eye.png', __('Tracking is active.')) . '</a>';
        } elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) {
            $tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&amp;table=' . $truename . '">' . PMA_Util::getImage('eye_grey.png', __('Tracking is not active.')) . '</a>';
        }
    }
    return array($browse_table, $search_table, $browse_table_label, $empty_table, $tracking_icon);
}
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:67,代码来源:structure.lib.php

示例2: PMA_backquote

// end of report
/*
 * List selectable tables
 */
$sql_query = " SELECT DISTINCT db_name, table_name FROM " . PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) . "." . PMA_backquote($GLOBALS['cfg']['Server']['tracking']) . " WHERE " . PMA_backquote('db_name') . " = '" . PMA_sqlAddslashes($GLOBALS['db']) . "' " . " ORDER BY " . PMA_backquote('db_name') . ", " . PMA_backquote('table_name');
$sql_result = PMA_query_as_controluser($sql_query);
if (PMA_DBI_num_rows($sql_result) > 0) {
    ?>
    <form method="post" action="tbl_tracking.php?<?php 
    echo $url_query;
    ?>
">
    <select name="table">
    <?php 
    while ($entries = PMA_DBI_fetch_array($sql_result)) {
        if (PMA_Tracker::isTracked($entries['db_name'], $entries['table_name'])) {
            $status = ' (' . $strTrackingStatusActive . ')';
        } else {
            $status = ' (' . $strTrackingStatusNotActive . ')';
        }
        if ($entries['table_name'] == $_REQUEST['table']) {
            $s = ' selected="selected"';
        } else {
            $s = '';
        }
        echo '<option value="' . htmlspecialchars($entries['table_name']) . '"' . $s . '>' . htmlspecialchars($entries['db_name']) . ' . ' . htmlspecialchars($entries['table_name']) . $status . '</option>' . "\n";
    }
    ?>
    </select>
    <input type="submit" name="show_versions_submit" value="<?php 
    echo $strTrackingShowVersions;
开发者ID:shishenkov,项目名称:zpanel,代码行数:31,代码来源:tbl_tracking.php

示例3: urlencode

        if (!empty($each_table['TABLE_ROWS'])) {
            $empty_table = '<a ';
            if ($GLOBALS['cfg']['AjaxEnable']) {
                $empty_table .= 'class="truncate_table_anchor"';
            }
            $empty_table .= ' href="sql.php?' . $tbl_url_query . '&amp;sql_query=';
            $empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME'])) . '&amp;message_to_show=' . urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME']))) . '">' . $titles['Empty'] . '</a>';
        } else {
            $empty_table = $titles['NoEmpty'];
        }
        $drop_query = 'DROP ' . ($table_is_view ? 'VIEW' : 'TABLE') . ' ' . PMA_backquote($each_table['TABLE_NAME']);
        $drop_message = sprintf($table_is_view ? __('View %s has been dropped') : __('Table %s has been dropped'), str_replace(' ', '&nbsp;', htmlspecialchars($each_table['TABLE_NAME'])));
    }
    $tracking_icon = '';
    if (PMA_Tracker::isActive()) {
        if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) {
            $tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&amp;table=' . $truename . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye.png" alt="' . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>';
        } elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) {
            $tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&amp;table=' . $truename . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye_grey.png" alt="' . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>';
        }
    }
    if ($num_columns > 0 && $num_tables > $num_columns && $row_count % $num_columns == 0) {
        $row_count = 1;
        $odd_row = true;
        ?>
    </tr>
</tbody>
</table>
        <?php 
        PMA_TableHeader(false, $server_slave_status);
    }
开发者ID:bugyak,项目名称:phporadmin,代码行数:31,代码来源:db_structure.php

示例4: testIsTracked

    /**
     * Test for PMA_Tracker::isTracked()
     *
     * @return void
     * @test
     */
    public function testIsTracked()
    {
        $attr = new \ReflectionProperty('PMA_Tracker', 'enabled');
        $attr->setAccessible(true);
        $attr->setValue(null, false);


        $reflection = new \ReflectionProperty('PMA_Tracker', 'pma_table');
        $reflection->setAccessible(true);
        $reflection->setValue(null, 'pma_table_tracking');

        $this->assertFalse(
            PMA_Tracker::isTracked("", "")
        );

        PMA_Tracker::enable();

        $_SESSION['relation'][$GLOBALS['server']]['trackingwork'] = false;

        $this->assertFalse(
            PMA_Tracker::isTracked("", "")
        );

        $_SESSION['relation'][$GLOBALS['server']]['trackingwork'] = true;

        $this->assertTrue(
            PMA_Tracker::isTracked("pma_test_db", "pma_test_table")
        );

        $reflection->setValue(null, 'pma_table_tracking');

        $this->assertFalse(
            PMA_Tracker::isTracked("pma_test_db", "pma_test_table2")
        );
    }
开发者ID:roccivic,项目名称:phpmyadmin,代码行数:41,代码来源:PMA_Tracker_test.php

示例5: __

    $tabs['tracking']['icon'] = 'eye.png';
    $tabs['tracking']['text'] = __('Tracking');
    $tabs['tracking']['link'] = 'tbl_tracking.php';
}
if (!$tbl_is_view && !(isset($db_is_information_schema) && $db_is_information_schema)) {
}
/**
 * Views support a limited number of operations
 */
if ($tbl_is_view && !(isset($db_is_information_schema) && $db_is_information_schema)) {
    $tabs['operation']['icon'] = 'b_tblops.png';
    $tabs['operation']['link'] = 'view_operations.php';
    $tabs['operation']['text'] = __('Operations');
}
if ($table_info_num_rows == 0 && !$tbl_is_view) {
    $tabs['browse']['warning'] = __('Table seems to be empty!');
    $tabs['search']['warning'] = __('Table seems to be empty!');
}
echo PMA_generate_html_tabs($tabs, $url_params);
unset($tabs);
if (PMA_Tracker::isActive() and PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"])) {
    $msg = PMA_Message::notice('<a href="tbl_tracking.php?' . $url_query . '">' . sprintf(__('Tracking of %s.%s is activated.'), htmlspecialchars($GLOBALS["db"]), htmlspecialchars($GLOBALS["table"])) . '</a>');
    $msg->display();
}
/**
 * Displays a message
 */
if (!empty($message)) {
    PMA_showMessage($message);
    unset($message);
}
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:31,代码来源:tbl_links.inc.php

示例6: PMA_getHtmlForSelectableTables

/**
 * Function to get html for selectable table rows
 *
 * @param array  $selectable_tables_sql_result sql results for selectable rows
 * @param string $url_query                    url query
 *
 * @return string
 */
function PMA_getHtmlForSelectableTables($selectable_tables_sql_result, $url_query)
{
    $html = '<form method="post" action="tbl_tracking.php' . $url_query . '">';
    $html .= '<select name="table" class="autosubmit">';
    while ($entries = $GLOBALS['dbi']->fetchArray($selectable_tables_sql_result)) {
        if (PMA_Tracker::isTracked($entries['db_name'], $entries['table_name'])) {
            $status = ' (' . __('active') . ')';
        } else {
            $status = ' (' . __('not active') . ')';
        }
        if ($entries['table_name'] == $_REQUEST['table']) {
            $s = ' selected="selected"';
        } else {
            $s = '';
        }
        $html .= '<option value="' . htmlspecialchars($entries['table_name']) . '"' . $s . '>' . htmlspecialchars($entries['db_name']) . ' . ' . htmlspecialchars($entries['table_name']) . $status . '</option>' . "\n";
    }
    $html .= '</select>';
    $html .= '<input type="hidden" name="show_versions_submit" value="1" />';
    $html .= '</form>';
    return $html;
}
开发者ID:saisai,项目名称:phpmyadmin,代码行数:30,代码来源:tracking.lib.php

示例7: unset

         $overhead_size += $tbl_stats['Data_free'];
     }
     if (isset($formatted_overhead)) {
         $overhead = $formatted_overhead . ' ' . $overhead_unit;
         unset($formatted_overhead);
     } else {
         $overhead = '-';
     }
 }
 $new_table_string = '<tr>' . "\n";
 $new_table_string .= '<td align="center"> <input type="checkbox" id="checkbox_tbl_" name="selected_tbl[]" value="' . htmlspecialchars($table) . '" /> </td>' . "\n";
 $new_table_string .= '<th>';
 $new_table_string .= '<a href="sql.php' . PMA_generate_common_url($tbl_url_params) . '">' . htmlspecialchars($table) . '</a>';
 if (PMA_Tracker::isActive()) {
     $truename = str_replace(' ', '&nbsp;', htmlspecialchars($table));
     if (PMA_Tracker::isTracked($db, $truename)) {
         $new_table_string .= '<a href="tbl_tracking.php' . PMA_generate_common_url($tbl_url_params) . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye.png" alt="' . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>';
     } elseif (PMA_Tracker::getVersion($db, $truename) > 0) {
         $new_table_string .= '<a href="tbl_tracking.php' . PMA_generate_common_url($tbl_url_params) . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye_grey.png" alt="' . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>';
     }
     unset($truename);
 }
 $new_table_string .= '</th>' . "\n";
 $new_table_string .= '<td>' . $titles['NoBrowse'] . '</td>' . "\n";
 $new_table_string .= '<td><a href="tbl_structure.php' . PMA_generate_common_url($tbl_url_params) . '">' . $titles['Structure'] . '</a></td>' . "\n";
 $new_table_string .= '<td>' . $titles['NoSearch'] . '</td>' . "\n";
 $new_table_string .= '<td><a href="tbl_change.php' . PMA_generate_common_url($tbl_url_params) . '">' . $titles['Insert'] . '</a></td>' . "\n";
 $new_table_string .= '<td>' . $titles['NoEmpty'] . '</td>' . "\n";
 $new_table_string .= '<td><a class="drop_table_anchor" href="sql.php' . PMA_generate_common_url($tbl_url_params) . '&amp;sql_query=';
 $new_table_string .= urlencode('DROP TABLE ' . PMA_backquote($table));
 $new_table_string .= '">';
开发者ID:hackersforcharity,项目名称:rachelpiOS,代码行数:31,代码来源:tbl_create.php

示例8: PMA_URL_getCommon

require_once './libraries/bookmark.lib.php';
// Check parameters
PMA_Util::checkParameters(array('db', 'table'));
$db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($db);
/**
 * Set parameters for links
 * @deprecated
 */
$url_query = PMA_URL_getCommon(array('db' => $db, 'table' => $table));
/**
 * Set parameters for links
 */
$url_params = array();
$url_params['db'] = $db;
$url_params['table'] = $table;
/**
 * Defines the urls to return to in case of error in a sql statement
 */
$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_URL_getCommon(array('db' => $db));
$err_url = $cfg['DefaultTabTable'] . PMA_URL_getCommon($url_params);
/**
 * Ensures the database and the table exist (else move to the "parent" script)
 */
require_once './libraries/db_table_exists.lib.php';
if (PMA_Tracker::isActive() && PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"]) && !isset($_REQUEST['submit_deactivate_now']) && !(isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldumpfile')) {
    $temp_msg = '<a href="tbl_tracking.php' . $url_query . '">';
    $temp_msg .= sprintf(__('Tracking of %s is activated.'), htmlspecialchars($GLOBALS["db"] . '.' . $GLOBALS["table"]));
    $temp_msg .= '</a>';
    $msg = PMA_Message::notice($temp_msg);
    PMA_Response::getInstance()->addHTML($msg->getDisplay());
}
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:31,代码来源:tbl_common.inc.php

示例9: PMA_URL_getCommon

$db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($db);
/**
 * Set parameters for links
 * @deprecated
 */
$url_query = PMA_URL_getCommon($db, $table);
/**
 * Set parameters for links
 */
$url_params = array();
$url_params['db'] = $db;
$url_params['table'] = $table;
/**
 * Defines the urls to return to in case of error in a sql statement
 */
$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_URL_getCommon(array('db' => $db));
$err_url = $cfg['DefaultTabTable'] . PMA_URL_getCommon($url_params);
/**
 * Ensures the database and the table exist (else move to the "parent" script)
 */
require_once './libraries/db_table_exists.lib.php';
if (PMA_Tracker::isActive() && PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"]) && !isset($_REQUEST['submit_deactivate_now'])) {
    $temp_msg = '<a href="tbl_tracking.php?' . $url_query . '">';
    $temp_msg .= sprintf(__('Tracking of %s is activated.'), htmlspecialchars($GLOBALS["db"] . '.' . $GLOBALS["table"]));
    $temp_msg .= '</a>';
    $msg = PMA_Message::notice($temp_msg);
    $msg->display();
}
?>
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:30,代码来源:tbl_common.inc.php


注:本文中的PMA_Tracker::isTracked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。