PluginProbe
Contact Forms by Cimatti / 1.9.2
Contact Forms by Cimatti v1.9.2
2.3.6 2.3.5 2.3.0 2.2.32 2.2.4 2.2.0 2.1.2 2.1.1 trunk 1.0 1.1 1.2 1.2.1 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 All 62 releases
contact-forms / PFBC / Element / Sort.php

Sort.php in Contact Forms by Cimatti 1.9.2, at PFBC/Element/Sort.php

27 lines 999 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 class Element_Sort extends OptionElement {
3 protected $jQueryOptions;
4
5 public function jQueryDocumentReady() {
6 echo 'jQuery("#', $this->attributes["id"], ' ul").sortable(', $this->jQueryOptions(), ');';
7 echo 'jQuery("#', $this->attributes["id"], ' ul").disableSelection();';
8 }
9
10 public function render() {
11 if(substr($this->attributes["name"], -2) != "[]")
12 $this->attributes["name"] .= "[]";
13
14 echo '<div id="', $this->attributes["id"], '"><ul>';
15 foreach($this->options as $value => $text) {
16 $value = $this->getOptionValue($value);
17 echo '<li class="ui-state-default"><input type="hidden" name="', $this->attributes["name"], '" value="', $value, '"/>', $text, '</li>';
18 }
19 echo "</ul></div>";
20 }
21
22 public function renderCSS() {
23 echo '#', $this->attributes["id"], ' ul { list-style-type: none; margin: 0; padding: 0; cursor: pointer; }';
24 echo '#', $this->attributes["id"], ' ul li { margin: 0.25em 0; padding: 0.5em; font-size: 1em; }';
25 }
26 }
27