本文整理汇总了PHP中BackendTemplate::import方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendTemplate::import方法的具体用法?PHP BackendTemplate::import怎么用?PHP BackendTemplate::import使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BackendTemplate
的用法示例。
在下文中一共展示了BackendTemplate::import方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* Show preview and send the Newsletter.
*
* @return string
*/
public function send()
{
$id = $this->Input->get('id');
$newsletter = AvisotaNewsletter::load($id);
if (!$newsletter) {
$this->redirect('contao/main.php?do=avisota_newsletter');
}
$category = AvisotaNewsletterCategory::load($newsletter->pid);
if (!$category) {
$this->redirect('contao/main.php?do=avisota_newsletter');
}
if (!$this->User->isAdmin) {
if (!is_array($this->User->avisota_newsletter_categories) || count($this->User->avisota_newsletter_categories) < 1) {
$root = array(0);
} else {
$root = $this->User->avisota_newsletter_categories;
}
if (!in_array($category->id, $root)) {
$this->log('Not enough permissions to send newsletter from category ID ' . $category->id, 'Avisota::send()', TL_ERROR);
$this->redirect('contao/main.php?act=error');
}
}
AvisotaStatic::pushCategory($category);
AvisotaStatic::pushNewsletter($newsletter);
$template = new BackendTemplate('be_avisota_send');
$template->import('BackendUser', 'User');
// allow backend sending
$template->beSend = $this->Base->allowBackendSending();
// Store the current referer
$session = $this->Session->get('referer');
if ($session['current'] != $this->Environment->requestUri) {
$session['orm_avisota_message'] = $this->Environment->requestUri;
$session['last'] = $session['current'];
$session['current'] = $this->Environment->requestUri;
$this->Session->set('referer', $session);
}
$template->users = $this->getAllowedUsers();
return $template->parse();
}