comparison core/lib/Drupal/Core/Ajax/RestripeCommand.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Core\Ajax;
4
5 /**
6 * AJAX command for resetting the striping on a table.
7 *
8 * The 'restripe' command instructs the client to restripe a table. This is
9 * usually used after a table has been modified by a replace or append command.
10 *
11 * This command is implemented by Drupal.AjaxCommands.prototype.restripe()
12 * defined in misc/ajax.js.
13 *
14 * @ingroup ajax
15 */
16 class RestripeCommand implements CommandInterface {
17
18 /**
19 * A CSS selector string.
20 *
21 * If the command is a response to a request from an #ajax form element then
22 * this value can be NULL.
23 *
24 * @var string
25 */
26 protected $selector;
27
28 /**
29 * Constructs a RestripeCommand object.
30 *
31 * @param string $selector
32 * A CSS selector for the table to be restriped.
33 */
34 public function __construct($selector) {
35 $this->selector = $selector;
36 }
37
38 /**
39 * Implements Drupal\Core\Ajax\CommandInterface:render().
40 */
41 public function render() {
42
43 return [
44 'command' => 'restripe',
45 'selector' => $this->selector,
46 ];
47 }
48
49 }