Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
package_manager_cms.inc
1 <?php
17 require_once SQ_INCLUDE_PATH.'/package_manager.inc';
18 
32 {
33 
39  {
40  $this->_full_path = SQ_PACKAGES_PATH.'/cms';
41  $this->Package_Manager();
42 
43  }//end constructor
44 
45 
55  {
56  $system_assets = Array(
57  'cron_job_manage_pending_accounts',
58  'cron_job_manage_incomplete_submissions',
59  );
60  $installed_assets = Array();
61 
62  foreach ($system_assets as $type_code) {
63  if ($GLOBALS['SQ_SYSTEM']->am->installed($type_code)) {
64  $installed_assets[] = $type_code;
65  }
66  }
67 
68  return $installed_assets;
69 
70  }//end getSystemAssetTypes()
71 
72 
80  {
81  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
82  if (is_null($cron_manager)) {
83  trigger_error('Couldn\'t get cron manager, couldn\'t create Manage Pending Accounts cron job', E_USER_WARNING);
84  $null = NULL;
85  return $null;
86  }
87 
88  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_manage_pending_accounts');
89 
90  $cron_job = new Cron_Job_Manage_Pending_Accounts();
91  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
92  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
93  trigger_error('Manage Pending Accounts Cron Job NOT CREATED', E_USER_ERROR);
94  }
95  pre_echo('Manage Pending Accounts Cron Job Id: '.$cron_job->id);
96 
97  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_manage_pending_accounts', $cron_job->id);
98 
99  return $cron_job;
100 
101  }//end createCronJobManagePendingAccounts()
102 
103 
111  {
112  $cron_manager = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('cron_manager');
113  if (is_null($cron_manager)) {
114  trigger_error('Couldn\'t get cron manager, couldn\'t create Manage Pending Accounts cron job', E_USER_WARNING);
115  $null = NULL;
116  return $null;
117  }
118 
119  $GLOBALS['SQ_SYSTEM']->am->includeAsset('cron_job_manage_incomplete_submissions');
120 
121  $cron_job = new Cron_Job_Manage_Incomplete_Submissions();
122  $root_user = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('root_user');
123  if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
124  trigger_error('Manage Incomplete Submissions Cron Job NOT CREATED', E_USER_ERROR);
125  }
126  pre_echo('Manage Incomplete Submissions Cron Job Id: '.$cron_job->id);
127 
128  $GLOBALS['SQ_SYSTEM']->am->registerSystemAsset('cron_job_manage_incomplete_submissions', $cron_job->id);
129 
130  return $cron_job;
131 
132  }//end createCronJobManagePendingAccounts()
133 
134 
135 }//end class
136 
137 ?>