updated etxlink, ctools, colorbox, computed_field
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for all entity ids.
|
||||
*/
|
||||
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a node id
|
||||
* Plugin to provide an argument handler for a node id.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -47,4 +46,3 @@ function ctools_argument_nid_context($arg = NULL, $conf = NULL, $empty = FALSE)
|
||||
|
||||
return ctools_context_create('node', $node);
|
||||
}
|
||||
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a Node add form
|
||||
* Plugin to provide an argument handler for a Node add form.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("Node add form: node type"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'node_type',
|
||||
'description' => t('Creates a node add form context from a node type argument.'),
|
||||
'context' => 'ctools_node_add_context',
|
||||
@@ -29,4 +28,3 @@ function ctools_node_add_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
||||
|
||||
return ctools_context_create('node_add_form', $arg);
|
||||
}
|
||||
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a Node edit form
|
||||
* Plugin to provide an argument handler for a Node edit form.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("Node edit form: node ID"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'node',
|
||||
'description' => t('Creates a node edit form context from a node ID argument.'),
|
||||
'context' => 'ctools_node_edit_context',
|
||||
@@ -48,4 +47,3 @@ function ctools_node_edit_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
||||
// This will perform a node_access check, so we don't have to.
|
||||
return ctools_context_create('node_edit_form', $node);
|
||||
}
|
||||
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a node revision id
|
||||
* Plugin to provide an argument handler for a node revision id.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -47,4 +46,3 @@ function ctools_argument_rid_context($arg = NULL, $conf = NULL, $empty = FALSE)
|
||||
|
||||
return ctools_context_create('node', $node);
|
||||
}
|
||||
|
||||
|
@@ -2,16 +2,16 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a raw string
|
||||
* Plugin to provide an argument handler for a raw string.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Plugins are described by creating a $plugin array which will be used
|
||||
* by the system that includes this file.
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("String"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'string',
|
||||
'description' => t('A string is a minimal context that simply holds a string that can be used for some other purpose.'),
|
||||
'settings form' => 'ctools_string_settings_form',
|
||||
@@ -20,7 +20,8 @@ $plugin = array(
|
||||
'#type' => 'textfield',
|
||||
'#description' => t('Enter a value for this argument'),
|
||||
),
|
||||
'path placeholder' => 'ctools_string_path_placeholder', // This is in pagemanager.
|
||||
// This is in pagemanager.
|
||||
'path placeholder' => 'ctools_string_path_placeholder',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -39,7 +40,7 @@ function ctools_string_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings form for the argument
|
||||
* Settings form for the argument.
|
||||
*/
|
||||
function ctools_string_settings_form(&$form, &$form_state, $conf) {
|
||||
$form['settings']['use_tail'] = array(
|
||||
@@ -48,7 +49,6 @@ function ctools_string_settings_form(&$form, &$form_state, $conf) {
|
||||
'#default_value' => !empty($conf['use_tail']),
|
||||
'#description' => t('If checked, this string will include all arguments. For example, if the path is "path/%" and the user visits "path/foo/bar", if this is not checked the string will be "foo". If it is checked the string will be "foo/bar".'),
|
||||
);
|
||||
// return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,4 +61,4 @@ function ctools_string_path_placeholder($argument) {
|
||||
else {
|
||||
return '%pm_arg_tail';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a Taxonomy term
|
||||
* Plugin to provide an argument handler for a Taxonomy term.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("Taxonomy term: ID"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'term',
|
||||
'description' => t('Creates a single taxonomy term from a taxonomy ID or taxonomy term name.'),
|
||||
'context' => 'ctools_term_context',
|
||||
@@ -67,7 +66,7 @@ function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
||||
foreach ($vocabularies as $machine_name) {
|
||||
if ($potential->vocabulary_machine_name == $machine_name) {
|
||||
$term = $potential;
|
||||
// break out of the foreaches AND the case
|
||||
// Break out of the foreaches AND the case.
|
||||
break 3;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +91,7 @@ function ctools_term_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings form for the argument
|
||||
* Settings form for the argument.
|
||||
*/
|
||||
function ctools_term_settings_form(&$form, &$form_state, $conf) {
|
||||
// @todo allow synonym use like Views does.
|
||||
@@ -137,10 +136,9 @@ function ctools_term_settings_form(&$form, &$form_state, $conf) {
|
||||
'#type' => 'checkbox',
|
||||
'#default_value' => !empty($conf['transform']),
|
||||
);
|
||||
// return $form;
|
||||
}
|
||||
|
||||
function ctools_term_settings_form_validate (&$form, &$form_state) {
|
||||
function ctools_term_settings_form_validate(&$form, &$form_state) {
|
||||
// Filter the selected vocabularies to avoid storing redundant data.
|
||||
$vocabularies = array_filter($form_state['values']['settings']['vocabularies']);
|
||||
form_set_value($form['settings']['vocabularies'], $vocabularies, $form_state);
|
||||
@@ -157,6 +155,7 @@ function ctools_term_ctools_argument_placeholder($conf) {
|
||||
'#type' => 'textfield',
|
||||
'#description' => t('Enter a taxonomy term ID.'),
|
||||
);
|
||||
|
||||
case 'term':
|
||||
return array(
|
||||
'#type' => 'textfield',
|
||||
@@ -190,13 +189,14 @@ function ctools_term_breadcrumb($conf, $context) {
|
||||
*
|
||||
* @param array $vids
|
||||
* Array of either vids.
|
||||
*
|
||||
* @return array
|
||||
* A keyed array of machine names.
|
||||
*/
|
||||
function _ctools_term_vocabulary_machine_name_convert($vids) {
|
||||
$vocabularies = taxonomy_vocabulary_load_multiple($vids);
|
||||
$return = array();
|
||||
foreach($vocabularies as $vocabulary) {
|
||||
foreach ($vocabularies as $vocabulary) {
|
||||
$return[$vocabulary->machine_name] = $vocabulary->machine_name;
|
||||
}
|
||||
return $return;
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a Taxonomy term
|
||||
* Plugin to provide an argument handler for a Taxonomy term.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("Taxonomy term (multiple): ID"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'term',
|
||||
'description' => t('Creates a group of taxonomy terms from a list of tids separated by a comma or a plus sign. In general the first term of the list will be used for panes.'),
|
||||
'context' => 'ctools_terms_context',
|
||||
@@ -45,7 +44,7 @@ function ctools_terms_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings form for the argument
|
||||
* Settings form for the argument.
|
||||
*/
|
||||
function ctools_terms_settings_form(&$form, &$form_state, $conf) {
|
||||
$form['settings']['breadcrumb'] = array(
|
||||
@@ -54,7 +53,6 @@ function ctools_terms_settings_form(&$form, &$form_state, $conf) {
|
||||
'#default_value' => !empty($conf['breadcrumb']),
|
||||
'#description' => t('If checked, taxonomy term parents will appear in the breadcrumb trail.'),
|
||||
);
|
||||
// return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a user id
|
||||
* Plugin to provide an argument handler for a user id.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("User: ID"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'user',
|
||||
'description' => t('Creates a user context from a user ID argument.'),
|
||||
'context' => 'ctools_argument_uid_context',
|
||||
@@ -21,7 +20,8 @@ $plugin = array(
|
||||
'#description' => t('Enter the user ID of a user for this argument'),
|
||||
),
|
||||
'default' => array('to_arg' => TRUE),
|
||||
'path placeholder' => '%pm_uid_arg', // This is in pagemanager.
|
||||
// This is in pagemanager.
|
||||
'path placeholder' => '%pm_uid_arg',
|
||||
'path placeholder to_arg' => TRUE,
|
||||
'no ui' => TRUE,
|
||||
);
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a Taxonomy term
|
||||
* Plugin to provide an argument handler for a Taxonomy term.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("User edit form: User ID"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'user',
|
||||
'description' => t('Creates a user edit form context from a user ID argument.'),
|
||||
'context' => 'ctools_user_edit_context',
|
||||
@@ -30,18 +29,18 @@ function ctools_user_edit_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
||||
if ($empty) {
|
||||
return ctools_context_create_empty('user_edit_form');
|
||||
}
|
||||
if(is_object($arg)){
|
||||
if (is_object($arg)) {
|
||||
return ctools_context_create('user_edit_form', $arg);
|
||||
}
|
||||
if (!is_numeric($arg)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$account= user_load($arg);
|
||||
$account = user_load($arg);
|
||||
if (!$account) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// This will perform a node_access check, so we don't have to.
|
||||
return ctools_context_create('user_edit_form', $account);
|
||||
}
|
||||
}
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a username
|
||||
* Plugin to provide an argument handler for a username.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("User: name"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'user',
|
||||
'description' => t('Creates a user context from a user name.'),
|
||||
'context' => 'ctools_argument_user_name_context',
|
||||
@@ -42,6 +41,3 @@ function ctools_argument_user_name_context($arg = NULL, $conf = NULL, $empty = F
|
||||
}
|
||||
return ctools_context_create('user', $account);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* Plugin to provide an argument handler for a vocabulary id
|
||||
* Plugin to provide an argument handler for a vocabulary id.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,7 @@
|
||||
*/
|
||||
$plugin = array(
|
||||
'title' => t("Vocabulary: ID"),
|
||||
// keyword to use for %substitution
|
||||
// Keyword to use for %substitution.
|
||||
'keyword' => 'vocabulary',
|
||||
'description' => t('Creates a vocabulary context from a vocabulary ID argument.'),
|
||||
'context' => 'ctools_vid_context',
|
||||
@@ -43,4 +42,3 @@ function ctools_vid_context($arg = NULL, $conf = NULL, $empty = FALSE) {
|
||||
|
||||
return ctools_context_create('vocabulary', $vocabulary);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user