class views_plugin_style_views_galleriffic in Views Galleriffic 7
Implements of views_plugin_style().
Hierarchy
- class \views_object
- class \views_plugin
- class \views_plugin_style
- class \views_plugin
Expanded class hierarchy of views_plugin_style_views_galleriffic
1 string reference to 'views_plugin_style_views_galleriffic'
- views_galleriffic_views_plugins in ./
views_galleriffic.views.inc - @file Provide the Galleriffic plugin definition.
File
- ./
views_plugin_style_views_galleriffic.inc, line 10 - Provide the views gallariffic plugin object with default options and form.
View source
class views_plugin_style_views_galleriffic extends views_plugin_style {
/**
* Defines format definitions.
*/
function option_definition() {
$options = parent::option_definition();
unset($options['grouping']);
$options['css'] = array(
'default' => 'default',
);
$options['delay'] = array(
'default' => '3000',
);
$options['preload'] = array(
'default' => '10',
);
$options['transition'] = array(
'default' => '1000',
);
$options['numbthumbs'] = array(
'default' => '10',
);
$options['pager_top'] = array(
'default' => '',
);
$options['pager_bottom'] = array(
'default' => 'true',
);
$options['renderss'] = array(
'default' => 'true',
);
$options['rendernav'] = array(
'default' => 'true',
);
$options['playtext'] = array(
'default' => 'Play',
);
$options['pausetext'] = array(
'default' => 'Pause',
);
$options['prevlink'] = array(
'default' => 'Previous',
);
$options['nextlink'] = array(
'default' => 'Next',
);
$options['nextpage'] = array(
'default' => 'Next >',
);
$options['prevpage'] = array(
'default' => '< Prev',
);
$options['history'] = array(
'default' => '',
);
$options['start'] = array(
'default' => '',
);
$options['sync'] = array(
'default' => '',
);
$options['keyboard'] = array(
'default' => '',
);
return $options;
}
/**
* Defines format options.
*/
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
unset($form['grouping']);
$history = views_galleriffic_history();
$form['history'] = array(
'#type' => $history['type'],
'#title' => t('History'),
'#description' => $history['description'],
'#default_value' => $this->options['history'],
'#options' => array(
'true' => t('Yes'),
'' => t('No'),
),
);
$form['css'] = array(
'#type' => 'select',
'#title' => t('CSS style'),
'#description' => t("You can use the default css or not. The default can't anticipate the image sizes you use so will likely need to be updated for individual needs."),
'#default_value' => $this->options['css'],
'#options' => array(
'default' => t('Default'),
'above' => t('Thumbnails above gallery'),
'' => t('None'),
),
);
$form['delay'] = array(
'#type' => 'textfield',
'#title' => t('Delay'),
'#default_value' => $this->options['delay'],
'#description' => t('The delay between each slide. In miliseconds.'),
);
$form['transition'] = array(
'#type' => 'textfield',
'#title' => t('Transition Duration'),
'#default_value' => $this->options['transition'],
'#description' => t('If "Sync Transisitions" is off, specifies the duration of the transitions.'),
);
$form['preload'] = array(
'#type' => 'textfield',
'#title' => t('Images to Preload'),
'#default_value' => $this->options['preload'],
'#description' => t('Set to -1 to preload all images.'),
);
$form['numbthumbs'] = array(
'#type' => 'textfield',
'#title' => t('Number of Thumbnails'),
'#default_value' => $this->options['numbthumbs'],
'#description' => t('This is the number of thumbnails that will appear before a pager is used.'),
);
$form['pager_top'] = array(
'#type' => 'select',
'#title' => t('Enable Top Pager'),
'#description' => t('Enable the pager at the top of the gallery. This will only work if the number of slides is higher than the number of thumbs. Automatically disabled with "Thumbnails above gallery" style.'),
'#default_value' => $this->options['pager_top'],
'#options' => array(
'true' => t('Yes'),
'' => t('No'),
),
);
$form['pager_bottom'] = array(
'#type' => 'select',
'#title' => t('Enable Bottom Pager'),
'#description' => t('Enable the pager at the bottom of the gallery. Automatically disabled with "Thumbnails above gallery" style.'),
'#default_value' => $this->options['pager_bottom'],
'#options' => array(
'true' => t('Yes'),
'' => t('No'),
),
);
$form['renderss'] = array(
'#type' => 'select',
'#title' => t('Show Play and Pause Controls'),
'#description' => t("Specifies whether the slideshow's Play and Pause links should be rendered."),
'#default_value' => $this->options['renderss'],
'#options' => array(
'true' => t('Yes'),
'' => t('No'),
),
);
$form['rendernav'] = array(
'#type' => 'select',
'#title' => t('Show Next and Pause Controls'),
'#description' => t("Specifies whether the slideshow's Next and Previous links should be rendered."),
'#default_value' => $this->options['rendernav'],
'#options' => array(
'true' => t('Yes'),
'' => t('No'),
),
);
$form['playtext'] = array(
'#type' => 'textfield',
'#title' => t('Play Link Text'),
'#default_value' => $this->options['playtext'],
'#description' => t('Text to display for the PLAY link.'),
);
$form['pausetext'] = array(
'#type' => 'textfield',
'#title' => t('Pause Link Text'),
'#default_value' => $this->options['pausetext'],
'#description' => t('Text to display for the PAUSE link.'),
);
$form['prevlink'] = array(
'#type' => 'textfield',
'#title' => t('Previous Link Text'),
'#default_value' => $this->options['prevlink'],
'#description' => t('Text to display for the PREVIOUS link.'),
);
$form['nextlink'] = array(
'#type' => 'textfield',
'#title' => t('Next Link Text'),
'#default_value' => $this->options['nextlink'],
'#description' => t('Text to display for the NEXT link.'),
);
$form['nextpage'] = array(
'#type' => 'textfield',
'#title' => t('Next Page Link Text'),
'#default_value' => $this->options['nextpage'],
'#description' => t('Text to display for the next PAGE link.'),
);
$form['prevpage'] = array(
'#type' => 'textfield',
'#title' => t('Previous Page Link Text'),
'#default_value' => $this->options['prevpage'],
'#description' => t('Text to display for the next PREVIOUS link.'),
);
$form['start'] = array(
'#type' => 'select',
'#title' => t('Auto Start'),
'#description' => t('Specifies whether the slideshow should be playing or paused when the page first loads.'),
'#default_value' => $this->options['start'],
'#options' => array(
'true' => t('Yes'),
'' => t('No'),
),
);
$form['sync'] = array(
'#type' => 'select',
'#title' => t('Sync Transitions'),
'#description' => t('Specifies whether the out and in transitions occur simultaneously or distinctly.'),
'#default_value' => $this->options['sync'],
'#options' => array(
'true' => t('Yes'),
'' => t('No'),
),
);
$form['keyboard'] = array(
'#type' => 'select',
'#title' => t('Keyboard Transitions'),
'#description' => t('Specifies whether you want to be able to scroll through images with your keyboard. CAUTION, may interfere with comments if turned on.'),
'#default_value' => $this->options['keyboard'],
'#options' => array(
'true' => t('Yes'),
'' => t('No'),
),
);
}
/**
* Make sure the display and all associated handlers are valid.
*
* @return array
* Empty array if the display is valid; an array of error strings if it not.
*/
function validate() {
$row_handler = $this->row_plugin->definition['handler'];
switch ($row_handler) {
case 'views_galleriffic_plugin_row_gallerifficrows':
$errors = array();
$row_fields = $this->row_plugin->options;
// Check to make sure image fields aren't empty.
foreach ($row_fields as $title => $result) {
if (($title == 'slide_field' || $title == 'thumbnail_field') && empty($result)) {
$errors[] = t('Views Galleriffic requires you to assign a field for "@field". Currently the "@field" is empty. Click \'Row Style: Galleriffic Fields\' to set.', array(
'@field' => $title,
));
}
}
// Check to make sure that two of the same image fields aren't selected.
$results = array();
foreach ($row_fields as $title => $result) {
if ($result && in_array($result, $results)) {
$errors[] = t("Views Galleriffic does not allow you to use the same field instance twice. You can use the same field twice, and are encouraged to for images. You just need to make two instances of the same field. To do add the same field twice under 'Fields'. Give each a different label. Then select each instance of that field once under 'Row style: Galleriffic Fields'. See README.txt for details.");
}
$results[] = $result;
}
return $errors;
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_object:: |
public | property | Handler's definition. | |
views_object:: |
public | property | Except for displays, options for the object will be held here. | 1 |
views_object:: |
function | Collect this handler's option definition and alter them, ready for use. | ||
views_object:: |
public | function | Views handlers use a special construct function. | 4 |
views_object:: |
public | function | 1 | |
views_object:: |
public | function | ||
views_object:: |
public | function | Always exports the option, regardless of the default value. | |
views_object:: |
public | function | Set default options on this object. | 1 |
views_object:: |
public | function | Set default options. | |
views_object:: |
public | function | Let the handler know what its full definition is. | |
views_object:: |
public | function | Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. | |
views_object:: |
public | function | Unpack a single option definition. | |
views_object:: |
public | function | Unpacks each handler to store translatable texts. | |
views_object:: |
public | function | ||
views_plugin:: |
public | property | The current used views display. | |
views_plugin:: |
public | property | The plugin name of this plugin, for example table or full. | |
views_plugin:: |
public | property | The plugin type of this plugin, for example style or query. | |
views_plugin:: |
public | property |
The top object of a view. Overrides views_object:: |
1 |
views_plugin:: |
public | function | Provide a list of additional theme functions for the theme info page. | |
views_plugin:: |
public | function | Handle any special handling on the validate form. | 9 |
views_plugin:: |
public | function | Return the human readable name of the display. | |
views_plugin:: |
public | function | Returns the summary of the settings in the display. | 8 |
views_plugin:: |
public | function | Provide a full list of possible theme templates used by this style. | |
views_plugin_style:: |
public | property | The row plugin, if it's initialized and the style itself supports it. | |
views_plugin_style:: |
public | property | Store all available tokens row rows. | |
views_plugin_style:: |
public | function | Called by the view builder to see if this style handler wants to interfere with the sorts. If so it should build; if it returns any non-TRUE value, normal sorting will NOT be added to the query. | 1 |
views_plugin_style:: |
public | function | Called by the view builder to let the style build a second set of sorts that will come after any other sorts in the view. | 1 |
views_plugin_style:: |
public | function |
Destructor. Overrides views_object:: |
|
views_plugin_style:: |
public | function | Should the output of the style plugin be rendered even if it's empty. | 1 |
views_plugin_style:: |
public | function | Get a rendered field. | |
views_plugin_style:: |
public | function | Get the raw field value. | |
views_plugin_style:: |
public | function | Return the token replaced row class for the specified row. | |
views_plugin_style:: |
public | function | Initialize a style plugin. | |
views_plugin_style:: |
public | function |
Validate the options form. Overrides views_plugin:: |
|
views_plugin_style:: |
public | function | Allow the style to do stuff before each row is rendered. | |
views_plugin_style:: |
public | function |
Add anything to the query that we might need to. Overrides views_plugin:: |
2 |
views_plugin_style:: |
public | function | Render the display in this style. | 5 |
views_plugin_style:: |
public | function | Render all of the fields for a given style and store them on the object. | |
views_plugin_style:: |
public | function | Group records as needed for rendering. | |
views_plugin_style:: |
public | function | Render the grouping sets. | |
views_plugin_style:: |
public | function | Take a value and apply token replacement logic to it. | |
views_plugin_style:: |
public | function | Return TRUE if this style also uses fields. | |
views_plugin_style:: |
public | function | Return TRUE if this style also uses a row plugin. | |
views_plugin_style:: |
public | function | Return TRUE if this style also uses a row plugin. | |
views_plugin_style:: |
public | function | Return TRUE if this style uses tokens. | |
views_plugin_style_views_galleriffic:: |
function |
Defines format options. Overrides views_plugin_style:: |
||
views_plugin_style_views_galleriffic:: |
function |
Defines format definitions. Overrides views_plugin_style:: |
||
views_plugin_style_views_galleriffic:: |
function |
Make sure the display and all associated handlers are valid. Overrides views_plugin_style:: |