Skip to content
Browse files

Updated export and import pages

  • Loading branch information...
1 parent dd3ee29 commit 9e86ca1580782335e68f887d04a8c18b6f74018c @shakty committed Apr 22, 2012
Showing with 11 additions and 13 deletions.
  1. +7 −8 includes/forms/export.inc
  2. +4 −5 includes/forms/import.inc
View
15 includes/forms/export.inc
@@ -24,7 +24,7 @@ function _patterns_export_goto($form, &$form_state, $step) {
return $form;
- $tm_index = patterns_api_build_tagmodules_index();
+ $tm_index = patterns_tagmodules_get_index();
$tag = $form_state['values']['options'];
$func_id = $form_state['values'][$tag];
@@ -144,7 +144,8 @@ function patterns_export($form, &$form_state) {
function patterns_export_page1($form, &$form_state) {
- $tm_index = patterns_api_build_tagmodules_index(null, null, PATTERNS_EXPORT);
+ $tm_index = patterns_tagmodules_get_index();
+ $tm_index = patterns_tagmodules_filter($tm_index, null, PATTERNS_EXPORT);
if (count($tm_index) == 0) {
drupal_set_message(t('The components currently installed do not allow automatic export of the configuration of the web site'), 'error');
@@ -156,11 +157,9 @@ function patterns_export_page1($form, &$form_state) {
return $form;
}
- $form['intro'] = array (
- '#markup' => t('In this area you can export the current configuration of your web site to a new pattern file that will be inserted in the database.'),
- '#prefix' => '<div id="intro_export"><strong>Export: </strong>',
- '#suffix' => '<hr><br/></div>',
- );
+ $text = 'In this area you can export the current configuration of your web site to a new pattern file that will be inserted in the database.';
+ $title = 'Export (experimental!)';
+ patterns_forms_add_page_header($form, $title, $text);
$form['all'] = array (
'#type' => 'fieldset',
@@ -248,7 +247,7 @@ function patterns_export_page1($form, &$form_state) {
function patterns_export_submit($form, &$form_state) {
- $tm_index = patterns_api_build_tagmodules_index();
+ $tm_index = patterns_tagmodules_get_index();
$format = $form_state['values']['format'];
$filename = $form_state['values']['pattern_name'];
// TODO: Loop here and create a modules section
View
9 includes/forms/import.inc
@@ -15,11 +15,10 @@ function patterns_import_source($form, &$form_state) {
$def_dir = patterns_path_get_files_dir();
- $form['intro'] = array (
- '#markup' => t('Cut and paste the content of a pattern file in the text area below to import it in the database.'),
- '#prefix' => '<div id="intro_export"><strong>Import from Source: </strong>',
- '#suffix' => '<hr><br/></div>',
- );
+ $text = 'Cut and paste the content of a pattern file in the text area below to import it in the database.';
+ $title = 'Import from Source';
+ patterns_forms_add_page_header($form, $title, $text);
+
$form['name'] = array(
'#type' => 'textfield',

0 comments on commit 9e86ca1

Please sign in to comment.
Something went wrong with that request. Please try again.