Add new comment

Thanks a lot, below one is working for me :)
  
function MODULENAME_views_pre_render(&$view)
{
    if ($view->name == VIEWNAME)
    {
      foreach ($view->result as $result)
      {

        $status[] = $result->_field_data['uid']['entity']->status;

      }
      //Load and render the user fields
      $view->style_plugin->render_fields($view->result);

      foreach ($view->style_plugin->rendered_fields as $index => &$rendered_result)
      {
        $icon = 'glyphicon-ban-circle';
        $title = 'Block';

        if($status[$index] == 0)  {
          $icon = 'glyphicon-ok-circle';
          $title = 'Unblock';
        }
      
          <a href="#" title="'. $title. '"
            class="block-user">
          <span class="glyphicon '. $icon. '"></span></a>';
      }
    }
}
  

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.