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
| /** | |
| * Implements hook_entity_info_alter(). | |
| */ | |
| function cba_events_entity_info_alter(&$entity_info) { | |
| // Update exam events path. | |
| $entity_info['event']['bundles']['exam_event']['crud']['edit']['path'] = 'event/exam/%eckentity/edit'; | |
| $entity_info['event']['bundles']['exam_event']['crud']['delete']['path'] = 'event/exam/%eckentity/delete'; | |
| // Update default event path. | |
| $entity_info['event']['bundles']['default']['crud']['add']['path'] = 'event/default/add'; |
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
| $form['startdate'] = array( | |
| '#type' => 'date_popup', | |
| '#title' => t('Lesson start date'), | |
| '#timepicker' => 'timepicker', | |
| '#timepicker_options' => array( | |
| 'rows' => 6, | |
| 'minutes' => array( | |
| 'starts' => 0, | |
| 'ends' => 56, | |
| 'interval' => 4, |
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
| $form['cancel'] = array( | |
| '#type' => 'button', | |
| '#value' => t('Cancel'), | |
| '#attributes' => array('onClick' => 'Drupal.CTools.Modal.dismiss();'), | |
| ); |
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
| $fields = field_info_fields(); | |
| $races_list = list_allowed_values($fields['field_race']); |
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
| CREATE TABLE example_table ( | |
| nid INT(11) NOT NULL, | |
| plain_text_field VARCHAR(32, | |
| numeric_field INT(11), | |
| boolean_field INT(1), | |
| timestamp_field INT(8), | |
| PRIMARY KEY(nid) | |
| ); | |
| function mymodule_views_data() { |
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
| /** | |
| * Create new multichoice questions. | |
| */ | |
| function cba_quiz_new_multichoice_question() { | |
| global $user; | |
| $question = new stdClass(); | |
| $question->title = t('Questions template'); | |
| $question->type = 'multichoice'; | |
| $question->body = array(LANGUAGE_NONE => array(array('value' => t('Your questions text')))); |
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
| $nids = db_select('node', 'n') | |
| ->fields('n', array('nid')) | |
| ->condition('type', 'quiz') | |
| ->execute() | |
| ->fetchCol(); | |
| node_delete_multiple($nids); |
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
| $form['full_calendar_link'] = array( | |
| '#type' => 'link', | |
| '#title' => '<i class="fa fa-calendar fa-2x"></i>', | |
| '#href' => 'fc/student-reports/calendar', | |
| '#options' => array( | |
| 'html' => TRUE, | |
| 'query' => array('assignee' => 'All'), | |
| 'attributes' => array( | |
| 'title' => t('Full calendar'), | |
| 'class' => array('ctools-use-modal'), |
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
| /** | |
| * Get information from module info file. | |
| * | |
| * @param string $path_to_module | |
| * @param string $module_name | |
| * | |
| * @return array $module_info; | |
| */ | |
| function bartik_get_module_info($path_to_module, $module_name) { | |
| $path_to_info_file = "{$path_to_module}/{$module_name}.info"; |
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
| function social_links_menu() { | |
| $items['admin/config/system/social_links'] = array( | |
| 'title' => 'social_links', | |
| 'description' => 'Configure to fit clients needs', | |
| 'page callback' => 'drupal_get_form', | |
| 'page arguments' => array('social_links_settings'), | |
| 'access arguments' => array('administer site configuration'), | |
| 'file' => 'social_links.admin.inc', | |
| ); |