mirror of
				https://github.com/Icinga/icingaweb2.git
				synced 2025-10-31 19:34:16 +01:00 
			
		
		
		
	Icinga\Web\Controller::setupSortControl(): set query on the newly created SortBox (if given)
refs #9220
This commit is contained in:
		
							parent
							
								
									32659647b9
								
							
						
					
					
						commit
						e1c3d23d12
					
				| @ -41,19 +41,24 @@ class Controller extends ModuleActionController | ||||
|      * | ||||
|      * In case the current view has been requested as compact this method does nothing. | ||||
|      * | ||||
|      * @param   array   $columns    An array containing the sort columns, with the | ||||
|      * @param   array    $columns    An array containing the sort columns, with the | ||||
|      *                               submit value as the key and the label as the value | ||||
|      * @param   Sortable $query      Query to set on the newly created SortBox | ||||
|      * | ||||
|      * @return  $this | ||||
|      */ | ||||
|     protected function setupSortControl(array $columns) | ||||
|     protected function setupSortControl(array $columns, Sortable $query = null) | ||||
|     { | ||||
|         if (! $this->view->compact) { | ||||
|             $req = $this->getRequest(); | ||||
|             $this->view->sortBox = SortBox::create( | ||||
|             $this->view->sortBox = $sortBox = SortBox::create( | ||||
|                 'sortbox-' . $req->getActionName(), | ||||
|                 $columns | ||||
|             )->setRequest($req); | ||||
|             if ($query !== null) { | ||||
|                 $sortBox->setQuery($query); | ||||
|             } | ||||
|             $sortBox->handleRequest(); | ||||
|         } | ||||
| 
 | ||||
|         return $this; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user