function loadActiveAddons() { $suiteDetails = unserialize(getOption('suiteDetails')); if (empty($suiteDetails) and !is_array($suiteDetails)) { $addonSuiteMiniActivity = ''; } else { $addonSuiteMiniActivity = $suiteDetails['addonSuiteMiniActivity']; } if (panelRequestManager::checkIsAddonSuiteMiniLimitExceeded('addonSuiteLimitExceededIllegally') && panelRequestManager::getAddonSuiteMiniActivity() == 'installed') { Reg::set('addonSuiteLimitExceededIllegally', 1); Reg::set('addonSuiteLimitExceededAttemp', 1); } else { Reg::set('addonSuiteLimitExceededIllegally', 0); Reg::set('addonSuiteLimitExceededAttemp', 0); } $activeAddons = DB::getArray("?:addons", "slug, status, addon", "1"); if (userStatus() != 'admin') { userAddonsAccess($activeAddons); } $installedAddons = @unserialize(getOption('updateAddonsAvailable')); $newAddons = getNewAddonsAvailable(); $purchasedAddons = array(); if (!empty($installedAddons)) { $purchasedAddons = array_merge($purchasedAddons, array_keys($installedAddons)); } if (!empty($newAddons)) { $purchasedAddons = array_merge($purchasedAddons, array_keys($newAddons)); } Reg::set('purchasedAddons', $purchasedAddons); $uninstallAddons = $uninstall = $activeLoadedAddonsSlugs = $allPurchasedAddonsNameAndSlug = array(); foreach ($activeAddons as $key => $addon) { if (!in_array($addon['slug'], $purchasedAddons)) { $uninstall[] = $addon['slug']; $uninstallAddons[]['slug'] = $addon['slug']; } if ($addon['status'] == 'active') { $allPurchasedAddonsNameAndSlug[$addon['slug']] = $addon['addon']; if (Reg::get('addonSuiteLimitExceededIllegally') && Reg::get('addonSuiteLimitExceededAttemp')) { $activeLoadedAddonsSlugs[$addon['slug']] = array('slug' => $addon['slug']); } else { //if(file_exists(APP_ROOT.'/addons/'.$addon['slug'].'/addon.'.$addon['slug'].'.php')){ @(include_once APP_ROOT . '/addons/' . $addon['slug'] . '/addon.' . $addon['slug'] . '.php'); if (method_exists('addon' . ucfirst($addon['slug']), 'init')) { call_user_func(array('addon' . ucfirst($addon['slug']), 'init')); $activeLoadedAddonsSlugs[$addon['slug']] = array('slug' => $addon['slug']); } else { //file not found deactivate the addon unset($activeAddons[$key]); //DB::delete("?:addons", "slug='".$addon['slug']."'"); //addNotification($type='E', $title='Addon file missing', $message='The "'.$addon['addon'].'" addon has been removed, since a file is missing.', $state='U', $callbackOnClose='', $callbackReference=''); } } } } if (!empty($uninstallAddons) && $addonSuiteMiniActivity != 'cancelled') { addNotification($type = 'E', $title = 'Addon error', $message = 'Addon(s) are not legitimate.', $state = 'U', $callbackOnClose = '', $callbackReference = ''); uninstallAddons($uninstallAddons); } regSetInstalledAddonsDetails($activeLoadedAddonsSlugs); Reg::set('allPurchasedAddonsNameAndSlug', $allPurchasedAddonsNameAndSlug); //Reg::set('activeAddons', $activeLoadedAddonsSlugs); }
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Updating</title> </head> <body style="font-family: 'Open Sans', sans-serif; font-size:12px; color: #555; line-height:24px;"> <div style="margin-top:-30px;"><?php processAppUpdate(); ?> </div> </body> </html> <?php } } if ($_GET['action'] == 'installAddons') { $addons = getNewAddonsAvailable(); if (empty($addons)) { echo "No, Addons to update."; exit; } echo "<br><strong>Install Addons</strong><br>"; echo str_pad(' ', 400); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Updating</title> </head> <body style="font-family: 'Open Sans', sans-serif; font-size:12px; color: #555; line-height:24px;"> <div style="margin-top:-30px;"><?php
public static function getAddonsPageHTML() { $data = array(); $data['installedAddons'] = getInstalledAddons(true); $data['newAddons'] = getNewAddonsAvailable(); $data['promoAddons'] = getPromoAddons(); $data['promos'] = getOption('promos'); $data['isAppRegistered'] = isAppRegistered(); $data['isMiniExpired'] = panelRequestManager::checkIsMiniExpired(); $data['priceForSuiteUpgradedFromMini'] = panelRequestManager::getPriceForSuiteUpgradedFromMini(); $data['priceForAddonSuite'] = panelRequestManager::getPriceForAddonSuite(); $suiteDetails = unserialize(getOption('suiteDetails')); if (empty($suiteDetails) and !is_array($suiteDetails)) { $data['addonSuiteMiniLimit'] = 0; $data['addonSuiteOrMiniPurchased'] = $data['addonSuiteMiniActivity'] = $data['IDToBeUpgradedFromMini'] = $data['IDForAddonSuite'] = ''; } else { $data['addonSuiteMiniLimit'] = $suiteDetails['addonSuiteMiniLimit']; $data['addonSuiteOrMiniPurchased'] = $suiteDetails['addonSuiteOrMiniPurchased']; $data['addonSuiteMiniActivity'] = $suiteDetails['addonSuiteMiniActivity']; $data['IDToBeUpgradedFromMini'] = $suiteDetails['IDToBeUpgradedFromMini']; $data['IDForAddonSuite'] = $suiteDetails['IDForAddonSuite']; } $HTML = TPL::get('/templates/addons/view.tpl.php', $data); return $HTML; }