Passed
Push — master ( d021a5...a13070 )
by Sam
03:47 queued 12s
created

ResultGrid   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 1
Metric Value
eloc 5
c 4
b 0
f 1
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A beforeParentInit() 0 8 1
A renderKeys() 0 2 1
1
<?php
2
3
/**
4
 * Displays media results as a grid with posters and labels.
5
 *
6
 * @author Sam Stenvall <[email protected]>
7
 * @copyright Copyright &copy; Sam Stenvall 2013-
8
 * @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v3.0
9
 */
10
Yii::import('zii.widgets.CListView');
11
12
class ResultGrid extends CListView
13
{
14
	use ResultTrait;
0 ignored issues
show
Bug introduced by
The trait ResultTrait requires the property $totalItemCount which is not provided by ResultGrid.
Loading history...
15
	
16
	public function beforeParentInit()
17
	{
18
		$this->itemsTagName = 'ul';
19
		$this->itemsCssClass = 'thumbnails item-grid';
20
		
21
		// Scroll to the top of the list and trigger unveiling of images 
22
		// whenever the page is changed
23
		$this->afterAjaxUpdate = new CJavaScriptExpression("function() {
24
			location.hash = '#result-list';
25
			$('.lazy').unveil();
26
		}");
27
	}
28
29
	/**
30
	 * Override parent implementation and do nothing since we don't need this
31
	 */
32
	public function renderKeys()
33
	{
34
35
	}
36
37
}
38