public function viewModeList($viewMode)
    {
        $this->_validateViewMode($viewMode);
        $this->loadModel('Field.FieldInstances');
        $instances = $this->_getInstances();

        if (count($instances) === 0) {
            $this->Flash->warning(__d('field', 'There are no field attached yet.'));
        } else {
            $instances = $instances->sortBy(function ($fieldInstance) use ($viewMode) {
                if (isset($fieldInstance->view_modes[$viewMode]['ordering'])) {
                    return $fieldInstance->view_modes[$viewMode]['ordering'];
                }

                return 0;
            }, SORT_ASC);
        }

        $this->title(__d('field', 'View Modes'));
        $this->set('instances', $instances);
        $this->set('viewMode', $viewMode);
        $this->set('viewModeInfo', $this->viewModes($viewMode));
    }