/** * Runs through all packages on the marketplace, sees if they're installed here, and updates the available version number for them */ public static function checkPackageUpdates() { Loader::model('system_notification'); $items = Marketplace::getAvailableMarketplaceItems(false); foreach ($items as $i) { $p = Package::getByHandle($i->getHandle()); if (is_object($p)) { // we only add a notification if it's newer than the last one we know about if (version_compare($p->getPackageVersionUpdateAvailable(), $i->getVersion(), '<') && version_compare($p->getPackageVersion(), $i->getVersion(), '<')) { SystemNotification::add(SystemNotification::SN_TYPE_ADDON_UPDATE, t('An updated version of %s is available.', $i->getName()), t('New Version: %s.', $i->getVersion()), '', View::url('/dashboard/extend/update'), $i->getRemoteURL()); } $p->updateAvailableVersionNumber($i->getVersion()); } } }
$coreBlockTypes[] = $_bt; } else { $webBlockTypes[] = $_bt; } } } $availableArray = array_merge($btAvailableArray, $pkgAvailableArray); usort($availableArray, 'sortAvailableArray'); /* Load featured add-ons from the marketplace. */ Loader::model('collection_attributes'); $db = Loader::db(); if(ENABLE_MARKETPLACE_SUPPORT && $tp->canInstallPackages()){ $purchasedBlocksSource = Marketplace::getAvailableMarketplaceItems(); }else{ $purchasedBlocksSource = array(); } // now we iterate through the purchased items (NOT BLOCKS, THESE CAN INCLUDE THEMES) list and removed ones already downloaded // This really should be made into a more generic object since it's not block types anymore. $skipHandles = array(); foreach($availableArray as $ava) { foreach($purchasedBlocksSource as $pi) { if ($pi->getHandle() == $ava->getPackageHandle()) { $skipHandles[] = $ava->getPackageHandle(); } } }