class LinkitPluginNode in Linkit 7.2
@file Define Linkit node plugin class.
Hierarchy
- class \LinkitPlugin implements LinkitPluginInterface
- class \LinkitPluginEntity
- class \LinkitPluginNode
- class \LinkitPluginEntity
Expanded class hierarchy of LinkitPluginNode
File
- plugins/
linkit_plugins/ linkit-plugin-node.class.php, line 6 - Define Linkit node plugin class.
View source
class LinkitPluginNode extends LinkitPluginEntity {
/**
* Returns a string which will be used as the search result label for this
* item.
*/
function buildLabel($entity) {
$label = parent::buildLabel($entity);
return $label;
}
/**
* Returns a string with CSS classes that will be added to the search result
* row for this item.
*/
function buildRowClass($entity) {
if ($this->conf['include_unpublished'] && $entity->status == NODE_NOT_PUBLISHED) {
return 'unpublished-node';
}
}
/**
* Start a new EntityFieldQuery instance.
*/
function getQueryInstance() {
// Call the parent getQueryInstance method.
parent::getQueryInstance();
// If we don't want to include unpublished nodes, add a condition on status.
if ($this->conf['include_unpublished'] == 0) {
$this->query
->propertyCondition('status', NODE_PUBLISHED);
}
}
/**
* Generate a settings form for this handler.
* Uses the standard Drupal FAPI.
* The element will be attached to the "data" key.
*
* @return
* An array containing any custom form elements to be displayed in the
* profile editing form.
*/
function buildSettingsForm() {
// Get the parent settings form.
$form = parent::buildSettingsForm();
$form[$this->plugin['name']]['include_unpublished'] = array(
'#title' => t('Include unpublished nodes'),
'#type' => 'checkbox',
'#default_value' => isset($this->conf['include_unpublished']) ? $this->conf['include_unpublished'] : 0,
);
return $form;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LinkitPlugin:: |
function | Determine if the handler is considered 'broken', meaning it's a a placeholder used when a handler can't be found. | 1 | |
LinkitPlugin:: |
function | Set the search string. | ||
LinkitPlugin:: |
function | Return a string representing this handler's description in the UI. | 2 | |
LinkitPlugin:: |
function | Return a string representing this handler's name in the UI. | 2 | |
LinkitPluginEntity:: |
property | Plugin specific settings. | ||
LinkitPluginEntity:: |
property | The name of the property that contains the entity label. | ||
LinkitPluginEntity:: |
property | The entity info array of an entity type. | ||
LinkitPluginEntity:: |
property | The name of the property of the bundle object that contains the name of the bundle object. | ||
LinkitPluginEntity:: |
property | Entity field query instance. | ||
LinkitPluginEntity:: |
function |
The autocomplete callback function for the Linkit Entity plugin. Overrides LinkitPluginInterface:: |
1 | |
LinkitPluginEntity:: |
function |
Build the search row description. Overrides LinkitPlugin:: |
1 | |
LinkitPluginEntity:: |
function |
When "group_by_bundle" is active, we need to add the bundle name to the
group, else just return the entity label. Overrides LinkitPlugin:: |
2 | |
LinkitPluginEntity:: |
function |
Build an URL based in the path and the options. Overrides LinkitPlugin:: |
1 | |
LinkitPluginEntity:: |
function | Builds a reverse menu trail for the entity. | ||
LinkitPluginEntity:: |
function |
Initialize this plugin with the plugin, profile, and entity specific
variables. Overrides LinkitPlugin:: |
2 | |
LinkitPluginNode:: |
function |
Returns a string which will be used as the search result label for this
item. Overrides LinkitPluginEntity:: |
||
LinkitPluginNode:: |
function |
Returns a string with CSS classes that will be added to the search result
row for this item. Overrides LinkitPlugin:: |
||
LinkitPluginNode:: |
function |
Generate a settings form for this handler.
Uses the standard Drupal FAPI.
The element will be attached to the "data" key. Overrides LinkitPluginEntity:: |
||
LinkitPluginNode:: |
function |
Start a new EntityFieldQuery instance. Overrides LinkitPluginEntity:: |