Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

Regarding custom view in drupal 7

I have one issue that I'm facing now, I have 2 roles :

  1. Admin and another one is
  2. creator.

Now I have created 1 view in that we are displaying few fields as table permission as role creator. Like this...enter image description here

and we have too many creator roles person and what I want to do, I want it like this if someone who has creator role that person should see his status like this image above. and I am writing code like this

function cstore_custom_views_pre_view(&$view, &$display_id, &$args) {

  // Change the display if the acting user has 'administer site configuration'
  // permission, to display something radically different.
  // (Note that this is not necessarily the best way to solve that task. Feel
  // free to contribute another example!)
  $view = views_get_view('asset_status'); //selecting views
  global $user;
  print_r($view);
  $userid = $user->uid;
  $rid = $user->roles;
  $username = $user->name;
  //now what i should do?
}

please help me in this after this what should i do how do i apply condition on for the user..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...