Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
package_manager_bulkmail.inc
1 <?php
17 require_once SQ_INCLUDE_PATH.'/package_manager.inc';
18 
29 {
30 
31 
37  {
38  $this->_full_path = SQ_PACKAGES_PATH.'/bulkmail';
39  $this->Package_Manager();
40 
41  }//end constructor
42 
43 
52  {
53  return Array(
54  'bulkmail_manager',
55  'cron_job_queue_scheduled_job',
56  );
57 
58  }//end getSystemAssetTypes()
59 
60 
68  {
69  // set default asset name in management.inc and define _getName() function
70  $system_management_folder = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('system_management_folder');
71 
72  $GLOBALS['SQ_SYSTEM']->am->includeAsset('bulkmail_manager');
73  $bulkmail_manager = new Bulkmail_Manager();
74  $bulkmail_manager_link = Array('asset' => &$system_management_folder, 'link_type' => SQ_LINK_TYPE_1, 'is_exclusive' => 1);
75  if (!$bulkmail_manager->create($bulkmail_manager_link)) {
76  trigger_localised_error('SCH0007', E_USER_ERROR);
77  }
78  pre_echo('Bulkmail Manager Asset Id : '.$bulkmail_manager->id);
79  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('bulkmail_manager', $bulkmail_manager->id);
80 
81  return $bulkmail_manager;
82 
83  }//end createBulkmailManager()
84 
85 
93  {
94  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
95  if (is_null($cron_manager)) {
96  trigger_localised_error('CORE0022', E_USER_WARNING);
97  $null = NULL;
98  return $null;
99  }
100 
101  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_queue_scheduled_job');
102 
103  $cron_job = new Cron_Job_Queue_Scheduled_Job();
104  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
105  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
106  trigger_localised_error('CORE0001', E_USER_ERROR, 'Queue Scheduled Bulkmail Cron Job');
107  }
108  pre_echo('Queue Scheduled Bulkmail Job Cron Job Id: '.$cron_job->id);
109 
110  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_queue_scheduled_job', $cron_job->id);
111 
112  return $cron_job;
113 
114  }//end createCronJobQueueScheduledJob()
115 
116 
117 }//end class
118 
119 ?>