Пример #1
0
 function mltlngg_table_data($hide_pro_options = false)
 {
     global $mltlngg_options;
     $i = 0;
     $mltlngg_data = $mltlngg_options['list_of_languages'];
     foreach ($mltlngg_data as $mltlngg_language) {
         $mltlngg_status = true === $mltlngg_language['enable'] ? __('Enabled', 'multilanguage') : __('Disabled', 'multilanguage');
         $mltlngg_flag = "<img src=" . plugins_url('images/flags/', dirname(__FILE__)) . $mltlngg_language['locale'] . '.png' . " alt=" . $mltlngg_language['name'] . " title=" . $mltlngg_language['name'] . ">";
         $by_default = '<input name="mltlngg_default_lang" type="radio" value="' . $mltlngg_language['locale'] . '"' . ($mltlngg_language['locale'] == $mltlngg_options['default_language'] ? ' checked>' : '>');
         $priority = '<input value="' . $mltlngg_language['priority'] . '" name="' . $mltlngg_language['locale'] . '" type="number" min="1" />';
         $mltlngg_return[$i] = array('name' => $mltlngg_language['name'], 'locale' => $mltlngg_language['locale'], 'flag' => $mltlngg_flag, 'status' => $mltlngg_status, 'priority' => $priority, 'bydefault' => $by_default);
         if (!$hide_pro_options) {
             $locale_array = explode('_', $mltlngg_language['locale']);
             $mltlngg_return[$i]['pro_options_slug'] = '<label class="mltlngg_language_code"><input type="radio" disabled="disabled"/>&nbsp;' . $locale_array[0] . '</label>' . (isset($locale_array[1]) ? '<label><input type="radio" disabled="disabled"/>&nbsp;' . $mltlngg_language['locale'] . '</label>' : '');
             if ($mltlngg_language['locale'] == $mltlngg_options['default_language']) {
                 $mltlngg_return[$i]['pro_options_blogname'] = esc_attr(get_option('blogname'));
                 $mltlngg_return[$i]['pro_options_blogdescription'] = esc_attr(get_option('blogdescription'));
             } else {
                 $mltlngg_return[$i]['pro_options_blogdescription'] = $mltlngg_return[$i]['pro_options_blogname'] = '<textarea class="mltlngg_table_pro_option" disabled="disabled"></textarea>';
             }
         }
         $i++;
     }
     if (isset($mltlngg_return)) {
         if (isset($_GET['orderby']) && isset($_GET['order'])) {
             $mltlngg_return = mltlngg_sort_data($mltlngg_return);
         }
         return $mltlngg_return;
     } else {
         return false;
     }
 }
Пример #2
0
 function mltlngg_table_data()
 {
     global $mltlngg_options;
     $i = 0;
     $mltlngg_data = $mltlngg_options['list_of_languages'];
     foreach ($mltlngg_data as $mltlngg_language) {
         if (true === $mltlngg_language['enable']) {
             $mltlngg_status = __('Enabled', 'multilanguage');
         } else {
             $mltlngg_status = __('Disabled', 'multilanguage');
         }
         $mltlngg_flag = "<img src=" . plugins_url('images/flags/', dirname(__FILE__)) . $mltlngg_language['locale'] . '.png' . " alt=" . $mltlngg_language['name'] . " title=" . $mltlngg_language['name'] . ">";
         $by_default = '<input name="mltlngg_default_lang" type="radio" value="' . $mltlngg_language['locale'] . '"' . ($mltlngg_language['locale'] == $mltlngg_options['default_language'] ? ' checked>' : '>');
         $priority = '<input value="' . $mltlngg_language['priority'] . '" name="' . $mltlngg_language['locale'] . '" type="number" min="1" />';
         $mltlngg_return[$i] = array('name' => $mltlngg_language['name'], 'locale' => $mltlngg_language['locale'], 'flag' => $mltlngg_flag, 'status' => $mltlngg_status, 'priority' => $priority, 'bydefault' => $by_default);
         $i++;
     }
     if (isset($mltlngg_return)) {
         if (isset($_GET['orderby']) && isset($_GET['order'])) {
             $mltlngg_return = mltlngg_sort_data($mltlngg_return);
         }
         return $mltlngg_return;
     } else {
         return false;
     }
 }