本文整理汇总了PHP中Main::getfileedit方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::getfileedit方法的具体用法?PHP Main::getfileedit怎么用?PHP Main::getfileedit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::getfileedit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: savevalidate
$parrentdir = $_REQUEST['parentdir'];
$fname = $_REQUEST['fname'];
if ($subdir != "") {
$parrentdir = $dir;
$dir = $subdir;
}
$newid = $_REQUEST['id'];
$main->savefile($access, $dir, $parrentdir, $fname, $newid);
}
if ($_REQUEST['do'] == "delete" and isset($_REQUEST['id'])) {
if ($_REQUEST['id'] > 0) {
$main->deletefile($_REQUEST['id']);
}
}
if ($_REQUEST['do'] == "edit" and isset($_REQUEST['id'])) {
$fileinfo = $main->getfileedit($_REQUEST['id']);
print "<script type='text/javascript'>\n function savevalidate(form)\n {\n error=\"\";\n if ( form.fname.value == \"\" )\n {\n error=\"" . str_replace(":", ",", " " . $main->edit_array($text['fname']) . " ") . "\";\n }\n if (error != '' )\n {\n error=error.replace(\":\", \",\");\n alert('" . $main->edit_array($text['missingfields']) . "'+' '+error);\n return;\n }\n else\n {\n form.submit();\n }\n }\n </script>";
print "<br /><br /><form enctype='multipart/form-data' action='?page=downloads' method='post'>\n <table><tr><td>\n <input type='hidden' name='rid' value='{$requestid}' />\n <input type='hidden' name='id' value='{$_REQUEST['id']}' />\n <input type='hidden' name='do' value='save' />\n <input type='hidden' name='parentdir' value='" . $fileinfo->records['0']['parrentdir'] . "' />\n <input type='hidden' name='dir' value='{$dir}' />\n {$text['filename']}</td><td>" . $fileinfo->records['0']['filename'] . "</td></tr>\n <tr><td>{$text['size']}</td><td>" . $fileinfo->records['0']['size'] . "</td></tr>\n <tr><td>{$text['uploaded']}</td><td>" . $fileinfo->records['0']['date'] . "</td></tr>\n \n";
print "<tr><td><label for='fname'>{$text['fname']}</label></td><td><input name='fname' type='text' id='fname' value='" . $fileinfo->records['0']['name'] . "'/></td></tr>";
print "<tr><td><label for='subdir'>{$text['subdir']}</label></td><td><input name='subdir' type='text' id='subdir' value='" . $fileinfo->records['0']['dir'] . "'/></td></tr>";
print "<tr><td><label for='access'>{$text['access']}</label></td><td><select name='access'>";
$editedfileaccess = $fileinfo->records['0']['access'];
$selected = "";
if ($editedfileaccess == 0) {
$selected = "selected=selected";
} else {
$selected = "";
}
print "<option value='0' {$selected}>{$text['noaccess']}</option>\n";
if ($editedfileaccess == 1) {
$selected = "selected=selected";