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\block\BlockBundle. | |
*/ | |
namespace Drupal\Block; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; |
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 block_menu() { | |
$items['block/autocomplete'] = array( | |
'title' => 'Block autocomplete', | |
'page callback' => 'block_autocomplete', | |
'access callback' => 'user_access', | |
'access arguments' => array('administer blocks'), | |
'type' => MENU_CALLBACK, | |
); |
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
diff --git a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php | |
index e245874..8670dd9 100644 | |
--- a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php | |
+++ b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php | |
@@ -67,10 +67,11 @@ class DerivativeDiscoveryDecorator implements DiscoveryInterface { | |
foreach ($base_plugin_definitions as $base_plugin_id => $plugin_definition) { | |
$derivative_fetcher = $this->getDerivativeFetcher($base_plugin_id, $plugin_definition); | |
if ($derivative_fetcher) { | |
- $derivative_definitions = $derivative_fetcher->getDerivativeDefinitions($plugin_definition); | |
- foreach ($derivative_definitions as $derivative_id => $derivative_definition) { |
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
$query->entityCondition('entity_type', 'node') | |
->entityCondition('bundle', 'faculty') | |
->propertyCondition('status', 1) | |
->fieldCondition('field_person_record', 'entity_id', arg(1), '='); | |
$result = $query->execute(); | |
if (isset($result['node'])) { | |
return FALSE; | |
} | |
return TRUE; |
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\block\BlockBundle. | |
*/ | |
namespace Drupal\Block; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; |
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
/** | |
* A generic autocomplete page callback for any plugin system tied to a plugin | |
* ui plugin. | |
*/ | |
function system_plugin_autocomplete($plugin_id, $string = '') { | |
$matches = array(); | |
$ui = system_plugin_manager('plugin_ui')->getDefinition($plugin_id); | |
$manager = new $ui['manager'](); | |
if ($string) { | |
$plugins = $manager->getDefinitions(); |
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 my_module_query_views_alter($query) { | |
$view = $query->alterMetaData['view']; | |
if ($view->name == 'product_term_menus' && $view->current_display == 'panel_pane_1') { | |
$fields = $query->getFields(); | |
$tables = $query->getTables(); | |
$tid_alias = $fields['tid']['alias']; |
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 _system_date_format_types_build() { | |
$types = config_get_storage_names_with_prefix('date.format.type'); | |
// Allow other modules to modify these date types. | |
drupal_alter('date_format_types', $types); | |
return $types; | |
} |
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 entity_schema() { | |
$schema = array(); | |
foreach ($manager->getDefinitions() as $plugin_id => $definition) { | |
$plugin = $manager->createInstance($plugin_id); | |
$schema[$definition->base_table] = $plugin->schema(); | |
$schema[$definition->base_table]['fields'] += entity_base_schema(); | |
} | |
return $schema; | |
} |
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 | |
namespace Drupal\layout\Plugin\layout\layout; | |
use Drupal\layout\Plugin\LayoutInterface; | |
use Drupal\Component\Plugin\PluginBase; | |
use Drupal\Core\Annotations\Plugin; | |
/** | |
* @Plugin( |