Пример #1
0
function wpjb_form_helper_listing(Daq_Form_Element $field, array $options = array())
{
    $listing = wpjb_view("listing");
    foreach ($field->getOptions() as $option) {
        $id = $option["value"];
        $l = $listing[$id];
        ?>
        <label class="wpjb-listing-type-item" for="listing_<?php 
        echo $id;
        ?>
">
            <input name="listing" id="listing_<?php 
        echo $id;
        ?>
" type="radio" value="<?php 
        echo $id;
        ?>
" <?php 
        if ($field->getValue() == $id) {
            ?>
checked="checked"<?php 
        }
        ?>
 />
            <span class="wpjb-listing-type-item-s1"><?php 
        esc_html_e($l->title);
        ?>
</span>
            <span class="wpjb-listing-type-item-s2"><?php 
        echo $l->getTextPrice();
        ?>
</span>
            <span class="wpjb-listing-type-item-s3">
                <?php 
        if ($l->description) {
            ?>
                <?php 
            echo $l->description;
            ?>
                <?php 
        } else {
            ?>
                <?php 
            _e("visible for {$l->visible} days", WPJB_DOMAIN);
            ?>
                <?php 
        }
        ?>
            </span>
        </label>    
    <?php 
    }
}
Пример #2
0
 public function renderTextarea(Daq_Form_Element $element)
 {
     $opt = array();
     $opt['id'] = $element->getName();
     $opt['name'] = $element->getName();
     return $this->_render("textarea", $opt, esc_html((string) $element->getValue()));
 }