migrateunfuddle.module 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * @file
  4. * Import an Unfuddle dump into a Drupal Casetracker instance
  5. *
  6. * @copyright Coyright (c) 2011 Ouest Systèmes Informatiques (OSI, OSInet)
  7. * @license Licensed under the General Public License version 2 and later, and
  8. * the CeCILL 2.0 license.
  9. */
  10. function migrateunfuddle_migrate_api() {
  11. $api = array(
  12. 'api' => 2,
  13. );
  14. // dsm(get_defined_vars(), __FUNCTION__);
  15. return $api;
  16. }
  17. /**
  18. * Lifted from Drupal 7
  19. */
  20. function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')) {
  21. // By default, we filter using Drupal's coding standards.
  22. $identifier = strtr($identifier, $filter);
  23. // Valid characters in a CSS identifier are:
  24. // - the hyphen (U+002D)
  25. // - a-z (U+0030 - U+0039)
  26. // - A-Z (U+0041 - U+005A)
  27. // - the underscore (U+005F)
  28. // - 0-9 (U+0061 - U+007A)
  29. // - ISO 10646 characters U+00A1 and higher
  30. // We strip out any character not in the above list.
  31. $identifier = preg_replace('/[^\x{002D}\x{0030}-\x{0039}\x{0041}-\x{005A}\x{005F}\x{0061}-\x{007A}\x{00A1}-\x{FFFF}]/u', '', $identifier);
  32. return $identifier;
  33. }