function views_column_class_prepare_advanced in Views Column Class 7
Parse the input from the Advanced classes textarea.
Parameters
string $advanced: Expects one entry per line with each line accepting up to 4 values using | as a delimiter. (e.g. columns|class_left|class_right|column_class_prefix)
Return value
array that has a depth of 2 a collection of arrays of 4 values 1. The columns 2. The class to apply to the blocks in the left column 3. The class to apply to the blocks in the right column 4. The class to apply as a prefix in each column that will be followed by the column number 5. The class to apply as a prefix in each row that will be followed by the row number 6. Hybrid class string which potentially combines left, right, column and row values
1 call to views_column_class_prepare_advanced()
- template_preprocess_views_view_column_class in ./
views_column_class.module - Implements template_preprocess_HOOK().
File
- ./
views_column_class.module, line 209 - @todo.
Code
function views_column_class_prepare_advanced($advanced) {
$advanced_parsed = array();
$advanced = trim($advanced);
if ($advanced != '') {
$advanced_array = explode("\n", $advanced);
if (count($advanced_array) > 0) {
foreach ($advanced_array as $id => $adv_row) {
$adv_row_arr = explode('|', $adv_row);
$row_elements = count($adv_row_arr);
$row_values = array();
if ($row_elements >= 1 && (int) $adv_row_arr[0] > 0) {
$advanced_parsed[] = array(
$adv_row_arr[0],
$row_elements >= 2 && trim($adv_row_arr[1]) != '' ? trim($adv_row_arr[1]) : 0,
$row_elements >= 3 && trim($adv_row_arr[2]) != '' ? trim($adv_row_arr[2]) : FALSE,
$row_elements >= 4 && trim($adv_row_arr[3]) != '' ? trim($adv_row_arr[3]) : FALSE,
$row_elements >= 5 && trim($adv_row_arr[4]) != '' ? trim($adv_row_arr[4]) : '',
$row_elements >= 6 && trim($adv_row_arr[5]) != '' ? trim($adv_row_arr[5]) : '',
$row_elements >= 7 && trim($adv_row_arr[6]) != '' ? trim($adv_row_arr[6]) : '',
);
}
}
}
}
return $advanced_parsed;
}