Guest User

Untitled

a guest
Jul 17th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Build login_peekaboo_admin form.
  5. *
  6. * @param array $form_state
  7. * @return array The created form.
  8. */
  9. function login_peekaboo_settings() {
  10.  
  11. $form['peek_base_url'] = array(
  12. '#type' => 'textfield',
  13. '#title' => t('Base URL'),
  14. '#default_value' => variable_get('peek_base_url', 'peekaboo'),
  15. '#size' => 60,
  16. '#maxlength' => 64,
  17. '#description' => "The base url of your peekaboo login"
  18. );
  19.  
  20. $form['peek_page_title'] = array(
  21. '#type' => 'textfield',
  22. '#title' => t('Login Page Title'),
  23. '#default_value' => variable_get('peek_page_title', 'This is where mama keeps the cookies'),
  24. '#size' => 60,
  25. '#maxlength' => 64,
  26. '#description' => t('title of your new login page.')
  27. );
  28.  
  29.  
  30. $form['#submit'][] = 'login_peekaboo_settings_submit';
  31.  
  32. return system_settings_form($form);
  33. }
  34.  
  35. /**
  36. * Validates the login peekaboo admin form
  37. */
  38. function login_peekaboo_settings_validate($form, &$form_state){
  39. foreach($form_state['values'] as $name => $val){
  40. switch($name){
  41. case 'peek_base_url':
  42.  
  43. break;
  44. }
  45. }
  46.  
  47.  
  48. }
  49.  
  50.  
  51.  
  52. /**
  53. * Allows submission of the login peekaboo admin form
  54. */
  55. function login_peekaboo_settings_submit($form, &$form_state){
  56.  
  57. if(true){
  58. //updates menu cache when the base URL is changed.
  59. menu_router_build(TRUE);
  60. menu_cache_clear_all();
  61. }
  62. }
Add Comment
Please, Sign In to add comment