Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Implements hook_element_info_alter().
  5. */
  6. function mymodule_element_info_alter(&$type) {
  7. if (isset($type['text_format'])) {
  8. $type['text_format']['#process'][] = 'mymodule_process_format';
  9. }
  10. }
  11.  
  12. function mymodule_process_format($element) {
  13. global $user;
  14.  
  15. //hide for all except superadmin
  16. if ($user->uid <> 1) {
  17. hide($element['format']);
  18. }
  19.  
  20. return $element;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement