[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class AphrontFormChooseButtonControl extends AphrontFormControl { 4 5 private $displayValue; 6 private $buttonText; 7 private $chooseURI; 8 9 public function setDisplayValue($display_value) { 10 $this->displayValue = $display_value; 11 return $this; 12 } 13 14 public function getDisplayValue() { 15 return $this->displayValue; 16 } 17 18 public function setButtonText($text) { 19 $this->buttonText = $text; 20 return $this; 21 } 22 23 public function setChooseURI($choose_uri) { 24 $this->chooseURI = $choose_uri; 25 return $this; 26 } 27 28 protected function getCustomControlClass() { 29 return 'aphront-form-control-choose-button'; 30 } 31 32 protected function renderInput() { 33 Javelin::initBehavior('choose-control'); 34 35 $input_id = celerity_generate_unique_node_id(); 36 $display_id = celerity_generate_unique_node_id(); 37 38 $display_value = $this->displayValue; 39 $button = javelin_tag( 40 'a', 41 array( 42 'href' => '#', 43 'class' => 'button grey', 44 'sigil' => 'aphront-form-choose-button', 45 ), 46 nonempty($this->buttonText, pht('Choose...'))); 47 48 $display_cell = phutil_tag( 49 'td', 50 array( 51 'class' => 'aphront-form-choose-display-cell', 52 'id' => $display_id, 53 ), 54 $display_value); 55 56 $button_cell = phutil_tag( 57 'td', 58 array( 59 'class' => 'aphront-form-choose-button-cell', 60 ), 61 $button); 62 63 $row = phutil_tag( 64 'tr', 65 array(), 66 array($display_cell, $button_cell)); 67 68 $layout = javelin_tag( 69 'table', 70 array( 71 'class' => 'aphront-form-choose-table', 72 'sigil' => 'aphront-form-choose', 73 'meta' => array( 74 'uri' => $this->chooseURI, 75 'inputID' => $input_id, 76 'displayID' => $display_id, 77 ), 78 ), 79 $row); 80 81 $hidden_input = phutil_tag( 82 'input', 83 array( 84 'type' => 'hidden', 85 'name' => $this->getName(), 86 'value' => $this->getValue(), 87 'id' => $input_id, 88 )); 89 90 return array( 91 $hidden_input, 92 $layout, 93 ); 94 } 95 96 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |