<?php if (!defined('APPLICATION')) { exit; } //$RequestUri = Gdn::Request()->RequestUri(); $RequestUri = GetValue('REQUEST_URI', $_SERVER); $Url = Url('candy/page/addnew?URI=' . $RequestUri); ?> <div class="SplashInfo"> <p> <?php echo LocalizedMessage("The page you're looking for doesn't exist (yet), do you want to <a href=\"%s\">create one</a>?", $Url); ?> </p> </div>
public function ReturEmailToSender($ErrorText = '') { $Email = new Gdn_Email(); $Message = LocalizedMessage('ReturEmailToSender %1$s %2$s %3$s', $this->Subject, $this->BodyText, $ErrorText); $Email->To($this->SenderMail, $this->SenderName)->Subject('[Ошибка] ' . $this->Subject)->Message($Message)->Send(); $this->Delete(); return $this; }
public function Edit($Reference = '') { //$this->AddJsFile('jquery.autocomplete.pack.js'); $this->AddJsFile('jquery.textpandable.js'); $this->AddJsFile('editform.js'); $this->Form->SetModel($this->PageModel); $Session = Gdn::Session(); $SectionModel = new SectionModel(); $this->Tree = $SectionModel->DropDownArray('Name', $SectionModel->GetNodes(array('Depth >' => 0))); $this->FormatOptions = LocalizedOptions(array('Text', 'xHtml', 'Html', 'Markdown', 'Raw')); if (!$Session->CheckPermission('Candy.Pages.Raw')) { unset($this->FormatOptions['Raw']); } $this->EventArguments['FormatOptions'] =& $this->FormatOptions; $this->FireEvent('FormatOptions'); $Content = False; if ($Reference != '') { $Content = $this->PageModel->GetID($Reference); if (!IsContentOwner($Content, 'Candy.Pages.Edit')) { $Content = False; } if ($Content) { $this->Form->AddHidden('PageID', $Content->PageID); $this->Form->SetData($Content); $this->Editing = True; } } if (!$Content) { $this->Permission('Candy.Pages.Add'); } if ($this->Form->AuthenticatedPostBack()) { if ($this->Form->ButtonExists('Delete')) { $this->PageModel->Delete($Content->PageID); $this->InformMessage(T('Page deleted'), array('Sprite' => 'SkullBones', 'CssClass' => 'Dismissable AutoDismiss')); } else { $SavedID = $this->Form->Save($Content); if ($SavedID) { $Message = LocalizedMessage('Saved. You can check it here: %s', Anchor($this->Form->GetFormValue('Title'), 'content/page/' . $SavedID)); $this->InformMessage($Message, array('Sprite' => 'Check', 'CssClass' => 'Dismissable')); } } } else { $URI = trim(GetIncomingValue('URI'), '/'); if ($URI) { $this->Form->SetValue('URI', $URI); } } $this->SetData('Content', $Content, True); $this->Title(ConcatSep(' - ', T('Page'), GetValue('Title', $Content))); $this->Render(); }