function bueditor_import_buttons in BUEditor 5
Same name and namespace in other branches
- 6 bueditor.admin.inc \bueditor_import_buttons()
Import buttons from a CSV file.
1 call to bueditor_import_buttons()
- bueditor_form_editor in ./
bueditor.module - Editor form.
File
- ./
bueditor.module, line 459
Code
function bueditor_import_buttons($file) {
$buttons = array();
if (is_file($file) && ($fp = fopen($file, 'r'))) {
$fields = fgetcsv($fp, 100000);
while ($values = fgetcsv($fp, 100000)) {
$button = array();
for ($i = 0; $field = $fields[$i]; $i++) {
$button[$field] = stripslashes($values[$i]);
}
$buttons[] = $button;
}
}
return $buttons;
}