123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- /**
- * @file
- * Import an Unfuddle dump into a Drupal Casetracker instance
- *
- * @copyright Coyright (c) 2011 Ouest Systèmes Informatiques (OSI, OSInet)
- * @license Licensed under the General Public License version 2 and later, and
- * the CeCILL 2.0 license.
- */
- /**
- * Implements hook_migrate_api().
- */
- function migrateunfuddle_migrate_api() {
- $api = array(
- 'api' => 2,
- );
- return $api;
- }
- /**
- * Implements hook_views_api().
- */
- function migrateunfuddle_views_api() {
- $ret = array(
- 'api' => '3.0',
- 'path' => drupal_get_path('module', 'migrateunfuddle') . '/views',
- );
- return $ret;
- }
- /**
- * Implements hook_views_default_views().
- *
- * No need to create a .views_default.inc just for this
- */
- function migrateunfuddle_views_default_views() {
- $info = migrateunfuddle_views_api();
- $ret = array();
- $files = file_scan_directory($info['path'], '.*\.view\.inc', array(), NULL, FALSE);
- foreach ($files as $file) {
- require_once $file->filename;
- $ret[$view->name] = $view;
- }
- return $ret;
- }
- /**
- * Convert a string to a SEO-passable slug.
- *
- * Lifted from Drupal 7
- *
- * @param string $identifier
- * @param array $filter
- *
- * @return string
- */
- function drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')) {
- // By default, we filter using Drupal's coding standards.
- $identifier = strtr($identifier, $filter);
- // Valid characters in a CSS identifier are:
- // - the hyphen (U+002D)
- // - a-z (U+0030 - U+0039)
- // - A-Z (U+0041 - U+005A)
- // - the underscore (U+005F)
- // - 0-9 (U+0061 - U+007A)
- // - ISO 10646 characters U+00A1 and higher
- // We strip out any character not in the above list.
- $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);
- return $identifier;
- }
|