本文整理汇总了PHP中Drupal\views\Plugin\views\style\StylePluginBase类的典型用法代码示例。如果您正苦于以下问题:PHP StylePluginBase类的具体用法?PHP StylePluginBase怎么用?PHP StylePluginBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StylePluginBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Overrides \Drupal\views\Plugin\views\style\StylePluginBase\StylePluginBase::render().
*/
public function render()
{
if (!empty($this->view->live_preview)) {
return parent::render();
}
// Group the rows according to the grouping field, if specified.
$sets = $this->renderGrouping($this->view->result, $this->options['grouping']);
// Grab the alias of the 'id' field added by
// entity_reference_plugin_display.
$id_field_alias = $this->view->storage->get('base_field');
// @todo We don't display grouping info for now. Could be useful for select
// widget, though.
$results = array();
$this->view->row_index = 0;
foreach ($sets as $records) {
foreach ($records as $values) {
// Sanitize HTML, remove line breaks and extra whitespace.
$output = $this->view->rowPlugin->render($values);
$output = drupal_render($output);
$results[$values->{$id_field_alias}] = Xss::filterAdmin(preg_replace('/\\s\\s+/', ' ', str_replace("\n", '', $output)));
$this->view->row_index++;
}
}
unset($this->view->row_index);
return $results;
}
开发者ID:alnutile,项目名称:drunatra,代码行数:29,代码来源:EntityReference.php
示例2: buildOptionsForm
/**
* Overrides Drupal\views\Plugin\views\style\StylePluginBase::buildOptionsForm().
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
// Get the mapping.
$mapping = $this->defineMapping();
// Restrict the list of defaults to the mapping, in case they have changed.
$options = array_intersect_key($this->options['mapping'], $mapping);
// Get the labels of the fields added to this display.
$field_labels = $this->displayHandler->getFieldLabels();
// Provide some default values.
$defaults = array('#type' => 'select', '#required' => FALSE, '#multiple' => FALSE);
// For each mapping, add a select element to the form.
foreach ($options as $key => $value) {
// If the field is optional, add a 'None' value to the top of the options.
$field_options = array();
$required = !empty($mapping[$key]['#required']);
if (!$required && empty($mapping[$key]['#multiple'])) {
$field_options = array('' => $this->t('- None -'));
}
$field_options += $field_labels;
// Optionally filter the available fields.
if (isset($mapping[$key]['#filter'])) {
$this->view->initHandlers();
$filter = $mapping[$key]['#filter'];
$this::$filter($field_options);
unset($mapping[$key]['#filter']);
}
// These values must always be set.
$overrides = array('#options' => $field_options, '#default_value' => $options[$key]);
// Optionally allow the select to be toggleable.
if (!empty($mapping[$key]['#toggle'])) {
$form['mapping']["toggle_{$key}"] = array('#type' => 'checkbox', '#title' => $this->t('Use a custom %field_name', array('%field_name' => strtolower($mapping[$key]['#title']))), '#default_value' => $this->options['mapping']["toggle_{$key}"]);
$overrides['#states']['visible'][':input[name="style_options[mapping][' . "toggle_{$key}" . ']"]'] = array('checked' => TRUE);
}
$form['mapping'][$key] = $overrides + $mapping[$key] + $defaults;
}
}
开发者ID:HakS,项目名称:drupal8_training,代码行数:40,代码来源:Mapping.php
示例3: buildOptionsForm
/**
* Overrides Drupal\views\Plugin\views\style\StylePluginBase::buildOptionsForm().
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$form['test_option'] = array('#title' => $this->t('Test option'), '#type' => 'textfield', '#description' => $this->t('This is a textfield for test_option.'), '#default_value' => $this->options['test_option']);
}
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:8,代码来源:StyleTest.php
示例4: buildOptionsForm
/**
* Render the given style.
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$form['type'] = array('#type' => 'radios', '#title' => $this->t('List type'), '#options' => array('ul' => $this->t('Unordered list'), 'ol' => $this->t('Ordered list')), '#default_value' => $this->options['type']);
$form['wrapper_class'] = array('#title' => $this->t('Wrapper class'), '#description' => $this->t('The class to provide on the wrapper, outside the list.'), '#type' => 'textfield', '#size' => '30', '#default_value' => $this->options['wrapper_class']);
$form['class'] = array('#title' => $this->t('List class'), '#description' => $this->t('The class to provide on the list element itself.'), '#type' => 'textfield', '#size' => '30', '#default_value' => $this->options['class']);
}
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:10,代码来源:HtmlList.php
示例5: validate
/**
* Validates the view configuration.
* Fails if there is a non-image field, or there are more
* than one image fields that are not excluded from display.
*/
function validate()
{
$errors = parent::validate();
if ($this->view->storage->isNew()) {
// Skip validation when the view is being created.
// (the default field is a title field, which would fail.)
return $errors;
}
// Get a list of fields that have been added to the display.
$fields = $this->displayHandler->handlers['field'];
// Check if there is exactly one image field to display.
$fields_valid = TRUE;
$field_count = 0;
foreach ($fields as $key => $field) {
// Ignore fields excluded from display.
if (!empty($field->options['exclude'])) {
continue;
}
// Determine the field's type.
$field_storage_definitions = \Drupal::entityManager()->getFieldStorageDefinitions($field->definition['entity_type']);
$field_type = $field_storage_definitions[$field->field]->getType();
if ($field_type != 'image') {
// Cannot display non-image fields. That would break the image grid.
$fields_valid = FALSE;
break;
}
$field_count++;
}
if (!$fields_valid || $field_count > 1) {
$errors[] = $this->t('This format can display only one image field and no other fields.');
}
return $errors;
}
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:38,代码来源:PhotoGrid.php
示例6: buildOptionsForm
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$form['grid_style'] = array('#prefix' => '<h4>Grid Settings</h4>', '#type' => 'select', '#title' => t('Mode'), '#description' => t('Choose grid style:'), '#options' => array('classic' => t('Classic Grid'), 'masonry' => t('Masonry Simple'), 'masonry_resize' => t('Masonry Resize')), '#default_value' => $this->options['grid_style'], '#attributes' => array('class' => array('grid-style')));
$field_options = array();
$fields = \Drupal::entityManager()->getFieldMapByFieldType('image');
foreach ($fields as $field) {
foreach ($field as $key => $value) {
$field_options[$key] = $key;
}
}
$form['masonry_background'] = array('#type' => 'select', '#title' => t('Image'), '#options' => $field_options, '#default_value' => $this->options['masonry_background'], '#states' => array('visible' => array('.grid-style' => array('value' => 'masonry_resize'))));
$form['grid_ratio'] = array('#type' => 'textfield', '#title' => t('Ratio'), '#description' => t('The ratio image'), '#default_value' => $this->options['grid_ratio'], '#states' => array('visible' => array('.grid-style' => array('value' => 'masonry_resize'))));
$form['grid_cols_lg'] = array('#type' => 'select', '#title' => t('Large Desktop Items'), '#description' => t('Number of items on large desktop'), '#options' => array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12), '#default_value' => $this->options['grid_cols_lg']);
$form['grid_cols_md'] = array('#type' => 'select', '#title' => t('Desktop Items'), '#description' => t('Number of items on desktop'), '#options' => array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12), '#default_value' => $this->options['grid_cols_md']);
$form['grid_cols_sm'] = array('#type' => 'select', '#title' => t('Tablet Items'), '#description' => t('Number of items on tablet'), '#options' => array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12), '#default_value' => $this->options['grid_cols_sm']);
$form['grid_cols_xs'] = array('#type' => 'select', '#title' => t('Phone Items'), '#description' => t('Number of items on phone'), '#options' => array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12), '#default_value' => $this->options['grid_cols_xs']);
$form['grid_margin'] = array('#type' => 'textfield', '#title' => t('Margin'), '#description' => t('The spacing beetween items'), '#default_value' => $this->options['grid_margin'], '#field_suffix' => 'px');
$form['grid_filter'] = array('#type' => 'select', '#title' => t('Use Filter'), '#options' => array(0 => t('No'), 1 => t('Yes')), '#description' => t('Filter items by taxonomy term'), '#default_value' => $this->options['grid_filter'], '#attributes' => array('class' => array('grid-filter-option')));
$categories = array();
$categories['select'] = t('Select');
foreach (Vocabulary::loadMultiple() as $vocabulary) {
$categories[$vocabulary->id()] = $vocabulary->get('name');
}
$form['grid_filter_vocabulary'] = array('#type' => 'select', '#title' => t('Filter Vocabulary'), '#options' => $categories, '#description' => t('Which taxonomy vocabulary do you want to use for the filter'), '#default_value' => $this->options['grid_filter_vocabulary'], '#states' => array('visible' => array('.grid-filter-option' => array('value' => 1))));
}
开发者ID:nearlyheadlessarvie,项目名称:bloomingline,代码行数:29,代码来源:InvGridStyle.php
示例7: defineOptions
protected function defineOptions()
{
$options = parent::defineOptions();
$options['base_path'] = array('default' => '');
$options['count'] = array('default' => TRUE, 'bool' => TRUE);
$options['override'] = array('default' => FALSE, 'bool' => TRUE);
$options['items_per_page'] = array('default' => 25);
return $options;
}
开发者ID:anatalsceo,项目名称:en-classe,代码行数:9,代码来源:DefaultSummary.php
示例8: buildOptionsForm
/**
* Builds the configuration form.
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$options = array('' => $this->t('- None -'));
$field_labels = $this->displayHandler->getFieldLabels(TRUE);
$options += $field_labels;
$form['date_field'] = array('#type' => 'select', '#title' => $this->t('Date'), '#options' => $options, '#default_value' => $this->options['date_field'], '#description' => $this->t('The field name of the date field that will be used as the date on the timeline.'));
$form['group_heading'] = array('#type' => 'select', '#title' => $this->t('Group heading'), '#options' => array('' => $this->t('No Heading'), 'century' => $this->t('Century'), 'date' => $this->t('Full Date'), 'format' => $this->t('Custom Format')), '#description' => $this->t('The type of date heading to add to the timeline. This heading will be inserted at the first spot where the value of the heading changes.'), '#default_value' => $this->options['group_heading']);
$form['group_heading_format'] = array('#type' => 'textfield', '#title' => $this->t('Group heading format'), '#description' => $this->t("If 'Custom Format' was selected above, input the format string to use for the date heading, using the formats from http://php.net/manual/en/function.date.php. For instance, 'M Y' will display a heading over all items with the same month and year, formatted as 'Jan 2016'."), '#default_value' => $this->options['group_heading_format']);
}
开发者ID:karens,项目名称:vertical_timeline,代码行数:13,代码来源:VerticalTimelineStyle.php
示例9: buildOptionsForm
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$options = array('' => $this->t('- None -'));
$field_labels = $this->displayHandler->getFieldLabels(TRUE);
$options += $field_labels;
$grouping = $this->options['grouping'];
$form['grouping'] = array('#type' => 'select', '#title' => $this->t('Grouping field Nr.@number'), '#options' => $options, '#default_value' => $grouping, '#description' => $this->t('You may optionally specify a field by which to group the records. Leave blank to not group.'));
$a = '';
}
开发者ID:karthikvaluebound,项目名称:custom,代码行数:13,代码来源:CustomDefaultStyle.php
示例10: buildOptionsForm
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$form['title_field'] = array('#type' => 'select', '#title' => $this->t('Title field'), '#options' => $this->displayHandler->getFieldLabels(TRUE), '#required' => TRUE, '#default_value' => $this->options['title_field'], '#description' => $this->t('Select the field that will be used as the title.'));
$form['accordion_filter'] = array('#type' => 'select', '#title' => t('Use Filter'), '#options' => array(0 => t('No'), 1 => t('Yes')), '#description' => t('Filter items by taxonomy term'), '#default_value' => $this->options['accordion_filter'], '#attributes' => array('class' => array('accordion-filter-option')));
$categories = array();
$categories['select'] = t('Select');
foreach (Vocabulary::loadMultiple() as $vocabulary) {
$categories[$vocabulary->id()] = $vocabulary->get('name');
}
$form['accordion_filter_vocabulary'] = array('#type' => 'select', '#title' => t('Filter Vocabulary'), '#options' => $categories, '#description' => t('Which taxonomy vocabulary do you want to use for the filter'), '#default_value' => $this->options['accordion_filter_vocabulary'], '#states' => array('visible' => array('.accordion-filter-option' => array('value' => 1))));
}
开发者ID:nearlyheadlessarvie,项目名称:bloomingline,代码行数:15,代码来源:InvAccordionStyle.php
示例11: testRenderWithIdAndToken
/**
* @covers ::render
* @covers ::defineOptions
* @covers ::init
*
* @dataProvider providerTestTokens
*/
public function testRenderWithIdAndToken($token, $id)
{
$this->setupEntityManager();
$options = ['target' => $token, 'tokenize' => TRUE];
$entity = $this->getMock('Drupal\\Core\\Entity\\EntityInterface');
$entity->expects($this->once())->method('access')->willReturn(TRUE);
$this->stylePlugin->expects($this->once())->method('tokenizeValue')->with($token, 0)->willReturn($id);
$this->entityStorage->expects($this->never())->method('loadByProperties');
$this->entityStorage->expects($this->once())->method('load')->with($id)->willReturn($entity);
$this->entityViewBuilder->expects($this->once())->method('view')->with($entity, 'default')->willReturn(['#markup' => 'hallo']);
$this->entityHandler->init($this->executable, $this->display, $options);
$result = $this->entityHandler->render();
$this->assertEquals(['#markup' => 'hallo'], $result);
}
开发者ID:nstielau,项目名称:drops-8,代码行数:21,代码来源:EntityTest.php
示例12: buildOptionsForm
/**
* Render the given style.
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$form['items'] = array('#type' => 'number', '#title' => $this->t('Items'), '#description' => $this->t('Maximum amount of items displayed at a time with the widest browser width.'), '#default_value' => $this->options['items']);
$form['itemsDesktop'] = array('#type' => 'textfield', '#title' => $this->t('Items Desktop'), '#description' => $this->t('This allows you to preset the number of slides visible with a particular browser width. The format is [x,y] whereby x=browser width and y=number of slides displayed. For example [1199,4] means that if(window<=1199){ show 4 slides per page}'), '#default_value' => $this->options['itemsDesktop']);
$form['itemsDesktopSmall'] = array('#type' => 'textfield', '#title' => $this->t('Items Desktop Small'), '#description' => $this->t('Example: [979,3]'), '#default_value' => $this->options['itemsDesktopSmall']);
$form['itemsTablet'] = array('#type' => 'textfield', '#title' => $this->t('Items Tablet'), '#description' => $this->t('Example: [768,2]'), '#default_value' => $this->options['itemsTablet']);
$form['itemsMobile'] = array('#type' => 'textfield', '#title' => $this->t('Items Mobile'), '#description' => $this->t('Example: [479,1]'), '#default_value' => $this->options['itemsMobile']);
$form['singleItem'] = array('#type' => 'checkbox', '#title' => $this->t('Single Item'), '#default_value' => $this->options['singleItem'], '#description' => $this->t('Display only one item.'));
//itemsScaleUp
$form['itemsScaleUp'] = array('#type' => 'checkbox', '#title' => $this->t('Items ScaleUp'), '#default_value' => $this->options['itemsScaleUp'], '#description' => $this->t('Option to not stretch items when it is less than the supplied items.'));
//slideSpeed
$form['slideSpeed'] = array('#type' => 'number', '#title' => $this->t('Slide Speed'), '#default_value' => $this->options['slideSpeed'], '#description' => $this->t('Slide speed in milliseconds.'));
//paginationSpeed
$form['paginationSpeed'] = array('#type' => 'number', '#title' => $this->t('Pagination Speed'), '#default_value' => $this->options['paginationSpeed'], '#description' => $this->t('Pagination speed in milliseconds.'));
//rewindSpeed
$form['rewindSpeed'] = array('#type' => 'number', '#title' => $this->t('Rewind Speed'), '#default_value' => $this->options['rewindSpeed'], '#description' => $this->t('Rewind speed in milliseconds.'));
//autoPlay
$form['autoPlay'] = array('#type' => 'checkbox', '#title' => $this->t('AutoPlay'), '#default_value' => $this->options['autoPlay']);
//stopOnHover
$form['stopOnHover'] = array('#type' => 'checkbox', '#title' => $this->t('Stop On Hover'), '#default_value' => $this->options['stopOnHover'], '#description' => $this->t('Stop autoplay on mouse hover.'));
//navigation
$form['navigation'] = array('#type' => 'checkbox', '#title' => $this->t('Navigation'), '#default_value' => $this->options['navigation'], '#description' => $this->t('Display "next" and "prev" buttons.'));
//prevText
$form['prevText'] = array('#type' => 'textfield', '#title' => $this->t('Prev Text'), '#default_value' => $this->options['prevText'], '#description' => $this->t('Text for navigation prev button'));
//nextText
$form['nextText'] = array('#type' => 'textfield', '#title' => $this->t('Next Text'), '#default_value' => $this->options['nextText'], '#description' => $this->t('Text for navigation next button'));
//rewindNav
$form['rewindNav'] = array('#type' => 'checkbox', '#title' => $this->t('Rewind Nav'), '#default_value' => $this->options['rewindNav'], '#description' => $this->t('Slide to first item.'));
//scrollPerPage
$form['scrollPerPage'] = array('#type' => 'checkbox', '#title' => $this->t('Scroll Per Page'), '#default_value' => $this->options['scrollPerPage'], '#description' => $this->t('Scroll per page not per item. This affect next/prev buttons and mouse/touch dragging.'));
//pagination
$form['pagination'] = array('#type' => 'checkbox', '#title' => $this->t('pagination'), '#default_value' => $this->options['pagination'], '#description' => $this->t('Show pagination.'));
//paginationNumbers
$form['paginationNumbers'] = array('#type' => 'checkbox', '#title' => $this->t('Pagination Numbers'), '#default_value' => $this->options['paginationNumbers'], '#description' => $this->t('Show numbers inside pagination buttons.'));
//responsive
$form['responsive'] = array('#type' => 'checkbox', '#title' => $this->t('Responsive'), '#default_value' => $this->options['responsive'], '#description' => $this->t('Uncheck to use Owl Carousel on desktop-only.'));
//responsiveRefreshRate
$form['responsiveRefreshRate'] = array('#type' => 'number', '#title' => $this->t('Responsive Refresh Rate'), '#default_value' => $this->options['responsiveRefreshRate'], '#description' => $this->t('Check window width changes every 200ms for responsive actions.'));
//mouseDrag
$form['mouseDrag'] = array('#type' => 'checkbox', '#title' => $this->t('Mouse Drag'), '#default_value' => $this->options['mouseDrag'], '#description' => $this->t('Turn off/on mouse events.'));
//touchDrag
$form['touchDrag'] = array('#type' => 'checkbox', '#title' => $this->t('Touch Drag'), '#default_value' => $this->options['touchDrag'], '#description' => $this->t('Turn off/on touch events.'));
//transitionStyle
$form['transitionStyle'] = array('#type' => 'select', '#options' => array('fade' => $this->t('Fade'), 'backSlide' => $this->t('Back Slide'), 'goDown' => $this->t('Go Down'), 'scaleUp' => $this->t('ScaleUp')), '#title' => $this->t('Transition Style'), '#default_value' => $this->options['transitionStyle'], '#description' => $this->t('Add CSS3 transition style. Works only with one item on screen.'));
}
开发者ID:tabvn,项目名称:owl,代码行数:49,代码来源:Owl.php
示例13: buildOptionsForm
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$form['columns'] = array('#type' => 'number', '#title' => $this->t('Number of columns'), '#default_value' => $this->options['columns'], '#required' => TRUE, '#min' => 1);
$form['automatic_width'] = array('#type' => 'checkbox', '#title' => $this->t('Automatic width'), '#description' => $this->t('The width of each column will be calculated automatically based on the number of columns provided. If additional classes are entered or a theme injects classes based on a grid system, disabling this option may prove beneficial.'), '#default_value' => $this->options['automatic_width']);
$form['alignment'] = array('#type' => 'radios', '#title' => $this->t('Alignment'), '#options' => array('horizontal' => $this->t('Horizontal'), 'vertical' => $this->t('Vertical')), '#default_value' => $this->options['alignment'], '#description' => $this->t('Horizontal alignment will place items starting in the upper left and moving right. Vertical alignment will place items starting in the upper left and moving down.'));
$form['col_class_default'] = array('#title' => $this->t('Default column classes'), '#description' => $this->t('Add the default views column classes like views-col, col-1 and clearfix to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'), '#type' => 'checkbox', '#default_value' => $this->options['col_class_default']);
$form['col_class_custom'] = array('#title' => $this->t('Custom column class'), '#description' => $this->t('Additional classes to provide on each column. Separated by a space.'), '#type' => 'textfield', '#default_value' => $this->options['col_class_custom']);
if ($this->usesFields()) {
$form['col_class_custom']['#description'] .= ' ' . $this->t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.');
}
$form['row_class_default'] = array('#title' => $this->t('Default row classes'), '#description' => $this->t('Adds the default views row classes like views-row, row-1 and clearfix to the output. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'), '#type' => 'checkbox', '#default_value' => $this->options['row_class_default']);
$form['row_class_custom'] = array('#title' => $this->t('Custom row class'), '#description' => $this->t('Additional classes to provide on each row. Separated by a space.'), '#type' => 'textfield', '#default_value' => $this->options['row_class_custom']);
if ($this->usesFields()) {
$form['row_class_custom']['#description'] .= ' ' . $this->t('You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.');
}
}
开发者ID:nstielau,项目名称:drops-8,代码行数:20,代码来源:Grid.php
示例14: buildOptionsForm
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state)
{
parent::buildOptionsForm($form, $form_state);
$form['global'] = array('#type' => 'fieldset', '#title' => 'Global');
$form['global']['autoplay'] = array('#type' => 'checkbox', '#title' => $this->t('Autoplay'), '#default_value' => isset($this->options['global']['autoplay']) ? $this->options['global']['autoplay'] : $this->options['autoplay'], '#description' => t('Enable to auto play.'));
$form['global']['autoplayinterval'] = array('#type' => 'number', '#title' => $this->t('Autoplay interval'), '#attributes' => array('min' => 0, 'step' => 1, 'value' => isset($this->options['global']['autoplayinterval']) ? $this->options['global']['autoplayinterval'] : $this->options['autoplayinterval']), '#description' => t('Interval (in milliseconds) to go for next slide since the previous stopped.'), '#states' => array('visible' => array(':input[name="style_options[global][autoplay]"]' => array('checked' => TRUE))));
$form['global']['autoplaysteps'] = array('#type' => 'number', '#title' => $this->t('Autoplay step'), '#attributes' => array('min' => 1, 'step' => 1, 'value' => isset($this->options['global']['autoplaysteps']) ? $this->options['global']['autoplaysteps'] : $this->options['autoplaysteps']), '#description' => t('Steps to go for each navigation request.'), '#states' => array('visible' => array(':input[name="style_options[global][autoplay]"]' => array('checked' => TRUE))));
$form['global']['pauseonhover'] = array('#type' => 'select', '#title' => $this->t('Pause on hover'), '#description' => t('Whether to pause when mouse over if a slider is auto playing.'), '#default_value' => isset($this->options['global']['pauseonhover']) ? $this->options['global']['pauseonhover'] : $this->options['pauseonhover'], '#options' => array(0 => $this->t('No pause'), 1 => $this->t('Pause for desktop'), 2 => $this->t('Pause for touch device'), 3 => $this->t('Pause for desktop and touch device'), 4 => $this->t('Freeze for desktop'), 8 => $this->t('Freeze for touch device'), 12 => $this->t('Freeze for desktop and touch device')), '#states' => array('visible' => array(':input[name="style_options[global][autoplay]"]' => array('checked' => TRUE))));
$form['global']['transition'] = array('#type' => 'select', '#title' => $this->t('Transition'), '#description' => t('Whether to pause when mouse over if a slider is auto playing.'), '#default_value' => isset($this->options['global']['transition']) ? $this->options['global']['transition'] : $this->options['transition'], '#options' => array(t('Twins Effects') => array('transition0001' => $this->t('Fade Twins'), 'transition0002' => $this->t('Rotate Overlap'), 'transition0003' => $this->t('Switch'), 'transition0004' => $this->t('Rotate Relay'), 'transition0005' => $this->t('Doors'), 'transition0006' => $this->t('Rotate in+ out-'), 'transition0007' => $this->t('Fly Twins'), 'transition0008' => $this->t('Rotate in- out+'), 'transition0009' => $this->t('Rotate Axis up overlap'), 'transition0010' => $this->t('Chess Replace TB'), 'transition0011' => $this->t('Chess Replace LR'), 'transition0012' => $this->t('Shift TB'), 'transition0013' => $this->t('Shift LR'), 'transition0014' => $this->t('Return TB'), 'transition0015' => $this->t('Return LR'), 'transition0016' => $this->t('Rotate Axis down'), 'transition0017' => $this->t('Extrude Replace')), t('Fade Effects') => array('transition0101' => $this->t('Fade'), 'transition0102' => $this->t('Fade in L'), 'transition0103' => $this->t('Fade in R')), t('Swing Outside Effects') => array('transition0201' => $this->t('Swing Outside in Stairs'), 'transition0202' => $this->t('Swing Outside in ZigZag'), 'transition0203' => $this->t('Swing Outside in Swirl'), 'transition0204' => $this->t('Swing Outside in Random'), 'transition0205' => $this->t('Swing Outside in Random Chess')), t('Swing Inside Effects') => array('transition0301' => $this->t('Swing Inside in Stairs'), 'transition0302' => $this->t('Swing Inside in ZigZag'), 'transition0303' => $this->t('Swing Inside in Swirl'), 'transition0304' => $this->t('Swing Inside in Random'), 'transition0305' => $this->t('Swing Inside in Random Chess')), t('Dodge Dance Outside Effects') => array('transition0401' => $this->t('Dodge Dance Outside in Stairs'), 'transition0402' => $this->t('Dodge Dance Outside in Swirl'), 'transition0403' => $this->t('Dodge Dance Outside in ZigZag'), 'transition0404' => $this->t('Dodge Dance Outside in Random'), 'transition0405' => $this->t('Dodge Dance Outside in Random Chess')), t('Dodge Dance Inside Effects') => array('transition0501' => $this->t('Dodge Dance Inside in Stairs'), 'transition0502' => $this->t('Dodge Dance Inside in Swirl'), 'transition0503' => $this->t('Dodge Dance Inside in ZigZag'), 'transition0504' => $this->t('Dodge Dance Inside in Random'), 'transition0505' => $this->t('Dodge Dance Inside in Random Chess')), t('Dodge Pet Outside Effects') => array('transition0601' => $this->t('Dodge Pet Outside in Stairs'), 'transition0602' => $this->t('Dodge Pet Outside in Swirl'), 'transition0603' => $this->t('Dodge Pet Outside in ZigZag'), 'transition0604' => $this->t('Dodge Pet Outside in Random'), 'transition0605' => $this->t('Dodge Pet Outside in Random Chess')), t('Dodge Pet Inside Effects') => array('transition0701' => $this->t('Dodge Pet Inside in Stairs'), 'transition0702' => $this->t('Dodge Pet Inside in Swirl'), 'transition0703' => $this->t('Dodge Pet Inside in ZigZag'), 'transition0704' => $this->t('Dodge Pet Inside in Random'), 'transition0705' => $this->t('Dodge Pet Inside in Random Chess')), t('Dodge Outside Effects') => array('transition0801' => $this->t('Dodge Outside out Stairs'), 'transition0802' => $this->t('Dodge Outside out Swirl'), 'transition0803' => $this->t('Dodge Outside out ZigZag'), 'transition0804' => $this->t('Dodge Outside out Random'), 'transition0805' => $this->t('Dodge Outside out Random Chess'), 'transition0806' => $this->t('Dodge Outside out Square'), 'transition0807' => $this->t('Dodge Outside in Stairs'), 'transition0808' => $this->t('Dodge Outside in Swirl'), 'transition0809' => $this->t('Dodge Outside in ZigZag'), 'transition0810' => $this->t('Dodge Outside in Random'), 'transition0811' => $this->t('Dodge Outside in Random Chess'), 'transition0812' => $this->t('Dodge Outside in Square')), t('Dodge Inside Effects') => array('transition0901' => $this->t('Dodge Inside out Stairs'), 'transition0902' => $this->t('Dodge Inside out Swirl'), 'transition0903' => $this->t('Dodge Inside out ZigZag'), 'transition0904' => $this->t('Dodge Inside out Random'), 'transition0905' => $this->t('Dodge Inside out Random Chess'), 'transition0906' => $this->t('Dodge Inside out Square'), 'transition0907' => $this->t('Dodge Inside in Stairs'), 'transition0908' => $this->t('Dodge Inside in Swirl'), 'transition0909' => $this->t('Dodge Inside in ZigZag'), 'transition0910' => $this->t('Dodge Inside in Random'), 'transition0911' => $this->t('Dodge Inside in Random Chess'), 'transition0912' => $this->t('Dodge Inside in Square')), t('Flutter Outside Effects') => array('transition1001' => $this->t('Flutter Outside in'), 'transition1002' => $this->t('Flutter Outside in Wind'), 'transition1003' => $this->t('Flutter Outside in Swirl'), 'transition1004' => $this->t('Flutter Outside in Column'), 'transition1005' => $this->t('Flutter Outside out'), 'transition1006' => $this->t('Flutter Outside out Wind'), 'transition1007' => $this->t('Flutter Outside out Swirl'), 'transition1008' => $this->t('Flutter Outside out Column')), t('Flutter Inside Effects') => array('transition1101' => $this->t('Flutter Inside in'), 'transition1102' => $this->t('Flutter Inside in Wind'), 'transition1103' => $this->t('Flutter Inside in Swirl'), 'transition1104' => $this->t('Flutter Inside in Column'), 'transition1105' => $this->t('Flutter Inside out'), 'transition1106' => $this->t('Flutter Inside out Wind'), 'transition1107' => $this->t('Flutter Inside out Swirl'), 'transition1108' => $this->t('Flutter Inside out Column')), t('Rotate Effects') => array('transition1201' => $this->t('Rotate VDouble+ in'), 'transition1202' => $this->t('Rotate HDouble+ in'), 'transition1203' => $this->t('Rotate VDouble- in'), 'transition1204' => $this->t('Rotate HDouble- in'), 'transition1205' => $this->t('Rotate VDouble+ out'), 'transition1206' => $this->t('Rotate HDouble+ out'), 'transition1207' => $this->t('Rotate VDouble- out'), 'transition1208' => $this->t('Rotate HDouble- out'), 'transition1209' => $this->t('Rotate VFork+ in'), 'transition1210' => $this->t('Rotate HFork+ in'), 'transition1211' => $this->t('Rotate VFork+ out'), 'transition1212' => $this->t('Rotate HFork+ out'), 'transition1213' => $this->t('Rotate Zoom+ in'), 'transition1214' => $this->t('Rotate Zoom+ in L'), 'transition1215' => $this->t('Rotate Zoom+ in R'), 'transition1216' => $this->t('Rotate Zoom+ in T'), 'transition1217' => $this->t('Rotate Zoom+ in B'), 'transition1218' => $this->t('Rotate Zoom+ in TL'), 'transition1219' => $this->t('Rotate Zoom+ in TR'), 'transition1220' => $this->t('Rotate Zoom+ in BL'), 'transition1221' => $this->t('Rotate Zoom+ in BR'), 'transition1222' => $this->t('Rotate Zoom+ out'), 'transition1223' => $this->t('Rotate Zoom+ out L'), 'transition1224' => $this->t('Rotate Zoom+ out R')), t('Zoom Effects') => array('transition1301' => $this->t('Zoom VDouble+ in'), 'transition1302' => $this->t('Zoom HDouble+ in'), 'transition1303' => $this->t('Zoom VDouble- in'), 'transition1304' => $this->t('Zoom HDouble- in'), 'transition1305' => $this->t('Zoom VDouble+ out'), 'transition1306' => $this->t('Zoom HDouble+ out'), 'transition1307' => $this->t('Zoom VDouble- out'), 'transition1308' => $this->t('Zoom HDouble- out'), 'transition1309' => $this->t('Zoom+ in'), 'transition1310' => $this->t('Zoom+ in L'), 'transition1311' => $this->t('Zoom+ in R'), 'transition1312' => $this->t('Zoom+ in T'), 'transition1313' => $this->t('Zoom+ in B'), 'transition1314' => $this->t('Zoom+ in TL'), 'transition1315' => $this->t('Zoom+ in TR'), 'transition1316' => $this->t('Zoom+ in BL'), 'transition1317' => $this->t('Zoom+ in BR'), 'transition1318' => $this->t('Zoom+ out'), 'transition1319' => $this->t('Zoom+ out L'), 'transition1320' => $this->t('Zoom+ out R')), t('Collapse Effects') => array('transition1401' => $this->t('Collapse Stairs')), t('Compound Effects') => array('transition1501' => $this->t('Clip & Chess in')), t('Expand Effects') => array('transition1601' => $this->t('Expand Stairs')), t('Stripe Effects') => array('transition1701' => $this->t('Dominoes Stripe')), t('Wave out Effects') => array('transition1801' => $this->t('Wave out')), t('Wave in Effects') => array('transition1901' => $this->t('Wave in')), t('Jump out Effects') => array('transition2001' => $this->t('Jump out Straight'), 'transition2002' => $this->t('Jump out Swirl'), 'transition2003' => $this->t('Jump out ZigZag'), 'transition2004' => $this->t('Jump out Square'), 'transition2005' => $this->t('Jump out Square with Chess'), 'transition2006' => $this->t('Jump out Rectangle'), 'transition2007' => $this->t('Jump out Circle'), 'transition2008' => $this->t('Jump out Rectangle Cross')), t('Jump in Effects') => array('transition2101' => $this->t('Jump in Straight'), 'transition2101' => $this->t('Jump in Straight'), 'transition2102' => $this->t('Jump in Swirl'), 'transition2103' => $this->t('Jump in ZigZag'), 'transition2104' => $this->t('Jump in Square'), 'transition2105' => $this->t('Jump in Square with Chess'), 'transition2106' => $this->t('Jump in Rectangle'), 'transition2107' => $this->t('Jump in Circle'), 'transition2108' => $this->t('Jump in Rectangle Cross')), t('Parabola Effects') => array('transition2201' => $this->t('Parabola Swirl in'), 'transition2202' => $this->t('Parabola Swirl out'), 'transition2203' => $this->t('Parabola ZigZag in'), 'transition2204' => $this->t('Parabola ZigZag out'), 'transition2205' => $this->t('Parabola Stairs in'), 'transition2206' => $this->t('Parabola Stairs out')), t('Float Effects') => array('transition2301' => $this->t('Float Right Random'), 'transition2302' => $this->t('Float up Random'), 'transition2303' => $this->t('Float up Random with Chess'), 'transition2304' => $this->t('Float Right ZigZag'), 'transition2305' => $this->t('Float up ZigZag'), 'transition2306' => $this->t('Float up ZigZag with Chess'), 'transition2307' => $this->t('Float Right Swirl'), 'transition2308' => $this->t('Float up Swirl'), 'transition2309' => $this->t('Float up Swirl with Chess')), t('Fly Effects') => array('transition2401' => $this->t('Fly Right Random'), 'transition2402' => $this->t('Fly up Random'), 'transition2403' => $this->t('Fly up Random with Chess'), 'transition2404' => $this->t('Fly Right ZigZag'), 'transition2405' => $this->t('Fly up ZigZag'), 'transition2406' => $this->t('Fly up ZigZag with Chess'), 'transition2407' => $this->t('Fly Right Swirl'), 'transition2408' => $this->t('Fly up Swirl'), 'transition2409' => $this->t('Fly up Swirl with Chess')), t('Stone Effects') => array('transition2501' => $this->t('Slide Down'), 'transition2502' => $this->t('Slide Right'), 'transition2503' => $this->t('Bounce Down'), 'transition2504' => $this->t('Bounce Right'))), '#states' => array('visible' => array(':input[name="style_options[global][autoplay]"]' => array('checked' => TRUE))));
$form['global']['arrownavigator'] = array('#type' => 'checkbox', '#title' => $this->t('Enable arrow navigator'), '#default_value' => isset($this->options['global']['arrownavigator']) ? $this->options['global']['arrownavigator'] : $this->options['arrownavigator']);
$form['global']['bulletnavigator'] = array('#type' => 'checkbox', '#title' => $this->t('Enable bullet navigator'), '#default_value' => isset($this->options['global']['bulletnavigator']) ? $this->options['global']['bulletnavigator'] : $this->options['bulletnavigator']);
// Arrow navigator.
$form['arrownavigator'] = array('#type' => 'fieldset', '#title' => $this->t('Arrow navigator'), '#states' => array('visible' => array(':input[name="style_options[global][arrownavigator]"]' => array('checked' => TRUE))));
$arrowskin = array();
for ($i = 1; $i < 22; $i++) {
$i = $i < 10 ? '0' . $i : $i;
$arrowskin[$i] = $this->t('Arrow ') . $i;
}
$form['arrownavigator']['arrowskin'] = array('#type' => 'select', '#title' => $this->t('Skin'), '#default_value' => isset($this->options['arrownavigator']['arrowskin']) ? $this->options['arrownavigator']['arrowskin'] : $this->options['arrowskin'], '#options' => $arrowskin);
$form['arrownavigator']['autocenter'] = array('#type' => 'select', '#title' => $this->t('Auto center'), '#description' => $this->t('Auto center arrows in parent container'), '#default_value' => isset($this->options['arrownavigator']['autocenter']) ? $this->options['arrownavigator']['autocenter'] : $this->options['autocenter'], '#options' => array(0 => $this->t('No'), 1 => $this->t('Horizontal'), 2 => $this->t('Vertical'), 3 => $this->t('Both')));
$form['arrownavigator']['chancetoshow'] = array('#type' => 'select', '#title' => $this->t('Chance to show'), '#default_value' => isset($this->options['arrownavigator']['chancetoshow']) ? $this->options['arrownavigator']['chancetoshow'] : $this->options['chancetoshow'], '#options' => array(0 => $this->t('Never'), 1 => $this->t('Mouse Over'), 2 => $this->t('Always')));
// Bullet navigator.
$form['bulletnavigator'] = array('#type' => 'fieldset', '#title' => $this->t('Bullet navigator'), '#states' => array('visible' => array(':input[name="style_options[global][bulletnavigator]"]' => array('checked' => TRUE))));
$bulletskin = array();
for ($i = 1; $i < 22; $i++) {
$i = $i < 10 ? '0' . $i : $i;
$bulletskin[$i] = $this->t('Bullet ') . $i;
}
$form['bulletnavigator']['bulletskin'] = array('#type' => 'select', '#title' => $this->t('Skin'), '#default_value' => isset($this->options['bulletnavigator']['bulletskin']) ? $this->options['bulletnavigator']['bulletskin'] : $this->options['bulletskin'], '#options' => $bulletskin);
$form['bulletnavigator']['autocenter'] = array('#type' => 'select', '#title' => $this->t('Auto center'), '#description' => $this->t('Auto center arrows in parent container'), '#default_value' => isset($this->options['bulletnavigator']['autocenter']) ? $this->options['bulletnavigator']['autocenter'] : $this->options['autocenter'], '#options' => array(0 => $this->t('No'), 1 => $this->t('Horizontal'), 2 => $this->t('Vertical'), 3 => $this->t('Both')));
$form['bulletnavigator']['chancetoshow'] = array('#type' => 'select', '#title' => $this->t('Chance to show'), '#default_value' => isset($this->options['bulletnavigator']['chancetoshow']) ? $this->options['bulletnavigator']['chancetoshow'] : $this->options['chancetoshow'], '#options' => array(0 => $this->t('Never'), 1 => $this->t('Mouse Over'), 2 => $this->t('Always')));
$form['bulletnavigator']['spacingx'] = array('#type' => 'number', '#title' => $this->t('Horizontal space'), '#at
|
请发表评论