get([ 'output' => ['itemid', 'name'], 'selectHosts' => ['name'], 'itemids' => array_keys($itemids), 'webitems' => true ]); foreach ($db_items as $db_item) { $graphs[] = [ 'itemid' => $db_item['itemid'], 'label' => $db_item['hosts'][0]['name'].NAME_DELIMITER.$db_item['name'] ]; } } CArrayHelper::sort($graphs, ['label']); $this->setResponse(new CControllerResponseData([ 'name' => $this->getInput('name', $this->widget->getDefaultName()), 'graphs' => $graphs, 'user' => [ 'debug_mode' => $this->getDebugMode() ], 'allowed_ui_hosts' => $this->checkAccess(CRoleHelper::UI_MONITORING_HOSTS), 'allowed_ui_latest_data' => $this->checkAccess(CRoleHelper::UI_MONITORING_LATEST_DATA) ])); } }