Plugin Directory

Changeset 2149035


Ignore:
Timestamp:
08/31/2019 08:21:30 PM (7 years ago)
Author:
Somonator
Message:

update to 1.2

Location:
orders-table/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orders-table/trunk/Readme.txt

    r2015672 r2149035  
    1212
    1313== Installation ==
    14 1. Install this plugin.
     141. Install this plugin
    15152. Add shortcode in tour page ([orders-table])
    16 3. Configure the plugin and fields as you need
    17 3. Well done!
     163. Configure the plugin and fields as you need
    1817
    1918== Frequently Asked Questions ==
     
    2524
    2625== Screenshots ==
    27 1. Orders
    28261. Options plugin
    29272. View orders table
     
    32301.0 Release
    33311.1 Completely rewritten code, add options page, add configure access for form table for guest, add extra fields, add manage main and extra fileds.
     321.2 New settings page, new types fileds for extra fields.
  • orders-table/trunk/add/css/ot-style-admin.css

    r2015673 r2149035  
    1 .form-table:last-of-type tr.delete:not(:last-child) td:after {
    2     content: '';
    3     background: #23282d;
     1/**
     2* The plugin "Orders Table" styles for admin panel.
     3*/
     4
     5.ot {
     6    max-width: 1200px;
     7    margin: 0 auto;
     8    position: relative;
     9}
     10.ot * {
     11    box-sizing: border-box;
     12}
     13
     14.ot .row {
    415    width: 100%;
    5     height: 3px;
    6     margin-top: 15px;   
     16    display: flex;
     17    flex-flow: row wrap;
     18    position: relative;
     19}
     20.ot .row .col {
     21    width: calc(100%/4);
     22}
     23
     24.ot .tabs-buttons {
     25    flex-wrap: nowrap;
     26    overflow-x: auto;
     27}
     28.ot .tabs-buttons .tabs-button {
     29    background: #f1f1f1;   
     30    border: 1px solid #ddd;
     31    border-radius: 3px 3px 0 0;
     32    font-weight: 600;
     33    color: #aaa;
     34    text-align: center;
     35    padding: 15px 25px;
     36    margin: 0 0 -1px;
     37}
     38.ot .tabs-buttons .tabs-button.active {
     39    background: #fff;   
     40    border-top: 1px solid #23282d;
     41    border-bottom: 1px solid #fff; 
     42    color: #555;
     43}
     44.ot .tabs-buttons .tabs-button:hover {
     45    color: #888;
     46    cursor: pointer;
     47}
     48
     49.ot .tabs-content {
     50    background: #fff;
     51    border: 1px solid #ddd;
     52    min-height: 64vh;
     53    color: #383838;
     54    line-height: 1.5;   
     55    display: none;
     56    padding: 15px 15px 70px 15px;
     57    margin: 0 0 5px;
     58    animation: fadeIn 1s both;
     59}
     60.ot .tabs-content.active {
    761    display: block;
     62}
     63
     64.ot .option {
     65    padding: 15px 0;
     66}
     67.ot .option:not(:last-child) {
     68    border-bottom: 2px solid #f1f1f1;
     69}
     70.ot .option > span,
     71.ot .extra-fields .col span:nth-child(1) {
     72    font-size: 14px;
     73    font-weight: 600;
     74    color: #23282d;
     75    margin-right: 5px;
     76}
     77.ot label {
     78    display: inline-block;
     79}
     80
     81.ot  .extra-fields fieldset {
     82    border: 2px groove threedface;
     83    padding: 0.35em 0.75em 0.625em 0.75em;
     84    margin: 2px 5px 10px 2px;
     85    position: relative;
     86}
     87.ot .extra-fields .move-field {
     88    font-size: 20px;
    889    position: absolute;
    9     left: 0;   
     90    top: 0;
     91    right: 3%;
     92    cursor: move;
    1093}
     94.ot .extra-fields .delete-field {
     95    font-size: 25px;
     96    position: absolute;
     97    top: 0;
     98    right: 1%;
     99    cursor: pointer;
     100}
     101.ot .extra-fields .move-field :hover,
     102.ot .extra-fields .delete-field:hover {
     103    color: #00b9eb;
     104}
     105.ot .extra-fields .portret-placeholder {
     106    border: 1px dashed threedface;
     107    margin: 2px 5px 10px 2px;
     108}
     109
     110.ot .submit {
     111    position: absolute;
     112    right: 1%; 
     113    bottom: -1%;
     114}
     115
     116
     117@keyframes fadeIn {
     118    from {
     119        opacity: 0;
     120    } to {
     121        opacity: 1;
     122    }
     123}
     124
     125@media all and (max-width: 1000px) and (min-width: 600px) {
     126    .ot .extra .row {
     127        align-items: center;
     128    }
     129    .ot .extra .row .col {
     130        width: calc(100%/2);
     131        padding: 15px 3px;
     132        position: relative;
     133    }
     134    .ot .extra .row .col:nth-child(1):after {
     135        content: '';
     136        background: #f1f1f1;
     137        width: 200%;
     138        height: 2px;
     139        display: block;
     140        position: absolute;
     141        right: -100%;
     142        bottom: -5px;
     143    }
     144}
     145@media all and (max-width: 600px) {
     146    .ot .extra .row .col {
     147        width: 100%;
     148        padding: 15px 0;
     149    }
     150    .ot .extra .row .col:not(.required) {
     151        border-bottom: 2px solid #f1f1f1;
     152    }
     153}
  • orders-table/trunk/add/css/ot-style.css

    r2015673 r2149035  
     1/**
     2* The plugin "Orders Table" styles.
     3*/
     4
    15.ot {
    26    max-width: 1200px;
  • orders-table/trunk/add/js/ot-admin-script.js

    r2015673 r2149035  
     1/**
     2* The plugin "Orders Table" scripts for admin panel.
     3*/
     4
    15jQuery(function($){
    2     var $table = $('.form-table').eq(-1);
    3     var block;
     6    var $wrap = $('.ot'),
     7        $extra = $wrap.find('.extra');
    48   
    5     $(function() {
    6         $table.find('tr:nth-child(4n)').after('\
    7         <tr class="delete"> \
    8         <td><button class="button show-settings delete-field">' + lang_text.delete_field + '</button></td> \
    9         </tr> \
    10         ');
     9    $('.tabs-buttons').on('click', '.tabs-button:not(.active)', function() {
     10        $(this)
     11        .addClass('active').siblings().removeClass('active')
     12        .closest('.tabs').find('.tabs-content').removeClass('active').eq($(this).index()).addClass('active');
    1113    });
    1214   
    1315    $(function() {
    14         $table.after('<button class="button action add-field">' + lang_text.add_field + '</button>');
    15     });
    16    
    17     $table.delegate('input[name*="field-name-"]', 'ready input keyup', function(e) {
    18         var tr = $(this).parents().closest('tr').next();
    19         var select = tr.find('select');
    20        
    21         if(!$(this).val() == '') {
    22             select.attr('required', 'required');
    23         } else {
    24             select.removeAttr('required');
     16        if ($(window).width() > 1000) {
     17            $extra.find('.extra-fields').sortable({
     18                handle: '.move-field',
     19                placeholder: 'portret-placeholder',
     20                sort: function(event, ui) {
     21                    var h = $(ui.item).height();
     22                    $(ui.placeholder).css('height', h);
     23                }, 
     24                beforeStop: function() {
     25                    census();
     26                }
     27            });
    2528        }
    2629    });
    2730   
    28     $table.delegate('select', 'ready input keyup', function(e) {
    29         var name = $(this).attr('name');
    30         var tr = $(this).parents().closest('tr').prev();
    31         var input = tr.find('input');
     31    function census() {
     32        $extra.find('fieldset:not(.ui-sortable-placeholder)').each(function(index) {
     33            var num = +index + 1,
     34                rename_class = $(this).attr('class').replace(/\d+/, num),
     35                replace_legend = $(this).find('legend').text().replace(/\d+/, num);
     36           
     37            $(this).attr('class', rename_class);
     38            $(this).find('legend').text(replace_legend);
     39           
     40            $(this).find('*[name]').each(function() {
     41                var replace_name = $(this).attr('name').replace(/\d+/, num);
     42               
     43                $(this).attr('name', replace_name);
     44            });
     45        });
     46    }
     47   
     48    function sortable_on() {
     49        if ($(window).width() > 1000) {
     50            if ($extra.find('fieldset').length > 1) {
     51                $extra.find('.extra-fields').sortable('enable');
     52            } else {
     53                if ($extra.find('.extra-fields').hasClass('ui-sortable')) {
     54                    $extra.find('.extra-fields').sortable('disable');
     55                }
     56            }
     57        }
     58    }
     59   
     60    function view_manage() {
     61        if ($extra.find('fieldset').length <= 1) { 
     62            $extra.find('.delete-field').hide();
     63            $extra.find('.move-field').hide();
     64        } else {
     65            if ($(window).width() > 1000) {
     66                $extra.find('.move-field').show();
     67            }
     68           
     69            $extra.find('.delete-field').show();
     70        }
     71    }   
    3272
    33         if($('option:nth-child(1)').index($('select[name="' + name + '"] option:selected')) < 0) {
    34             input.attr('required', 'required');
    35         } else {
    36             input.removeAttr('required');
    37         }
     73   
     74    $(function() {
     75        sortable_on();
     76        view_manage();
    3877    });
    3978   
    40     $(document).delegate('.delete-field', 'click', function(e) {
     79    $wrap.delegate('.add-field', 'click', function(e) {
    4180        e.preventDefault();
    4281       
    43         var tr = $(this).parents().closest('tr');
    44         var opt = tr.prevAll().slice(0, 4);
    45         var rev = Array.prototype.reverse.call(opt);
    46         var un = $.merge(rev, tr);
    47        
    48         $table.find('tr:nth-child(1) input', 'tr:nth-child(5n) input').each(function(index) {
    49             var num = +index + 1;
    50             $(this).attr('name', 'field-name-' + num);
    51         });
    52        
    53         $table.find('tr:nth-child(2) select', 'tr:nth-child(6n) select').each(function(index) {
    54             var num = +index + 1;
    55             $(this).attr('name', 'field-type-' + num);
    56         });
    57        
    58         $table.find('tr:nth-child(3) input', 'tr:nth-child(7n) input').each(function(index) {
    59             var num = +index + 1;
    60             $(this).attr('name', 'field-front-' + num);
    61         });
    62        
    63         $table.find('tr:nth-child(4) input', 'tr:nth-child(8n) input').each(function(index) {
    64             var num = +index + 1;
    65             $(this).attr('name', 'field-required-' + num);
    66         });     
     82        var block = $extra.find('fieldset').eq(-1).clone();
    6783
    68         block = un.detach();
    69     });
    70    
    71     $(document).delegate('.add-field', 'click', function(e) {
    72         e.preventDefault();
    73        
    74         if($table.find('tr').length > 0) {
    75             block = $table.find('tbody > tr:nth-last-child(-n + 5)').clone();
    76            
    77             block.find('*[name]').each(function() {
    78                 var name = $(this).attr('name');
    79                 var replace_name = name.replace(/\d+/, function(val) { return parseInt(val)+1; });
    80                 $(block).find('[name="' + name + '"]').attr('name', replace_name);
    81             });         
    82         }
    83        
    8484        block.find('input[type="text"]').val('');
    85         block.find('select option').removeAttr('checked').first().attr('selected', 'selected');
     85        block.find('select option').first().attr('selected', 'selected');
    8686        block.find('input[type="checkbox"]').removeAttr('checked');
    8787       
    88         $table.append(block);
     88        $(this).before(block);
     89       
     90        census();
     91        sortable_on();
     92        view_manage();
    8993    });
    90 } );
     94   
     95    $wrap.delegate('.delete-field', 'click', function(e) {
     96        e.preventDefault();
     97
     98        $(this).parents().closest('fieldset').remove();
     99       
     100        census();
     101        sortable_on();
     102        view_manage();
     103    });
     104
     105   
     106    function input_to_select_required() {
     107        var select = $(this).parents().closest('fieldset').find('select');
     108       
     109        !$(this).val() == ''?select.attr('required', 'required'):select.removeAttr('required');
     110    }
     111   
     112    function select_to_input_required() {
     113        var name = $(this).attr('name'),
     114            input = $(this).parents().closest('fieldset').find('input[name*="field-name"]');
     115
     116        $('option:nth-child(1)').index($('select[name="' + name + '"] option:selected')) < 0?input.attr('required', 'required'):input.removeAttr('required');
     117    }
     118   
     119    function change_text_checkbox() {
     120        var label = $(this).siblings().closest('span'),
     121            text = $(this).is(':checked')?change_text.enable:change_text.disable;
     122       
     123        label.text(text);
     124    }
     125
     126    $extra.find('fieldset input[name*="field-name"]').each(input_to_select_required);
     127    $extra.delegate('input[name*="field-name"]', 'input keyup', input_to_select_required);
     128   
     129    $extra.find('fieldset select').each(select_to_input_required);
     130    $extra.delegate('select', 'input keyup', select_to_input_required);
     131   
     132    $wrap.find('input[type="checkbox"]').each(change_text_checkbox);
     133    $wrap.delegate('input[type="checkbox"]', 'onload change', change_text_checkbox);
     134   
     135   
     136    $(document).delegate('input[name="submit"]', 'click', function() {
     137        var $form = $(this).parents().closest('form');
     138       
     139        $form.find('input[required]').each(function() {
     140            if (!$(this)[0].checkValidity()) {
     141                $(this)[0].reportValidity();
     142            }
     143        });
     144    });
     145});
  • orders-table/trunk/inc/functions.php

    r2015673 r2149035  
    162162        ?>
    163163        <div class="wrap">
    164             <h2><?php echo get_admin_page_title() ?></h2>
    165 
    166             <form action="options.php" method="POST">
    167                 <?php
    168                 settings_fields('option_group');
    169 
    170                 do_settings_sections('ot_options');
    171 
    172                 submit_button();
    173                 ?>
    174             </form>
     164            <?php require_once('options-page.php'); ?>
    175165        </div>
    176166        <?php
     
    178168   
    179169    public function plugin_settings() {
    180         register_setting('option_group', 'ot_main_options', array($this, 'sanitize_callback'));
    181        
    182        
    183         add_settings_section('main_options', __('Main options', 'orders-table'), '', 'ot_options');
    184        
    185         $opt_name = 'form-enabled';
    186         add_settings_field($opt_name, __('Enanle form add', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'main_options', $opt_name);
    187        
    188         $opt_name = 'guest-add';
    189         add_settings_field($opt_name, __('Guests can add orders', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'main_options', $opt_name);           
    190        
    191         $opt_name = 'nubmer-orders';
    192         add_settings_field($opt_name, __('Number posts on page', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'main_options', $opt_name);   
    193        
    194        
    195         add_settings_section('manage_main_input', __('Manage main field', 'orders-table'), '', 'ot_options');
    196        
    197         $opt_name = 'order-status';
    198         add_settings_field($opt_name, __('Order status', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'manage_main_input', $opt_name);   
    199 
    200         $opt_name = 'order-description';
    201         add_settings_field($opt_name, __('Order description', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'manage_main_input', $opt_name);
    202 
    203         $opt_name = 'order-category';
    204         add_settings_field($opt_name, __('Order category', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'manage_main_input', $opt_name);         
    205        
    206         $opt_name = 'order-author';
    207         add_settings_field($opt_name, __('Order author', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'manage_main_input', $opt_name);   
    208        
    209        
    210         add_settings_section('add_new_input', __('Extra fields', 'orders-table'), '', 'ot_options');
    211 
    212         // Вывод созданных скриптом на клиенте полей
    213         if (!isset($this->options['extra']) || count($this->options['extra']) == 1) {
    214             $opt_name = 'field-name-1';
    215             add_settings_field($opt_name, __('Field name', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'add_new_input', $opt_name);
    216        
    217             $opt_name = 'field-type-1';
    218             add_settings_field($opt_name, __('Field type', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'add_new_input', $opt_name);
    219        
    220             $opt_name = 'field-front-1';
    221             add_settings_field($opt_name, __('Field front', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'add_new_input', $opt_name);
    222            
    223             $opt_name = 'field-required-1';
    224             add_settings_field($opt_name, __('Required?', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'add_new_input', $opt_name);
    225         } else {
    226             for ($i = 1; $i <= count($this->options['extra']); $i++) {
    227                 foreach ($this->options['extra']['extra-field-' . $i] as $name => & $val) {
    228                     $opt_name = $name . '-' . $i;
    229                     if ($name == 'field-name') {
    230                         add_settings_field($opt_name, __('Field name', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'add_new_input', $opt_name);
    231                     } else if ($name == 'field-type') {
    232                         add_settings_field($opt_name, __('Field type', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'add_new_input', $opt_name);
    233                     } else if ($name == 'field-front') {
    234                         add_settings_field($opt_name, __('Field front', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'add_new_input', $opt_name);
    235                     } else if ($name == 'field-required') {
    236                         add_settings_field($opt_name, __('Required?', 'orders-table'), array($this, 'fill_field') , 'ot_options', 'add_new_input', $opt_name);
    237                     }
    238                 }
    239             }
    240         }
    241     }
    242    
    243     public function fill_field($opt_name) {
    244         $name_attr = "ot_main_options[$opt_name]";
    245        
    246         // Выборка ответов с массива по виду
    247         if (preg_match('/field-name/ui', $opt_name) || preg_match('/field-type/ui', $opt_name) || preg_match('/field-front/ui', $opt_name) || preg_match('/field-required/ui', $opt_name)) {
    248             $i = intval(preg_replace('/[^0-9]+/', '', $opt_name), 10);
    249             $new_name = substr($opt_name, 0, -2);
    250             $val = isset($this->options['extra']['extra-field-' . $i][$new_name])?$this->options['extra']['extra-field-' . $i][$new_name]:null;
    251         } else {
    252             $val = isset($this->options[ $opt_name ])?$this->options[$opt_name]:null;
    253         }
    254 
    255         if ($opt_name == 'form-enabled' || $opt_name == 'guest-add' || $opt_name == 'order-status' || $opt_name == 'order-name' || $opt_name == 'order-description' || $opt_name == 'order-category' || $opt_name == 'order-author' || preg_match('/field-required/ui', $opt_name)) {
    256             echo '<label><input type="checkbox" name="'. $name_attr .'" value="1" '. checked(1, $val, 0) .' /> ' . __('On or off', 'orders-table') . '</label>';
    257         } else if ($opt_name === 'nubmer-orders') {
    258             echo '<input type="number" min="1" name="'. $name_attr .'" value="'. esc_attr( $val ) .'" />';
    259         } else if (preg_match('/field-name/ui', $opt_name) || preg_match('/field-front/ui', $opt_name)) {
    260             echo '<input type="text" name="'. $name_attr .'" value="'. esc_attr( $val ) .'" />';
    261         } else if (preg_match('/field-type/ui', $opt_name)) {
    262             ?>
    263             <select class="field-type" name="<?php echo $name_attr ?>">
    264                 <option value=""><?php echo __('Not selected', 'orders-table') ?></option>
    265                 <option value="text" <?php selected($val, 'text') ?>><?php echo __('Text', 'orders-table') ?></option>
    266                 <option value="number" <?php selected($val, 'number') ?>><?php echo __('Number', 'orders-table') ?></option>
    267                 <option value="date" <?php selected($val, 'date') ?>><?php echo __('Data', 'orders-table') ?></option>
    268             </select>
    269             <?php
    270         }       
    271     }   
     170        register_setting('ot_option_group', 'ot_main_options', array($this, 'sanitize_callback'));
     171    }
     172
     173    public function get_extra_html($i = 1) {
     174        $field_name = @ $this->options['extra']['extra-field-' . $i]['field-name']?:null;
     175        $field_type = @ $this->options['extra']['extra-field-' . $i]['field-type']?:null;
     176        $field_front = @ $this->options['extra']['extra-field-' . $i]['field-front']?:null;
     177        $field_required = @ $this->options['extra']['extra-field-' . $i]['field-required']?:null;
     178        ?>
     179        <fieldset class="extra-field-<?php echo $i ?>">
     180            <legend><?php echo __('Extra Field', 'orders-table'); ?> <?php echo $i ?></legend>
     181            <div class="row">
     182                <div class="col name">
     183                    <label><span><?php echo __('Field name:', 'orders-table'); ?></span>
     184                        <input type="text" name="ot_main_options[extra][extra-field-<?php echo $i ?>][field-name]" value="<?php echo $field_name ?>">
     185                    </label>
     186                </div>     
     187                <div class="col type">
     188                    <label><span><?php echo __('Field type:', 'orders-table'); ?></span>
     189                        <select name="ot_main_options[extra][extra-field-<?php echo $i ?>][field-type]">
     190                            <option value=""><?php echo __('Not selected', 'orders-table'); ?></option>
     191                            <option value="text" <?php selected($field_type, 'text') ?>><?php echo __('Text', 'orders-table'); ?></option>
     192                            <option value="number" <?php selected($field_type, 'number') ?>><?php echo __('Number', 'orders-table'); ?></option>
     193                            <option value="date" <?php selected($field_type, 'date') ?>><?php echo __('Data', 'orders-table'); ?></option>
     194                            <option value="email" <?php selected($field_type, 'email') ?>><?php echo __('E-mail', 'orders-table'); ?></option>
     195                            <option value="checkbox" <?php selected($field_type, 'checkbox') ?>><?php echo __('Checkbox', 'orders-table'); ?></option>
     196                            <option value="range" <?php selected($field_type, 'range') ?>><?php echo __('Range', 'orders-table'); ?></option>
     197                        </select>
     198                    </label>
     199                </div>     
     200                <div class="col front">
     201                    <label><span><?php echo __('Field front:', 'orders-table'); ?></span>
     202                        <input type="text" name="ot_main_options[extra][extra-field-<?php echo $i ?>][field-front]" value="<?php echo $field_front ?>">
     203                    </label class="">
     204                </div>     
     205                <div class="col required">
     206                    <span><?php echo __('Required?', 'orders-table'); ?></span>
     207                    <label>
     208                        <input type="checkbox" name="ot_main_options[extra][extra-field-<?php echo $i ?>][field-required]" value="1" <?php echo checked(1, $field_required, 0) ?>>
     209                        <span><?php echo __('on/off', 'orders-table'); ?></span>
     210                    </label>
     211                </div>
     212                <div class="dashicons dashicons-no-alt delete-field"></div>
     213                <div class="dashicons dashicons-move move-field"></div>
     214            </div>
     215        </fieldset>
     216        <?php
     217    }
    272218   
    273219    public function sanitize_callback($options) {
    274         // Формирование удобного массива для работы
    275         foreach ($options as $name => & $val) {
    276             if (preg_match('/field-name/ui', $name) || preg_match('/field-type/ui', $name) || preg_match('/field-front/ui', $name) || preg_match('/field-required/ui', $name)) {
    277                 $i = intval(preg_replace('/[^0-9]+/', '', $name), 10);
    278                 $new_name = substr($name, 0, -2);
    279                 $options['extra']['extra-field-' . $i][$new_name] = $val;
    280                 unset($options[$name]);
    281                
    282                 if (preg_match('/field-front/ui', $name) && !isset($options['extra']['extra-field-' . $i]['field-required'])) {
    283                     $options['extra']['extra-field-' . $i]['field-required'] = '';
    284                 }
    285             }
    286         }
    287        
    288         if (isset($options['extra']) && count($options['extra']) > 1) {
     220        if (isset($options['extra']) && count($options['extra']) == 1) {
    289221            if (empty($options['extra']['extra-field-1']['field-name'])) {
    290222                unset($options['extra']);
    291223            }
    292224        }
    293 
     225       
    294226        return $options;
    295227    }
     
    350282        $this->options = get_option('ot_main_options');
    351283        $this->data = $post;
     284       
     285        $this->first_step();
    352286    }
    353287   
     
    356290            'post_type' => 'orders-table',
    357291            'post_title' => $this->data['title'],
     292            'post_status' => 'publish'
    358293        );
    359294
     
    411346        if ($page == 'settings_page_ot_options') {
    412347            wp_enqueue_style('ot-style-admin', plugin_dir_url(dirname(__FILE__)). 'add/css/ot-style-admin.css');
     348            wp_enqueue_script('jquery-ui-sortable');           
    413349            wp_enqueue_script('ot-admin-script', plugin_dir_url(dirname(__FILE__)). 'add/js/ot-admin-script.js', array('jquery'));
    414             wp_localize_script( 'ot-admin-script', 'lang_text', array(
    415                 'delete_field' => __('Delete field', 'orders-table'),
    416                 'add_field' => __('Add field', 'orders-table')
    417             ) );
     350            wp_localize_script( 'ot-admin-script', 'change_text', array(
     351                'enable' => __('On', 'orders-table'),
     352                'disable' => __('Off', 'orders-table')
     353            ));
    418354        }   
    419355    }
     
    432368    public function shortcode_show_table() {
    433369        ob_start();
    434         require_once('ot-view.php');
     370        require_once('frontend.php');
    435371        $content = ob_get_clean();
    436372       
  • orders-table/trunk/lang/orders-table.pot

    r2015673 r2149035  
    44"Project-Id-Version: Orders Table\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2019-01-11 12:12+0000\n"
     6"POT-Creation-Date: 2019-01-31 19:02+0000\n"
    77"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    88"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1616"X-Loco-Version: 2.2.0; wp-4.9.9"
    1717
    18 #: inc/ot-view.php:57
     18#: inc/frontend.php:56
    1919msgid "Add"
    2020msgstr ""
    2121
    22 #: inc/functions.php:416
     22#: inc/options-page.php:76
    2323msgid "Add field"
    2424msgstr ""
     
    3636msgstr ""
    3737
    38 #: inc/ot-view.php:91
     38#: inc/frontend.php:90
    3939msgid "Author"
    4040msgstr ""
    4141
    42 #: inc/ot-view.php:114
     42#: inc/frontend.php:113
    4343msgid "Awaiting Verification"
    4444msgstr ""
     
    4949msgstr ""
    5050
    51 #: inc/functions.php:58 inc/ot-view.php:87
     51#: inc/functions.php:58 inc/frontend.php:86
    5252msgid "Category"
    5353msgstr ""
    5454
    55 #: inc/ot-view.php:35
     55#: inc/functions.php:195
     56msgid "Checkbox"
     57msgstr ""
     58
     59#: inc/frontend.php:34
    5660msgid "Content:"
    5761msgstr ""
    5862
    59 #: inc/functions.php:267
     63#: inc/functions.php:193
    6064msgid "Data"
    61 msgstr ""
    62 
    63 #: inc/functions.php:415
    64 msgid "Delete field"
    6565msgstr ""
    6666
     
    7373msgstr ""
    7474
     75#: inc/functions.php:194
     76msgid "E-mail"
     77msgstr ""
     78
    7579#: inc/functions.php:36
    7680msgid "Edit order"
    7781msgstr ""
    7882
    79 #: inc/functions.php:186
     83#: inc/options-page.php:14
    8084msgid "Enanle form add"
    8185msgstr ""
    8286
    83 #: inc/ot-view.php:36
     87#: inc/frontend.php:35
    8488msgid "Enter a order content"
    8589msgstr ""
    8690
    87 #: inc/ot-view.php:17
     91#: inc/frontend.php:16
    8892msgid "Enter a title"
    8993msgstr ""
    9094
    91 #: inc/functions.php:210
    92 msgid "Extra fields"
    93 msgstr ""
    94 
    95 #: inc/functions.php:221 inc/functions.php:234
    96 msgid "Field front"
    97 msgstr ""
    98 
    99 #: inc/functions.php:215 inc/functions.php:230
    100 msgid "Field name"
    101 msgstr ""
    102 
    103 #: inc/functions.php:218 inc/functions.php:232
    104 msgid "Field type"
    105 msgstr ""
    106 
    107 #: inc/ot-view.php:138
     95#: inc/functions.php:180
     96msgid "Extra Field"
     97msgstr ""
     98
     99#: inc/options-page.php:8 inc/options-page.php:64
     100msgid "Extra Fields"
     101msgstr ""
     102
     103#: inc/functions.php:201
     104msgid "Field front:"
     105msgstr ""
     106
     107#: inc/functions.php:183
     108msgid "Field name:"
     109msgstr ""
     110
     111#: inc/functions.php:188
     112msgid "Field type:"
     113msgstr ""
     114
     115#: inc/frontend.php:137
    108116msgid "Guest"
    109117msgstr ""
    110118
    111 #: inc/functions.php:189
     119#: inc/options-page.php:21
    112120msgid "Guests can add orders"
    113121msgstr ""
    114122
    115 #: inc/functions.php:183
     123#: inc/options-page.php:6 inc/options-page.php:12
    116124msgid "Main options"
    117125msgstr ""
    118126
    119 #: inc/functions.php:195
     127#: inc/options-page.php:7 inc/options-page.php:33
    120128msgid "Manage main field"
    121129msgstr ""
     
    125133msgstr ""
    126134
    127 #: inc/ot-view.php:162
     135#: inc/frontend.php:173
     136msgid "Next »"
     137msgstr ""
     138
     139#: inc/frontend.php:161
    128140msgid "No orders yet ..."
    129141msgstr ""
    130142
    131 #: inc/functions.php:264
     143#: inc/functions.php:190
    132144msgid "Not selected"
    133145msgstr ""
    134146
    135 #: inc/functions.php:266
     147#: inc/functions.php:192
    136148msgid "Number"
    137149msgstr ""
    138150
    139 #: inc/functions.php:192
     151#: inc/options-page.php:28
    140152msgid "Number posts on page"
    141153msgstr ""
    142154
    143 #: inc/functions.php:256
    144 msgid "On or off"
     155#: inc/functions.php:352
     156msgid "Off"
     157msgstr ""
     158
     159#: inc/functions.php:351
     160msgid "On"
     161msgstr ""
     162
     163#: inc/functions.php:209 inc/options-page.php:17 inc/options-page.php:24
     164#: inc/options-page.php:38 inc/options-page.php:45 inc/options-page.php:52
     165#: inc/options-page.php:59
     166msgid "on/off"
    145167msgstr ""
    146168
     
    149171msgstr ""
    150172
    151 #: inc/functions.php:207
     173#: inc/options-page.php:56
    152174msgid "Order author"
    153175msgstr ""
    154176
    155 #: inc/functions.php:204
     177#: inc/options-page.php:49
    156178msgid "Order category"
    157179msgstr ""
    158180
    159 #: inc/ot-view.php:83
     181#: inc/frontend.php:82
    160182msgid "Order content"
    161183msgstr ""
    162184
    163 #: inc/functions.php:201
     185#: inc/options-page.php:42
    164186msgid "Order description"
    165187msgstr ""
     
    178200msgstr ""
    179201
    180 #: inc/functions.php:198 inc/ot-view.php:112 inc/ot-view.php:114
     202#: inc/frontend.php:111 inc/frontend.php:113 inc/options-page.php:35
    181203msgid "Order status"
    182204msgstr ""
     
    203225msgstr ""
    204226
    205 #: inc/functions.php:224 inc/functions.php:236
     227#: inc/functions.php:196
     228msgid "Range"
     229msgstr ""
     230
     231#: inc/functions.php:206
    206232msgid "Required?"
    207233msgstr ""
     
    216242msgstr ""
    217243
    218 #: inc/ot-view.php:112
     244#: inc/frontend.php:111
    219245msgid "Success"
    220246msgstr ""
    221247
    222 #: inc/functions.php:265
     248#: inc/functions.php:191
    223249msgid "Text"
    224250msgstr ""
     
    243269msgstr ""
    244270
    245 #: inc/ot-view.php:80
     271#: inc/frontend.php:79
    246272msgid "Title"
    247273msgstr ""
    248274
    249 #: inc/ot-view.php:16
     275#: inc/frontend.php:15
    250276msgid "Title:"
    251277msgstr ""
    252278
    253 #: inc/ot-view.php:21
     279#: inc/frontend.php:20
    254280msgid "What do we order?"
    255281msgstr ""
     282
     283#: inc/frontend.php:172
     284msgid "« Previous"
     285msgstr ""
  • orders-table/trunk/orders-table.php

    r2015672 r2149035  
    44    Plugin URI:
    55    Description: The plugin allows you to make a convenient order page for your site. It is perfect for a store, hotel or a simple master of billets. Adjust it as it should and achieve the desired result.
    6     Version: 1.1
     6    Version: 1.2
    77    Author: Somonator
    88    Author URI:
Note: See TracChangeset for help on using the changeset viewer.