示例#1
0
文件: list.php 项目: RA2WP/RA2WP
 public function checkbox_showItem($uniqueName, $itemInfo, $disabled = false)
 {
     $elem = array('type' => 'checkbox_list', 'separator' => '<br>', 'value' => $itemInfo['extra']['value']);
     $elem['options'] = array();
     for ($x = 0; $x < sizeof($itemInfo['extra']['options']); $x++) {
         $elem['options'][$uniqueName . "-" . $x] = $itemInfo['extra']['options'][$x];
     }
     if ($disabled) {
         $elem['attributes']['disabled'] = 'disabled';
     }
     return '<div class="fm-checkbox-list">' . fe_getElementHTML($elem) . '</div>' . '<input type="hidden" name="' . $uniqueName . '" id="' . $uniqueName . '" value="' . sizeof($itemInfo['extra']['options']) . '" />';
 }
示例#2
0
 public function showItem($uniqueName, $itemInfo)
 {
     global $fm_display;
     $elem = array('type' => 'text', 'attributes' => array('name' => $uniqueName, 'id' => $uniqueName, 'style' => "width:" . $itemInfo['extra']['size'] . "px;"));
     if (trim($itemInfo['extra']['maxlength']) != "") {
         $elem['attributes']['maxlength'] = $itemInfo['extra']['maxlength'];
     }
     if (isset($fm_display->currentFormOptions['use_placeholders']) && $fm_display->currentFormOptions['use_placeholders'] === false) {
         $elem['attributes']['value'] = htmlspecialchars(strip_tags($itemInfo['extra']['value']));
     } else {
         $elem['attributes']['placeholder'] = htmlspecialchars(strip_tags($itemInfo['extra']['value']));
     }
     return fe_getElementHTML($elem);
 }
示例#3
0
function fm_createFormElement()
{
    //echo "<pre>".print_r($elem,true)."</pre>";
    $elem = sanitize_text_field($_POST['elem']);
    echo fe_getElementHTML($elem);
    die;
}
示例#4
0
 public function showItemSimple($uniqueName, $itemInfo)
 {
     $isChecked = $itemInfo['extra']['value'] == __("yes", 'wordpress-form-manager');
     $elem = array('type' => 'checkbox', 'attributes' => array('name' => $uniqueName, 'id' => $uniqueName), 'checked' => $isChecked);
     return fe_getElementHTML($elem);
 }
 public function editItem($uniqueName, $itemInfo)
 {
     $elem = array('type' => 'textarea', 'default' => $itemInfo['extra']['value'], 'attributes' => array('name' => $uniqueName . "-edit-value", 'id' => $uniqueName . "-edit-value", 'rows' => 2, 'cols' => 18, 'readonly' => 'readonly'));
     return fe_getElementHTML($elem);
 }
示例#6
0
function fm_createFormElement()
{
    //echo "<pre>".print_r($elem,true)."</pre>";
    echo fe_getElementHTML($_POST['elem']);
    die;
}