Файл: concrete5.7.5.6/concrete/controllers/backend/marketplace/connect.php
Строк: 47
<?php
namespace ConcreteControllerBackendMarketplace;
use ConcreteControllerBackendUserInterfaceMarketplaceItem;
use ConcreteCoreApplicationEditResponse;
use ConcreteCoreLegacyTaskPermission;
class Connect extends MarketplaceItem
{
public function view()
{
// we also perform the "does the user need to buy it?" query here to save some requests
$r = new EditResponse();
$r->setAdditionalDataAttribute('isConnected', $this->marketplace->isConnected());
$r->setAdditionalDataAttribute('connectionError', $this->marketplace->getConnectionError());
if (is_object($this->item)) {
$r->setAdditionalDataAttribute('purchaseRequired', $this->item->purchaseRequired());
$r->setAdditionalDataAttribute('remoteURL', $this->item->getRemoteURL());
$r->setAdditionalDataAttribute('localURL', $this->item->getLocalURL());
if (!$this->item->purchaseRequired()) {
$this->item->enableFreeLicense();
}
}
$r->outputJSON();
}
protected function canAccess()
{
$tp = new TaskPermission();
return $tp->canInstallPackages();
}
}