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
var bcrypt = require('bcrypt'); | |
load('application'); | |
before(loadUser, {only: ['show', 'edit', 'update', 'destroy']}); | |
before(loadGroups, {only: ['new', 'edit']}); | |
action('new', function () { | |
this.title = 'New user'; | |
this.user = new User; |
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
core = 7.x | |
api = 2 | |
projects[drupal][version] = "7.x" | |
projects[admin_menu][version] = "3.0-rc3" | |
projects[ctools][version] = "1.0" | |
projects[commerce][version] = "1.3" |
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
$view = new view(); | |
$view->name = 'user_autocomplete_example'; | |
$view->description = ''; | |
$view->tag = 'default'; | |
$view->base_table = 'users'; | |
$view->human_name = 'User Autocomplete Example'; | |
$view->core = 7; | |
$view->api_version = '3.0'; | |
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
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 | |
function get_orders($user){ | |
$query = new EntityFieldQuery(); | |
$query->entityCondition('entity_type','commerce_order'); | |
$query->entityCondition('bundle', 'commerce_order'); | |
$query->propertyCondition('user','uid',$user,'='); | |
$results = $query->execute['commerce_order']; | |
if ($results){ | |
return $results; |
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 | |
function MYMODULE_form_alter(&$form, &$form_state, $form_id){ | |
if ($form_id == 'user_register_form') { | |
$fields = array_filter($form['profile_PROFILE_TYPE_NAME'], "_filter_required_fields"); | |
foreach ($fields as $field_name => $field) { | |
$form['profile_PROFILE_TYPE_NAME'][$field_name]['und']['#access'] = false; | |
} | |
} | |
} |
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
/** | |
* Implements hook_node_accces(). | |
*/ | |
function example_schedules_node_access($node, $op, $account) { | |
if ($op !== 'view' && $node->type == 'class') { | |
if($profile = example_account_profile($account->uid)){ | |
if ($profile->type == 'teacher') { | |
if ($op == 'create'){ | |
return NODE_ACCESS_ALLOW; | |
} |
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 | |
function example_update_N(){ | |
// This manually enables the module using the same function features will use in the other example | |
features_module_enable('backup_migrate'); | |
// Now you don't need to revert dependencies component because you've already enabled the module that you added. | |
$features['site_config'] = array('variable'); | |
$features_rebuild($features); | |
$features_revert($features); |
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_drush_command() | |
* goes in modulename.drush.inc | |
*/ | |
function yogatrail_schedules_drush_command() { | |
$items = array(); | |
$items['yt-schedules-update-classes'] = array(); |
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
<pre style="display:inline-block;text-align:center;font-family:monospace;letter-spacing:6.5px;line-height:13px;font-size:13px;font-weight:bold;"> | |
<span style="color:rgb(127, 127, 127);">C</span><span style="color:rgb(236, 236, 236);">a</span><span style="color:rgb(254, 254, 254);">n</span><span style="color:rgb(254, 254, 254);">'</span><span style="color:rgb(254, 254, 254);">t</span><span style="color:rgb(255, 255, 255);"> </span><span style="color:rgb(254, 254, 254);">f</span><span style="color:rgb(254, 254, 254);">u</span><span style="color:rgb(254, 254, 254);">c</span><span style="color:rgb(254, 254, 254);">k</span><span style="color:rgb(254, 254, 254);"> </span><span style="color:rgb(254, 254, 254);">w</span><span style="color:rgb(254, 254, 254);">i</span><span style="color:rgb(254, 254, 254);">t</span><span style="color:rgb(254, 254, 254);">h</span><span style="color:rgb(255, 255, 255);"> </span><span style="color:rgb(254, 254, 254);">t</span><span style="color:rgb(254, 254, 254);">h</span |
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
/* eslint strict: 0 */ | |
'use strict'; | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const webpackTargetElectronRenderer = require('webpack-target-electron-renderer'); | |
var argv = require('minimist')(process.argv.slice(2)); | |
const isWeb = (argv && argv.target === 'web'); | |
const output = (isWeb ? 'build/web' : 'build/electron'); |
OlderNewer