Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Build login_peekaboo_admin form.
- *
- * @param array $form_state
- * @return array The created form.
- */
- function login_peekaboo_settings() {
- $form['peek_base_url'] = array(
- '#type' => 'textfield',
- '#title' => t('Base URL'),
- '#default_value' => variable_get('peek_base_url', 'peekaboo'),
- '#size' => 60,
- '#maxlength' => 64,
- '#description' => "The base url of your peekaboo login"
- );
- $form['peek_page_title'] = array(
- '#type' => 'textfield',
- '#title' => t('Login Page Title'),
- '#default_value' => variable_get('peek_page_title', 'This is where mama keeps the cookies'),
- '#size' => 60,
- '#maxlength' => 64,
- '#description' => t('title of your new login page.')
- );
- $form['#submit'][] = 'login_peekaboo_settings_submit';
- return system_settings_form($form);
- }
- /**
- * Validates the login peekaboo admin form
- */
- function login_peekaboo_settings_validate($form, &$form_state){
- foreach($form_state['values'] as $name => $val){
- switch($name){
- case 'peek_base_url':
- break;
- }
- }
- }
- /**
- * Allows submission of the login peekaboo admin form
- */
- function login_peekaboo_settings_submit($form, &$form_state){
- if(true){
- //updates menu cache when the base URL is changed.
- menu_router_build(TRUE);
- menu_cache_clear_all();
- }
- }
Add Comment
Please, Sign In to add comment