+ add mailExist function.
This commit is contained in:
@@ -82,7 +82,7 @@ class mail extends control
|
||||
$this->view->position[] = html::a(inlink('index'), $this->lang->mail->common);
|
||||
$this->view->position[] = $this->lang->mail->edit;
|
||||
|
||||
$this->view->mailExist = $this->dao->select('email')->from(TABLE_USER)->where('email')->ne('')->fetch();
|
||||
$this->view->mailExist = $this->mail->mailExist();
|
||||
$this->view->mailConfig = $mailConfig;
|
||||
$this->display();
|
||||
}
|
||||
@@ -121,6 +121,7 @@ class mail extends control
|
||||
$this->view->position[] = html::a(inlink('index'), $this->lang->mail->common);
|
||||
$this->view->position[] = $this->lang->mail->save;
|
||||
|
||||
$this->view->mailExist = $this->mail->mailExist();
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -369,6 +369,17 @@ class mailModel extends model
|
||||
$this->mta->clearAttachments();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check system if there is a mail at least.
|
||||
*
|
||||
* @access public
|
||||
* @return bool | object
|
||||
*/
|
||||
public function mailExist()
|
||||
{
|
||||
return $this->dao->select('email')->from(TABLE_USER)->where('email')->ne('')->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is error?
|
||||
*
|
||||
|
||||
@@ -17,7 +17,7 @@ include '../../common/view/header.html.php';
|
||||
<td>
|
||||
<?php
|
||||
echo $lang->mail->successSaved;
|
||||
echo html::linkButton($lang->mail->test, inlink('test'));
|
||||
if($this->config->mail->turnon and $mailExist) echo html::linkButton($lang->mail->test, inlink('test'));
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user