comparison core/modules/views_ui/src/Controller/ViewsUIController.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
52 * 52 *
53 * @return array 53 * @return array
54 * The Views fields report page. 54 * The Views fields report page.
55 */ 55 */
56 public function reportFields() { 56 public function reportFields() {
57 $views = $this->entityManager()->getStorage('view')->loadMultiple(); 57 $views = $this->entityTypeManager()->getStorage('view')->loadMultiple();
58 58
59 // Fetch all fieldapi fields which are used in views 59 // Fetch all fieldapi fields which are used in views
60 // Therefore search in all views, displays and handler-types. 60 // Therefore search in all views, displays and handler-types.
61 $fields = []; 61 $fields = [];
62 $handler_types = ViewExecutable::getHandlerTypes(); 62 $handler_types = ViewExecutable::getHandlerTypes();
158 // Perform the operation. 158 // Perform the operation.
159 $view->$op()->save(); 159 $view->$op()->save();
160 160
161 // If the request is via AJAX, return the rendered list as JSON. 161 // If the request is via AJAX, return the rendered list as JSON.
162 if ($request->request->get('js')) { 162 if ($request->request->get('js')) {
163 $list = $this->entityManager()->getListBuilder('view')->render(); 163 $list = $this->entityTypeManager()->getListBuilder('view')->render();
164 $response = new AjaxResponse(); 164 $response = new AjaxResponse();
165 $response->addCommand(new ReplaceCommand('#views-entity-list', $list)); 165 $response->addCommand(new ReplaceCommand('#views-entity-list', $list));
166 return $response; 166 return $response;
167 } 167 }
168 168
181 */ 181 */
182 public function autocompleteTag(Request $request) { 182 public function autocompleteTag(Request $request) {
183 $matches = []; 183 $matches = [];
184 $string = $request->query->get('q'); 184 $string = $request->query->get('q');
185 // Get matches from default views. 185 // Get matches from default views.
186 $views = $this->entityManager()->getStorage('view')->loadMultiple(); 186 $views = $this->entityTypeManager()->getStorage('view')->loadMultiple();
187 // Keep track of previously processed tags so they can be skipped. 187 // Keep track of previously processed tags so they can be skipped.
188 $tags = []; 188 $tags = [];
189 foreach ($views as $view) { 189 foreach ($views as $view) {
190 $tag = $view->get('tag'); 190 $tag = $view->get('tag');
191 if ($tag && !in_array($tag, $tags)) { 191 if ($tag && !in_array($tag, $tags)) {