Révision 76bdcd04
Ajouté par Assos Assos il y a presque 6 ans
drupal7/sites/all/modules/print/print_mail/print_mail.install | ||
---|---|---|
11 | 11 |
* Implements hook_enable(). |
12 | 12 |
*/ |
13 | 13 |
function print_mail_enable() { |
14 |
$t = get_t(); |
|
15 |
|
|
16 |
// Module weight |
|
14 |
// Module weight. |
|
17 | 15 |
db_update('system') |
18 | 16 |
->fields(array( |
19 | 17 |
'weight' => 1, |
... | ... | |
27 | 25 |
} |
28 | 26 |
} |
29 | 27 |
|
28 |
/** |
|
29 |
* Implements hook_requirements(). |
|
30 |
*/ |
|
31 |
function print_mail_requirements($phase) { |
|
32 |
$requirements = array(); |
|
33 |
$t = get_t(); |
|
34 |
switch ($phase) { |
|
35 |
// At runtime, make sure that a PDF generation tool is selected. |
|
36 |
case 'runtime': |
|
37 |
if (module_exists('mailsystem')) { |
|
38 |
$mail_system = mailsystem_get(); |
|
39 |
if (($mail_system['default-system'] != 'DefaultMailSystem') && (!isset($mail_system['print_mail']) || ($mail_system['print_mail'] != 'DefaultMailSystem'))) { |
|
40 |
$requirements['print_mail_mailsystem'] = array( |
|
41 |
'title' => $t('Printer, email and PDF versions - Send by email'), |
|
42 |
'value' => $t('Incompatible Mail System setting detected'), |
|
43 |
'description' => $t('The send by email module requires the use of the DefaultMailSystem, please configure it in the !url.', array('!url' => l($t('Mail System Settings page'), 'admin/config/system/mailsystem'))), |
|
44 |
'severity' => REQUIREMENT_WARNING, |
|
45 |
); |
|
46 |
} |
|
47 |
} |
|
48 |
} |
|
49 |
|
|
50 |
return $requirements; |
|
51 |
} |
|
52 |
|
|
30 | 53 |
/** |
31 | 54 |
* Implements hook_disable(). |
32 | 55 |
*/ |
... | ... | |
40 | 63 |
* Implements hook_uninstall(). |
41 | 64 |
*/ |
42 | 65 |
function print_mail_uninstall() { |
43 |
variable_del('print_mail_settings'); |
|
44 |
variable_del('print_mail_show_link'); |
|
45 |
variable_del('print_mail_link_pos'); |
|
46 |
variable_del('print_mail_link_teaser'); |
|
47 |
variable_del('print_mail_node_link_visibility'); |
|
48 |
variable_del('print_mail_node_link_pages'); |
|
49 |
variable_del('print_mail_link_class'); |
|
50 |
variable_del('print_mail_sys_link_visibility'); |
|
51 |
variable_del('print_mail_sys_link_pages'); |
|
52 |
variable_del('print_mail_book_link'); |
|
66 |
variable_del('print_mail_display_sys_urllist'); |
|
53 | 67 |
variable_del('print_mail_hourly_threshold'); |
54 |
variable_del('print_mail_use_reply_to'); |
|
55 |
variable_del('print_mail_teaser_default'); |
|
56 |
variable_del('print_mail_teaser_choice'); |
|
68 |
variable_del('print_mail_job_queue'); |
|
57 | 69 |
variable_del('print_mail_link_text'); |
70 |
variable_del('print_mail_link_text_enabled'); |
|
71 |
variable_del('print_mail_send_option_default'); |
|
72 |
variable_del('print_mail_teaser_choice'); |
|
73 |
variable_del('print_mail_teaser_default'); |
|
74 |
variable_del('print_mail_use_reply_to'); |
|
75 |
variable_del('print_mail_user_recipients'); |
|
76 |
|
|
77 |
variable_del('print_mail_book_link'); |
|
78 |
variable_del('print_mail_link_class'); |
|
79 |
variable_del('print_mail_link_pos'); |
|
80 |
variable_del('print_mail_link_teaser'); |
|
58 | 81 |
variable_del('print_mail_link_use_alias'); |
59 |
variable_del('print_mail_text_title'); |
|
60 |
variable_del('print_mail_text_confirmation'); |
|
61 |
variable_del('print_mail_text_message'); |
|
62 |
variable_del('print_mail_text_subject'); |
|
63 |
variable_del('print_mail_text_content'); |
|
64 |
variable_del('print_mail_job_queue'); |
|
65 |
variable_del('print_mail_display_sys_urllist'); |
|
82 |
variable_del('print_mail_show_link'); |
|
83 |
variable_del('print_mail_sys_link_pages'); |
|
84 |
variable_del('print_mail_sys_link_visibility'); |
|
85 |
|
|
66 | 86 |
$settings = db_query("SELECT name FROM {variable} WHERE name LIKE 'print\_mail\_display\_%'"); |
67 | 87 |
foreach ($settings as $variable) { |
68 | 88 |
variable_del($variable->name); |
... | ... | |
157 | 177 |
} |
158 | 178 |
|
159 | 179 |
/** |
160 |
* Remove hardcoded numeric deltas from all blocks |
|
180 |
* Remove hardcoded numeric deltas from all blocks.
|
|
161 | 181 |
*/ |
162 | 182 |
function print_mail_update_7000(&$sandbox) { |
163 | 183 |
$renamed_deltas = array( |
... | ... | |
170 | 190 |
} |
171 | 191 |
|
172 | 192 |
/** |
173 |
* Disable MimeMailSystem for now |
|
193 |
* Disable MimeMailSystem for now.
|
|
174 | 194 |
*/ |
175 | 195 |
function print_mail_update_7100(&$sandbox) { |
176 | 196 |
if (module_exists('mailsystem')) { |
... | ... | |
179 | 199 |
} |
180 | 200 |
|
181 | 201 |
/** |
182 |
* Update permissions to new spellings |
|
202 |
* Update permissions to new spellings.
|
|
183 | 203 |
*/ |
184 | 204 |
function print_mail_update_7101(&$sandbox) { |
185 | 205 |
db_update('role_permission') |
... | ... | |
193 | 213 |
} |
194 | 214 |
|
195 | 215 |
/** |
196 |
* Enable block and help area links
|
|
216 |
* Delete old variables.
|
|
197 | 217 |
*/ |
198 |
function print_mail_update_7102(&$sandbox) { |
|
218 |
function print_mail_update_7200(&$sandbox) { |
|
219 |
variable_del('print_mail_settings'); |
|
220 |
|
|
221 |
variable_del('print_mail_node_link_pages'); |
|
222 |
variable_del('print_mail_node_link_visibility'); |
|
223 |
|
|
224 |
variable_del('print_mail_text_title'); |
|
225 |
variable_del('print_mail_text_confirmation'); |
|
226 |
variable_del('print_mail_text_message'); |
|
227 |
variable_del('print_mail_text_subject'); |
|
228 |
variable_del('print_mail_text_content'); |
|
229 |
} |
|
230 |
|
|
231 |
/** |
|
232 |
* Enable block and help area links. |
|
233 |
*/ |
|
234 |
function print_mail_update_7202(&$sandbox) { |
|
199 | 235 |
$link_pos = variable_get('print_mail_link_pos', drupal_json_decode('{ "link": "link", "block": "block", "help": "help" }')); |
200 | 236 |
$link_pos['block'] = 'block'; |
201 | 237 |
$link_pos['help'] = 'help'; |
... | ... | |
203 | 239 |
} |
204 | 240 |
|
205 | 241 |
/** |
206 |
* Increase size of the path field in the print_mail_page_counter table |
|
242 |
* Increase size of the path field in the print_mail_page_counter table.
|
|
207 | 243 |
*/ |
208 |
function print_mail_update_7103(&$sandbox) {
|
|
244 |
function print_mail_update_7203(&$sandbox) {
|
|
209 | 245 |
db_drop_primary_key('print_mail_page_counter'); |
210 | 246 |
db_change_field('print_mail_page_counter', 'path', 'path', |
211 |
array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'description' => 'Page path'), |
|
247 |
array( |
|
248 |
'type' => 'varchar', |
|
249 |
'length' => 255, |
|
250 |
'not null' => TRUE, |
|
251 |
'description' => 'Page path', |
|
252 |
), |
|
212 | 253 |
array('primary key' => array('path'))); |
213 | 254 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules