You are here

function smiley_import_packs in Smiley 6

Custom callback; Scan for available packs.

4 calls to smiley_import_packs()
smiley_export_page in ./smiley_import.module
Menu callback; Present a page for .pak file for a Smiley pack.
smiley_import_add_pak in ./smiley_import.module
smiley_import_add_plist in ./smiley_import.module
smiley_import_page in ./smiley_import.module
Menu callback; Present the page for operations on Smiley packs.

File

./smiley_import.module, line 119

Code

function smiley_import_packs($a = NULL) {
  $packs = file_scan_directory(drupal_get_path('module', 'smiley') . '/packs', '\\.pak$');
  $files_directory = file_directory_path() . '/smiley';
  file_check_directory($file_directory, TRUE);
  $packs_from_files = file_scan_directory($files_directory, '\\.pak$');
  $packs = array_merge($packs, $packs_from_files);
  smiley_import_packs_plist($packs);
  ksort($packs);
  $pack_names = array();
  if ($a) {
    $packd = NULL;
    foreach ($packs as $pack) {
      if ($pack->name == $a) {
        $packd = $pack;
      }
    }
    return $packd;
  }
  return $packs;
}