You are here

function smileys_import_packs_plist in Smileys 6

2 calls to smileys_import_packs_plist()
smileys_import_packs in ./smileys_import.module
Custom callback; Scan for available packs.
smileys_import_parse_plist in ./smileys_import.module
Custom callback; Parse the plist information for a smiley package.

File

./smileys_import.module, line 144

Code

function smileys_import_packs_plist(&$packs) {
  $plists = file_scan_directory(drupal_get_path('module', 'smileys') . '/packs', '\\.plist$');
  $files_directory = file_directory_path() . '/smileys';
  file_check_directory($file_directory, TRUE);
  $plists_from_files = file_scan_directory($files_directory, '\\.plist$');
  $plists = array_merge($plists, $plists_from_files);
  foreach ($plists as $key => $plist) {
    $plists[$key]->name = str_ireplace(array(
      drupal_get_path('module', 'smileys') . '/packs/',
      '.AdiumEmoticonset',
      '/Emoticons.plist',
    ), '', $plist->filename);
  }
  if (!empty($packs)) {
    $packs = array_merge($packs, $plists);
  }
  else {
    $packs = $plists;
  }
}