Révision 76e2e7c3
Ajouté par Assos Assos il y a environ 10 ans
drupal7/sites/all/modules/flag/flag_bookmark/flag_bookmark.install | ||
---|---|---|
13 | 13 |
*/ |
14 | 14 |
function flag_bookmark_enable() { |
15 | 15 |
// Load the flag API in case we want to use it when enabling. |
16 |
include_once(drupal_get_path('module', 'flag') . '/flag.module');
|
|
16 |
include_once drupal_get_path('module', 'flag') . '/flag.module';
|
|
17 | 17 |
|
18 | 18 |
if (!flag_get_flags()) { |
19 | 19 |
// Install a demonstration flag only if no flag exists. This is to prevent |
... | ... | |
21 | 21 |
// flag is overwritten or re-created. |
22 | 22 |
$flag = flag_flag::factory_by_entity_type('node'); |
23 | 23 |
$configuration = array( |
24 |
'name' => 'bookmarks',
|
|
25 |
'global' => 0,
|
|
26 |
'show_in_links' => array(
|
|
27 |
'full' => 1,
|
|
28 |
'teaser' => 1,
|
|
29 |
),
|
|
30 |
'show_on_form' => 1,
|
|
31 |
// The following UI labels aren't wrapped in t() because they are written
|
|
32 |
// to the DB in English. They are passed to t() later, thus allowing for
|
|
33 |
// multilingual sites.
|
|
34 |
'title' => 'Bookmarks',
|
|
35 |
'flag_short' => 'Bookmark this',
|
|
36 |
'flag_long' => 'Add this post to your bookmarks',
|
|
37 |
'flag_message' => 'This post has been added to your bookmarks',
|
|
38 |
'unflag_short' => 'Unbookmark this',
|
|
39 |
'unflag_long' => 'Remove this post from your bookmarks',
|
|
40 |
'unflag_message' => 'This post has been removed from your bookmarks',
|
|
41 |
'types' => _flag_bookmark_install_get_suggested_node_types(),
|
|
24 |
'name' => 'bookmarks', |
|
25 |
'global' => 0, |
|
26 |
'show_in_links' => array( |
|
27 |
'full' => 1, |
|
28 |
'teaser' => 1, |
|
29 |
), |
|
30 |
'show_on_form' => 1, |
|
31 |
// The following UI labels aren't wrapped in t() because they are written |
|
32 |
// to the DB in English. They are passed to t() later, thus allowing for |
|
33 |
// multilingual sites. |
|
34 |
'title' => 'Bookmarks', |
|
35 |
'flag_short' => 'Bookmark this', |
|
36 |
'flag_long' => 'Add this post to your bookmarks', |
|
37 |
'flag_message' => 'This post has been added to your bookmarks', |
|
38 |
'unflag_short' => 'Unbookmark this', |
|
39 |
'unflag_long' => 'Remove this post from your bookmarks', |
|
40 |
'unflag_message' => 'This post has been removed from your bookmarks', |
|
41 |
'types' => _flag_bookmark_install_get_suggested_node_types(), |
|
42 | 42 |
); |
43 | 43 |
$flag->form_input($configuration); |
44 | 44 |
$flag->save(); |
... | ... | |
53 | 53 |
} |
54 | 54 |
|
55 | 55 |
/** |
56 |
* Returns some node types to which the demonstration 'bookmarks' flag will apply. |
|
56 |
* Returns some node types to which the demonstration 'bookmarks' flag will |
|
57 |
* apply. |
|
57 | 58 |
*/ |
58 | 59 |
function _flag_bookmark_install_get_suggested_node_types() { |
59 | 60 |
$preferred = array('article', 'story', 'forum', 'blog'); |
... | ... | |
64 | 65 |
} |
65 | 66 |
return $existing; |
66 | 67 |
} |
67 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules