".$GLOBALS['I18N']->get('loading')." $desc
\n";
$lc_name = str_replace(" ","", strtolower(str_replace(".txt","",$val)));
$lc_name = ereg_replace("[^[:alnum:]]","",$lc_name);
if ($lc_name == "") Fatal_Error($GLOBALS['I18N']->get('name_empty')." $lc_name");
Sql_Query("select * from {$tables['attribute']} where tablename = \"$lc_name\"");
if (Sql_Affected_Rows()) Fatal_Error($GLOBALS['I18N']->get('name_not_unique'));
$query = sprintf('insert into %s (name,type,required,tablename) values("%s","%s",%d,"%s")',
$tables["attribute"],addslashes($name),"select",1,$lc_name);
Sql_Query($query);
$insertid = Sql_Insert_id();
$query = "create table $table_prefix"."listattr_$lc_name (id integer not null primary key auto_increment, name varchar(255) unique,listorder integer default 0)";
Sql_Query($query);
$fp = fopen("data/$val","r");
$header = "";
while (!feof ($fp)) {
$buffer = fgets($fp, 4096);
if (!ereg("#",$buffer)) {
if (!$header)
$header = $buffer;
else if (trim($buffer) != "")
Sql_Query(sprintf('insert into %slistattr_%s (name) values("%s")',$table_prefix,$lc_name,trim($buffer)));
}
}
fclose ($fp);
}
print $GLOBALS['I18N']->get('done')."
";
#@@@@ not sure about this one: print ''.PageLink2("attributes",$GLOBALS['I18N']->get('continue')).'
';
} else {
?>
%s
', $attribute,$desc);
}
}
}
print '';
}
?>