westdc-zf1/application/default/controllers/AboutController.php

89 lines
2.4 KiB
PHP
Raw Normal View History

2009-03-06 03:20:46 +00:00
<?php
class AboutController extends Zend_Controller_Action
{
function indexAction()
{
}
function preDispatch()
{
$this->view->config = Zend_Registry::get('config');
$this->messenger=$this->_helper->getHelper('FlashMessenger');
$this->view->messages = $this->messenger->getMessages();
$this->db=Zend_Registry::get('db');
2009-03-06 03:20:46 +00:00
}
function contactAction()
{
$form=new ContactForm();
$this->view->form=$form;
$this->view->addHelperPath('helper','Zend_View_Helper_');
if ($this->_request->isPost()) {
//发送邮件
$formData=$this->_request->getPost();
include_once("bcspamblock.php");
if (bcspamblock_verify() && $form->isValid($formData)) {
$mail=new Zend_Mail('utf-8');
$mail->setFrom($formData['email'],$formData['username']);
$mail->setBodyText($formData['body']);
$mail->setSubject($formData['subject']);
$mail->addTo($this->view->config->supportemail);
$mail->send();
$this->messenger->addMessage('发送成功!');
$this->_redirect('/about/contact');
}
} else {
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$user=$auth->getIdentity();
$formData['username']=($user->realname)?$user->realname:$user->username;
$formData['email']=$user->email;
$form->populate($formData);
}
}
}
function termsAction()
{
}
function backgroundAction()
{
}
2012-03-27 13:02:49 +00:00
function legalAction()
{
}
2012-03-27 14:11:22 +00:00
function supportusAction()
{
}
function copyrightAction()
{
}
function linkAction()
{
}
function honorAction()
{
}
function sponsorsAction()
{
}
2012-06-12 12:53:05 +00:00
function publicationAction()
{
$ac = $this->_request->getParam("ac");
2012-06-12 12:53:05 +00:00
$siteid="e31f5ea7-a4af-4ae3-9ac1-1a84132c4338";//site uuid from geonetowrk
if(empty($ac))
{
$sql="select * from mdref mr left join reference r on mr.refid=r.id where mr.uuid=?";
$sth = $this->db->prepare($sql);
$sth->execute(array($siteid));
$rows = $sth->fetchAll();
$paginator = Zend_Paginator::factory($rows);
$paginator->setCurrentPageNumber($this->_getParam('page'));
$paginator->setItemCountPerPage(10);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
}
2012-06-12 12:53:05 +00:00
}
2009-03-06 03:20:46 +00:00
}