default services conflit ?

This commit is contained in:
armansansd
2022-04-27 11:30:43 +02:00
parent 28190a5749
commit 8bb1064a3b
8132 changed files with 900138 additions and 426 deletions

View 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');
}

View File

@@ -0,0 +1,52 @@
<?php
/**
* @file
* {{ plugin_name }} content type 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 }}'),
'render callback' => '{{ machine_name }}_{{ plugin_machine_name }}_content_type_render',
);
/**
* Render callback.
*/
function {{ machine_name }}_{{ plugin_machine_name }}_content_type_render($subtype, $conf, $panel_args, $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 to avoid confusion with the global $user object #}
$account = clone $context->data;
{% endif %}
// Build pane content.
$build = array(
'#markup' => 'Content placeholder.',
);
$block = new stdClass();
$block->module = '{{ machine_name }}';
$block->title = t('Title placeholder');
$block->content = $build;
return $block;
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* @file
* {{ plugin_name }} relationship plugin.
*/
/**
* Plugin definition.
*/
$plugin = array(
'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 %}
'context' => '{{ machine_name }}_{{ plugin_machine_name }}_context',
);
/**
* Returns a new context based on an existing context.
*/
function {{ machine_name }}_{{ plugin_machine_name }}_context($context, $conf) {
// @TODO: Replace "node" with identifier of the context
// this plugin is meant to provide.
if (empty($context->data)) {
return ctools_context_create_empty('node', NULL);
}
{% 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: Replace this code with your own.
$related_node = node_load(1);
return ctools_context_create('node', $related_node);
}