Révision 1aa883a3
Ajouté par Assos Assos il y a plus de 5 ans
drupal7/sites/all/modules/print/print_epub/print_epub.module | ||
---|---|---|
121 | 121 |
return $block; |
122 | 122 |
} |
123 | 123 |
|
124 |
/** |
|
125 |
* Implements hook_requirements(). |
|
126 |
*/ |
|
127 |
function print_epub_requirements($phase) { |
|
128 |
$requirements = array(); |
|
129 |
$t = get_t(); |
|
130 |
switch ($phase) { |
|
131 |
// At runtime, make sure that a EPUB generation tool is selected. |
|
132 |
case 'runtime': |
|
133 |
$print_epub_epub_tool = variable_get('print_epub_epub_tool', PRINT_EPUB_EPUB_TOOL_DEFAULT); |
|
134 |
if (empty($print_epub_epub_tool)) { |
|
135 |
$requirements['print_epub_tool'] = array( |
|
136 |
'title' => $t('Printer, email and EPUB versions - EPUB generation library'), |
|
137 |
'value' => $t('No EPUB tool selected'), |
|
138 |
'description' => $t('Please configure it in the !url.', array('!url' => l($t('EPUB settings page'), 'admin/config/user-interface/print/epub'))), |
|
139 |
'severity' => REQUIREMENT_ERROR, |
|
140 |
); |
|
141 |
} |
|
142 |
else { |
|
143 |
$tool = explode('|', $print_epub_epub_tool); |
|
144 |
|
|
145 |
if (!is_file($tool[1]) || !is_readable($tool[1])) { |
|
146 |
$requirements['print_epub_tool'] = array( |
|
147 |
'title' => $t('Printer, email and EPUB versions - EPUB generation library'), |
|
148 |
'value' => $t('File not found'), |
|
149 |
'description' => $t('The currently selected EPUB generation library (%file) is no longer accessible.', array('%file' => $tool[1])), |
|
150 |
'severity' => REQUIREMENT_ERROR, |
|
151 |
); |
|
152 |
} |
|
153 |
} |
|
154 |
break; |
|
155 |
} |
|
156 |
return $requirements; |
|
157 |
} |
|
158 |
|
|
159 | 124 |
/** |
160 | 125 |
* Implements hook_node_delete(). |
161 | 126 |
*/ |
Formats disponibles : Unified diff
Weekly update of contrib modules