/[drupal]/contributions/modules/site_country/site_country.module
ViewVC logotype

Contents of /contributions/modules/site_country/site_country.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Wed Nov 12 14:21:37 2008 UTC (12 months, 2 weeks ago) by snpower
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
File MIME type: text/x-php
Fixed whitespace issue.
1 <?php
2 // $Id: site_country.module,v 1.1.2.4 2008/11/12 14:21:17 snpower Exp $
3
4 /**
5 * @file
6 * Helper module to add support to Drupal for a site default country.
7 */
8
9 /**
10 * Implementation of hook_boot().
11 *
12 * This function is present so other modules requiring this one during bootstrap
13 * can use its functions.
14 */
15 function site_country_boot() {
16 }
17
18 /**
19 * Implementation of hook_form_alter().
20 *
21 * Show site default country setting on 'site information' config form.
22 */
23 function site_country_form_system_site_information_settings_alter(&$form, $form_state) {
24 $countries = site_country_country_list();
25 $form['site_country_default_country'] = array(
26 '#type' => 'select',
27 '#title' => t('Default country'),
28 '#default_value' => variable_get('site_country_default_country', ''),
29 '#options' => $countries,
30 '#description' => t('Select the default country for the site.'),
31 );
32 $form['buttons']['#weight'] = 2;
33 }
34
35 /**
36 * Get an array of all country code => country name pairs.
37 *
38 * @return
39 * An array of all country code => country name pairs.
40 */
41 function site_country_country_list() {
42 // drupal_get_path() is not declared yet.
43 $path = dirname(__FILE__) . '/site_country_country_list.inc';
44 include_once($path);
45 return _site_country_country_list();
46 }
47

  ViewVC Help
Powered by ViewVC 1.1.2