This file contains 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 | |
// ... | |
use Symfony\Component\HttpFoundation\Response; | |
// Then later on (inside your controller's class), you have a function used | |
// for the route_name (on a hook_menu() item in your .module file), this | |
// function can return a JSON response... |
This file contains 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
'use strict'; | |
// Configure the angular-drupal module. | |
angular.module('angular-drupal').config(function($provide) { | |
$provide.value('drupalSettings', { | |
sitePath: 'http://test.easystreet3.com/drupal', // Example: 'http://example.com' with no trailing slash | |
basePath: '/', | |
endpoint: 'drupalgap', | |
language: 'und', | |
file_public_path: 'sites/default/files' // use public or private |
This file contains 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
// Returns true if the account has the 'foo' or 'bar' roles. | |
return count(array_intersect($account->roles, ['foo', 'bar'])); |
This file contains 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
/** | |
* @see https://www.drupal.org/documentation/entity-metadata-wrappers | |
* @example usage: my_dpm($wrapped_object); | |
*/ | |
function my_dpm($w) { | |
$values = array(); | |
foreach ($w->getPropertyInfo() as $key => $val) { | |
$values[$key] = $w->$key->value(); | |
} | |
$callers = debug_backtrace(); |
This file contains 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
#my-button { | |
background-color: #4e69a2; | |
border-color: #435a8b #3c5488 #334c83; | |
color: #fff; | |
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); | |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); | |
} | |
#my-button:after { | |
background-image: url("FB-f-Logo__white_29.png"); /* get image from https://www.facebookbrand.com/ */ | |
background-position: 0% 0%; |
This file contains 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
setInterval(function() { | |
$.mobile.loading('show', { | |
textVisible: true, | |
html: '<div style="text-align: center;"><h2>Saved!</h2></div>' | |
}); | |
setTimeout(function() { | |
$.mobile.loading().hide(); | |
}, 420); | |
}, 1); |
This file contains 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_user_operations(). | |
*/ | |
function example_user_operations() { | |
$operations = array( | |
'example_resend_welcome_email' => array( | |
'label' => t('Re-send welcome e-mail'), | |
'callback' => 'example_resend_welcome_email', |
NewerOlder