class CControllerDashboardList extends CController {
protected function init() {
$this->disableCsrfValidation();
protected function checkInput() {
'sortorder' => 'in '.ZBX_SORT_DOWN.','.ZBX_SORT_UP,
'filter_name' => 'string',
'filter_show' => 'in '.DASHBOARD_FILTER_SHOW_ALL.','.DASHBOARD_FILTER_SHOW_MY
$ret = $this->validateInput($fields);
$this->setResponse(new CControllerResponseFatal());
protected function checkPermissions() {
return $this->checkAccess(CRoleHelper::UI_MONITORING_DASHBOARD);
protected function doAction() {
CProfile::delete('web.dashboard.dashboardid');
CProfile::update('web.dashboard.list_was_opened', 1, PROFILE_TYPE_INT);
$sort_field = $this->getInput('sort', CProfile::get('web.dashboard.list.sort', 'name'));
$sort_order = $this->getInput('sortorder', CProfile::get('web.dashboard.list.sortorder', ZBX_SORT_UP));
CProfile::update('web.dashboard.list.sort', $sort_field, PROFILE_TYPE_STR);
CProfile::update('web.dashboard.list.sortorder', $sort_order, PROFILE_TYPE_STR);
if ($this->hasInput('filter_set')) {
CProfile::update('web.dashboard.filter_name', $this->getInput('filter_name', ''), PROFILE_TYPE_STR);
CProfile::update('web.dashboard.filter_show', $this->getInput('filter_show', DASHBOARD_FILTER_SHOW_ALL),
elseif ($this->hasInput('filter_rst')) {
CProfile::delete('web.dashboard.filter_name');
CProfile::delete('web.dashboard.filter_show');
'name' => CProfile::get('web.dashboard.filter_name', ''),
'show' => CProfile::get('web.dashboard.filter_show', DASHBOARD_FILTER_SHOW_ALL)
'uncheck' => $this->hasInput('uncheck'),
'sortorder' => $sort_order,
'profileIdx' => 'web.dashboard.filter',
'active_tab' => CProfile::get('web.dashboard.filter.active', 1),
'allowed_edit' => CWebUser::checkAccess(CRoleHelper::ACTIONS_EDIT_DASHBOARDS)
$limit = CSettingsHelper::get(CSettingsHelper::SEARCH_LIMIT) + 1;
$data['dashboards'] = API::Dashboard()->get([
'output' => ['dashboardid', 'name', 'userid', 'private'],