3 $root_dir = dirname(dirname(dirname(dirname(__FILE__))));
5 require_once $root_dir.
'/core/include/init.inc';
7 $GLOBALS[
'SQ_SYSTEM']->setRunLevel(SQ_RUN_LEVEL_FORCED);
8 $GLOBALS[
'SQ_SYSTEM']->setCurrentUser($GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'root_user'));
9 $suitem = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'suite_manager');
10 if ($suitem !== NULL) {
11 $pages = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'funnelback_search_page');
12 foreach ($pages as $assetid) {
13 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
14 if ($asset !== NULL) {
15 $systemid = $asset->attr(
'systemid');
16 $product = $suitem->getProductBySystemid($systemid);
17 if (isset($product[0][
'suiteid'])) {
18 $asset->setAttrValue(
'systemid', $product[0][
'suiteid']);
19 $asset->saveAttributes();
21 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset, TRUE);
26 $GLOBALS[
'SQ_SYSTEM']->restoreCurrentUser();
27 $GLOBALS[
'SQ_SYSTEM']->restoreRunLevel();