Ejemplo n.º 1
0
 public function view()
 {
     Loader::library('update');
     $this->set('latest_version', Update::getLatestAvailableVersionNumber());
     $tp = new TaskPermission();
     $updates = 0;
     $local = array();
     $remote = array();
     if ($tp->canInstallPackages()) {
         $local = Package::getLocalUpgradeablePackages();
         $remote = Package::getRemotelyUpgradeablePackages();
     }
     // now we strip out any dupes for the total
     $updates = 0;
     $localHandles = array();
     foreach ($local as $_pkg) {
         $updates++;
         $localHandles[] = $_pkg->getPackageHandle();
     }
     foreach ($remote as $_pkg) {
         if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
             $updates++;
         }
     }
     $this->set('updates', $updates);
 }
Ejemplo n.º 2
0
 public function view()
 {
     $this->set('latest_version', Config::get('APP_VERSION_LATEST'));
     $tp = new TaskPermission();
     $updates = 0;
     $local = array();
     $remote = array();
     if ($tp->canInstallPackages()) {
         $local = Package::getLocalUpgradeablePackages();
         $remote = Package::getRemotelyUpgradeablePackages();
     }
     // now we strip out any dupes for the total
     $updates = 0;
     $localHandles = array();
     foreach ($local as $_pkg) {
         $updates++;
         $localHandles[] = $_pkg->getPackageHandle();
     }
     foreach ($remote as $_pkg) {
         if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
             $updates++;
         }
     }
     $this->set('updates', $updates);
 }
Ejemplo n.º 3
0
if ($tp->canInstallPackages()) {
    $mi = Marketplace::getInstance();
}
$pkgRemote = array();
$pkgLocal = array();
if (Config::get('concrete.marketplace.enabled') && is_object($mi)) {
    if ($mi->isConnected()) {
        $pkgArray = Package::getInstalledList();
        foreach ($pkgArray as $pkg) {
            if ($pkg->isPackageInstalled() && version_compare($pkg->getPackageVersion(), $pkg->getPackageVersionUpdateAvailable(), '<')) {
                $pkgRemote[] = $pkg;
            }
        }
    }
}
$pkgAvailableArray = Package::getLocalUpgradeablePackages();
foreach ($pkgAvailableArray as $pkg) {
    if (!in_array($pkg, $pkgRemote)) {
        $pkgLocal[] = $pkg;
    }
}
?>
		<?php 
echo Loader::helper('concrete/dashboard')->getDashboardPaneHeaderWrapper(t('Update Add-Ons'));
?>

<?php 
if (!$tp->canInstallPackages()) {
    ?>
	<p class="block-message alert-message error"><?php 
    echo t('You do not have access to download themes or add-ons from the marketplace.');
Ejemplo n.º 4
0
	function sortAvailableArray($obj1, $obj2) {
		$name1 = ($obj1 instanceof Package) ? $obj1->getPackageName() : $obj1->getBlockTypeName();
		$name2 = ($obj2 instanceof Package) ? $obj2->getPackageName() : $obj2->getBlockTypeName();
		return strcasecmp($name1, $name2);
	}
	
	// grab the total numbers of updates.
	// this consists of 
	// 1. All packages that have greater pkgAvailableVersions than pkgVersion
	// 2. All packages that have greater pkgVersion than getPackageCurrentlyInstalledVersion
	$local = array();
	$remote = array();
	$pkgAvailableArray = array();
	if ($tp->canInstallPackages()) { 
		$local = Package::getLocalUpgradeablePackages();
		$remote = Package::getRemotelyUpgradeablePackages();
	}
	
	// now we strip out any dupes for the total
	$updates = 0;
	$localHandles = array();
	foreach($local as $_pkg) {
		$updates++;
		$localHandles[] = $_pkg->getPackageHandle();
	}
	foreach($remote as $_pkg) {
		if (!in_array($_pkg->getPackageHandle(), $localHandles)) {
			$updates++;
		}
	}