Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
53
vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/access.twig
vendored
Normal file
53
vendor/chi-teck/drupal-code-generator/templates/d7/ctools-plugin/access.twig
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* {{ plugin_name }} access plugin.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Plugin definition.
|
||||
*/
|
||||
$plugin = array(
|
||||
'single' => TRUE,
|
||||
'title' => t('{{ plugin_name }}'),
|
||||
'description' => t('{{ description }}'),
|
||||
{% if context == 'Node' or context == 'User' %}
|
||||
'required context' => new ctools_context_required(t('{{ context }}'), '{{ context|lower }}'),
|
||||
{% elseif context == 'Term' %}
|
||||
'required context' => new ctools_context_required(t('{{ context }}'), array('term', 'taxonomy_term')),
|
||||
{% endif %}
|
||||
'category' => t('{{ category }}'),
|
||||
'callback' => '{{ machine_name }}_{{ plugin_machine_name }}_access_check',
|
||||
'summary' => '{{ machine_name }}_{{ plugin_machine_name }}_access_summary',
|
||||
);
|
||||
|
||||
/**
|
||||
* Access callback.
|
||||
*/
|
||||
function {{ machine_name }}_{{ plugin_machine_name }}_access_check($conf, $context) {
|
||||
{% if context != '-' %}
|
||||
|
||||
if (empty($context->data)) {
|
||||
return;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if context == 'Node' or context == 'Term' %}
|
||||
${{ context|lower }} = clone $context->data;
|
||||
|
||||
{% elseif context == 'User' %}
|
||||
{# Use $account variable avoid confusion with the global $user object #}
|
||||
$account = clone $context->data;
|
||||
|
||||
{% endif %}
|
||||
// @TODO: Check access here.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary callback.
|
||||
*/
|
||||
function {{ machine_name }}_{{ plugin_machine_name }}_access_summary($conf, $context) {
|
||||
return t('Summary placeholder');
|
||||
}
|
Reference in a new issue