function smileys_import_packs in Smileys 6
Same name and namespace in other branches
- 5 smileys_import.module \smileys_import_packs()
Custom callback; Scan for available packs.
4 calls to smileys_import_packs()
- smileys_export_page in ./
smileys_import.module - Menu callback; Present a page for .pak file for a Smiley pack.
- smileys_import_add_pak in ./
smileys_import.module - smileys_import_add_plist in ./
smileys_import.module - smileys_import_page in ./
smileys_import.module - Menu callback; Present the page for operations on Smiley packs.
File
- ./
smileys_import.module, line 119
Code
function smileys_import_packs($a = NULL) {
$packs = file_scan_directory(drupal_get_path('module', 'smileys') . '/packs', '\\.pak$');
$files_directory = file_directory_path() . '/smileys';
file_check_directory($file_directory, TRUE);
$packs_from_files = file_scan_directory($files_directory, '\\.pak$');
$packs = array_merge($packs, $packs_from_files);
smileys_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;
}