public function get_files()
 {
     return File::from_property(array("Module_id" => DS_Module::from_value(static::get_mysql_table())->id, "object_id" => $this->id));
 }
    die(Language::string(85));
}
$file = $_FILES['file'];
$f = new File();
$f->temp_id = $_POST['temp_id'];
$f->file_name = $file['name'];
$f->Module_id = $_POST['Module_id'];
$f->object_id = $_POST['object_id'];
$f->temp_name = $file['tmp_name'];
$f->file_size = $file['size'];
$code = 0;
$can_upload = true;
$module = DS_Module::from_mysql_id($_POST['Module_id']);
$class_name = $module->value;
$max_num = $class_name::$max_files_num;
$obj = $class_name::from_mysql_id($_POST['object_id']);
if ($obj == null) {
    $files = File::from_property(array("temp_id" => $_POST['temp_id']));
} else {
    $files = $obj->get_files();
}
$cur_num = count($files);
if ($cur_num >= $max_num && $max_num != -1) {
    $can_upload = false;
}
if ($can_upload) {
    $f->mysql_save();
} else {
    $code = -1;
}
echo '{"name":"' . $file['name'] . '","type":"' . $file['type'] . '","size":"' . $file['size'] . '", "code":"' . $code . '"}';
        $oid = $_POST['oid'];
    }
    if (isset($_POST['temp_id'])) {
        $temp_id = $_POST['temp_id'];
    }
    if (isset($_POST['class_name'])) {
        $class_name = $_POST['class_name'];
    }
    $obj = $class_name::from_mysql_id($oid);
    if ($obj == null) {
        $obj = new $class_name();
    }
}
$files = $obj->get_files();
if ($oid == 0) {
    $files = File::from_property(array("temp_id" => $temp_id));
}
foreach ($files as $file) {
    ?>
    <tr>
        <td class="ui-widget-content ui-corner-all"><?php 
    echo $file->id;
    ?>
</td>
        <td class="noWrap ui-widget-content ui-corner-all"><?php 
    echo $file->file_name;
    ?>
</td>
        <td class="noWrap ui-widget-content ui-corner-all"><?php 
    echo $file->get_stored_as();
    ?>