public function loadMakiaveloData() { $proj = load_project(1); Makiavelo::puts("Grabing data for project: " . $proj->name); $proj->grabHistoricData(); Makiavelo::puts("Done!"); }
public function showAction() { $id = mysql_real_escape_string($this->request->getParam("id")); $project = load_project($id); $new_faq = new Faq(); $new_faq->project_id = $id; $faqs = $project->getQuestions(); if ($project && !$project->published) { $this->flash->setError("This project has not been published yet!"); $this->redirect_to(project_list_path()); } else { if (!$project) { $this->flash->setError("Project not found!"); $this->redirect_to(project_list_path()); } else { //$issue = random_issue($id); $issues = list_issue("num desc", 5, "project_id = " . $id); $this->render(array("faqs_list" => $faqs, "faq" => $new_faq, "issues" => $issues, "project" => $project)); } } }
return; } $type = $_GET["type"]; if ($type != "new" && $type != "edit") { echo "错误,无效的请求类型({$type})!"; return; } if ($type == "edit" && !array_key_exists("id", $_GET)) { echo "错误,没有指定任何id来编辑!"; return; } $id = ""; $row = array("", "", "", "", "", "", "", "", "", "", "", ""); if (array_key_exists("id", $_GET)) { $id = $_GET["id"]; $row = load_project($id); $row = $row[0]; } list($id, $title, $summary, $ctime, $wiki, $home, $svn, $status, $creator, $members, $ef1, $ef2) = $row; $title = htmlspecialchars_decode($title, ENT_QUOTES); $summary = htmlspecialchars_decode($summary, ENT_QUOTES); echo "<script type='text/javascript'>\n"; echo "var _pType='{$type}';\n"; echo "var _pId='{$id}';\n"; echo "</script>\n"; ?> </head> <body> <h2>添加或编辑项目信息</h2>
echo "There was a hole."; } } } } } } } } } return; } //===== //===== GET -------------------------------------------------------------------- //===== if ($_SERVER['REQUEST_METHOD'] == "GET") { $function = $_GET['function']; if ($function == 'load-projects') { load_projects($_GET['username'], $_GET['amount'], $_GET['start']); } else { if ($function == 'load-project') { load_project($_GET['username'], $_GET['projectname']); } else { if ($function == 'load-project-counts') { load_project_counts($_GET['project_id']); } else { echo "There was a hole."; } } } }