当前位置: 首页>>代码示例>>PHP>>正文


PHP Notification::prepare方法代码示例

本文整理汇总了PHP中Notification::prepare方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::prepare方法的具体用法?PHP Notification::prepare怎么用?PHP Notification::prepare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notification的用法示例。


在下文中一共展示了Notification::prepare方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: prepare

 public function prepare()
 {
     $notification = new Notification($this->curpage, $this->db, $this->config);
     $notification->prepare();
     $mainToggle = '';
     $tasksToggle = '';
     $usersToggle = '';
     $serversToggle = '';
     $storeToggle = '';
     $settingsToggle = '';
     $route = getroute();
     if ($route == '') {
         $mainToggle = 'active';
     }
     if ($route == 'servers' || strpos('##' . $route, 'servers/')) {
         $serversToggle = 'active';
     } elseif ($route == 'tasks' || strpos('##' . $route, 'tasks/')) {
         $tasksToggle = 'active';
     }
     if ($route == 'users' || strpos('##' . $route, 'users/')) {
         $usersToggle = 'active';
     }
     if ($route == 'store' || strpos('##' . $route, 'store/')) {
         $storeToggle = 'active';
     }
     if ($route == 'settings' || strpos('##' . $route, 'settings/')) {
         $settingsToggle = 'active';
     }
     $this->data['mainToggle'] = $mainToggle;
     $this->data['tasksToggle'] = $tasksToggle;
     $this->data['usersToggle'] = $usersToggle;
     $this->data['serversToggle'] = $serversToggle;
     $this->data['storeToggle'] = $storeToggle;
     $this->data['settingsToggle'] = $settingsToggle;
     $this->data['notification'] = $notification->show();
 }
开发者ID:openweb-tech,项目名称:hotbackup,代码行数:36,代码来源:topMenu.php

示例2: sendUpdateNotification

	function sendUpdateNotification($activities = array()){
		$notif = new Notification();
		$params = $this->getNotificationParams($activities);
		if(!isset($params['project_ccs']) || empty($params['project_ccs']))
			return TRUE;
			
		if($notif->getByName('ProjectUpdated') === FALSE){
			$this->error = "SI_Project::update() : ".$notif->getLastError()."\n";
			return FALSE;
		}
		if($notif->prepare($params) === FALSE){
			$this->error = "SI_Project::update() : ".$notif->getLastError()."\n";
			return FALSE;
		}
		if($notif->send() === FALSE){
			$this->error = "SI_Project::update() : ".$notif->getLastError()."\n";
			return FALSE;
		}

		return TRUE;
	}
开发者ID:nanoprime,项目名称:sureinvoice,代码行数:21,代码来源:SI_Project.php

示例3: sendEmail

	function sendEmail($notification = 'InvoiceEmail'){
		$notif = new Notification();
		$params = $this->getNotificationParams();
//		if(!isset($params['invoice_emails']) || empty($params['invoice_emails']))
//			return TRUE;
			
		if($notif->getByName($notification) === FALSE){
			$this->error = "SI_Invoice::sendEmail() : ".$notif->getLastError()."\n";
			return FALSE;
		}
		if($notif->prepare($params) === FALSE){
			$this->error = "SI_Invoice::sendEmail() : ".$notif->getLastError()."\n";
			return FALSE;
		}
		
		// Setup attachment
		$pdf_file = $this->getPDF();
		if($pdf_file === FALSE)
			return FALSE;
			
		$my_company = SureInvoice::getMyCompany();
		$filename = 'invoice_'.$this->id.'.pdf';
		if(!empty($my_company->name)){
			$normalized_name = str_replace(array(',','.',' ',"\t","'",'"'), '_', $my_company->name);
			$filename = $normalized_name.'_'.$this->id.'.pdf';
		}
		$attachments[0]['data'] = $pdf_file;
		$attachments[0]['name'] = $filename;
		$attachments[0]['type'] = 'application/pdf';
		$attachments[0]['encoding'] = 'base64';
		if($notif->send($attachments) === FALSE){
			$this->error = "SI_Invoice::sendEmail() : ".$notif->getLastError()."\n";
			return FALSE;
		}

		// Update sent_ts
		$this->sent_ts = time();
		if($this->update() === FALSE){
			$this->error = "SI_Invoice::sendEmail(): Email sent, error updating sent timestamp: ".$this->getLastError();
			return FALSE;	
		}
		
		return TRUE;
	}
开发者ID:nanoprime,项目名称:sureinvoice,代码行数:44,代码来源:SI_Invoice.php


注:本文中的Notification::prepare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。