-
Notifications
You must be signed in to change notification settings - Fork 0
/
Notification.php
64 lines (53 loc) · 2.09 KB
/
Notification.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
require_once BASE_PATH . '/modules/api/library/APIEnabledNotification.php';
/** notification manager*/
class Pyslicer_Notification extends ApiEnabled_Notification
{
public $moduleName = 'pyslicer';
public $_moduleComponents=array('Api');
/** Register callbacks */
public function init()
{
$this->enableWebAPI($this->moduleName);
$fc = Zend_Controller_Front::getInstance();
$this->moduleWebroot = $fc->getBaseUrl().'/modules/'.$this->moduleName;
$this->coreWebroot = $fc->getBaseUrl().'/core';
$this->addCallBack('CALLBACK_CORE_GET_FOOTER_HEADER', 'getHeader');
$this->addCallBack('CALLBACK_CORE_GET_LEFT_LINKS', 'getLeftLink');
$this->addCallBack('CALLBACK_CORE_GET_FOOTER_LAYOUT', 'getFooter');
}
/** get layout header */
public function getHeader()
{
return '<link type="text/css" rel="stylesheet" href="'.Zend_Registry::get('webroot').'/modules/'.$this->moduleName.'/public/css/layout/'.$this->moduleName.'.css" />';
}
/** get layout footer */
public function getFooter()
{
$footer = '<script type="text/javascript" src="'.Zend_Registry::get('webroot').'/modules/api/public/js/common/common.ajaxapi.js"></script>';
$footer .= '<script type="text/javascript" src="'.Zend_Registry::get('webroot').'/modules/'.$this->moduleName.'/public/js/layout/'.$this->moduleName.'.js"></script>';
return $footer;
}
/**
*@method getLeftLink
* will generate a link for this module to be displayed in the main view.
*/
public function getLeftLink()
{
$fc = Zend_Controller_Front::getInstance();
$baseURL = $fc->getBaseUrl();
$moduleWebroot = $baseURL . '/'.$this->moduleName;
if(isset($this->userSession->Dao))
{
$apiComponent = MidasLoader::loadComponent('Api', $this->moduleName);
$args = array("useSession" => true);
$text = 'Slicer';
return array($text => array($moduleWebroot . '/process/statuslist', $baseURL . '/modules/'.$this->moduleName.'/public/images/slicer_icon16x16.png'));
}
else
{
return array();
}
}
} //end class
?>