Beispiel #1
0
/**
 * Function to get html for displaying last version number
 *
 * @param array  $sql_result    sql result
 * @param int    $last_version  last version
 * @param array  $url_params    url parameters
 * @param string $url_query     url query
 * @param string $pmaThemeImage path to theme's image folder
 * @param string $text_dir      text direction
 *
 * @return string
 */
function PMA_getHtmlForTableVersionDetails($sql_result, $last_version, $url_params, $url_query, $pmaThemeImage, $text_dir)
{
    $tracking_active = false;
    $html = '<form method="post" action="tbl_tracking.php" name="versionsForm"' . ' id="versionsForm" class="ajax">';
    $html .= PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']);
    $html .= '<table id="versions" class="data">';
    $html .= '<thead>';
    $html .= '<tr>';
    $html .= '<th></th>';
    $html .= '<th>' . __('Version') . '</th>';
    $html .= '<th>' . __('Created') . '</th>';
    $html .= '<th>' . __('Updated') . '</th>';
    $html .= '<th>' . __('Status') . '</th>';
    $html .= '<th>' . __('Action') . '</th>';
    $html .= '<th>' . __('Show') . '</th>';
    $html .= '</tr>';
    $html .= '</thead>';
    $html .= '<tbody>';
    $style = 'odd';
    $GLOBALS['dbi']->dataSeek($sql_result, 0);
    $delete = PMA_Util::getIcon('b_drop.png', __('Delete version'));
    $report = PMA_Util::getIcon('b_report.png', __('Tracking report'));
    $structure = PMA_Util::getIcon('b_props.png', __('Structure snapshot'));
    while ($version = $GLOBALS['dbi']->fetchArray($sql_result)) {
        if ($version['version'] == $last_version) {
            if ($version['tracking_active'] == 1) {
                $tracking_active = true;
            } else {
                $tracking_active = false;
            }
        }
        $delete_link = 'tbl_tracking.php' . $url_query . '&amp;version=' . htmlspecialchars($version['version']) . '&amp;submit_delete_version=true';
        $checkbox_id = 'selected_versions_' . htmlspecialchars($version['version']);
        $html .= '<tr class="' . $style . '">';
        $html .= '<td class="center">';
        $html .= '<input type="checkbox" name="selected_versions[]"' . ' class="checkall" id="' . $checkbox_id . '"' . ' value="' . htmlspecialchars($version['version']) . '"/>';
        $html .= '</td>';
        $html .= '<th class="floatright">';
        $html .= '<label for="' . $checkbox_id . '">' . htmlspecialchars($version['version']) . '</label>';
        $html .= '</th>';
        $html .= '<td>' . htmlspecialchars($version['date_created']) . '</td>';
        $html .= '<td>' . htmlspecialchars($version['date_updated']) . '</td>';
        $html .= '<td>' . PMA_getVersionStatus($version) . '</td>';
        $html .= '<td><a class="delete_version_anchor ajax"' . ' href="' . $delete_link . '" >' . $delete . '</a></td>';
        $html .= '<td><a href="tbl_tracking.php';
        $html .= PMA_URL_getCommon($url_params + array('report' => 'true', 'version' => $version['version']));
        $html .= '">' . $report . '</a>';
        $html .= '&nbsp;&nbsp;';
        $html .= '<a href="tbl_tracking.php';
        $html .= PMA_URL_getCommon($url_params + array('snapshot' => 'true', 'version' => $version['version']));
        $html .= '">' . $structure . '</a>';
        $html .= '</td>';
        $html .= '</tr>';
        if ($style == 'even') {
            $style = 'odd';
        } else {
            $style = 'even';
        }
    }
    $html .= '</tbody>';
    $html .= '</table>';
    $html .= PMA_Util::getWithSelected($pmaThemeImage, $text_dir, "versionsForm");
    $html .= PMA_Util::getButtonOrImage('submit_mult', 'mult_submit', 'submit_mult_delete_version', __('Delete version'), 'b_drop.png', 'delete_version');
    $html .= '</form>';
    if ($tracking_active) {
        $html .= PMA_getHtmlForActivateDeactivateTracking('deactivate', $url_query, $last_version);
    } else {
        $html .= PMA_getHtmlForActivateDeactivateTracking('activate', $url_query, $last_version);
    }
    return $html;
}
Beispiel #2
0
        ?>
</td>
            <td><?php 
        echo $version_data['version'];
        ?>
</td>
            <td><?php 
        echo $version_data['date_created'];
        ?>
</td>
            <td><?php 
        echo $version_data['date_updated'];
        ?>
</td>
            <td><?php 
        echo PMA_getVersionStatus($version_data);
        ?>
</td>
            <td>
            <a class="drop_tracking_anchor ajax" href="<?php 
        echo $delete_link;
        ?>
" >
            <?php 
        echo $drop_image_or_text;
        ?>
