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-submit').bind('ajaxSuccess', function() { | |
doStuff(this); | |
jQuery(this).unbind('ajaxSuccess'); | |
}); |
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
(function($) { | |
Drupal.attachBehaviors = function (context, settings) { | |
context = context || document; | |
settings = settings || Drupal.settings; | |
// Execute all of Drupal behaviours. | |
jQuery.each(Drupal.behaviors, function () { | |
if (jQuery.isFunction(this.attach)) { | |
this.attach(context, settings); | |
} | |
}); |
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
#include 'stdio.h'; | |
#include 'conio.h'; | |
function void main(void) { | |
clrscr(); | |
print_f("Hello world!!"); | |
} |
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
function example_dependent_options($key) { | |
$plakalar = array(1, 2); // These are keys from parent dropdown. | |
$iller = array( | |
'1' => array( | |
'1' => 'Aladağ' | |
), | |
'2' => array( | |
'5' => 'Aşkale') |
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
/** | |
* Privacy level: Public. | |
* Field can be viewed by all. | |
*/ | |
define('CORE_SECURITY_PRIVACY_PUBLIC', 0); | |
/** | |
* Privacy level: Friends only. | |
* Field can be viewed by only friends. | |
*/ |
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
/** | |
* Privacy settings form for user. | |
*/ | |
function privacy_settings_form_callback($form, &$form_state) { | |
global $user; | |
$form = array(); | |
$options = array(0 => 'Public', 1 => 'Friends', 2 => 'Private'); | |
$instances = field_info_instances('user', 'user'); | |
foreach ($instances as $field_name => $field_info) { | |
$form[$field_name] = 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
/** | |
* Implements hook_user_insert(). | |
* Add default privacy settings. | |
*/ | |
function MYMODULE_user_insert(&$edit, $account, $category) { | |
// Add default privacy settings into users.data | |
$instances = field_info_instances('user', 'user'); | |
$field_settings = array(); | |
foreach ($instances as $field_name => $field_info) { | |
// Lets make it PUBLIC by default. |
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_field_access(). | |
* Check if user has access for the field. | |
*/ | |
function MYMODULE_field_access($op, $field, $entity_type, $entity, $account) { | |
if ($entity_type == 'user') { | |
switch ($op) { | |
case 'view': | |
global $user; | |
// Implement you access logic here for each field. |
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
name: My Style | |
type: module | |
description: 'Provides a views display style for listings.' | |
package: Views | |
core: '8.x' | |
dependencies: | |
- views |
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 | |
/** | |
* @file | |
* Definition of Drupal\my_scroller\Plugin\views\style\Scroller. | |
*/ | |
namespace Drupal\my_scroller\Plugin\views\style; | |
use Drupal\core\form\FormStateInterface; |
OlderNewer