elysia_drupalconv.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. define('EC_DRUPAL_VERSION', 7);
  3. /***************************************************************
  4. * D7 VERSION
  5. ***************************************************************/
  6. function _dcf_hook_boot($module) {
  7. return true;
  8. }
  9. function _dcf_hook_init($module) {
  10. return true;
  11. }
  12. function _dcf_hook_menu($items, $maycache) {
  13. return $items;
  14. }
  15. function _dcr_render_array($output) {
  16. return $output;
  17. }
  18. function _dcr_form(&$form) {
  19. return $form;
  20. }
  21. function _dcf_internal_path($path) {
  22. return $path;
  23. }
  24. function _dcf_t($string) {
  25. return $string;
  26. }
  27. function _dco_watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) { // WARN d7 changed WATCHDOG_ costants
  28. return watchdog($type, $message, $variables, $severity, $link);
  29. }
  30. function _dco_l($text, $path, array $options = array()) {
  31. return l($text, $path, $options);
  32. }
  33. function _dcf_form_validate(&$form, &$form_state) {
  34. return array('form' => &$form, 'form_state' => &$form_state);
  35. }
  36. function _dco_theme($name, $args) {
  37. return theme($name, $args);
  38. }
  39. function _dcf_theme_signature($args) {
  40. return array();
  41. }
  42. function _dcr_hook_theme($specs) {
  43. return $specs;
  44. }
  45. function _dcf_theme_form(&$args) {
  46. return array( 'variables' => $args );
  47. }
  48. /***************************************************************
  49. * D7 EXTRA FUNCTIONS
  50. ***************************************************************/
  51. function drupal_module_get_min_weight($except_module = false) {
  52. return !$except_module ? db_query("select min(weight) from {system}")->fetchField() :
  53. db_query("select min(weight) from {system} where name != :name", array(':name' => $except_module))->fetchField();
  54. }
  55. function drupal_module_get_weight($name) {
  56. return db_query("select weight from {system} where name = :name", array(':name' => $name))->fetchField();
  57. }
  58. function drupal_module_set_weight($name, $weight) {
  59. db_update('system')->fields(array('weight' => $weight))->condition('name', $name)->execute();
  60. }
  61. function drupal_disable_standard_cron() {
  62. }
  63. function drupal_clean_after_cron_run() {
  64. }