18.10.2016 Views

Drupal 7 Module Development

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 12<br />

// URL filter.<br />

'filter_url' => array(<br />

'weight' => 0,<br />

'status' => 1,<br />

),<br />

// Line break filter.<br />

'filter_autop' => array(<br />

'weight' => 1,<br />

'status' => 1,<br />

),<br />

// HTML corrector filter.<br />

'filter_htmlcorrector' => array(<br />

'weight' => 10,<br />

'status' => 1,<br />

),<br />

),<br />

);<br />

$full_html_format = (object) $full_html_format;<br />

filter_format_save($full_html_format);<br />

Code placement<br />

Code placed in the .profile file will be loaded on every page load. This means<br />

that after <strong>Drupal</strong> is installed, the install tasks contained in the .profile file for the<br />

installation will be loaded all the time. Since the install tasks will only be used during<br />

the installer, they do not need to be loaded after that.<br />

The first step is to move the tasks to a different file that can be loaded only when<br />

needed. In this case let's create a file named store.install.inc in the installation<br />

profile and move the following install task functions into it:<br />

store_configure_contact_form()<br />

store_configure_contact_form_validate()<br />

store_configure_contact_form_submit()<br />

store_database_settings_form()<br />

store_database_settings_form_validate()<br />

store_database_settings_form_submit()<br />

store_create_content_types()<br />

[ 359 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!