Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Oct 29, 2014
2 parents eda8a2c + b17ff5b commit bdc4526
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions libraries/db_designer.lib.php
Expand Up @@ -11,6 +11,29 @@

require_once 'libraries/relation.lib.php';

/**
* Function to get html to display a page selector
*
* @param array $cfgRelation information about the configuration storage
* @param string $db database name
*
* @return string html content
*/
function PMA_getHtmlForPageSelector($cfgRelation, $db)
{
$html = '<select name="selected_page" id="selected_page">';
$html .= '<option value="0">-- ' . __('Select page') . ' --</option>';
if ($cfgRelation['pdfwork']) {
$pages = PMA_getPageIdsAndNames($db);
foreach ($pages as $nr => $desc) {
$html .= '<option value="' . $nr . '">';
$html .= htmlspecialchars($desc) . '</option>';
}
}
$html .= '</select>';
return $html;
}

/**
* Function to get html for displaying the page edit/delete form
*
Expand All @@ -34,16 +57,7 @@ function PMA_getHtmlForEditOrDeletePages($db, $operation)
$html .= __("Page to delete");
}
$html .= ': </label>';
$html .= '<select name="selected_page" id="selected_page">';
$html .= '<option value="0">-- ' . __('Select page') . ' --</option>';
if ($cfgRelation['pdfwork']) {
$pages = PMA_getPageIdsAndNames($db);
foreach ($pages as $nr => $desc) {
$html .= '<option value="' . $nr . '">';
$html .= htmlspecialchars($desc) . '</option>';
}
}
$html .= '</select>';
$html .= PMA_getHtmlForPageSelector($cfgRelation, $db);
$html .= '</fieldset>';
$html .= '</form>';
return $html;
Expand Down Expand Up @@ -73,17 +87,7 @@ function PMA_getHtmlForPageSaveAs($db)
$html .= '<tr>';
$html .= '<td>';
$html .= '<input type="hidden" name="operation" value="savePage" />';
$html .= '<select name="selected_page" id="selected_page">';
$html .= '<option value="0">-- ' . __('Select page') . ' --</option>';

if ($cfgRelation['pdfwork']) {
$pages = PMA_getPageIdsAndNames($db);
foreach ($pages as $nr => $desc) {
$html .= '<option value="' . $nr . '">';
$html .= htmlspecialchars($desc) . '</option>';
}
}
$html .= '</select>';
$html .= PMA_getHtmlForPageSelector($cfgRelation, $db);
$html .= '</td>';
$html .= '</tr>';

Expand Down

0 comments on commit bdc4526

Please sign in to comment.