Exemplo n.º 1
0
 /**
  * Provides html elements for search criteria inputbox
  * in case the column's type is geometrical
  *
  * @param int  $column_index Column's index
  * @param bool $in_fbs       Whether we are in 'function based search'
  *
  * @return string HTML elements.
  */
 private function _getGeometricalInputBox($column_index, $in_fbs)
 {
     $html_output = '<input type="text" name="criteriaValues[' . $column_index . ']"' . ' size="40" class="textfield" id="field_' . $column_index . '" />';
     if ($in_fbs) {
         $edit_url = 'gis_data_editor.php?' . PMA_URL_getCommon();
         $edit_str = PMA_Util::getIcon('b_edit.png', __('Edit/Insert'));
         $html_output .= '<span class="open_search_gis_editor">';
         $html_output .= PMA_Util::linkOrButton($edit_url, $edit_str, array(), false, false, '_blank');
         $html_output .= '</span>';
     }
     return $html_output;
 }
Exemplo n.º 2
0
 /**
  * Prepares a Delete link
  *
  * @param string $del_url delete url
  * @param string $del_str text for the delete link
  * @param string $js_conf text for the JS confirmation
  * @param string $class   css classes for the td element
  *
  * @return string  the generated HTML
  *
  * @access  private
  *
  * @see     _getTableBody(), _getCheckboxAndLinks()
  */
 private function _getDeleteLink($del_url, $del_str, $js_conf, $class)
 {
     $ret = '';
     if (!empty($del_url)) {
         $ret .= '<td class="';
         if (!empty($class)) {
             $ret .= $class . ' ';
         }
         $ajax = PMA_Response::getInstance()->isAjax() ? ' ajax' : '';
         $ret .= 'center" ' . ' >' . PMA_Util::linkOrButton($del_url, $del_str, array('class' => 'delete_row requireConfirm' . $ajax), false) . '<div class="hide">' . $js_conf . '</div>' . '</td>';
     }
     return $ret;
 }
Exemplo n.º 3
0
/**
 * Get HTML for gis data types
 *
 * @return string an html snippet
 */
function PMA_getHTMLforGisDataTypes()
{
    $edit_str = PMA_Util::getIcon('b_edit.png', __('Edit/Insert'));
    return '<span class="open_gis_editor">' . PMA_Util::linkOrButton('#', $edit_str, array(), false, false, '_blank') . '</span>';
}
Exemplo n.º 4
0
/**
 * Get HTML for edit views'
 *
 * @param string $url_params URL parameters
 *
 * @return string $html_output
 */
function PMA_getHtmlForEditView($url_params)
{
    $query = "SELECT `VIEW_DEFINITION`, `CHECK_OPTION`, `DEFINER`, `SECURITY_TYPE`" . " FROM `INFORMATION_SCHEMA`.`VIEWS`" . " WHERE TABLE_SCHEMA='" . PMA_Util::sqlAddSlashes($GLOBALS['db']) . "'" . " AND TABLE_NAME='" . PMA_Util::sqlAddSlashes($GLOBALS['table']) . "';";
    $item = $GLOBALS['dbi']->fetchSingleRow($query);
    $view = array('operation' => 'alter', 'definer' => $item['DEFINER'], 'sql_security' => $item['SECURITY_TYPE'], 'name' => $GLOBALS['table'], 'as' => $item['VIEW_DEFINITION'], 'with' => $item['CHECK_OPTION']);
    $url = 'view_create.php' . PMA_URL_getCommon($url_params) . '&amp;';
    $url .= implode('&amp;', array_map(function ($key, $val) {
        return 'view[' . urlencode($key) . ']=' . urlencode($val);
    }, array_keys($view), $view));
    $html_output = PMA_Util::linkOrButton($url, PMA_Util::getIcon('b_edit.png', __('Edit view'), true));
    return $html_output;
}
Exemplo n.º 5
0
/**
 * Get HTML for edit views'
 *
 * @param string $url_params URL parameters
 *
 * @return string $html_output
 */
function PMA_getHtmlForEditView($url_params)
{
    $query = "SELECT `VIEW_DEFINITION`, `CHECK_OPTION`, `DEFINER`, `SECURITY_TYPE`" . " FROM `INFORMATION_SCHEMA`.`VIEWS`" . " WHERE TABLE_SCHEMA='" . PMA_Util::sqlAddSlashes($GLOBALS['db']) . "'" . " AND TABLE_NAME='" . PMA_Util::sqlAddSlashes($GLOBALS['table']) . "';";
    $item = $GLOBALS['dbi']->fetchSingleRow($query);
    $query = "SHOW CREATE TABLE " . PMA_Util::backquote($GLOBALS['db']) . "." . PMA_Util::backquote($GLOBALS['table']);
    $createView = $GLOBALS['dbi']->fetchValue($query, 0, 'Create View');
    // get algorithm from $createView of the form CREATE ALGORITHM=<ALGORITHM> DE...
    $parts = explode(" ", substr($createView, 17));
    $item['ALGORITHM'] = $parts[0];
    $view = array('operation' => 'alter', 'definer' => $item['DEFINER'], 'sql_security' => $item['SECURITY_TYPE'], 'name' => $GLOBALS['table'], 'as' => $item['VIEW_DEFINITION'], 'with' => $item['CHECK_OPTION'], 'algorithm' => $item['ALGORITHM']);
    $url = 'view_create.php' . PMA_URL_getCommon($url_params) . '&amp;';
    $url .= implode('&amp;', array_map(function ($key, $val) {
        return 'view[' . urlencode($key) . ']=' . urlencode($val);
    }, array_keys($view), $view));
    $html_output = PMA_Util::linkOrButton($url, PMA_Util::getIcon('b_edit.png', __('Edit view'), true));
    return $html_output;
}
Exemplo n.º 6
0
/**
 * Get HTML for edit views'
 *
 * @param string $url_params URL parameters
 *
 * @return string $html_output
 */
function PMA_getHtmlForEditView($url_params)
{
    $create_view = PMA_DBI_get_definition($GLOBALS['db'], 'VIEW', $GLOBALS['table']);
    $create_view = preg_replace('@^CREATE@', 'ALTER', $create_view);
    $html_output = PMA_Util::linkOrButton('tbl_sql.php' . PMA_generate_common_url($url_params + array('sql_query' => $create_view, 'show_query' => '1')), PMA_Util::getIcon('b_edit.png', __('Edit view'), true));
    return $html_output;
}
Exemplo n.º 7
0
 /**
  * Prepares a Delete link
  *
  * @param string $del_url delete url
  * @param string $del_str text for the delete link
  * @param string $js_conf text for the JS confirmation
  * @param string $class   css classes for the td element
  *
  * @return string  the generated HTML
  *
  * @access  private
  *
  * @see     _getTableBody(), _getCheckboxAndLinks()
  */
 private function _getDeleteLink($del_url, $del_str, $js_conf, $class)
 {
     $ret = '';
     if (!empty($del_url)) {
         $ret .= '<td class="';
         if (!empty($class)) {
             $ret .= $class . ' ';
         }
         $ret .= 'center" ' . ' >' . PMA_Util::linkOrButton($del_url, $del_str, $js_conf, false) . '</td>';
     }
     return $ret;
 }