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