public static function getRemotelyUpgradeablePackages()
 {
     $packages = Package::getInstalledList();
     $upgradeables = array();
     $db = Loader::db();
     foreach ($packages as $p) {
         if (version_compare($p->getPackageVersion(), $p->getPackageVersionUpdateAvailable(), '<')) {
             $upgradeables[] = $p;
         }
     }
     return $upgradeables;
 }
Exemple #2
0
                    <div class="spacer-row-5"></div>

                    <a name="addons"></a>
                    <a href="<?php 
        echo URL::to('/dashboard/extend/update');
        ?>
" class="btn btn-default pull-right btn-xs "><?php 
        echo t('Update Add-Ons');
        ?>
</a>
                    <h3><?php 
        echo t('Add-On Compatibility');
        ?>
</h3>
                    <?php 
        $list = \Package::getInstalledList();
        $ci = Core::make('helper/concrete/urls');
        if (count($list) == 0) {
            ?>
                        <p><?php 
            echo t('No add-ons installed.');
            ?>
</p>

                    <?php 
        }
        foreach ($list as $pkg) {
            ?>

                        <div class="media" data-addon="<?php 
            echo $pkg->getPackageHandle();
<?php

defined('C5_EXECUTE') or die("Access Denied.");
$valt = Loader::helper('validation/token');
$ci = Loader::helper('concrete/urls');
$ch = Loader::helper('concrete/ui');
$tp = new TaskPermission();
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'));
 public function execute()
 {
     $params = $this->params;
     $params['version'] = APP_VERSION;
     $params['itemsPerPage'] = $this->itemsPerPage;
     Loader::library("marketplace");
     $mi = Marketplace::getInstance();
     $params['csToken'] = $mi->getSiteToken();
     if ($this->includeInstalledItems) {
         $params['includeInstalledItems'] = 1;
     } else {
         $params['includeInstalledItems'] = 0;
         $list = Package::getInstalledList();
         foreach ($list as $pkg) {
             $params['installedPackages'][] = $pkg->getPackageHandle();
         }
     }
     if (isset($_REQUEST[$this->queryStringPagingVariable])) {
         $params[$this->queryStringPagingVariable] = $_REQUEST[$this->queryStringPagingVariable];
     }
     $uh = Loader::helper('url');
     $url = $uh->buildQuery(MARKETPLACE_REMOTE_ITEM_LIST_WS . $this->type . '/-/get_remote_list', $params);
     $r = Loader::helper('file')->getContents($url);
     $r2 = @Loader::helper('json')->decode($r);
     $total = 0;
     $items = array();
     if (is_object($r2)) {
         $items = $r2->items;
         $total = $r2->total;
     }
     $this->total = $total;
     $this->setItems($items);
 }