FINAL suepr merge step : added all modules to this super repos
This commit is contained in:
33
sites/all/modules/contrib/admin/cobalt/cobalt_update.inc.php
Normal file
33
sites/all/modules/contrib/admin/cobalt/cobalt_update.inc.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
function cobalt_js_update() {
|
||||
$settings = array();
|
||||
$out = 'Updating the following: <ul>';
|
||||
for ($i=2; arg($i); $i+=3) {
|
||||
$module = arg($i);
|
||||
$from = arg($i+1);
|
||||
$to = arg($i+2);
|
||||
|
||||
$settings[$module] = array($from, $to);
|
||||
|
||||
$up_file = drupal_get_path('module', $module) . '/' . $module . '_update.inc.php';
|
||||
if (file_exists($up_file)) {
|
||||
require_once($up_file);
|
||||
}
|
||||
|
||||
$up_function = $module . '_cobalt_js_update';
|
||||
if (is_callable($up_function)) {
|
||||
call_user_func($up_function, $from, $to);
|
||||
}
|
||||
|
||||
$out .= "<li>{$module} from {$from} to {$to}</li>";
|
||||
}
|
||||
$out .= '</ul>';
|
||||
|
||||
drupal_add_js(array('cobalt' => array('update' => $settings)), 'setting');
|
||||
return $out;
|
||||
}
|
||||
|
||||
function cobalt_cobalt_js_update($from, $to) {
|
||||
drupal_add_js(drupal_get_path('module', 'cobalt') . '/js/cobalt.update.js');
|
||||
}
|
Reference in New Issue
Block a user