~ubuntu-fr/ubuntu-fr-website/www.dev

« back to all changes in this revision

Viewing changes to sites/all/modules/token/token.install

  • Committer: Vincent Liefooghe
  • Date: 2010-11-16 20:51:54 UTC
  • Revision ID: vl@ubuntovo-20101116205154-fuyfka524rm2zgni
Mise à jour des modules Backup & Migrate, Image API, Token et Pathauto

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
// $Id: token.install,v 1.2.2.1 2008/06/28 15:10:22 greggles Exp $
 
2
// $Id: token.install,v 1.2.2.2 2010/09/24 20:37:21 davereid Exp $
3
3
 
4
4
/**
5
5
 * @file
8
8
 * @ingroup token
9
9
 */
10
10
 
 
11
/**
 
12
 * Implements hook_requirements().
 
13
 */
 
14
function token_requirements($phase = 'runtime') {
 
15
  $requirements = array();
 
16
  $t = get_t();
 
17
 
 
18
  // Check for duplicate tokens.
 
19
  if ($phase == 'runtime') {
 
20
    if ($duplicate_tokens = token_find_duplicate_tokens()) {
 
21
      foreach ($duplicate_tokens as $token => $modules) {
 
22
        $duplicate_tokens[$token] = t('@token (defined by modules: @modules)', array('@token' => $token, '@modules' => implode(', ', $modules)));
 
23
      }
 
24
      $requirements['token_duplicates'] = array(
 
25
        'title' => $t('Duplicate tokens'),
 
26
        'value' => $t('The following tokens are defined by multiple modules and may cause problems when performing token replacement.'),
 
27
        'severity' => REQUIREMENT_WARNING,
 
28
        'description' => theme('item_list', $duplicate_tokens),
 
29
      );
 
30
    }
 
31
  }
 
32
 
 
33
  return $requirements;
 
34
}
 
35
 
11
36
function token_install() {
12
37
  db_query("UPDATE {system} SET weight = 10 WHERE name = 'token'");
13
38
}
16
41
  $ret = array();
17
42
  $ret[] = update_sql("UPDATE {system} SET weight = 10 WHERE name = 'token'");
18
43
  return $ret;
19
 
}
 
 
b'\\ No newline at end of file'
 
44
}