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
angular.element(document).ready(function() { | |
var $inj = angular.bootstrap(document.body, ['use']); | |
var $rootScope = $inj.get("$rootScope"); | |
$rootScope.$broadcast("init", "hello"); | |
$rootScope.$digest(); | |
}); |
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
<div ng-app="mcApp"> | |
<div ng-controller="TeamCtrl"> | |
<h1>{{team.name}}</h1> | |
<hr> | |
<div class='row'> | |
<div class='col-sm-4'> | |
<mc-user ng-repeat="user in users.slice(0, users.length / 3) | filter:{team_ids: team.id}"></mc-user> | |
</div> |
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 | |
$machine_name = preg_replace('@[^a-z0-9-]+@', '-', strtolower($string)); |
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
$scope.$$phase || $scope.$apply(function() { | |
$scope.todos = todos; | |
}); |
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_views_pre_view(). | |
*/ | |
function HOOK_views_pre_view(&$view, &$display_id, &$args) { | |
if ($view->name == 'company_contents') { | |
$company_node = menu_get_object(); | |
if (!empty($company_node->field_contract_period[LANGUAGE_NONE][0])) { |
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 | |
/** | |
* Get location object by address string. | |
* | |
* @param string $location | |
* | |
* @return array | |
* | |
* @dependencies geocoder module. | |
*/ |
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 | |
$access_token = 'woknfowenf'; | |
$query = 'SELECT blabla... FROM blabla...'; | |
$result = fboauth_graph_query('fql', $access_token, array('q' => $query)); |
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 | |
//@see: https://drupal.org/node/1021556 | |
$wrapper = entity_metadata_wrapper('node', $node); | |
$wrapper->author->mail->value(); | |
$wrapper->author->mail->set('[email protected]'); | |
$wrapper->author->mail = '[email protected]'; | |
// Unified way of getting $node->title, $user->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
<?php | |
drupal_add_js('misc/ajax.js'); | |
ctools_add_js('modal'); | |
ctools_add_css('modal'); | |
// Add your modal style to the settings. You find the defaults in modal.js near the top: | |
drupal_add_js(array( | |
'my-modal-style' => array( | |
'modalSize' => array( |
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
app.controller('mainCtrl', function($rootScope, UserService) { | |
$rootScope.users = []; | |
$rootScope.todos = []; | |
// Get all users. | |
UserService.all().then(function(users) { | |
angular.forEach(users, function(user) { | |
$scope.users.push(user); | |
// Get all todos. |