本文整理匯總了PHP中Documents::createNewDocument方法的典型用法代碼示例。如果您正苦於以下問題:PHP Documents::createNewDocument方法的具體用法?PHP Documents::createNewDocument怎麽用?PHP Documents::createNewDocument使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Documents
的用法示例。
在下文中一共展示了Documents::createNewDocument方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* [__construct description]
* Stellt entsprechend der Anfrage das Dokument dar
*/
public function __construct()
{
$doc = new Documents();
// Neues Dokument erstellen
if (isset($_POST["operation"])) {
if ($_POST["operation"] == "create") {
$current_user = wp_get_current_user();
$doc->createNewDocument($this->saveInputs($_POST["project_name"]), $current_user->display_name, get_current_user_id(), $this->saveInputs($_POST["layout"]));
} else {
if ($_POST["operation"] == "delete") {
$doc->deleteDocument($this->saveInputs($_POST["id"]));
} else {
if ($_POST["operation"] == "selectGroup") {
$group = new Groups();
$group->selectGroup($this->saveInputs($_POST["selectedGroup"]), $this->saveInputs($_POST["document_id"]));
} else {
if ($_POST["operation"] == "addAbschnitt") {
$doc->addAbschnitt(esc_textarea($_POST["content"]), $this->saveInputs($_POST["document_id"]));
} else {
if ($_POST["operation"] == "setContentAbschnitt") {
$doc->updateAbschnitt($this->saveInputs($_POST["document_id"]), $this->saveInputs($_POST["abschnitt_id"]), esc_textarea($_POST["content"]));
} else {
if ($_POST["operation"] == "deleteAbschnitt") {
$doc->deleteAbschnitt($this->saveInputs($_POST["document_id"]), $this->saveInputs($_POST["abschnitt_id"]));
} else {
if ($_POST["operation"] == "selectLayout") {
$doc->selectLayout($this->saveInputs($_POST["document_id"]), $this->saveInputs($_POST["selectedLayout"]), $this->saveInputs($_POST["old_layout"]));
}
}
}
}
}
}
}
}
if (isset($_GET["id"])) {
$document = $doc->getDocument($this->saveInputs($_GET["id"]));
$document->abschnitte = array();
$document->abschnitte = $doc->getAbschnitte($document->id);
$downloadLinks = $doc->getDownloadLinks($document);
$document->downloadZip = $downloadLinks["zip"];
$document->downloadPdf = $downloadLinks["pdf"];
$this->viewDocument($document);
} else {
if (isset($_GET["create"])) {
$this->viewDocumentCreateForm($_GET["create"]);
} else {
$authDocs = $doc->getDocumentsCreatedByUser(get_current_user_id());
$this->viewShortDoc($authDocs);
$this->viewDocumentCreateForm();
}
}
}