function panels_extra_layouts_adaptive_get_digit in Panels Extra Layouts 7
Same name and namespace in other branches
- 6 panels_extra_layouts.module \panels_extra_layouts_adaptive_get_digit()
- 7.2 panels_extra_layouts.module \panels_extra_layouts_adaptive_get_digit()
The mapper function for computing the hash.
Parameters
$x integer: The index of the content array.
Return value
integer The sum of all the 2nd digits in a given row of the content array.
1 call to panels_extra_layouts_adaptive_get_digit()
- panels_extra_layouts_adaptive_hash in ./
panels_extra_layouts.module - The hashing function is quite simple, hence imperfect. There are some exceptions that are handled below to make the way the grid is filled consistent.
2 string references to 'panels_extra_layouts_adaptive_get_digit'
- four-three-adaptive.tpl.php in plugins/
layouts/ four_three_adaptive/ four-three-adaptive.tpl.php - three-four-adaptive.tpl.php in plugins/
layouts/ three_four_adaptive/ three-four-adaptive.tpl.php
File
- ./
panels_extra_layouts.module, line 35 - panels_extra_layouts.module @author António P. P. Almeida <appa@perusio.net> @date Wed Aug 3 04:36:20 2011
Code
function panels_extra_layouts_adaptive_get_digit($x) {
// array_pop requires a variable. Doh no love for FP on PHP :(.
$last_digit = sscanf($x, "%*1d%d");
return empty($x) ? 0 : array_pop($last_digit);
}