FINAL suepr merge step : added all modules to this super repos

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-19 16:46:59 +02:00
7585 changed files with 1723356 additions and 18 deletions

View File

@@ -0,0 +1,18 @@
<?php
/**
* @file
* Views settings for Node_Clone module.
*/
/**
* Implements hook_views_data_alter()
*/
function clone_views_data_alter(&$views_data) {
$views_data['node']['clone_node'] = array(
'field' => array(
'title' => t('Clone link'),
'help' => t('Provide a simple link to clone the node.'),
'handler' => 'views_handler_field_node_link_clone',
),
);
}

View File

@@ -0,0 +1,36 @@
<?php
/**
* @file
* Views field handler for Node_Clone module.
*/
/**
* Field handler to present a clone node link.
*
* Closely modeled after views/modules/node/views_handler_field_node_link_edit.inc
*/
class views_handler_field_node_link_clone extends views_handler_field_node_link {
/**
* Renders the link.
*/
function render_link($node, $values) {
if (!clone_access_cloning($node)) {
return;
}
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = "node/{$node->nid}/clone/" . clone_token_to_arg();
$method = variable_get('clone_method', 'prepopulate');
$destination = drupal_get_destination();
if ($method == 'prepopulate') {
$this->options['alter']['query'] = $destination;
}
elseif (!empty($destination['destination'])) {
$this->options['alter']['query']['node-clone-destination'] = $destination['destination'];
}
$text = !empty($this->options['text']) ? $this->options['text'] : t('clone');
return $text;
}
}