Import source (create a pattern), file or URL

When we create a pattern (import source), the behaviour will be similar to the one explained previously for quick-run, but constructing a more complex form that allows the users to create some extra metadata. The same idea applies to “Import file” and “Import from URL”, they will return a different form than “Import source”, but the validation and submission (patterns_import_validate() and patterns_import_submit() in the file includes/forms/import.inc) functions are shared between all of them.

The diagram below provides a general overview, and the main functions involved are detailed in the next subsections:

Importing a pattern

Import source

  • The function patterns_editor() of the file includes/editor.inc is called, using "patterns_import_source" as a value for the parameter $form_id.
  • The form then will be constructed using drupal_get_form(), that will call the function function patterns_import_source() in the file includes/import.inc.
Subscribe with RSS Subscribe to RSS - create