Created
January 20, 2016 07:05
-
-
Save alvar0hurtad0/f8dc7cfee10669104378 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_views_post_execute. | |
*/ | |
function points_of_sale_feature_views_post_execute(&$view){ | |
if ($view->name == 'points_of_sale') { | |
switch ($view->current_display){ | |
case 'where_to_buy_page': | |
// Put LOSAN Points of sale on the top of the list. | |
$temp_result = array(); | |
foreach ($view->result as $key => $item){ | |
if ($item->node_title == 'LOSAN'){ | |
array_unshift($temp_result, $item); | |
} | |
else{ | |
$temp_result[] = $item; | |
} | |
} | |
$view->result = $temp_result; | |
$view->display_handler->view->result = $temp_result; | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment