Esempio n. 1
0
    public function form($instance)
    {
        $image_bg_id = esc_attr(isset($instance[$this->image_bg_field]) ? $instance[$this->image_bg_field] : 0);
        $image_bg = new WidgetImageField($this, $image_bg_id);
        ?>

        <div id="div_background_image">
            <label><?php 
        _e('Background Image:');
        ?>
</label>
            <?php 
        echo $image_bg->get_widget_field('bg_image', 'bg');
        ?>
        </div>

        <p id="div_content">
            <label for="<?php 
        echo $this->get_field_id('content');
        ?>
"><?php 
        _e('content:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('content');
        ?>
" name="<?php 
        echo $this->get_field_name('content');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['content']);
        ?>
" />
        </p>
        
        <p id="div_content_2">
            <label for="<?php 
        echo $this->get_field_id('content_2');
        ?>
"><?php 
        _e('second content:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('content_2');
        ?>
" name="<?php 
        echo $this->get_field_name('content_2');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['content_2']);
        ?>
" />
        </p>

        <?php 
    }
Esempio n. 2
0
    public function form($instance)
    {
        if (empty($instance['title'])) {
            $title = '';
        } else {
            $title = $instance['title'];
        }
        $image_bg_id = esc_attr(isset($instance[$this->image_bg_field]) ? $instance[$this->image_bg_field] : 0);
        $image_bg = new WidgetImageField($this, $image_bg_id);
        ?>
        <p>
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
" />
        </p>

        <div id="div_background_image">
            <label><?php 
        _e('Background Image:');
        ?>
</label>
            <?php 
        echo $image_bg->get_widget_field('bg_image', 'bg');
        ?>
        </div>

        <p id="div_number">
            <label for="<?php 
        echo $this->get_field_id('number');
        ?>
"><?php 
        _e('Number of testimonials to show:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('number');
        ?>
" name="<?php 
        echo $this->get_field_name('number');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['number']);
        ?>
" />
        </p>

        <?php 
    }
    function form($instance)
    {
        $image_id = esc_attr(isset($instance[$this->image_field]) ? $instance[$this->image_field] : 0);
        $blurb = esc_attr(isset($instance['blurb']) ? $instance['blurb'] : '');
        $url = esc_attr(isset($instance['url']) ? $instance['url'] : '');
        $new = esc_attr(isset($instance['new']) ? 'true' : 'false');
        $image = new WidgetImageField($this, $image_id);
        ?>
            <div>
                <label><?php 
        _e('Billede');
        ?>
</label>
                <?php 
        echo $image->get_widget_field();
        ?>
            </div>
            <p>
                <label for="<?php 
        echo $this->get_field_id('blurb');
        ?>
"><?php 
        _e('Tekst:');
        ?>
                    <input class="widefat" id="<?php 
        echo $this->get_field_id('blurb');
        ?>
" name="<?php 
        echo $this->get_field_name('blurb');
        ?>
" type="text" value="<?php 
        echo $blurb;
        ?>
" />
                </label>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('url');
        ?>
"><?php 
        _e('Link:');
        ?>
                    <input class="widefat" id="<?php 
        echo $this->get_field_id('url');
        ?>
" name="<?php 
        echo $this->get_field_name('url');
        ?>
" type="text" value="<?php 
        echo $url;
        ?>
" />
                </label>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('new');
        ?>
"><?php 
        _e('Åben i nyt vindue:');
        ?>
                    <input id="<?php 
        echo $this->get_field_id('new');
        ?>
" name="<?php 
        echo $this->get_field_name('new');
        ?>
" type="checkbox" <?php 
        checked(isset($instance['new']) ? $instance['new'] : 'off', 'on');
        ?>
/>
                </label>
            </p>
        <?php 
    }
    /**
     * Back-end widget form.
     *
     * @see WP_Widget::form()
     *
     * @param array $instance Previously saved values from database.
     */
    public function form($instance)
    {
        $title = esc_attr($instance['title']);
        $text = esc_textarea($instance['textarea']);
        $url = esc_attr($instance['url']);
        $image_id = esc_attr($instance[$this->image_field]);
        $image = new WidgetImageField($this, $image_id);
        ?>
            <p>
                <label><?php 
        _e('Image:');
        ?>
</label>
                <?php 
        echo $image->get_widget_field();
        ?>
            </p> 
            <p>
                <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:');
        ?>
</label>
                <input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $title;
        ?>
" placeholder="Get The Book" />
                
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('text');
        ?>
"><?php 
        _e('Rollover text:');
        ?>
</label>
                <textarea class="widefat" rows="8" id="<?php 
        echo $this->get_field_id('textarea');
        ?>
" name="<?php 
        echo $this->get_field_name('textarea');
        ?>
"><?php 
        echo $text;
        ?>
</textarea>   
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('url');
        ?>
"><?php 
        _e('URL:');
        ?>
</label>
                <input class="widefat" id="<?php 
        echo $this->get_field_id('url');
        ?>
" name="<?php 
        echo $this->get_field_name('url');
        ?>
" type="text" value="<?php 
        echo $url;
        ?>
" placeholder="ex: http://christameola.com/about/" />
            </p>
        <?php 
    }
Esempio n. 5
0
    function form($instance)
    {
        $image_id = esc_attr(isset($instance[$this->image_field]) ? $instance[$this->image_field] : 0);
        $title = esc_attr(isset($instance['title']) ? $instance['title'] : '');
        $codeembed = esc_attr(isset($instance['codeembed']) ? $instance['codeembed'] : '');
        $textshowvideo = esc_attr(isset($instance['textshowvideo']) ? $instance['textshowvideo'] : '');
        $linkshare = esc_attr(isset($instance['linkshare']) ? $instance['linkshare'] : '');
        $link = esc_attr(isset($instance['link']) ? $instance['link'] : '');
        $image = new WidgetImageField($this, $image_id);
        ?>
        <div>
            <label><?php 
        _e('Background:');
        ?>
</label>
            <?php 
        echo $image->get_widget_field();
        ?>
            <label for="<?php 
        echo $this->get_field_id('link');
        ?>
"><?php 
        _e('Link for Image:');
        ?>
                <input class="widefat" id="<?php 
        echo $this->get_field_id('link');
        ?>
" name="<?php 
        echo $this->get_field_name('link');
        ?>
" type="text" value="<?php 
        echo $link;
        ?>
" />
            </label>
        </div>
        <p>
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('headline:');
        ?>
                <input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo $title;
        ?>
" />
            </label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('codeembed');
        ?>
"><?php 
        _e('codeembed:');
        ?>
                <textarea class="widefat" id="<?php 
        echo $this->get_field_id('codeembed');
        ?>
" name="<?php 
        echo $this->get_field_name('codeembed');
        ?>
"><?php 
        echo $codeembed;
        ?>
</textarea>
            </label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('textshowvideo');
        ?>
"><?php 
        _e('Text Show Video:');
        ?>
                <input class="widefat" id="<?php 
        echo $this->get_field_id('textshowvideo');
        ?>
" name="<?php 
        echo $this->get_field_name('textshowvideo');
        ?>
" type="text" value="<?php 
        echo $textshowvideo;
        ?>
" />
            </label>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('linkshare');
        ?>
"><?php 
        _e('Link Share:');
        ?>
                <input class="widefat" id="<?php 
        echo $this->get_field_id('linkshare');
        ?>
" name="<?php 
        echo $this->get_field_name('linkshare');
        ?>
" type="text" value="<?php 
        echo $linkshare;
        ?>
" />
            </label>
        </p>
        <?php 
    }
Esempio n. 6
0
    function form($instance)
    {
        // Check values
        // if( $instance) {
        $logo = esc_attr(isset($instance[$this->image_field]) ? $instance[$this->image_field] : 0);
        $descricao = esc_textarea($instance['descricao']);
        $endereco = esc_attr($instance['endereco']);
        $email = esc_attr($instance['email']);
        $telefone = esc_attr($instance['telefone']);
        $facebook = esc_attr($instance['facebook']);
        $twitter = esc_attr($instance['twitter']);
        $googleplus = esc_attr($instance['googleplus']);
        $linkedin = esc_attr($instance['linkedin']);
        $github = esc_attr($instance['github']);
        $contato = esc_attr($instance['contato']);
        $image = new WidgetImageField($this, $logo);
        // } else {
        //      $logo = '';
        //      $descricao = '';
        //      $endereco = '';
        //      $email = '';
        //      $telefone = '';
        //      $facebook = '';
        //      $twitter = '';
        //      $googleplus = '';
        //      $linkedin = '';
        //      $github = '';
        //      $image = '';
        // }
        ?>

    <p>
    <label><?php 
        _e('Logotipo', 'jardim_digital');
        ?>
</label>
    <?php 
        echo $image->get_widget_field();
        ?>
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('endereco');
        ?>
"><?php 
        _e('Endereço:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('endereco');
        ?>
" name="<?php 
        echo $this->get_field_name('endereco');
        ?>
" type="text" value="<?php 
        echo $endereco;
        ?>
" />
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('telefone');
        ?>
"><?php 
        _e('Telefone:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('telefone');
        ?>
" name="<?php 
        echo $this->get_field_name('telefone');
        ?>
" type="text" value="<?php 
        echo $telefone;
        ?>
" />
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('email');
        ?>
"><?php 
        _e('Email:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('email');
        ?>
" name="<?php 
        echo $this->get_field_name('email');
        ?>
" type="text" value="<?php 
        echo $email;
        ?>
" />
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('descricao');
        ?>
"><?php 
        _e('Descrição:', 'jardim_digital');
        ?>
</label>
    <textarea class="widefat" id="<?php 
        echo $this->get_field_id('descricao');
        ?>
" name="<?php 
        echo $this->get_field_name('descricao');
        ?>
"><?php 
        echo $descricao;
        ?>
</textarea>
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('facebook');
        ?>
"><?php 
        _e('URL do perfil no Facebook:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('facebook');
        ?>
" name="<?php 
        echo $this->get_field_name('facebook');
        ?>
" type="text" value="<?php 
        echo $facebook;
        ?>
" />
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('twitter');
        ?>
"><?php 
        _e('URL do perfil no Twitter:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('twitter');
        ?>
" name="<?php 
        echo $this->get_field_name('twitter');
        ?>
" type="text" value="<?php 
        echo $twitter;
        ?>
" />
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('googleplus');
        ?>
"><?php 
        _e('URL do perfil no Google Plus:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('googleplus');
        ?>
" name="<?php 
        echo $this->get_field_name('googleplus');
        ?>
" type="text" value="<?php 
        echo $googleplus;
        ?>
" />
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('linkedin');
        ?>
"><?php 
        _e('URL do perfil no LinkedIn:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('linkedin');
        ?>
" name="<?php 
        echo $this->get_field_name('linkedin');
        ?>
" type="text" value="<?php 
        echo $linkedin;
        ?>
" />
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('github');
        ?>
"><?php 
        _e('URL do perfil no Github:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('github');
        ?>
" name="<?php 
        echo $this->get_field_name('github');
        ?>
" type="text" value="<?php 
        echo $github;
        ?>
" />
    </p>

    <p>
    <label for="<?php 
        echo $this->get_field_id('contato');
        ?>
"><?php 
        _e('ID da página de contato:', 'jardim_digital');
        ?>
</label>
    <input class="widefat" id="<?php 
        echo $this->get_field_id('contato');
        ?>
" name="<?php 
        echo $this->get_field_name('contato');
        ?>
" type="text" value="<?php 
        echo $contato;
        ?>
" />
    </p>

  <?php 
    }
    public function form($instance)
    {
        if (empty($instance['title'])) {
            $title = '';
        } else {
            $title = $instance['title'];
        }
        $image_id = esc_attr(isset($instance[$this->image_field]) ? $instance[$this->image_field] : 0);
        $image = new WidgetImageField($this, $image_id);
        ?>
        <!--        <script>
                function setShowHide(show_on){
                    alert(show_on);
                    if(show_on==='real_food_in_school') {
                            jQuery('#div_headline').hide();
                            jQuery('#div_headline_font_size').hide();
                            jQuery('#div_headline_font_color').hide();
                    } 
                }
                jQuery(document).ready( function(){
                    jQuery('#div_headline').show();
                    jQuery('#div_headline_font_size').show();
                    jQuery('#div_headline_font_color').show();
                    var show_on ="<?php 
        echo $instance['show_on'];
        ?>
";
                    setShowHide(show_on);
                   jQuery('#show_on').change(function() {                    
                        var show_on1 =jQuery(this).val();
                        setShowHide(show_on1);
                   });
                });   
            </script>    -->
        <p>
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
" />
        </p>
        <p>
        <?php 
        $checked = $instance['add_submenu'] == 'on' ? 'checked="true"' : '';
        ?>
            <input type="checkbox" name="<?php 
        echo $this->get_field_name('add_submenu');
        ?>
" id="" <?php 
        echo $checked;
        ?>
>
            <label for="<?php 
        echo $this->get_field_id('add_submenu');
        ?>
">Add title as submenu</label>        
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('show_on');
        ?>
"><?php 
        _e('Show on');
        ?>
:</label><br/>
            <select name="<?php 
        echo $this->get_field_name('show_on');
        ?>
" id="<?php 
        echo $this->get_field_id('show_on');
        ?>
">
                <option value="real_food_for_all" <?php 
        if ($instance['show_on'] == 'real_food_for_all') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Real food for all on Home page');
        ?>
</option>
                <option value="real_food_in_school" <?php 
        if ($instance['show_on'] == 'real_food_in_school') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Real food in school on Home page');
        ?>
</option>
                <option value="real_food_in_store" <?php 
        if ($instance['show_on'] == 'real_food_in_store') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Real food in store on Home page');
        ?>
</option>
                <option value="our_mission" <?php 
        if ($instance['show_on'] == 'our_mission') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Our mission on About page');
        ?>
</option>
                <option value="our_story" <?php 
        if ($instance['show_on'] == 'our_story') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Our story on About page');
        ?>
</option>
                <option value="foot_philosophy" <?php 
        if ($instance['show_on'] == 'foot_philosophy') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Food philosophy on About page');
        ?>
</option>
                <option value="nutritional_education" <?php 
        if ($instance['show_on'] == 'nutritional_education') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Nutritional education on About page');
        ?>
</option>
                <option value="careers" <?php 
        if ($instance['show_on'] == 'careers') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Careers on About page');
        ?>
</option>
                <option value="meals_served" <?php 
        if ($instance['show_on'] == 'meals_served') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Meals served on In Schools page');
        ?>
</option>
                <option value="meal_program" <?php 
        if ($instance['show_on'] == 'meal_program') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Meal program on In Schools page');
        ?>
</option>
                <option value="our_kind_of_partners" <?php 
        if ($instance['show_on'] == 'our_kind_of_partners') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Our kind of partners on In Schools page');
        ?>
</option>
                <option value="in_school_products" <?php 
        if ($instance['show_on'] == 'in_school_products') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('In School products on In Schools page');
        ?>
</option>
                <option value="the_buzz" <?php 
        if ($instance['show_on'] == 'the_buzz') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('The buzz on In Schools page');
        ?>
</option>
                <option value="new_products" <?php 
        if ($instance['show_on'] == 'new_products') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('New products on In Stores page');
        ?>
</option>
                <option value="meal_kits" <?php 
        if ($instance['show_on'] == 'meal_kits') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Meal kits on In Stores page');
        ?>
</option>
            </select>
        </p>
        <div id="div_background_image">
            <label><?php 
        _e('Background Image:');
        ?>
</label>
        <?php 
        echo $image->get_widget_field();
        ?>
        </div>
        <p id="div_bg_color">
            <label for="<?php 
        echo $this->get_field_id('bg_color');
        ?>
"><?php 
        _e('Background Color:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('bg_color');
        ?>
" name="<?php 
        echo $this->get_field_name('bg_color');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['bg_color']);
        ?>
" />
        </p>
        <p id="div_headline">
            <label for="<?php 
        echo $this->get_field_id('headline');
        ?>
"><?php 
        _e('Headline:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('headline');
        ?>
" name="<?php 
        echo $this->get_field_name('headline');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['headline']);
        ?>
" />
        </p>
        <p id="div_headline_font_size">
            <label for="<?php 
        echo $this->get_field_id('headline_font_size');
        ?>
"><?php 
        _e('Font size of headline:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('headline_font_size');
        ?>
" name="<?php 
        echo $this->get_field_name('headline_font_size');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['headline_font_size']);
        ?>
" />
        </p>
        <p id="div_headline_font_color">
            <label for="<?php 
        echo $this->get_field_id('headline_font_color');
        ?>
"><?php 
        _e('Font color of headline:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('headline_font_color');
        ?>
" name="<?php 
        echo $this->get_field_name('headline_font_color');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['headline_font_color']);
        ?>
" />
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('content');
        ?>
"><?php 
        _e('Content:');
        ?>
</label> 
            <textarea rows="8" class="widefat" id="<?php 
        echo $this->get_field_id('content');
        ?>
" name="<?php 
        echo $this->get_field_name('content');
        ?>
"><?php 
        echo format_to_edit($instance['content']);
        ?>
</textarea>
        </p>
        <p id="div_link">
            <label for="<?php 
        echo $this->get_field_id('link');
        ?>
"><?php 
        _e('Link:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('link');
        ?>
" name="<?php 
        echo $this->get_field_name('link');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['link']);
        ?>
" />
            <select name="<?php 
        echo $this->get_field_name('link_target');
        ?>
" id="<?php 
        echo $this->get_field_id('link_target');
        ?>
">
                <option value="new_window" <?php 
        if ($instance['link_target'] == 'new_window') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('New Window');
        ?>
</option>
                <option value="stay_in_window" <?php 
        if ($instance['link_target'] == 'stay_in_window') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Stay in window');
        ?>
</option>
                <option value="pop_up" <?php 
        if ($instance['link_target'] == 'pop_up') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Open popup');
        ?>
</option>
            </select>
        </p>
        <p>
            <label for="<?php 
        echo $this->get_field_id('learn_more_text');
        ?>
"><?php 
        _e('Learn more text:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('learn_more_text');
        ?>
" name="<?php 
        echo $this->get_field_name('learn_more_text');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['learn_more_text']);
        ?>
" />
        </p>
        <?php 
    }
    function form($instance)
    {
        $defaults = array('title' => '', 'image' => '', 'item_title' => '', 'text' => '', 'link_text' => 'read on', 'link_url' => '');
        $values = wp_parse_args($instance, $defaults);
        $image = new WidgetImageField($this, $values['image']);
        ?>
        <p>
        	<label for='<?php 
        echo $this->get_field_id('title');
        ?>
'>
        		<?php 
        _e('Title:', THEMENAME);
        ?>
        		<input class='widefat' id='<?php 
        echo $this->get_field_id('title');
        ?>
' name='<?php 
        echo $this->get_field_name('title');
        ?>
' type='text' value='<?php 
        echo $values['title'];
        ?>
' />
        	</label>
        </p>

        <p>
        	<label for='<?php 
        echo $this->get_field_id('item_title');
        ?>
'>
        		<?php 
        _e('Featured Item Title:', THEMENAME);
        ?>
        		<input class='widefat' id='<?php 
        echo $this->get_field_id('item_title');
        ?>
' name='<?php 
        echo $this->get_field_name('item_title');
        ?>
' type='text' value='<?php 
        echo $values['item_title'];
        ?>
' />
        	</label>
        </p>


        <p>
            <label><?php 
        _e('Featured Item image:', THEMENAME);
        ?>
</label>
            <?php 
        echo $image->get_widget_field();
        ?>
        </p>

        <p>
        	<label for='<?php 
        echo $this->get_field_id('text');
        ?>
'>
        		<?php 
        _e('Featured Item Text:', THEMENAME);
        ?>
        		<textarea rows='9' cols='20' class='widefat' id='<?php 
        echo $this->get_field_id('text');
        ?>
' name='<?php 
        echo $this->get_field_name('text');
        ?>
'><?php 
        echo $values['text'];
        ?>
</textarea>
        	</label>
        </p>

        <p>
        	<label for='<?php 
        echo $this->get_field_id('link_url');
        ?>
'>
        		<?php 
        _e('Featured Item Link URL:', THEMENAME);
        ?>
        		<input class='widefat' id='<?php 
        echo $this->get_field_id('link_url');
        ?>
' name='<?php 
        echo $this->get_field_name('link_url');
        ?>
' type='text' value='<?php 
        echo $values['link_url'];
        ?>
' />
        	</label>
        </p>

        <p>
        	<label for='<?php 
        echo $this->get_field_id('link_text');
        ?>
'>
        		<?php 
        _e('Featured Item Link Text:', THEMENAME);
        ?>
        		<input class='widefat' id='<?php 
        echo $this->get_field_id('link_text');
        ?>
' name='<?php 
        echo $this->get_field_name('link_text');
        ?>
' type='text' value='<?php 
        echo $values['link_text'];
        ?>
' />
        	</label>
        </p>


        <?php 
    }
Esempio n. 9
0
    public function form($instance)
    {
        if (empty($instance['title'])) {
            $title = '';
        } else {
            $title = $instance['title'];
        }
        $image_id = esc_attr(isset($instance[$this->image_field]) ? $instance[$this->image_field] : 0);
        $image = new WidgetImageField($this, $image_id);
        ?>

       
        <p>
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" type="text" value="<?php 
        echo esc_attr($title);
        ?>
" />
        </p>
        
        
        <div id="div_main_image">
            <label><?php 
        _e('Main Image:');
        ?>
</label>
        <?php 
        echo $image->get_widget_field('main_image', 'main');
        ?>

        </div>       
        <p id="div_link">
            <label for="<?php 
        echo $this->get_field_id('link');
        ?>
"><?php 
        _e('Link:');
        ?>
</label> 
            <input class="widefat" id="<?php 
        echo $this->get_field_id('link');
        ?>
" name="<?php 
        echo $this->get_field_name('link');
        ?>
" type="text" value="<?php 
        echo esc_attr($instance['link']);
        ?>
" />
            <select name="<?php 
        echo $this->get_field_name('link_target');
        ?>
" id="<?php 
        echo $this->get_field_id('link_target');
        ?>
">
                <option value="new_window" <?php 
        if ($instance['link_target'] == 'new_window') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('New Window');
        ?>
</option>
                <option value="stay_in_window" <?php 
        if ($instance['link_target'] == 'stay_in_window') {
            echo "selected='true'";
        }
        ?>
><?php 
        _e('Stay in window');
        ?>
</option>              
            </select>
        </p>        
        <?php 
    }