function setting_field_render($setting_id)
 {
     $CI =& get_instance();
     $row = $CI->db->get_where('settings', array('id' => $setting_id))->row();
     if (!$row || empty($row)) {
         return FALSE;
     }
     $html = NULL;
     switch ($row->type) {
         case 'text':
             $html .= field_text($row->key, empty($row->value) ? $row->default_value : $row->value);
             break;
         case 'textarea':
             $html .= field_textarea($row->key, empty($row->value) ? $row->default_value : $row->value);
             break;
         case 'date':
             $html .= field_date($row->key, empty($row->value) ? $row->default_value : $row->value);
             break;
         case 'select':
             $options = array();
             if (!empty($row->options)) {
                 $rows = unserialize($row->options);
                 if (isset($rows['value']) && is_array($rows['value']) && count($rows['value'])) {
                     foreach ($rows['value'] as $key => $value) {
                         $options[$value] = isset($rows['title'][$key]) ? $rows['title'][$key] : '';
                     }
                 }
             }
             $html .= field_select($row->key, $options, empty($row->value) ? $row->default_value : $row->value, 'class="input-block-level form-control"');
             break;
         case 'boolen':
             $options = array();
             if (!empty($row->options)) {
                 $rows = unserialize($row->options);
                 if (isset($rows['value']) && is_array($rows['value']) && count($rows['value'])) {
                     foreach ($rows['value'] as $key => $value) {
                         $options[$value] = isset($rows['title'][$key]) ? $rows['title'][$key] : '';
                     }
                 }
             }
             $html .= field_select($row->key, $options, empty($row->value) ? $row->default_value : $row->value, 'class="input-block-level form-control"');
             break;
     }
     return $html;
 }
        function form($instance)
        {
            $defaults = array('content' => '', 'type' => 'note', 'style' => '');
            $instance = wp_parse_args($instance, $defaults);
            extract($instance);
            $type_options = array('default' => __('Standard', 'oblivion'), 'info' => __('Info', 'oblivion'), 'note' => __('Notification', 'oblivion'), 'warn' => __('Warning', 'oblivion'), 'tips' => __('Tips', 'oblivion'));
            ?>
            <p class="description">
                <label for="<?php 
            echo $this->get_field_id('title');
            ?>
">
                    <?php 
            _e("Title (optional)", 'oblivion');
            ?>
<br/>
                    <?php 
            echo field_input('title', $block_id, $title);
            ?>
                </label>
            </p>
            <p class="description">
                <label for="<?php 
            echo $this->get_field_id('content');
            ?>
">
                    <?php 
            _e("Alert Text (required)", 'oblivion');
            ?>
<br/>
                    <?php 
            echo field_textarea('content', $block_id, $content);
            ?>
                </label>
            </p>
            <p class="description half">
                <label for="<?php 
            echo $this->get_field_id('type');
            ?>
">
                    <?php 
            _e("Alert Type", 'oblivion');
            ?>
<br/>
                    <?php 
    function form($instance)
    {
        $defaults = array('text' => '', 'marg' => '', 'boxed' => '');
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        ?>
        <p class="description">
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
               <?php 
        _e("Title (optional)", 'oblivion');
        ?>
                <?php 
        echo field_input('title', $block_id, $title, $size = 'full');
        ?>
            </label>
        </p>
        <p class="description">
            <label for="<?php 
        echo $this->get_field_id('text');
        ?>
">
               <?php 
        _e("Content", 'oblivion');
        ?>
                <?php 
        echo field_textarea('text', $block_id, $text, $size = 'full');
        ?>
            </label>
        </p>
           <p class="description">
            <label for="<?php 
        echo $this->get_field_id('boxed');
        ?>
">
             <?php 
        _e("Boxed &nbsp;&nbsp;", 'oblivion');
        ?>
                <?php 
        echo field_checkbox('boxed', $block_id, $boxed, $check = 'true');
        ?>
            </label>
    function form($instance)
    {
        $defaults = array('textskill' => '', 'skills' => array(1 => array('title' => __('My New Skill', 'oblivion'), 'content' => '100')), 'type' => 'skill');
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        $skill_types = array('skill' => __('Skills', 'oblivion'));
        ?>
            <div class="description cf">
             <p class="description">
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
                <?php 
        _e("Title (optional)", 'oblivion');
        ?>
                <?php 
        echo field_input('title', $block_id, $title, $size = 'full');
        ?>
            </label>
        </p>
        <p class="description">
            <label for="<?php 
        echo $this->get_field_id('textskill');
        ?>
">
                <?php 
        _e("Content", 'oblivion');
        ?>
                <?php 
        echo field_textarea('textskill', $block_id, $textskill, $size = 'full');
        ?>
            </label>
        </p>
                <ul id="sortable-list-<?php 
        echo $block_id;
        ?>
" class="sortable-list" rel="<?php 
        echo $block_id;
        ?>
">
                    <?php 
        $skills = is_array($skills) ? $skills : $defaults['skills'];
        $count = 1;
    function form($instance)
    {
        $defaults = array('text' => '', 'icon' => 'none', 'title' => 'none');
        $icon_options = array('none' => 'None', 'icon-glass' => 'glass', 'icon-music' => 'music', 'icon-search' => 'search', 'icon-envelope' => 'envelope', 'icon-heart' => 'heart', 'icon-star' => 'star', 'icon-star-empty' => 'star empty', 'icon-user' => 'user', 'icon-film' => 'film', 'icon-th-large' => 'th large', 'icon-th' => 'th', 'icon-th-list' => 'th list', 'icon-ok' => 'ok', 'icon-remove' => 'remove', 'icon-zoom-in' => 'zoom in', 'icon-zoom-out' => 'zoom out', 'icon-off' => 'off', 'icon-signal' => 'signal', 'icon-cog' => 'cog', 'icon-trash' => 'trash', 'icon-home' => 'home', 'icon-file' => 'file', 'icon-time' => 'time', 'icon-road' => 'road', 'icon-download-alt' => 'download alt', 'icon-download' => 'download', 'icon-upload' => 'upload', 'icon-inbox' => 'inbox', 'icon-play-circle' => 'play circle', 'icon-repeat' => 'repeat', 'icon-refresh' => 'refresh', 'icon-list-alt' => 'list alt', 'icon-lock' => 'lock', 'icon-flag' => 'flag', 'icon-headphones' => 'headphones', 'icon-volume-off' => 'volume off', 'icon-volume-down' => 'volume down', 'icon-volume-up' => 'volume up', 'icon-qrcode' => 'qrcode', 'icon-barcode' => 'barcode', 'icon-tag' => 'tag', 'icon-tags' => 'tags', 'icon-book' => 'book', 'icon-bookmark' => 'bookmark', 'icon-print' => 'print', 'icon-camera' => 'camera', 'icon-bold' => 'bold', 'icon-italic' => 'italic', 'icon-text-height' => 'text height', 'icon-text-width' => 'text width', 'icon-align-left' => 'align left', 'icon-align-center' => 'align center', 'icon-align-right' => 'align right', 'icon-align-justify' => 'align justify', 'icon-list' => 'list', 'icon-indent-left' => 'indent left', 'icon-indent-right' => 'indent right', 'icon-facetime-video' => 'facetime video', 'icon-picture' => 'picture', 'icon-pencil' => 'pencil', 'icon-map-marker' => 'map marker', 'icon-adjust' => 'adjust', 'icon-tint' => 'tint', 'icon-edit' => 'edit', 'icon-share' => 'share', 'icon-check' => 'check', 'icon-move' => 'move', 'icon-step-backward' => 'step backward', 'icon-fast-backward' => 'fast backward', 'icon-backward' => 'backward', 'icon-play' => 'play', 'icon-pause' => 'pause', 'icon-stop' => 'stop', 'icon-forward' => 'forward', 'icon-fast-forward' => 'fast forward', 'icon-step-forward' => 'step forward', 'icon-eject' => 'eject', 'icon-chevron-left' => 'chevron left', 'icon-chevron-right' => 'chevron right', 'icon-plus-sign' => 'plus sign', 'icon-minus-sign' => 'minus sign', 'icon-remove-sign' => 'remove sign', 'icon-ok-sign' => 'oksign', 'icon-question-sign' => 'question sign', 'icon-info-sign' => 'infosign', 'icon-screenshot' => 'screenshot', 'icon-remove-circle' => 'remove circle', 'icon-ok-circle' => 'ok circle', 'icon-ban-circle' => 'ban circle', 'icon-arrow-left' => 'arrow left', 'icon-arrow-right' => 'arrow right', 'icon-arrow-up' => 'arrow up', 'icon-arrow-down' => 'arrow down', 'icon-share-alt' => 'share alt', 'icon-resize-full' => 'resize full', 'icon-resize-small' => 'resize small', 'icon-plus' => 'plus', 'icon-minus' => 'minus', 'icon-asterisk' => 'asterisk', 'icon-exclamation-sign' => 'exclamation sign', 'icon-gift' => 'gift', 'icon-leaf' => 'leaf', 'icon-fire' => 'fire', 'icon-eye-open' => 'eye open', 'icon-eye-close' => 'eye close', 'icon-warning-sign' => 'warning sign', 'icon-plane' => 'plane', 'icon-calendar' => 'calendar', 'icon-random' => 'random', 'icon-comment' => 'comment', 'icon-magnet' => 'magnet', 'icon-chevron-up' => 'chevron up', 'icon-chevron-down' => 'chevron dow ', 'icon-retweet' => 'retweet', 'icon-shopping-cart' => 'shopping cart', 'icon-folder-close' => 'folder close', 'icon-folder-open' => 'folder open', 'icon-resize-vertical' => 'resize vertical', 'icon-resize-horizontal' => 'resize horizontal', 'icon-bar-chart' => 'bar chart', 'icon-twitter-sign' => 'twitter sign', 'icon-facebook-sign' => 'facebook sign', 'icon-camera-retro' => 'camera retro', 'icon-key' => 'key', 'icon-cogs' => 'cogs', 'icon-comments' => 'comments', 'icon-thumbs-up' => 'thumbs up', 'icon-thumbs-down' => 'thumbs down', 'icon-star-half' => 'star half', 'icon-heart-empty' => 'heart empty', 'icon-signout' => 'signout', 'icon-linkedin-sign' => 'linkedin sign', 'icon-pushpin' => 'pushpin', 'icon-external-link' => 'external link', 'icon-signin' => 'signin', 'icon-trophy' => 'trophy', 'icon-github-sign' => 'github sign', 'icon-upload-alt' => 'upload alt', 'icon-lemon' => 'lemon', 'icon-phone' => 'phone', 'icon-check-empty' => 'check empty', 'icon-bookmark-empty' => 'bookmark empty', 'icon-phone-sign' => 'phone sign', 'icon-twitter' => 'twitter', 'icon-facebook' => 'facebook', 'icon-github' => 'github', 'icon-unlock' => 'unlock', 'icon-credit-card' => 'credit card', 'icon-rss' => 'rss', 'icon-hdd' => 'hdd', 'icon-bullhorn' => 'bullhorn', 'icon-bell' => 'bell', 'icon-certificate' => 'certificate', 'icon-hand-right' => 'hand right', 'icon-hand-left' => 'handleft', 'icon-hand-up' => 'hand up', 'icon-hand-down' => 'hand down', 'icon-circle-arrow-left' => 'circle arrow left', 'icon-circle-arrow-right' => 'circle arrow right', 'icon-circle-arrow-up' => 'circle arrow up', 'icon-circle-arrow-down' => 'circle arrow down', 'icon-globe' => 'globe', 'icon-wrench' => 'wrench', 'icon-tasks' => 'tasks', 'icon-filter' => 'filter', 'icon-briefcase' => 'briefcase', 'icon-fullscreen' => 'fullscreen', 'icon-group' => 'group', 'icon-link' => 'link', 'icon-cloud' => 'cloud', 'icon-beaker' => 'beaker', 'icon-cut' => 'cut', 'icon-copy' => 'copy', 'icon-paper-clip' => 'paper clip', 'icon-save' => ' save', 'icon-sign-blank' => 'sign blank', 'icon-reorder' => 'reorder', 'icon-list-ul' => 'list ul', 'icon-list-ol' => 'list ol', 'icon-strikethrough' => 'strikethrough', 'icon-underline' => 'underline', 'icon-table' => 'table', 'icon-magic' => 'magic', 'icon-truck' => 'truck', 'icon-pinterest' => 'pinterest', 'icon-pinterest-sign' => 'pinterest sign', 'icon-google-plus-sign' => 'google plus sign', 'icon-google-plus' => 'google plus', 'icon-money' => 'money', 'icon-caret-down' => 'caret down', 'icon-caret-left' => 'caret left', 'icon-caret-right' => 'caret right', 'icon-columns' => 'columns', 'icon-sort' => 'sort', 'icon-sort-down' => 'sort down', 'icon-sort-up' => 'sort up', 'icon-envelope-alt' => 'envelope alt', 'icon-linkedin' => 'linkedin', 'icon-undo' => 'undo', 'icon-legal' => 'legal', 'icon-dashboard' => 'dashboard', 'icon-comment-alt' => 'comment alt', 'icon-comments-alt' => 'comments alt', 'icon-bolt' => 'bolt', 'icon-sitemap' => 'sitemap', 'icon-umbrella' => 'umbrella', 'icon-paste' => 'paste', 'icon-lightbulb' => 'lightbulb', 'icon-exchange' => 'exchange', 'icon-cloud-download' => 'cloud download', 'icon-cloud-upload' => 'cloud upload', 'icon-user-md' => 'user md', 'icon-stethoscope' => 'stethoscope', 'icon-suitcase' => 'suitcase', 'icon-bell-alt' => 'bell alt', 'icon-coffee' => 'coffee', 'icon-food' => 'food', 'icon-file-alt' => 'file alt', 'icon-building' => 'building', 'icon-hospital' => 'hospital', 'icon-ambulance' => 'ambulance', 'icon-medkit' => 'medkit', 'icon-fighter-jet' => 'fighter jet', 'icon-beer' => 'beer', 'icon-h-sign' => 'h sign', 'icon-plus-sign-alt' => 'plus sign alt', 'icon-double-angle-left' => 'double angle left', 'icon-double-angle-right' => 'double angle right', 'icon-double-angle-up' => 'double angle up', 'icon-double-angle-down' => 'double angle down', 'icon-angle-left' => 'angle left', 'icon-angle-right' => 'angle right', 'icon-angle-up' => 'angle up', 'icon-angle-down' => 'angle down', 'icon-desktop' => 'desktop', 'icon-laptop' => 'laptop', 'icon-tablet' => 'tablet', 'icon-mobile-phone' => 'mobile phone', 'icon-circle-blank' => 'circle blank', 'icon-quote-left' => 'quote left', 'icon-quote-right' => 'quote right', 'icon-spinner' => 'spinner', 'icon-circle' => 'circle', 'icon-reply' => 'reply');
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        ?>
        <p class="description">
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
                <?php 
        _e("Title", 'oblivion');
        ?>
                <?php 
        echo field_input('title', $block_id, $title, $size = 'full');
        ?>
            </label>
        </p>
            <p class="description fourth">
            <label for="<?php 
        echo $this->get_field_id('icon');
        ?>
">
                <?php 
        _e("Icon", 'oblivion');
        ?>
<br/>
                <?php 
        echo field_select('icon', $block_id, $icon_options, $icon, $block_id);
        ?>
            </label>
        </p>
        <p class="description">
            <label for="<?php 
    function form($instance)
    {
        $defaults = array('text' => '');
        $instance = wp_parse_args($instance, $defaults);
        extract($instance);
        ?>
        <p class="description">
            <label for="<?php 
        echo $this->get_field_id('title');
        ?>
">
                <?php 
        _e("Member name", 'oblivion');
        ?>
                <?php 
        echo field_input('title', $block_id, $title, $size = 'full');
        ?>
            </label>
        </p>
        <p class="description">
            <label for="<?php 
        echo $this->get_field_id('position');
        ?>
">
                <?php 
        _e("Member position", 'oblivion');
        ?>
                <?php 
        echo field_input('position', $block_id, $position, $size = 'full');
        ?>
            </label>
        </p>
        <p class="description">
            <label for="<?php 
        echo $this->get_field_id('text');
        ?>
">
                <?php 
        _e("About member", 'oblivion');
        ?>
                <?php 
        echo field_textarea('text', $block_id, $text, $size = 'full');
        ?>
            </label>
        </p>
         <p class="description">
            <label for="<?php 
        echo $this->get_field_id('image');
        ?>
">
                <?php 
        _e("Enter link to member picture", 'oblivion');
        ?>
                <?php 
        echo field_input('image', $block_id, $image, $size = 'full');
        ?>
            </label>
        </p>
        <p class="description">
            <label for="<?php 
        echo $this->get_field_id('facebook');
        ?>
function tls_server_popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $ID = $_GET["ID"];
    $bttext = "{add}";
    $title = $tpl->_ENGINE_parse_body("{add_tls_smtp_server}");
    $q = new mysql();
    $t = time();
    if ($ID > 0) {
    }
    $options["none"] = "{none}";
    $options["may"] = "{tls_may}";
    $options["encrypt"] = "{Mandatory_TLS_encryption}";
    $options["dane"] = "DANE";
    $options["dane-only"] = "DANE Only";
    $options["fingerprint"] = "{fingerprint}";
    $options["verify"] = "{fingerprint} {verify}";
    $options["secure"] = "{Secure_channel_TLS}";
    if ($ligne["tls_option"] == null) {
        $ligne["tls_option"] = "may";
    }
    if ($ligne["protocols"] == null) {
        $ligne["protocols"] = "ALL:!SSLv2:-RC4:RC4-SHA:RC4:+SEED:!IDEA:!3DES:!MD5:!aDSS:!aDH:!PSK:!SRP:@STRENGTH";
    }
    $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{servername2}:</td>\n\t\t\t<td>" . Field_text("servername-{$t}", $ligne["servername"], "font-size:18px;width:90%") . "</td>\t\t\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{port}:</td>\n\t\t\t<td>" . Field_text("port-{$t}", $ligne["port"], "font-size:18px;width:110px") . "</td>\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{MX_lookups}:</td>\n\t\t\t<td>" . Field_checkbox("MX_lookups-{$t}", 1, $ligne["MX_lookups"]) . "</td>\t\t\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{tls_security_level}:</td>\n\t\t\t<td>" . Field_array_Hash($options, "tls_option-{$t}", $ligne["tls_option"], "style:font-size:18px") . "</td>\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{protocols}:</td>\n\t\t\t<td>" . Field_text("protocols-{$t}", $ligne["protocols"], "font-size:18px;width:90%") . "</td>\t\t\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{ssl_ciphers}:</td>\n\t\t\t<td>" . Field_text("ciphers-{$t}", $ligne["ciphers"], "font-size:18px;width:90%") . "</td>\t\t\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{ssl_ciphers} (match):</td>\n\t\t\t<td>" . Field_text("tls_match-{$t}", $ligne["ssl_ciphers"], "font-size:18px;width:90%") . "</td>\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:18px'>{fingerprint}:</td>\n\t\t\t<td>" . field_textarea("fingerprint-{$t}", $ligne["fingerprint"], "18", "100%", "150") . "</td>\t\t\n\t\t</tr>\t\t\t\t\t\n\t\t\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr>" . button($bttext, "Save{$t}()", 26) . "</td>\n\t\t</tr>\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#POSTFIX_TLS_TABLE').flexReload();\n\tvar ID={$_GET["ID"]}\n\tif(ID==0){ YahooWin2Hide();}\n\tUnlockPage();\n\t\n}\nfunction Save{$t}(){\n\tLockPage();\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('servername',document.getElementById('servername-{$t}').value);\n\tXHR.appendData('port',document.getElementById('port-{$t}').value);\n\tif(document.getElementById('servername-{$t}').checked){ XHR.appendData('MX_lookups',1); }else{ XHR.appendData('MX_lookups',0); }\n\tXHR.appendData('tls_option',document.getElementById('tls_option-{$t}').value);\n\tXHR.appendData('protocols',document.getElementById('protocols-{$t}').value);\n\tXHR.appendData('ciphers',document.getElementById('ciphers-{$t}').value);\n\tXHR.appendData('tls_match',document.getElementById('tls_match-{$t}').value);\n\tXHR.appendData('fingerprint',document.getElementById('fingerprint-{$t}').value);\n\tXHR.appendData('hostname','{$_POST["hostname"]}');\n\tXHR.appendData('ID','{$_GET["ID"]}');\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\t\t\t\t\t\n";
    echo $tpl->_ENGINE_parse_body($html);
}