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
| drush upwd host --password=123 |
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_state->getFormObject()->getEntity(); |
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
| $config = \Drupal::service('config.factory')->getEditable("domain.config.{$domain_machine_name}.omni_magazine.settings"); | |
| $config->set('logo', array('use_default' => FALSE, 'path' => drupal_realpath($file->getFileUri()))); | |
| $config->save(); |
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
| $config = \Drupal::service('config.factory')->getEditable('domain.config.three_d8_test.system.site'); | |
| $config->set('name', 'trest'); | |
| $config->save(); |
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
| $query = new EntityFieldQuery(); | |
| $query->entityCondition('entity_type', 'node') | |
| ->propertyCondition('type', 'feasibility_plan') | |
| ->propertyCondition('uid', $uid) | |
| ->addTag('DANGEROUS_ACCESS_CHECK_OPT_OUT'); | |
| if ($personal_view) { | |
| $query->fieldCondition('field_show_in_student_record', 'value', 1, '='); | |
| } | |
| $res = $query->execute(); |
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 MYMODULE_form_user_register_form_alter(&$form, &$form_state, $form_id) { | |
| $form['account']['pass']['#process'] = array( | |
| 'form_process_password_confirm', | |
| 'MYMODULE_password_confirm_process', | |
| 'user_form_process_password_confirm' | |
| ); | |
| } | |
| function MYMODULE_password_confirm_process($element) { | |
| $element['pass1']['#attributes']['title'] = 'Title'; |
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
| $exam_wrp = entity_metadata_wrapper('event', 10); | |
| $exam_wrp->field_assignee[ITEM_KEY]->set(); | |
| $exam_wrp->save(); |
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
| $q = new EntityFieldQuery; | |
| $exam_id = $exam_wrp->field_event_exan_id->value(); | |
| $assignee_user = $q->entityCondition('entity_type', 'event') | |
| ->propertyCondition('type', 'exam_event') | |
| ->fieldCondition('field_start_event_date', 'value', date('Y-m-d'), '>') | |
| ->fieldCondition('field_event_exan_id', 'value', $exam_id, '=') | |
| ->fieldCondition('field_assignee', 'target_id', array($GLOBALS['user']->uid), 'IN') | |
| ->execute(); |
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
| ctools_include('ajax'); | |
| ctools_include('modal'); | |
| ctools_modal_add_js(); | |
| drupal_set_message('test'); | |
| ctools_modal_render('test', theme('status_messages')); |
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 default entity in ctools popup. | |
| */ | |
| function cba_events_create_default_entity_in_popup($js, $user_id) { | |
| if (!$js) { | |
| return drupal_goto('event/default/add'); | |
| } | |
| ctools_include('ajax'); | |
| ctools_include('modal'); |