Plugin Directory

Changeset 3082039


Ignore:
Timestamp:
05/06/2024 04:23:54 PM (2 years ago)
Author:
misterplan
Message:

Version 1.1.10

Location:
misterplan
Files:
341 added
6 edited

Legend:

Unmodified
Added
Removed
  • misterplan/trunk/class.mrplan_TMrPlanPlugin.php

    r3078617 r3082039  
    205205            $motor->datos->id_idioma    = (int) $boton_atts['id_idioma'];
    206206        }
     207       
    207208
    208209        if(isset($_GET['debug_misterplan']) && !empty($_GET['debug_misterplan'])){
     
    231232            $motor->datos->autoload         = (int) $_GET['autoload'];
    232233        }
     234
     235
     236        switch($motor->datos->default_date){
     237            case 1:     $motor->datos->fecha_entrada = date('d/m/Y', strtotime("+1 day"));              break;
     238            case 2:     $motor->datos->fecha_entrada = date('d/m/Y', strtotime("+2 day"));              break;
     239
     240            case 4:     $motor->datos->fecha_entrada = date('d/m/Y', strtotime("next d"));              break;
     241            case 5:     $motor->datos->fecha_entrada = date('d/m/Y', strtotime("next monday"));         break;
     242            case 6:     $motor->datos->fecha_entrada = date('d/m/Y', strtotime("next wednesday"));      break;
     243            case 7:     $motor->datos->fecha_entrada = date('d/m/Y', strtotime("next thursday"));       break;
     244            case 8:     $motor->datos->fecha_entrada = date('d/m/Y', strtotime("next friday"));         break;
     245            case 9:     $motor->datos->fecha_entrada = date('d/m/Y', strtotime("next saturday"));       break;
     246            case 10:    $motor->datos->fecha_entrada = date('d/m/Y', strtotime("next sunday"));         break;
     247
     248            case 0:
     249            default:
     250        }
     251
    233252
    234253        $this->setPlantilla();
     
    305324    }
    306325
     326
     327    private function getLanguageBrowser(){
     328        $languageList   = null;
     329        if (is_null($languageList)) {
     330            if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
     331                return 0;
     332            }
     333            $languageList = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
     334        }
     335        $languages = array();
     336        $languageRanges = explode(',', trim($languageList));
     337        foreach ($languageRanges as $languageRange) {
     338            if (preg_match('/(\*|[a-zA-Z0-9]{1,8}(?:-[a-zA-Z0-9]{1,8})*)(?:\s*;\s*q\s*=\s*(0(?:\.\d{0,3})|1(?:\.0{0,3})))?/', trim($languageRange), $match)) {
     339                if (!isset($match[2])) {
     340                    $match[2] = '1.0';
     341                } else {
     342                    $match[2] = (string) floatval($match[2]);
     343                }
     344                if (!isset($languages[$match[2]])) {
     345                    $languages[$match[2]] = array();
     346                }
     347                $languages[$match[2]][] = strtolower($match[1]);
     348            }
     349        }
     350        krsort($languages);
     351        return $languages;
     352    }
    307353}
  • misterplan/trunk/class.mrplan_TMrPlanPluginAdmin.php

    r3078617 r3082039  
    556556            $datos->texto_boton                 = sanitize_text_field($_POST['texto_boton']);
    557557        }
     558        if(!empty($_POST['default_date'])){
     559            $datos->default_date                    = (int) $_POST['default_date'];
     560        }
    558561
    559562        return $datos;
  • misterplan/trunk/init.php

    r3078617 r3082039  
    88 * Author: MisterPlan
    99 * Author URI: https://misterplan.es
    10  * Version: 1.1.9
     10 * Version: 1.1.10
    1111 * Text Domain: misterplan
    1212 * Domain Path: /languages
  • misterplan/trunk/readme.txt

    r3078617 r3082039  
    44Tested up to: 6.4.3
    55Requires PHP: 7.2.5
    6 Stable tag: 1.1.9
     6Stable tag: 1.1.10
    77License: GPLv2 or later
    88Contributors: jorgealonso
  • misterplan/trunk/templates/motor/tipo_1.html

    r3078617 r3082039  
    6969        mini_preview_V="2"
    7070        TEws_onSearch=""
    71         TEws_version="10"
     71        TEws_version="12"
    7272        TEws_tipo_widget="1"
    7373        BV7_tipo_inicio="0"
  • misterplan/trunk/templates_php/admin/motor/tipo_1.php

    r3049213 r3082039  
    176176            </div>
    177177
     178
     179            <div class="col-6 col-md-3"> 
     180            <label>
     181                    <div><?php echo esc_html__('Default date', 'misterplan'); ?></div>
     182                    <select name="default_date">
     183                            <option <?php if(!isset($motor->datos->default_date) || $motor->datos->default_date==0) echo esc_attr('selected'); ?> value="0"><?php echo esc_html__('Show default date', 'misterplan'); ?> <?php echo esc_html__('(Today or last day selected)', 'misterplan'); ?></option>
     184                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==1) echo esc_attr('selected'); ?> value="1"><?php echo esc_html__('Tomorrow', 'misterplan'); ?></option>
     185                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==2) echo esc_attr('selected'); ?> value="2"><?php echo esc_html__('The day after tomorrow', 'misterplan'); ?></option>
     186                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==4) echo esc_attr('selected'); ?> value="4"><?php echo esc_html__('Next monday', 'misterplan'); ?></option>
     187                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==5) echo esc_attr('selected'); ?> value="5"><?php echo esc_html__('Next tuesday', 'misterplan'); ?></option>
     188                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==6) echo esc_attr('selected'); ?> value="6"><?php echo esc_html__('Next wednesday', 'misterplan'); ?></option>
     189                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==7) echo esc_attr('selected'); ?> value="7"><?php echo esc_html__('Next thursday', 'misterplan'); ?></option>
     190                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==8) echo esc_attr('selected'); ?> value="8"><?php echo esc_html__('Next friday', 'misterplan'); ?></option>
     191                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==9) echo esc_attr('selected'); ?> value="9"><?php echo esc_html__('Next saturday', 'misterplan'); ?></option>
     192                            <option <?php if(isset($motor->datos->default_date) && $motor->datos->default_date==10) echo esc_attr('selected'); ?> value="10"><?php echo esc_html__('Next sunday', 'misterplan'); ?></option>
     193                    </select>
     194                </label>
     195                <span class="TMrPlanPlugin_Help"><?php echo esc_html__('Only works in the type of the booking engine: simple', 'misterplan'); ?></span>
     196           
     197
     198            </div>
     199
     200
    178201        </div>
    179202        <div class="row">
Note: See TracChangeset for help on using the changeset viewer.