コード例 #1
0
ファイル: Yesno.php プロジェクト: OPL/Open-Power-Forms
    /**
     * Displays the input component.
     *
     * @todo Add procedure injection!
     * @todo Add translations.
     * @param array $attributes The opt:display attribute list.
     */
    public function display($attributes = array())
    {
        $name = $this->_item->getFullyQualifiedName();
        $value = $this->_item->getValue();
        echo '<fieldset class="' . Opf_Design::getClass('yesno', $this->_item->isValid()) . '">
			<label class="yes"><input type="radio" name="' . $name . '" value="1" ' . ($value == true ? 'checked="checked"' : '') . '> Yes</label>
			<label class="no"><input type="radio" name="' . $name . '" value="0" ' . ($value == false ? 'checked="checked"' : '') . '> No</label>
		</fieldset>';
    }
コード例 #2
0
ファイル: Select.php プロジェクト: OPL/Open-Power-Forms
 /**
  * Displays the select component.
  *
  * @param array $attributes The opt:display attribute list.
  */
 public function display($attributes = array())
 {
     $attributes = array('name' => $this->_item->getFullyQualifiedName(), 'class' => Opf_Design::getClass('select', $this->_item->isValid()));
     $code = '<select ' . Opt_Function::buildAttributes($attributes) . '>';
     foreach ($this->_options as $id => $option) {
         if ($id == $this->_item->getValue()) {
             $code .= '<option value="' . $id . '" selected="selected">' . $option . '</option>';
         } else {
             $code .= '<option value="' . $id . '">' . $option . '</option>';
         }
     }
     echo $code . '</select>';
 }
コード例 #3
0
ファイル: Input.php プロジェクト: OPL/Open-Power-Forms
 /**
  * Displays the input component.
  *
  * @param array $attributes The opt:display attribute list.
  */
 public function display($attributes = array())
 {
     $attributes = array('name' => $this->_item->getFullyQualifiedName(), 'value' => $this->_item->getDisplayedValue(), 'class' => Opf_Design::getClass('input', $this->_item->isValid()));
     echo '<input type="text" ' . Opt_Function::buildAttributes($attributes) . ' />';
 }
コード例 #4
0
ファイル: Component.php プロジェクト: OPL/Open-Power-Forms
 public function manageAttributes($tagName, array $attributes)
 {
     $valid = $this->_item->isValid();
     $attributes['class'] = Opf_Design::getClass($this->getComponentName() . '.field', $valid);
     if ($attributes['class'] === null) {
         $attributes['class'] = Opf_Design::getClass('field', $valid);
     }
     return $attributes;
 }