private function get_available_modules()
{
$result = dbquery("SELECT field_id, field_name, field_cat, field_required, field_log, field_registration, field_order, field_cat_name\n\t\t\t\t\tFROM " . $this->field_db . " tuf\n\t\t\t\t\tINNER JOIN " . $this->category_db . " tufc ON (tuf.field_cat = tufc.field_cat_id)\n\t\t\t\t\tWHERE field_type = 'file'\n\t\t\t\t\tORDER BY field_cat_order, field_order");
if (dbrows($result) > 0) {
while ($data = dbarray($result)) {
$this->enabled_fields[] = $data['field_name'];
}
}
$user_field_name = '';
$user_field_desc = '';
if ($temp = opendir($this->plugin_folder)) {
while (FALSE !== ($file = readdir($temp))) {
if (!in_array($file, array("..", ".", "index.php")) && !is_dir($this->plugin_folder . $file)) {
if (preg_match("/_var.php/i", $file)) {
$field_name = explode("_", $file);
$field_title = "";
for ($i = 0; $i <= count($field_name) - 3; $i++) {
$field_title .= $field_title ? "_" : "";
$field_title .= $field_name[$i];
}
if (!in_array($field_title, $this->enabled_fields)) {
if ($this->module_debug) {
print_p($field_title . " set for load.");
}
if (file_exists($this->plugin_locale_folder . $field_title . ".php")) {
include $this->plugin_locale_folder . $field_title . ".php";
include $this->plugin_folder . $field_title . "_include_var.php";
$this->available_field_info[$field_title] = array('title' => $user_field_name, 'description' => $user_field_desc);
$this->get_available_modules[$field_title] = $user_field_name;
if ($this->module_debug) {
print_p($field_title . " loaded.");
}
} elseif ($this->module_debug) {
print_p($field_title . " locale missing!");
}
}
unset($field_name);
}
}
}
closedir($temp);
}
}