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 | |
| //This will generate a random password, you could set your own here | |
| $password = user_password(8); | |
| //set up the user fields | |
| $fields = array( | |
| 'name' => 'user_name', | |
| 'mail' => '[email protected]', | |
| 'pass' => $password, | |
| 'status' => 1, |
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 | |
| /** | |
| * Basic Node Creation Example for Drupal 7 | |
| * | |
| * This example: | |
| * - Assumes a standard Drupal 7 installation | |
| * - Does not verify that the field values are correct | |
| */ | |
| $body_text = 'This is the body text I want entered with the node.'; |
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 | |
| $field = field_info_field('field_name'); | |
| $allowed_values = list_allowed_values($field); |
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
| var w = window.open(jQuery(this).attr('href'), 'real-size-photo', 'width=500,height=500'); | |
| w.moveTo(0, 0); | |
| if (document.all) { | |
| w.resizeTo(screen.availWidth, screen.availHeight); | |
| } | |
| else { | |
| if (document.layers || document.getElementById) { | |
| if (w.outerHeight < screen.availHeight || w.outerWidth < screen.availWidth) { | |
| w.outerHeight = top.screen.availHeight; |
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 | |
| function customModule_views_pre_render(&$view) { | |
| if ($view->name == 'view_name' && $view->current_display == 'display_id') { | |
| // Here you can do any php you want to get the title you need for your view. | |
| $view->build_info['title'] = "My custom 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| <head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
| <link rel="selenium.base" href="http://example.com/" /> | |
| <title>checkout</title> | |
| </head> | |
| <body> | |
| <table cellpadding="1" cellspacing="1" border="1"> |
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 | |
| /** | |
| * Implementation of hook_form_alter() | |
| */ | |
| function hook_form_alter(&$form, $form_state, $form_id) { | |
| if (drupal_match_path($form_id, 'uc_product_add_to_cart_form_*')) { | |
| array_unshift($form['#submit'], 'uc_product_before_add_to_cart_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
| $('#user-register :input').each(function(){ | |
| console.log($(this).attr('name')) | |
| }); |
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
| `svn diff -r #{ARGV[0]}:HEAD --summarize`.lines().each { |file| | |
| p file.chomp.gsub(/[AM ]/, "") | |
| } |
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 | |
| $msg = t('Your message here.'); | |
| form_set_error('field_shopdata_paypal][0][value', $msg); | |
| form_set_error('field_shopdata_paypal_fname][0][value', $msg); | |
| array_pop($_SESSION['messages']['error']); // Remove doubled mesage. | |
| form_set_error('field_shopdata_paypal_lname][0][value', $msg); | |
| array_pop($_SESSION['messages']['error']); // Remove doubled mesage. |
OlderNewer