This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Table header | |
| $header = array( | |
| 'fruit' => t('Fruit'), | |
| 'a' => t('Vitamin A'), | |
| 'b1' => t('Vitamin B1'), | |
| 'b2' => t('Vitamin B2'), | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Table header | |
| $header = array( | |
| // Column 1 | |
| 'fruit' => array( | |
| 'data' => t('Fruit'), | |
| 'id' => 'head-fruit', | |
| 'class' => 'col-fruit', | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Table rows | |
| $rows = array( | |
| // Row 1 | |
| array( | |
| 'data' => array( | |
| // Column 1 | |
| 'fruit' => array( | |
| 'data' => t('Apple'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Table header | |
| $table_header = array( | |
| // Column 1 | |
| 'nid' => array( | |
| 'data' => 'Nid', | |
| 'class' => 'col-nid', | |
| ), | |
| // Column 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Format and print out the table. | |
| return theme('table', array( | |
| 'header' => $table_header, | |
| 'rows' => $table_rows, | |
| 'id' => 'table-articles', | |
| 'class' => 'articles', | |
| )); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_form_alter(). | |
| */ | |
| function MYMODULE_form_alter(&$form, &$form_state, $form_id) { | |
| if ($form_id == 'user_login') { | |
| $form['#submit'][] = 'MYMODULE_user_login_submit'; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Additional handler for user_login form submit. | |
| */ | |
| function MYMODULE_user_login_submit($form, &$form_state) { | |
| $user = user_load($form_state['uid']); | |
| if ($user->access == 0) { | |
| $form_state['redirect'] = 'terms-and-conditions'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_form_alter(). | |
| */ | |
| function MYMODULE_form_alter(&$form, &$form_state, $form_id) { | |
| if ($form_id == 'user_register_form') { | |
| $form['#validate'][] = 'MYMODULE_user_register_form_validate'; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_menu(). | |
| */ | |
| function MYMODULE_menu() { | |
| $items = array(); | |
| $items['terms-and-conditions'] = array( | |
| 'title' => t('Terms & Conditions'), | |
| 'page callback' => 'MYMODULE_page_terms_and_conditions', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_admin_paths(). | |
| */ | |
| function MYMODULE_admin_paths() { | |
| $paths = array( | |
| 'terms-and-conditions' => TRUE, | |
| ); | |
| return $paths; |