Файл: concrete5.7.5.6/concrete/controllers/backend/marketplace/search.php
Строк: 33
<?php
namespace ConcreteControllerBackendMarketplace;
use ConcreteControllerBackendUserInterface;
use ConcreteCoreApplicationServiceDashboard;
use ConcreteCoreMarketplaceRemoteItemList;
class Search extends UserInterface
{
public function view()
{
session_write_close();
$mri = new RemoteItemList();
$mri->setItemsPerPage(5);
$mri->setIncludeInstalledItems(false);
$mri->filterByCompatibility(1);
$mri->setType('addons');
$keywords = $_REQUEST['q'];
$mri->filterByKeywords($keywords);
$mri->execute();
$items = $mri->getPage();
$r = array();
foreach ($items as $it) {
$obj = new stdClass;
$obj->mpID = $it->getMarketplaceItemID();
$obj->name = $it->getName();
$obj->img = $it->getRemoteIconURL();
$obj->href = $it->getRemoteURL();
$r[] = $obj;
}
print json_encode($r);
exit;
}
public function canAccess()
{
$dh = new Dashboard();
return $dh->canRead();
}
}