-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathextjs.install
42 lines (39 loc) · 1.43 KB
/
extjs.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @file
*
* The install hooks for this module.
*/
/**
* Implementation of hook_requirements().
*/
function extjs_requirements($phase) {
include_once dirname(__FILE__) . '/extjs.utils.inc'; // module_load_include() isn't avaliable during the 'install' $phase
$t = get_t();
$requirements = array(
'extjs' => array('title' => $t('Sencha ExtJS Library'))
);
$version = extjs_get_version();
if ($version !== FALSE && version_compare($version, '4.0.0') >= 0) {
$requirements['extjs']['severity'] = REQUIREMENT_OK;
$requirements['extjs']['value'] = $version;
}
else {
$requirements['extjs']['severity'] = REQUIREMENT_ERROR;
$requirements['extjs']['value'] = $t('Not found');
$requirements['extjs']['description'] = $t('The <a href="@extjs">Sencha ExtJS Library</a> plugin is missing. <a href="@download">Download</a> and extract it into the <code>@directory</code> directory. Rename the extracted folder to <code>@library-folder</code>.', array(
'@extjs' => 'http://www.sencha.com/',
'@download' => 'http://www.sencha.com/products/extjs/download?page=a',
'@directory' => 'sites/all/libraries',
'@library-folder' => 'extjs')
);
}
return $requirements;
}
/**
* Implementation of hook_install().
*/
function extjs_install() {
// Set the module's weight high so that it runs after other modules.
db_query("UPDATE {system} SET weight = 99 WHERE name = 'extjs' and type = 'module'");
}