</a>
        <?php 
        echo '</td>' . '<td>' . '<a href="' . $tmp_link . '">' . __('Versions') . '</a>' . '&nbsp;|&nbsp;' . '<a href="' . $tmp_link . '&amp;report=true&amp;version=' . $version_data['version'] . '">' . __('Tracking report') . '</a>' . '&nbsp;|&nbsp;' . '<a href="' . $tmp_link . '&amp;snapshot=true&amp;version=' . $version_data['version'] . '">' . __('Structure snapshot') . '</a>' . '</td>' . '</tr>';
        if ($style == 'even') {
            $style = 'odd';
Beispiel #3
0
/**
 * Display tracking status button
 *
 * @param array  $version_data data about tracking versions
 * @param string $tbl_link     link for tbl_tracking.php
 *
 * @return void
 */
function PMA_displayStatusButton($version_data, $tbl_link)
{
    $state = PMA_getVersionStatus($version_data);
    $options = array(0 => array('label' => __('not active'), 'value' => 'deactivate_now', 'selected' => $state != 'active'), 1 => array('label' => __('active'), 'value' => 'activate_now', 'selected' => $state == 'active'));
    echo PMA\libraries\Util::toggleButton($tbl_link . '&amp;version=' . $version_data['version'], 'toggle_activation', $options, null);
}
Beispiel #4
0
            </th>
            <td class="right"><?php 
        echo $version_data['version'];
        ?>
</td>
            <td><?php 
        echo $version_data['date_created'];
        ?>
</td>
            <td><?php 
        echo $version_data['date_updated'];
        ?>
</td>
            <td>
            <?php 
        $state = PMA_getVersionStatus($version_data);
        $options = array(0 => array('label' => __('not active'), 'value' => 'deactivate_now', 'selected' => $state != 'active'), 1 => array('label' => __('active'), 'value' => 'activate_now', 'selected' => $state == 'active'));
        echo PMA_Util::toggleButton($tmp_link . '&amp;version=' . $version_data['version'], 'toggle_activation', $options, null);
        ?>
            </td>
            <td>
            <a class="delete_tracking_anchor ajax"
               href="<?php 
        echo $delete_link;
        ?>
" >
            <?php 
        echo $delete;
        ?>
</a>
        <?php 
/**
 * Function to get html for displaying last version number
 *
 * @param array  $sql_result   sql result
 * @param int    $last_version last version
 * @param array  $url_params   url parameters
 * @param string $url_query    url query
 *
 * @return string
 */
function PMA_getHtmlForTableVersionDetails($sql_result, $last_version, $url_params, $url_query)
{
    $tracking_active = false;
    $html = '<table id="versions" class="data">';
    $html .= '<thead>';
    $html .= '<tr>';
    $html .= '<th>' . __('Database') . '</th>';
    $html .= '<th>' . __('Table') . '</th>';
    $html .= '<th>' . __('Version') . '</th>';
    $html .= '<th>' . __('Created') . '</th>';
    $html .= '<th>' . __('Updated') . '</th>';
    $html .= '<th>' . __('Status') . '</th>';
    $html .= '<th>' . __('Show') . '</th>';
    $html .= '</tr>';
    $html .= '</thead>';
    $html .= '<tbody>';
    $style = 'odd';
    $GLOBALS['dbi']->dataSeek($sql_result, 0);
    while ($version = $GLOBALS['dbi']->fetchArray($sql_result)) {
        if ($version['version'] == $last_version) {
            if ($version['tracking_active'] == 1) {
                $tracking_active = true;
            } else {
                $tracking_active = false;
            }
        }
        $html .= '<tr class="noclick ' . $style . '">';
        $html .= '<td>' . htmlspecialchars($version['db_name']) . '</td>';
        $html .= '<td>' . htmlspecialchars($version['table_name']) . '</td>';
        $html .= '<td>' . htmlspecialchars($version['version']) . '</td>';
        $html .= '<td>' . htmlspecialchars($version['date_created']) . '</td>';
        $html .= '<td>' . htmlspecialchars($version['date_updated']) . '</td>';
        $html .= '<td>' . PMA_getVersionStatus($version) . '</td>';
        $html .= '<td><a href="tbl_tracking.php';
        $html .= PMA_URL_getCommon($url_params + array('report' => 'true', 'version' => $version['version']));
        $html .= '">' . __('Tracking report') . '</a>';
        $html .= '&nbsp;|&nbsp;';
        $html .= '<a href="tbl_tracking.php';
        $html .= PMA_URL_getCommon($url_params + array('snapshot' => 'true', 'version' => $version['version']));
        $html .= '">' . __('Structure snapshot') . '</a>';
        $html .= '</td>';
        $html .= '</tr>';
        if ($style == 'even') {
            $style = 'odd';
        } else {
            $style = 'even';
        }
    }
    $html .= '</tbody>';
    $html .= '</table>';
    if ($tracking_active) {
        $html .= PMA_getHtmlForActivateDeactivateTracking('deactivate', $url_query, $last_version);
    } else {
        $html .= PMA_getHtmlForActivateDeactivateTracking('activate', $url_query, $last_version);
    }
    return $html;
}