17 require_once SQ_INCLUDE_PATH.
'/package_manager.inc';
41 $this->_full_path = SQ_PACKAGES_PATH.
'/squiz_suite';
57 $system_assets = Array(
59 'cron_job_sync_suite_products',
61 $installed_assets = Array();
63 foreach ($system_assets as $type_code) {
64 if ($GLOBALS[
'SQ_SYSTEM']->am->installed($type_code)) {
65 $installed_assets[] = $type_code;
69 return $installed_assets;
82 $web_services_folder = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'web_folder_web_services');
84 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'suite_manager');
86 $suite_manager->setAttrValue(
'name',
'Squiz Suite Manager');
87 $suite_manager_link = Array(
'asset' => &$web_services_folder,
'link_type' => SQ_LINK_TYPE_1,
'is_exclusive' => 1);
88 if (!$suite_manager->create($suite_manager_link)) {
89 trigger_localised_error(
'SQS0001', E_USER_ERROR);
91 pre_echo(
'Squiz Suite Manager Asset Id : '.$suite_manager->id);
93 $GLOBALS[
'SQ_SYSTEM']->am->registerSystemAsset(
'suite_manager', $suite_manager->id);
95 return $suite_manager;
108 $cron_manager = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'cron_manager');
109 if (is_null($cron_manager)) {
110 trigger_error(
'Couldn\'t get cron manager, couldn\'t create Sync Squiz Suite Products cron job', E_USER_WARNING);
115 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'cron_job_sync_suite_products');
118 $root_user = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'root_user');
119 if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
120 trigger_error(
'Sync Squiz Suite Products Cron Job NOT CREATED', E_USER_ERROR);
122 pre_echo(
'Sync Squiz Suite Products Cron Job Id: '.$cron_job->id);
124 $GLOBALS[
'SQ_SYSTEM']->am->registerSystemAsset(
'cron_job_sync_suite_products', $cron_job->id);