updated synonyms to 1.5
This commit is contained in:
@@ -5,16 +5,18 @@
|
||||
* Plugin to provide a synonyms-friendly argument handler for a Taxonomy term.
|
||||
*/
|
||||
|
||||
$plugin = array(
|
||||
'title' => t("Taxonomy term: ID (synonyms-friendly)"),
|
||||
'keyword' => 'term',
|
||||
'description' => t('Creates a single taxonomy term from a taxonomy term name or one of its synonyms.'),
|
||||
'context' => 'synonyms_term_synonyms_context',
|
||||
'default' => array('breadcrumb' => TRUE, 'transform' => FALSE),
|
||||
'settings form' => 'synonyms_term_synonyms_settings_form',
|
||||
'placeholder form' => 'synonyms_term_synonyms_ctools_argument_placeholder',
|
||||
'breadcrumb' => 'synonyms_term_synonyms_breadcrumb',
|
||||
);
|
||||
if (module_exists('taxonomy')) {
|
||||
$plugin = array(
|
||||
'title' => t("Taxonomy term: ID (synonyms-friendly)"),
|
||||
'keyword' => 'term',
|
||||
'description' => t('Creates a single taxonomy term from a taxonomy term name or one of its synonyms.'),
|
||||
'context' => 'synonyms_term_synonyms_context',
|
||||
'default' => array('breadcrumb' => TRUE, 'transform' => FALSE),
|
||||
'settings form' => 'synonyms_term_synonyms_settings_form',
|
||||
'placeholder form' => 'synonyms_term_synonyms_ctools_argument_placeholder',
|
||||
'breadcrumb' => 'synonyms_term_synonyms_breadcrumb',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Discover if this argument gives us the term we crave.
|
||||
@@ -66,12 +68,12 @@ function synonyms_term_synonyms_context($arg = NULL, $conf = NULL, $empty = FALS
|
||||
foreach ($vocabularies as $vocabulary) {
|
||||
$condition = db_and();
|
||||
if ($conf['transform']) {
|
||||
$condition->where("REPLACE(" . AbstractSynonymsSynonymsBehavior::COLUMN_PLACEHOLDER . ", ' ', '-') = :argument", array(
|
||||
$condition->where("REPLACE(" . AbstractSynonymsBehavior::COLUMN_SYNONYM_PLACEHOLDER . ", ' ', '-') = :argument", array(
|
||||
':argument' => $arg,
|
||||
));
|
||||
}
|
||||
else {
|
||||
$condition->condition(AbstractSynonymsSynonymsBehavior::COLUMN_PLACEHOLDER, $arg);
|
||||
$condition->condition(AbstractSynonymsBehavior::COLUMN_SYNONYM_PLACEHOLDER, $arg);
|
||||
}
|
||||
$rows = synonyms_synonyms_find($condition, 'taxonomy_term', $vocabulary->machine_name);
|
||||
if (!empty($rows)) {
|
||||
|
@@ -23,8 +23,8 @@ function synonyms_behavior_autocomplete_settings_form($form, &$form_state, $sett
|
||||
$element['wording'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Autocomplete wording'),
|
||||
'#default_value' => isset($settings['wording']) ? $settings['wording'] : '@synonym is a synonym of @term',
|
||||
'#description' => t('Specify with what wording the synonyms should be suggested in the autocomplete feature. You may use: <ul><li><em>@synonym</em> to denote value of the synonym</li><li><em>@term</em> to denote term name</li><li><em>@field_name</em> to denote lowercase label of the field from where the synonym originates</li></ul>'),
|
||||
'#default_value' => isset($settings['wording']) ? $settings['wording'] : '@synonym is a synonym of @entity',
|
||||
'#description' => t('Specify with what wording the synonyms should be suggested in the autocomplete feature. You may use: <ul><li><em>@synonym</em> to denote value of the synonym</li><li><em>@entity</em> to denote entity name</li><li><em>@field_name</em> to denote lowercase label of the field from where the synonym originates</li></ul>'),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
|
||||
|
@@ -24,7 +24,7 @@ function synonyms_behavior_select_settings_form($form, &$form_state, $settings)
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Select wording'),
|
||||
'#default_value' => isset($settings['wording']) ? $settings['wording'] : '@synonym',
|
||||
'#description' => t('Specify with what wording the synonyms should be placed in the select form element. You may use: <ul><li><em>@synonym</em> to denote value of the synonym</li><li><em>@term</em> to denote term name</li><li><em>@field_name</em> to denote lowercase label of the field from where the synonym originates</li></ul>'),
|
||||
'#description' => t('Specify with what wording the synonyms should be placed in the select form element. You may use: <ul><li><em>@synonym</em> to denote value of the synonym</li><li><em>@entity</em> to denote entity name</li><li><em>@field_name</em> to denote lowercase label of the field from where the synonym originates</li></ul>'),
|
||||
'#required' => TRUE,
|
||||
);
|
||||
|
||||
|
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Plugin definition for most general synonyms behavior.
|
||||
*/
|
||||
|
||||
$plugin = array(
|
||||
'title' => t('Include into term synonyms'),
|
||||
'description' => t('Basic behavior that includes values of this field into the list of synonyms of its entity.'),
|
||||
'interface' => 'SynonymsSynonymsBehavior',
|
||||
);
|
Reference in New Issue
Block a user