Plugin Directory

Changeset 1931166


Ignore:
Timestamp:
08/27/2018 10:49:07 PM (7 years ago)
Author:
ibexestudio
Message:

Update version 1.2

Location:
ibexrentacar/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ibexrentacar/trunk/ibexrentacar-plugin.php

    r1430771 r1931166  
    33Plugin Name: Ibexrentacar
    44Plugin URI: http://www.ibexrentacar.com/
    5 Description: Plugin de WordPress para conectar tu blog con la plataforma de gestión de Ibexrentacar. Shortcode: [ibexrentacar-buscador1],[ibexrentacar-buscador2],[ibexrentacar-buscador3],[ibexrentacar-fleet],[ibexrentacar-modelo]
    6 Version: 1.1
     5Description: Plugin de WordPress para conectar tu blog con la plataforma de gestión de Ibexrentacar.
     6Version: 1.2
    77Author: Ibexestudio
    88Author URI: http://www.ibexrentacar.com
    99*/
    10 
    11 // don't load directly
    12 if (!function_exists('is_admin')) {
    13     header('Status: 403 Forbidden');
    14     header('HTTP/1.1 403 Forbidden');
    15     exit();
    16 }
    17 
    18 // Pre-2.6 compatibility
    19 if ( ! defined( 'WP_CONTENT_URL' ) )
    20       define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
    21 if ( ! defined( 'WP_CONTENT_DIR' ) )
    22       define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    23 
    24 
    25 define( 'IBEXRENTACAR_VERSION', '1.1' );
    26 define( 'IBEXRENTACAR_RELEASE_DATE', date_i18n( 'F j, Y', '1427009111' ) ); //http://www.unixtimestamp.com
    27 define( 'IBEXRENTACAR_DIR', WP_PLUGIN_DIR . '/ibexrentacar-plugin' );
    28 define( 'IBEXRENTACAR_URL', WP_PLUGIN_URL . '/ibexrentacar-plugin' );
    29 
    30 $GLOBALS['lsPluginPath'] = plugins_url('/', __FILE__);
    31 
    32 if (!class_exists("Ibexrentacar")) :
    33 
    34 class Ibexrentacar {
    35     var $settings, $options_page;
    36    
    37     function __construct() {   
    38 
    39         if (is_admin()) {
    40             // Load example settings page
    41             if (!class_exists("Ibexrentacar_Settings"))
    42                 require(IBEXRENTACAR_DIR . '/ibexrentacar-settings.php');
    43             $this->settings = new Ibexrentacar_Settings(); 
    44         }
    45        
    46         add_action('init', array($this,'init') );
    47         add_action('admin_init', array($this,'admin_init') );
    48         add_action('admin_menu', array($this,'admin_menu') );
    49        
    50        
    51        
    52         register_activation_hook( __FILE__, array($this,'activate') );
    53         register_deactivation_hook( __FILE__, array($this,'deactivate') );
    54     }
    55 
    56     function network_propagate($pfunction, $networkwide) {
    57         global $wpdb;
    58 
    59         if (function_exists('is_multisite') && is_multisite()) {
    60             // check if it is a network activation - if so, run the activation function
    61             // for each blog id
    62             if ($networkwide) {
    63                 $old_blog = $wpdb->blogid;
    64                 // Get all blog ids
    65                 $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
    66                 foreach ($blogids as $blog_id) {
    67                     switch_to_blog($blog_id);
    68                     call_user_func($pfunction, $networkwide);
    69                 }
    70                 switch_to_blog($old_blog);
    71                 return;
    72             }   
    73         }
    74         call_user_func($pfunction, $networkwide);
    75     }
    76 
    77     function activate($networkwide) {
    78         $this->network_propagate(array($this, '_activate'), $networkwide);
    79     }
    80 
    81     function deactivate($networkwide) {
    82         $this->network_propagate(array($this, '_deactivate'), $networkwide);
    83     }
    84 
    85     /*
    86         Enter our plugin activation code here.
    87     */
    88     function _activate() {}
    89 
    90     /*
    91         Enter our plugin deactivation code here.
    92     */
    93     function _deactivate() {}
    94    
    95 
    96     /*
    97         Load language translation files (if any) for our plugin.
    98     */
    99     function init() {
    100         load_plugin_textdomain( 'ibexrentacar', IBEXRENTACAR_DIR . '/lang',
    101                                basename( dirname( __FILE__ ) ) . '/lang' );
    102     }
    103 
    104     function admin_init() {
    105     }
    106 
    107     function admin_menu() {
    108     }
    109 
    110 
    111     /*
    112         Example print function for debugging.
    113     */ 
    114     function print_example($str, $print_info=TRUE) {
    115         if (!$print_info) return;
    116         __($str . "<br/><br/>\n", 'ibexrentacar' );
    117     }
    118 
    119    
    120     function javascript_redirect($location) {
    121         // redirect after header here can't use wp_redirect($location);
    122         ?>
    123           <script type="text/javascript">
    124           <!--
    125           window.location= <?php echo "'" . $location . "'"; ?>;
    126           //-->
    127           </script>
    128         <?php
    129         exit;
    130     }
    131    
    132 } // end class
    133 endif;
    134 
    135 // Initialize our plugin object.
    136 global $ibexrentacar;
    137 global $settings_ibex;
    138 
    139 if (class_exists("Ibexrentacar") && !$ibexrentacar) {
    140     $ibexrentacar  = new Ibexrentacar();       
    141 }   
    142 
    143 if (!class_exists("Ibexrentacar_Settings")){
    144     require(IBEXRENTACAR_DIR . '/ibexrentacar-settings.php');
    145     $settings_ibex = new Ibexrentacar_Settings();   
    146 }
    147 
    148 //Shortcode Flota
    149 function shortcode_ibexrentacar_fleet($atts) { 
    150     global $settings_ibex;
    151     $ibexrentacar_apikey = $settings_ibex->options['ibexrentacar_apikey'];
    152     $ibexrentacar_url    = $settings_ibex->options['ibexrentacar_url'];
    153     // get attibutes and set defaults
    154         extract(shortcode_atts(array(
    155                 'width'             => '100%',
    156                 'include_jquery'    => '0',
    157                 'locale'            => 'es_ES',
    158                 'result_view'       => 'list',
    159                 'include_css'       => ''
    160        ), $atts));
    161     // Display info
    162     if($ibexrentacar_apikey!='' && $ibexrentacar_url!=''){
    163         $icss = '';
    164         if($include_css!='')$icss = '&include_css='.$include_css;
    165         return ' <script src="'.$ibexrentacar_url.'/widget/?include_jquery='.$include_jquery.'&locale='.$locale.'&result_view='.$result_view.''.$icss.'"></script>
    166                  <div id="irc_fleet" style="width: '.$width.';"></div>';
    167     }
    168 }
    169 add_shortcode('ibexrentacar-fleet','shortcode_ibexrentacar_fleet');     
    170 
    171        
    172 //Shortcode Only results
    173 function shortcode_ibexrentacar_results($atts) {   
    174     global $settings_ibex;
    175     $ibexrentacar_apikey = $settings_ibex->options['ibexrentacar_apikey'];
    176     $ibexrentacar_url    = $settings_ibex->options['ibexrentacar_url'];
    177     // get attibutes and set defaults
    178         extract(shortcode_atts(array(
    179                 'width'             => '100%',
    180                 'include_jquery'    => '0',
    181                 'locale'            => 'es_ES',
    182                 'result_view'       => 'list',
    183                 'include_css'       => ''
    184        ), $atts));
    185     // Display info
    186     if($ibexrentacar_apikey!='' && $ibexrentacar_url!=''){
    187         $icss = '';
    188         if($include_css!='')$icss = '&include_css='.$include_css;
    189         return ' <script src="'.$ibexrentacar_url.'/widget/?include_jquery='.$include_jquery.'&locale='.$locale.'&autoload=1&result_view='.$result_view.''.$icss.'"></script>
    190                  <div id="irc_search" style="width: '.$width.'; display: none;"></div>
    191                  <div id="irc_result" style="width: '.$width.';"></div>';
    192     }
    193 }
    194 add_shortcode('ibexrentacar-results','shortcode_ibexrentacar_results');
    195 
    196 //Shortcode Flota sale
    197 function shortcode_ibexrentacar_fleetsale($atts) { 
    198     global $settings_ibex;
    199     $ibexrentacar_apikey = $settings_ibex->options['ibexrentacar_apikey'];
    200     $ibexrentacar_url    = $settings_ibex->options['ibexrentacar_url'];
    201     // get attibutes and set defaults
    202         extract(shortcode_atts(array(
    203                 'width'             => '100%',
    204                 'include_jquery'    => '0',
    205                 'locale'            => 'es_ES',
    206                 'result_view'       => 'list',
    207                 'include_css'       => ''
    208        ), $atts));
    209     // Display info
    210     if($ibexrentacar_apikey!='' && $ibexrentacar_url!=''){
    211         $icss = '';
    212         if($include_css!='')$icss = '&include_css='.$include_css;
    213         return ' <script src="'.$ibexrentacar_url.'/widget/?include_jquery='.$include_jquery.'&locale='.$locale.'&result_view='.$result_view.''.$icss.'"></script>
    214                  <div id="irc_fleetsale" style="width: '.$width.';"></div>';
    215     }
    216 }
    217 add_shortcode('ibexrentacar-fleetsale','shortcode_ibexrentacar_fleetsale');         
    218 
    219 //Shortcode Buscador 1
    220 function shortcode_ibexrentacar_buscador1($atts) { 
    221     global $settings_ibex;
    222     $ibexrentacar_apikey = $settings_ibex->options['ibexrentacar_apikey'];
    223     $ibexrentacar_url    = $settings_ibex->options['ibexrentacar_url'];
    224     // get attibutes and set defaults
    225         extract(shortcode_atts(array(
    226                 'width'             => '100%',
    227                 'include_jquery'    => '0',
    228                 'locale'            => 'es_ES',
    229                 'include_css'       => ''
    230        ), $atts));
    231     // Display info
    232     if($ibexrentacar_apikey!='' && $ibexrentacar_url!=''){
    233         $icss = '';
    234         if($include_css!='')$icss = '&include_css='.$include_css;
    235         return ' <script src="'.$ibexrentacar_url.'/widget/?include_jquery='.$include_jquery.'&locale='.$locale.''.$icss.'"></script>
    236                  <div id="irc_search" style="width: '.$width.';"></div>
    237                  <div id="irc_result" style="width: '.$width.';"></div>';
    238     }
    239 }
    240 add_shortcode('ibexrentacar-buscador1','shortcode_ibexrentacar_buscador1');
    241 
    242 //Shortcode Buscador 2
    243 function shortcode_ibexrentacar_buscador2($atts) { 
    244     global $settings_ibex;
    245     $ibexrentacar_apikey = $settings_ibex->options['ibexrentacar_apikey'];
    246     $ibexrentacar_url    = $settings_ibex->options['ibexrentacar_url'];
    247     // get attibutes and set defaults
    248         extract(shortcode_atts(array(
    249                 'width'             => '100%',
    250                 'include_jquery'    => '0',
    251                 'locale'            => 'es_ES',
    252                 'include_css'       => ''
    253        ), $atts));
    254     // Display info
    255     if($ibexrentacar_apikey!='' && $ibexrentacar_url!=''){
    256         $icss = '';
    257         if($include_css!='')$icss = '&include_css='.$include_css;
    258         return ' <script src="'.$ibexrentacar_url.'/widget/?include_jquery='.$include_jquery.'&locale='.$locale.''.$icss.'"></script>
    259                  <div id="irc_home" style="width: '.$width.';"></div>';
    260     }
    261 }
    262 add_shortcode('ibexrentacar-buscador2','shortcode_ibexrentacar_buscador2');         
    263            
    264 //Shortcode Buscador 3
    265 function shortcode_ibexrentacar_buscador3($atts) { 
    266     global $settings_ibex;
    267     $ibexrentacar_apikey = $settings_ibex->options['ibexrentacar_apikey'];
    268     $ibexrentacar_url    = $settings_ibex->options['ibexrentacar_url'];
    269     // get attibutes and set defaults
    270         extract(shortcode_atts(array(
    271                 'width'             => '100%',
    272                 'include_jquery'    => '0',
    273                 'locale'            => 'es_ES',
    274                 'include_css'       => ''
    275        ), $atts));
    276     // Display info
    277     if($ibexrentacar_apikey!='' && $ibexrentacar_url!=''){
    278         $icss = '';
    279         if($include_css!='')$icss = '&include_css='.$include_css;
    280         return ' <script src="'.$ibexrentacar_url.'/widget/?include_jquery='.$include_jquery.'&locale='.$locale.''.$icss.'"></script>
    281                  <div id="irc_searchlarge" style="width: '.$width.';"></div>
    282                  <div id="irc_result" style="width: '.$width.';"></div>';
    283     }
    284 }
    285 add_shortcode('ibexrentacar-buscador3','shortcode_ibexrentacar_buscador3');         
    286 
    287 
    288 //Shortcode Ficha Modelo
    289 function shortcode_ibexrentacar_modelo($atts) {
    290     global $settings_ibex;
    291     $ibexrentacar_apikey = $settings_ibex->options['ibexrentacar_apikey'];
    292     $ibexrentacar_url    = $settings_ibex->options['ibexrentacar_url'];
    293     // get attibutes and set defaults
    294         extract(shortcode_atts(array(
    295                 'width'             => '100%',
    296                 'include_jquery'    => '0',
    297                 'locale'            => 'es_ES',
    298                 'modelo_id'         => '',
    299                 'include_css'       => ''
    300        ), $atts));
    301     // Display info
    302     if($ibexrentacar_apikey!='' && $ibexrentacar_url!='' && $modelo_id!=''){
    303         $icss = '';
    304         if($include_css!='')$icss = '&include_css='.$include_css;
    305         return ' <script src="'.$ibexrentacar_url.'/widget/?include_jquery='.$include_jquery.'&model='.$modelo_id.'&locale='.$locale.''.$icss.'"></script>
    306                  <div id="irc_vehicle" style="width: '.$width.';"></div>';
    307     }
    308 }
    309 add_shortcode('ibexrentacar-modelo','shortcode_ibexrentacar_modelo');       
    310 
    311 
    312 //Shortcode Features
    313 function shortcode_ibexrentacar_featured($atts) {   
    314     global $settings_ibex;
    315     $ibexrentacar_apikey = $settings_ibex->options['ibexrentacar_apikey'];
    316     $ibexrentacar_url    = $settings_ibex->options['ibexrentacar_url'];
    317     // get attibutes and set defaults
    318         extract(shortcode_atts(array(
    319                 'width'             => '100%',
    320                 'include_jquery'    => '0',
    321                 'locale'            => 'es_ES',
    322                 'featured_items'    => '',
    323                 'include_css'       => ''
    324        ), $atts));
    325    
    326     if($featured_items=='')$featured_items = 4;
    327     // Display info
    328     if($ibexrentacar_apikey!='' && $ibexrentacar_url!=''){
    329         $icss = '';
    330         if($include_css!='')$icss = '&include_css='.$include_css;
    331         return ' <script src="'.$ibexrentacar_url.'/widget/?include_jquery='.$include_jquery.'&featured_items='.$featured_items.'&locale='.$locale.''.$icss.'"></script>
    332                  <div id="irc_featured" style="width: '.$width.';"></div>';
    333     }
    334 }
    335 add_shortcode('ibexrentacar-featured','shortcode_ibexrentacar_featured');   
    336 
    33710?>
     11<?php if (!function_exists('is_admin')) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit();}if (!defined( 'WP_CONTENT_URL'))define('WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content');if (!defined( 'WP_CONTENT_DIR'))define('WP_CONTENT_DIR', ABSPATH . 'wp-content'); define('IBEXRENTACAR_VERSION','1.2');define('IBEXRENTACAR_RELEASE_DATE', date_i18n( 'F j, Y', time()));define('IBEXRENTACAR_DIR', trailingslashit( plugin_dir_path( __FILE__ )));define('IBEXRENTACAR_URL', trailingslashit( plugin_dir_url( __FILE__ )));$GLOBALS['lsPluginPath'] = plugins_url('/', __FILE__); if (!class_exists("Ibexrentacar")) : class Ibexrentacar { var $settings, $options_page; function __construct() { if(is_admin()){if(!class_exists("Ibexrentacar_Settings"))require(IBEXRENTACAR_DIR.'/ibexrentacar-settings.php');$this->settings = new Ibexrentacar_Settings();} add_action('init', array($this,'init')); add_action('admin_init',array($this,'admin_init'));add_action('admin_menu',array($this,'admin_menu')); register_activation_hook( __FILE__, array($this,'activate') ); register_deactivation_hook( __FILE__, array($this,'deactivate') ); } function network_propagate($pfunction, $networkwide) { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { if ($networkwide) { $old_blog = $wpdb->blogid; $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}"); foreach ($blogids as $blog_id){ switch_to_blog($blog_id); call_user_func($pfunction, $networkwide);} switch_to_blog($old_blog); return; } } call_user_func($pfunction, $networkwide); }  function _activate(){} function _deactivate(){} function admin_init(){} function admin_menu(){} function activate($networkwide){ $this->network_propagate(array($this, '_activate'), $networkwide); } function deactivate($networkwide){ $this->network_propagate(array($this, '_deactivate'), $networkwide);} function init(){ load_plugin_textdomain('ibexrentacar', IBEXRENTACAR_DIR.'/lang',basename(dirname( __FILE__ )).'/lang');} function javascript_redirect($location) { ?> <script type="text/javascript"> window.location= <?php  echo "'" . $location . "'"; ?>; </script> <?php  exit;} } endif; global $ibexrentacar;global $settings_ibex; if (class_exists("Ibexrentacar") && !$ibexrentacar)$ibexrentacar = new Ibexrentacar();if (!class_exists("Ibexrentacar_Settings")){ require(IBEXRENTACAR_DIR.'/ibexrentacar-settings.php'); $settings_ibex = new Ibexrentacar_Settings();} function shortcode_ibexrentacar($atts){ global $settings_ibex; $ws_settings = array('irc_url' => $settings_ibex->options['irc_url'],'irc_username' => $settings_ibex->options['irc_username'],'irc_password' => $settings_ibex->options['irc_password']);if(isset($settings_ibex->options['irc_apikey']) && $settings_ibex->options['irc_apikey']!='')$dec = apidec($settings_ibex->options['irc_apikey']);if(isset($dec[0]) && $dec[0]!='')$ws_settings['irc_url'] = $dec[0];if(isset($dec[1]) && $dec[1]!=''){ $ws_settings['irc_username'] = $dec[1];}$session_check = ws_request("/models/session/check",$ws_settings,array("view_id" => 1));extract(shortcode_atts(array('width'=>'100%','result_width'=>'100%','include_jquery'=> '0','view'=> '1','result_view'=> 'list','vclass'=> '','vprice'=> '0','include_css'=> '','model'=> '','featured_items'=> '','type'=> '','layout'=> 'block','key'=> '',), $atts)); if(isset($session_check['ok'])){ if($type=="result"){ return '<div id="irc_result" style="width: '.$result_width.';"></div>'; }else{ $wsrc = $settings_ibex->options['irc_url'].'/widget/?include_jquery='.$include_jquery.'&view_id='.$view.'&result_view='.$result_view; if($include_css!=''){ $wsrc .= '&include_css='.$include_css;}else{$sessio_module = ws_request("/models/module/records",$ws_settings,array("view_id" => 1, "name" => "widget")); if(isset($sessio_module['items']) && sizeof($sessio_module['items'])){$wsrc .= '&include_css='.$settings_ibex->options['irc_url'].'/layout/widget/css/'.$sessio_module['items'][0]['style'].'.css';} } if($key!=''){ $wsrc .= "&key=".$key; }else{ $session_user = ws_request("/models/user/visibleRecords",$ws_settings,array("view_id" => 1, "username" => $settings_ibex->options['irc_username'])); if(isset($session_user['items'][0]))$wsrc .= "&key=".$session_user['items'][0]["user_id"]."-".md5($session_user['items'][0]["username"]);}if($model!='')$wsrc .= '&model='.$model; if($featured_items!=''){$wsrc .= '&featured_items='.$featured_items;}else{ if($type=="featured")$wsrc .= '&featured_items=4';} $result_wiget_content = '<div id="irc_'.$type.'" style="width: '.$width.';"></div>'; if(($type=='search' || $type=='searchsmart' || $type=='searchlarge') && $layout=="block")$result_wiget_content .= '<div id="irc_result" style="width: '.$result_width.';"></div>'; $wsrc .= '&autoscroll=0'; return '<script async="async" src="'.$wsrc.'"></script>'.$result_wiget_content; } }else{ return "IRC: "._irct("Revise la configuración del plugin"); }} add_shortcode('irc','shortcode_ibexrentacar'); ?>
  • ibexrentacar/trunk/ibexrentacar-settings.php

    r1430771 r1931166  
    1 <?php
    2 if (!function_exists('is_admin')) {
    3     header('Status: 403 Forbidden');
    4     header('HTTP/1.1 403 Forbidden');
    5     exit();
    6 }
    7 
    8 if (!class_exists("Ibexrentacar_Settings")) :
    9 
    10 /*
    11     Create example settings page for our plugin.
    12    
    13     - We show how to render our own controls using HTML.
    14     - We show how to get WordPress to render controls for us using do_settings_sections'
    15    
    16     WordPress Settings API tutorials
    17     http://codex.wordpress.org/Settings_API
    18     http://ottopress.com/2009/wordpress-settings-api-tutorial/
    19 */
    20 class Ibexrentacar_Settings {
    21 
    22     public static $default_settings =
    23         array( 
    24                 'example_text' => '',
    25                 'example_checkbox1' => '',
    26                 'example_checkbox2' => '',
    27                 'mbox_example_text' => 'Ibexrentacar plugin by Ibexestudio',
    28                 'mbox_example_checkbox1' => '',
    29                 'ibexrentacar_apikey'    => '12345',
    30                 'ibexrentacar_url'      => '',
    31                 'mbox_example_checkbox2' => ''
    32                 );
    33     var $pagehook, $page_id, $settings_field, $options;
    34 
    35    
    36     function __construct() {   
    37         $this->page_id = 'ibexrentacar';
    38         // This is the get_options slug used in the database to store our plugin option values.
    39         $this->settings_field = 'ibexrentacar_options';
    40         $this->options = get_option( $this->settings_field );
    41 
    42         add_action('admin_init', array($this,'admin_init'), 20 );
    43         add_action( 'admin_menu', array($this, 'admin_menu'), 20);
    44     }
    45    
    46     function admin_init() {
    47         register_setting( $this->settings_field, $this->settings_field, array($this, 'sanitize_theme_options') );
    48         add_option( $this->settings_field, Ibexrentacar_Settings::$default_settings );
    49        
    50        
    51         /*
    52             This is needed if we want WordPress to render our settings interface
    53             for us using -
    54             do_settings_sections
    55            
    56             It sets up different sections and the fields within each section.
    57         */
    58         add_settings_section('ibexrentacar_main', '', 
    59             array($this, 'main_section_text'), 'example_settings_page');
    60 
    61         add_settings_field('example_text', 'Example Text',
    62             array($this, 'render_example_text'), 'example_settings_page', 'ibexrentacar_main');
    63 
    64         add_settings_field('example_checkbox1', 'Example Checkboxes',
    65             array($this, 'render_example_checkbox'), 'example_settings_page', 'ibexrentacar_main',
    66             array('id' => 'example_checkbox1', 'value' => 'apples', 'text' => 'Apples') );
    67         add_settings_field('example_checkbox2', '',
    68             array($this, 'render_example_checkbox'), 'example_settings_page', 'ibexrentacar_main',
    69             array('id' => 'example_checkbox2', 'value' => 'oranges', 'text' => 'Oranges') );
    70     }
    71 
    72     function admin_menu() {
    73         if ( ! current_user_can('update_plugins') )
    74             return;
    75        
    76        
    77         $this->pagehook = add_menu_page( __('Ibexrentacar', 'ibexrentacar'), __('Ibexrentacar', 'ibexrentacar'), 'administrator', $this->page_id, array($this,'render'),  plugins_url('/', __FILE__).'/img/icon4_16x16.png');
    78        
    79         // Add a new submenu to the standard Settings panel
    80         //--> añadir opción en ajustes -> $this->pagehook = $page =  add_options_page(__('Ibexrentacar', 'ibexrentacar'), __('Ibexrentacar', 'ibexrentacar'), 'administrator', $this->page_id, array($this,'render') );
    81        
    82         // Executed on-load. Add all metaboxes.
    83         add_action( 'load-' . $this->pagehook, array( $this, 'metaboxes' ) );
    84         // Include js, css, or header *only* for our settings page
    85         add_action("admin_print_scripts-$page", array($this, 'js_includes'));
    86         // add_action("admin_print_styles-$page", array($this, 'css_includes'));
    87         add_action("admin_head-$page", array($this, 'admin_head') );
    88     }
    89 
    90     function admin_head() { ?>
    91         <style>
    92         .settings_page_ibexrentacar label { display:inline-block; width: 150px; }
    93         </style>
    94 
    95     <?php }
    96 
    97      
    98     function js_includes() {
    99         // Needed to allow metabox layout and close functionality.
    100         wp_enqueue_script( 'postbox' );
    101     }
    102    
    103     function test_function() {
    104         return 'test test 99';
    105     }
    106 
    107 
    108     /*
    109         Sanitize our plugin settings array as needed.
    110     */ 
    111     function sanitize_theme_options($options) {
    112         $options['example_text'] = stripcslashes($options['example_text']);
    113         return $options;
    114     }
    115 
    116 
    117     /*
    118         Settings access functions.
    119        
    120     */
    121     protected function get_field_name( $name ) {
    122 
    123         return sprintf( '%s[%s]', $this->settings_field, $name );
    124 
    125     }
    126 
    127     protected function get_field_id( $id ) {
    128 
    129         return sprintf( '%s[%s]', $this->settings_field, $id );
    130 
    131     }
    132 
    133     protected function get_field_value( $key ) {
    134 
    135         return $this->options[$key];
    136 
    137     }
    138        
    139 
    140     /*
    141         Render settings page.
    142        
    143     */
    144    
    145     function render() {
    146         global $wp_meta_boxes;
    147 
    148         $messages[1] = __('Ibexrentacar action taken.', 'ibexrentacar');
    149        
    150         if ( isset($_GET['message']) && (int) $_GET['message'] ) {
    151             $message = $messages[$_GET['message']];
    152             $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
    153         }
    154        
    155         $title = __('Ibexrentacar', 'ibexrentacar');
    156         ?>
    157         <div class="wrap">   
    158             <?php //screen_icon(); ?>
    159             <div style="display:block; float:left; margin-right: 20px;"><img src="<?= plugins_url('/', __FILE__).'/img/ibexrentacar.png' ?>" /></div>
    160             <div style="display:block; float:left;">
    161                 <br />
    162                 <h2 style="margin-bottom:0; padding-bottom:5px;"><?php echo esc_html( $title ); ?></h2>
    163                 <p>
    164                     Convierta su blog de Wordpress en un completo <strong>sistema de reservas online</strong> conectado con su <strong>Ibexrentacar</strong>.<br /><br />
    165                 </p>
    166             </div>
    167             <div style="display:block; clear:both;"></div>
    168             <? /*<div style="width:100%; height:20px; background-color:#fc992e;"></div>*/?>
    169             <?php
    170                 if ( !empty($message) ) :
    171                 ?>
    172                 <div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
    173                 <?php
    174                 endif;
    175             ?>
    176             <form method="post" action="options.php">
    177                 <? /*
    178                 <p>
    179                 <input type="submit" class="button button-primary" name="save_options" value="<?php esc_attr_e('Guardar'); ?>" />
    180                 </p>
    181                 */?>
    182                
    183                 <div class="metabox-holder">
    184                     <div class="postbox-container" style="width: 99%;">
    185                     <?php
    186                         // Render metaboxes
    187                         settings_fields($this->settings_field);
    188                         do_meta_boxes( $this->pagehook, 'main', null );
    189                         if ( isset( $wp_meta_boxes[$this->pagehook]['column2'] ) )
    190                             do_meta_boxes( $this->pagehook, 'column2', null );
    191                     ?>
    192                     </div>
    193                 </div>
    194                 <div style="display:block; clear:both;"></div>
    195                 <p style="padding-top:20px;">
    196                     Más información: <a href="http://www.ibexrentacar.com" target="_blank">www.ibexrentacar.com</a><br />
    197                     Soporte: <a href="mailto:[email protected]">[email protected]</a><br />
    198                     Ibexrentacar plugin by <a href="http://www.ibexestudio.com" target="_blank">Ibexestudio</a><br />
    199                     Ibexrentacar.com © <?= date('Y') ?><br />
    200                 </p>
    201             </form>
    202         </div>
    203        
    204         <!-- Needed to allow metabox layout and close functionality. -->
    205         <script type="text/javascript">
    206             //<![CDATA[
    207             jQuery(document).ready( function ($) {
    208                 // close postboxes that should be closed
    209                 $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
    210                 // postboxes setup
    211                 postboxes.add_postbox_toggles('<?php echo $this->pagehook; ?>');
    212             });
    213            
    214             function view_example_page_shortcode(){
    215                 jQuery('#code_page_examples_shortcode').slideToggle("fast");
    216             }
    217             //]]>
    218         </script>
    219     <?php }
    220    
    221    
    222     function metaboxes() {
    223 
    224         add_meta_box( 'ibexrentacar-version', __( 'Configuración', 'ibexrentacar' ), array( $this, 'info_box' ), $this->pagehook, 'main', 'high' );
    225        
    226         add_meta_box( 'ibexrentacar-sincr-models', __( 'Widget de integración en web', 'ibexrentacar' ), array( $this, 'sincr_models' ), $this->pagehook, 'main' );
    227 
    228         //add_meta_box( 'ibexrentacar-conditions', __( 'Example Conditions', 'ibexrentacar' ), array( $this, 'condition_box' ), $this->pagehook, 'main' );
    229 
    230         //add_meta_box(     'ibexrentacar-all', __( 'Rendered by WordPress using do_settings_sections', 'ibexrentacar' ), array( $this, 'do_settings_box' ), $this->pagehook, 'main' );
    231 
    232     }
    233    
    234     function info_box() {
    235 
    236         ?>
    237         <div style="padding:10px;">
    238             <p><strong><?php _e( 'Version:', 'ibexrentacar' ); ?></strong> <?php echo IBEXRENTACAR_VERSION; ?> <?php echo '&middot;'; ?> <strong><?php _e( 'Released:', 'ibexrentacar' ); ?></strong> <?php echo IBEXRENTACAR_RELEASE_DATE; ?></p>
    239             <p><strong>Parámetros de conexión con Ibexrentacar</strong></p>
    240             <p>
    241                 <div style="display:block; float:left; width:6%;">
    242                     <label for="<?php echo $this->get_field_id( 'ibexrentacar_apikey' ); ?>" style="font: normal 12px/20px Arial, Helvetica, sans-serif;"><?php _e( 'Ibexrentacar Api Key', 'ibexrentacar' ); ?></label>
    243                 </div>
    244                 <div style="display:block; float:left; width:94%">
    245                     <input type="text" name="<?php echo $this->get_field_name( 'ibexrentacar_apikey' ); ?>" id="<?php echo $this->get_field_id( 'ibexrentacar_apikey' ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'ibexrentacar_apikey' ) ); ?>" style="width:100%;" />
    246                 </div>
    247                 <div style="display:block; clear:both;"></div><br />
    248                 <div style="display:block; float:left; width:6%;">
    249                     <label for="<?php echo $this->get_field_id( 'ibexrentacar_url' ); ?>" style="font: normal 12px/20px Arial, Helvetica, sans-serif;"><?php _e( 'Ibexrentacar Url', 'ibexrentacar' ); ?></label>
    250                 </div>
    251                 <div style="display:block; float:left; width:94%">
    252                     <input type="text" name="<?php echo $this->get_field_name( 'ibexrentacar_url' ); ?>" id="<?php echo $this->get_field_id( 'ibexrentacar_url' ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'ibexrentacar_url' ) ); ?>" style="width:100%;" />
    253                 </div>
    254                 <div style="display:block; clear:both;"></div>
    255                 <div style="display:block; float:left; width:6%;">&nbsp;</div>
    256                 <div style="display:block; float:left; width:94%">
    257                     <br />
    258                      <input type="submit" class="button button-primary" name="save_options" value="<?php esc_attr_e('Guardar'); ?>" style="background:none; background-color:#fc992e; border-radius:5px; padding:0 20px 0 20px; font: bold 14px/18px Arial, Helvetica, sans-serif; color:#FFF;margin:0; border:none;" />
    259                 </div>
    260                 <div style="display:block; clear:both;"></div>
    261             </p>
    262          </div>
    263       <?php
    264 
    265     }
    266    
    267    
    268     function sincr_models(){
    269     ?>
    270         <? $url_save_plugin = $this->get_field_value( 'ibexrentacar_url' ); ?>
    271        
    272         <div style="padding:10px;">
    273             <? if($url_save_plugin==''){ ?>
    274             <p>
    275                 <div align="center">
    276                     Para poder realizar la integración del sistema de reservas en su sitio web debe rellenar los datos de configuración con su Ibexrentacar.
    277                 </div>
    278             </p>
    279             <? }else{?>
    280             <p>
    281                 El interface de conexión del motor de reservas "Widget Integrable", permite integrar de forma transparente al usuario las funciones necesarias para la reserva on-line, realiza acciones sobre la reserva tales como búsquedas o formalización.<br />
    282                 De esta forma ofrecemos a nuestros clientes un producto exclusivo para añadir una prestación más a su página o blog.<br />
    283                 <br />
    284                 <div style="padding:10px; background-color: #fafafa;border:1px solid #efefef; "><strong style="font-size: 14px; color:#666">1. Shortcode - Seleccione el tipo de integración que desee</strong></div>
    285                 <div style="padding:1%;">
    286                     <div style="display:block; float:left; width:32%; margin-right:1%; background-color:#fafafa; border:1px solid #efefef; border-radius: 6px">
    287                         <div style="padding:10px; background-color: #fc992e"><span style="font-size: 14px; color:#FFF">Widget: <strong>Buscador 1</strong></span></div>
    288                         <div style="padding:10px;">
    289                             Integración de un formulario de búsqueda de disponibilidad para la reserva.<br />
    290                             Le permite mantener al mismo tiempo la visualización del buscador y los resultados.<br />
    291                             <br />
    292                             <strong>Shortcode:</strong> [ibexrentacar-buscador1]<br />
    293                             <br />
    294                             <strong>Parámetros opcionales</strong><br /><br />
    295                             <strong>width:</strong> Tamaño del Widget (px o %)<br />
    296                             <strong>include_jquery:</strong> Inclusión de Jquery<br />
    297                             <strong>locale:</strong> Idioma (es_ES)<br />
    298                             <strong>include_css:</strong> Inclusión de CSS personalizado (Url)<br />
    299                             <br />
    300                             <strong>Ejemplo:</strong><br />
    301                             <span style="font-style:italic;">[ibexrentacar-buscador1 width="75%" include_jquery="0" locale="es_ES" include_css=""]</span>
    302                         </div>
    303                     </div>
    304                     <div style="display:block; float:left; width:32%; margin-right:1%;background-color:#fafafa; border:1px solid #efefef; border-radius: 6px">
    305                         <div style="padding:10px; background-color: #fc992e"><span style="font-size: 14px; color:#FFF">Widget: <strong>Buscador 2</strong></span></div>
    306                         <div style="padding:10px;">
    307                             Integración de un formulario de búsqueda de disponibilidad para la reserva.<br />
    308                             Una vez realizada la búsqueda se oculta el buscador.<br />
    309                             <br />
    310                             <strong>Shortcode:</strong> [ibexrentacar-buscador2]<br />
    311                             <br />
    312                             <strong>Parámetros opcionales</strong><br /><br />
    313                             <strong>width:</strong> Tamaño del Widget (px o %)<br />
    314                             <strong>include_jquery:</strong> Inclusión de Jquery<br />
    315                             <strong>locale:</strong> Idioma (es_ES)<br />
    316                             <strong>include_css:</strong> Inclusión de CSS personalizado (Url)<br />
    317                             <br />
    318                             <strong>Ejemplo:</strong><br />
    319                             <span style="font-style:italic;">[ibexrentacar-buscador2 width="75%" include_jquery="0" locale="es_ES" include_css=""]</span>
    320                         </div>
    321                     </div>
    322                     <div style="display:block; float:left; width:32%; margin-right:1%;background-color:#fafafa; border:1px solid #efefef; border-radius: 6px">
    323                         <div style="padding:10px; background-color: #fc992e"><span style="font-size: 14px; color:#FFF">Widget: <strong>Buscador 3</strong></span></div>
    324                         <div style="padding:10px;">
    325                             Integración de un formulario de búsqueda de disponibilidad para la reserva.<br />
    326                             Variación del Buscador I con una disposición del formulario alargada.<br />
    327                             <br />
    328                             <strong>Shortcode:</strong> [ibexrentacar-buscador3]<br />
    329                             <br />
    330                             <strong>Parámetros opcionales</strong><br /><br />
    331                             <strong>width:</strong> Tamaño del Widget (px o %)<br />
    332                             <strong>include_jquery:</strong> Inclusión de Jquery<br />
    333                             <strong>locale:</strong> Idioma (es_ES)<br />
    334                             <strong>include_css:</strong> Inclusión de CSS personalizado (Url)<br />
    335                             <br />
    336                             <strong>Ejemplo:</strong><br />
    337                             <span style="font-style:italic;">[ibexrentacar-buscador3 width="100%" include_jquery="0" locale="es_ES" include_css=""]</span>
    338                         </div>
    339                     </div>
    340                     <div style="display:block; clear:both;"></div><br />
    341                     <div style="display:block; float:left; width:32%; margin-right:1%;background-color:#fafafa; border:1px solid #efefef; border-radius: 6px">
    342                         <div style="padding:10px; background-color: #fc992e"><span style="font-size: 14px; color:#FFF">Widget: <strong>Listado de Flota</strong></span></div>
    343                         <div style="padding:10px;">
    344                             Listado de modelos disponibles para la reserva con filtros, enlace a la ficha de modelo y formulario de búsqueda.<br />
    345                             Le permite definir el tipo de vista de los resultados: Mosaico / Listado<br />
    346                             <br />
    347                             <strong>Shortcode:</strong> [ibexrentacar-fleet]<br />
    348                             <br />
    349                             <strong>Parámetros opcionales</strong><br /><br />
    350                             <strong>width:</strong> Tamaño del Widget (px o %)<br />
    351                             <strong>include_jquery:</strong> Inclusión de Jquery<br />
    352                             <strong>locale:</strong> Idioma (es_ES)<br />
    353                             <strong>result_view:</strong> Vista de resultados (grid/list)<br />
    354                             <strong>include_css:</strong> Inclusión de CSS personalizado (Url)<br />
    355                             <br />
    356                             <strong>Ejemplo:</strong><br />
    357                             <span style="font-style:italic;">[ibexrentacar-fleet width="75%" include_jquery="0" locale="es_ES" result_view="list" include_css=""]</span>
    358                         </div>
    359                     </div>
    360                     <div style="display:block; float:left; width:32%;; margin-right:1%;background-color:#fafafa; border:1px solid #efefef; border-radius: 6px">
    361                         <div style="padding:10px; background-color: #fc992e"><span style="font-size: 14px; color:#FFF">Widget: <strong>Ficha Modelo</strong></span></div>
    362                         <div style="padding:10px;">
    363                             Ficha del modelo con formulario de búsqueda.<br /><br />
    364                             <br />
    365                             <strong>Shortcode:</strong> [ibexrentacar-modelo]<br />
    366                             <br />
    367                             <strong>Parámetros opcionales</strong><br /><br />
    368                             <strong>width:</strong> Tamaño del Widget (px o %)<br />
    369                             <strong>include_jquery:</strong> Inclusión de Jquery<br />
    370                             <strong>locale:</strong> Idioma (es_ES)<br />
    371                             <strong>modelo_id:</strong> Identificador de modelo en su Ibexrentacar<br />
    372                             <strong>include_css:</strong> Inclusión de CSS personalizado (Url)<br />
    373                             <br />
    374                             <strong>Ejemplo:</strong><br />
    375                             <span style="font-style:italic;">[ibexrentacar-modelo width="100%" include_jquery="0" locale="es_ES" modelo_id="94" include_css=""] </span>
    376                         </div>
    377                     </div>
    378                     <div style="display:block; float:left; width:32%;;background-color:#fafafa; border:1px solid #efefef; border-radius: 6px">
    379                         <div style="padding:10px; background-color: #fc992e"><span style="font-size: 14px; color:#FFF">Widget: <strong>Modelos destacados</strong></span></div>
    380                         <div style="padding:10px;">
    381                             Muestra una previa con los modelos marcados en su sistema como destacados.<br /><br />
    382                             <br />
    383                             <strong>Shortcode:</strong> [ibexrentacar-featured]<br />
    384                             <br />
    385                             <strong>Parámetros opcionales</strong><br /><br />
    386                             <strong>width:</strong> Tamaño del Widget (px o %)<br />
    387                             <strong>include_jquery:</strong> Inclusión de Jquery<br />
    388                             <strong>locale:</strong> Idioma (es_ES)<br />
    389                             <strong>featured_items:</strong> Número de modelos a visualizar (Por defecto: 4)<br />
    390                             <strong>include_css:</strong> Inclusión de CSS personalizado (Url)<br />
    391                             <br />
    392                             <strong>Ejemplo:</strong><br />
    393                             <span style="font-style:italic;">[ibexrentacar-featured width="100%" include_jquery="0" locale="es_ES" featured_items="3"] </span>
    394                         </div>
    395                     </div>
    396                     <div style="display:block; clear:both;"></div>
    397                 </div>
    398                 <div style="padding:10px; background-color: #fafafa;border:1px solid #efefef; "><strong style="font-size: 14px; color: #666">2. Copie y pegue el shortcode seleccionado en la página o entrada dónde quiera visualizar el widget.</strong></div>
    399                 <br />
    400                 <br />
    401                 <a href="javascript:view_example_page_shortcode()">Crear página con ejemplos de todos los Widgets disponibles</a><br /><br />
    402                 <div id="code_page_examples_shortcode" style="padding:10px; background-color: #fafafa;border:1px solid #efefef; display: none;">
    403                     <div style="padding:10px;">
    404                         <strong style="font-size: 14px; color: #666">Cree una nueva página e inserte el siguiente código fuente en modo de edición "Texto".</strong>
    405                         <br /><br />
    406                         <style type="text/css">
    407                             pre {
    408                                 font-size: 12px;
    409                                 line-height: 20px;
    410                                 width: 100%;
    411                                 overflow: auto;
    412                                 overflow-y: hidden;
    413                                 margin: 1px 0 10px;
    414                                 text-align:left;
    415                             }
    416                         </style>               
    417                        <pre><code>&lt;h1&gt;Buscador 1&lt;/h1&gt;
    418 Shortcode: &lt;strong&gt;ibexrentacar-buscador1&lt;/strong&gt;
    419 Ejemplo: &lt;code&gt;&lt;strong&gt;&amp;#91;ibexrentacar-buscador1 width="75%" include_jquery="0" locale="es_ES" include_css=""] &lt;/strong&gt;&lt;/code&gt;
    420 &lt;div align="center"&gt;[ibexrentacar-buscador1 width="75%" include_jquery="0" locale="es_ES" include_css=""]&lt;/div&gt;
    421 &lt;h1&gt;Buscador 2&lt;/h1&gt;
    422 Shortcode: &lt;strong&gt;ibexrentacar-buscador2&lt;/strong&gt;
    423 Ejemplo: &lt;code&gt;&lt;strong&gt;&amp;#91;ibexrentacar-buscador2 width="75%" include_jquery="0" locale="es_ES" include_css=""] &lt;/strong&gt;&lt;/code&gt;
    424 &lt;div align="center"&gt;[ibexrentacar-buscador2 width="75%" include_jquery="0" locale="es_ES" include_css=""]&lt;/div&gt;
    425 &lt;h1&gt;Buscador 3&lt;/h1&gt;
    426 Shortcode: &lt;strong&gt;ibexrentacar-buscador2&lt;/strong&gt;
    427 Ejemplo: &lt;code&gt;&lt;strong&gt;&amp;#91;ibexrentacar-buscador3 width="100%" include_jquery="0" locale="es_ES" include_css=""] &lt;/strong&gt;&lt;/code&gt;
    428 &lt;div align="center"&gt;[ibexrentacar-buscador3 width="100%" include_jquery="0" locale="es_ES" include_css=""]&lt;/div&gt;
    429 &lt;h1&gt;Flota&lt;/h1&gt;
    430 Shortcode: &lt;strong&gt;ibexrentacar-fleet&lt;/strong&gt;
    431 Ejemplo: &lt;code&gt;&lt;strong&gt;&amp;#91;ibexrentacar-fleet width="75%" include_jquery="0" locale="es_ES" result_view="list" include_css=""]&lt;/strong&gt;&lt;/code&gt;
    432 &lt;div align="center"&gt;[ibexrentacar-fleet width="75%" include_jquery="0" locale="es_ES" result_view="list" include_css=""]&lt;/div&gt;
    433 &lt;h1&gt;Modelo&lt;/h1&gt;
    434 Shortcode: &lt;strong&gt;ibexrentacar-modelo&lt;/strong&gt;
    435 Ejemplo: &lt;code&gt;&lt;strong&gt;&amp;#91;ibexrentacar-modelo width="100%" include_jquery="0" locale="es_ES" modelo_id="10" include_css=""] &lt;/strong&gt;&lt;/code&gt;
    436 &lt;div align="center"&gt;[ibexrentacar-modelo width="100%" include_jquery="0" locale="es_ES" modelo_id="10" include_css=""]&lt;/div&gt;</code>
    437                         </pre>
    438                     </div>
    439                 </div>
    440             </p>
    441             <? }?>
    442         </div>
    443         <? /*
    444         <p style="margin-top: 20px;">
    445             <input type="button" onclick="refresh_models_lst()" class="button button-primary" value="<?php esc_attr_e('Actualizar'); ?>" style="background:none; background-color:#fc992e; border-radius:5px; padding:0 20px 0 20px; font: bold 14px/18px Arial, Helvetica, sans-serif; color:#FFF;margin:0; border:none;" />
    446         </p>
    447         */?>
    448     <?php }
    449        
    450    
    451     function condition_box() {
    452     ?>
    453         <p>       
    454             <input type="checkbox" name="<?php echo $this->get_field_name( 'mbox_example_checkbox1' ); ?>" id="<?php echo $this->get_field_id( 'mbox_example_checkbox1' ); ?>" value="grapes" <?php echo isset($this->options['mbox_example_checkbox1']) ? 'checked' : '';?> />
    455             <label for="<?php echo $this->get_field_id( 'mbox_example_checkbox1' ); ?>"><?php _e( 'Grapes', 'ibexrentacar' ); ?></label>
    456             <br/>
    457            
    458            
    459             <input type="checkbox" name="<?php echo $this->get_field_name( 'mbox_example_checkbox2' ); ?>" id="<?php echo $this->get_field_id( 'mbox_example_checkbox2' ); ?>" value="lemons" <?php echo isset($this->options['mbox_example_checkbox2']) ? 'checked' : '';?> />
    460             <label for="<?php echo $this->get_field_id( 'mbox_example_checkbox2' ); ?>"><?php _e( 'Lemons', 'ibexrentacar' ); ?></label>
    461            
    462         </p>
    463     <?php }
    464 
    465 
    466     function do_settings_box() {
    467         do_settings_sections('example_settings_page');
    468     }
    469    
    470     /*
    471         WordPress settings rendering functions
    472        
    473         ONLY NEEDED if we are using wordpress to render our controls (do_settings_sections)
    474     */
    475                                                                      
    476                                                                      
    477     function main_section_text() {
    478         echo '<p>Some example inputs.</p>';
    479     }
    480    
    481     function render_example_text() {
    482         ?>
    483         <input id="example_text" style="width:50%;"  type="text" name="<?php echo $this->get_field_name( 'example_text' ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'example_text' ) ); ?>" />   
    484         <?php
    485     }
    486    
    487     function render_example_checkbox($args) {
    488         $id = 'ibexrentacar_options['.$args['id'].']';
    489         ?>
    490         <input name="<?php echo $id;?>" type="checkbox" value="<?php echo $args['value'];?>" <?php echo isset($this->options[$args['id']]) ? 'checked' : '';?> /> <?php echo " {$args['text']}"; ?> <br/>
    491         <?php
    492     }
    493    
    494 
    495 } // end class
    496 endif;
    497 z
    498 ?>
     1<?php if (!function_exists('is_admin')) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit();} include(trailingslashit(plugin_dir_path( __FILE__ )).'lib/irc/wp.php');include(trailingslashit(plugin_dir_path( __FILE__ )).'lib/irc/irc.php'); if (!class_exists("Ibexrentacar_Settings")) : class Ibexrentacar_Settings { var $pagehook, $page_id, $settings_field, $options; public static $default_settings = array('irc_apikey'=>'','irc_url'=>'','irc_wpml'=>'','irc_username'=>'','irc_password'=>'','ibexrentacar_token'=>'','irc_gmaps_key'=>''); var $ircview, $wplang, $wplanguages, $ircuser, $irccompany, $ircurl, $plugin_url_base, $plugin_url, $pluginfiles, $ws_setting, $is_ws_logged; function __construct(){ $this->page_id = 'ibexrentacar'; $this->settings_field = 'ibexrentacar_options'; $this->options = get_option($this->settings_field); add_action('admin_init', array($this,'admin_init'), 20); add_action('admin_menu', array($this, 'admin_menu'), 20); } function admin_init(){ if(isset($this->options['irc_apikey']) && $this->options['irc_apikey']!='')$dec = apidec($this->options['irc_apikey']); if(isset($dec[0]) && $dec[0]!='')$this->options['irc_url'] = $dec[0];if(isset($dec[1]) && $dec[1]!=''){ $this->options['irc_username'] = $dec[1];} register_setting($this->settings_field, $this->settings_field,array($this, 'sanitize_theme_options')); add_option($this->settings_field, Ibexrentacar_Settings::$default_settings); } function admin_menu() { $insert_params = false; $param_url = $this->get_field_value('irc_url'); $param_user = $this->get_field_value('irc_username'); $param_pass = $this->get_field_value('irc_password'); if($param_url!='' && $param_user!='' && $param_pass!='')$insert_params = true; if(!current_user_can('update_plugins'))return; $this->pagehook = add_menu_page( __('Ibexrentacar', 'ibexrentacar'), __('Ibexrentacar', 'ibexrentacar'), 'administrator', $this->page_id, array($this,'render'), plugins_url('/', __FILE__).'/img/icon4_16x16.png'); add_action('load-'.$this->pagehook, array( $this, 'metaboxes')); add_action("admin_print_scripts-$page", array($this, 'js_includes')); } protected function get_field_name($name){ return sprintf('%s[%s]', $this->settings_field, $name ); } protected function get_field_id($id){ return sprintf('%s[%s]', $this->settings_field, $id );} protected function get_field_value($key){ return $this->options[$key];} function metaboxes(){} function js_includes(){ wp_enqueue_script('postbox');} function irc_shortcodes(){ include($this->pluginfiles.'shortcode/shortcode.php');}  function irc_support(){ include($this->pluginfiles.'support/support.php');} function irc_docu(){ include($this->pluginfiles.'support/documentation.php');} function irc_company(){ include($this->pluginfiles.'irc/company.php');} function irc_account(){ include($this->pluginfiles.'irc/user.php');} function irc_sidebar(){ include($this->pluginfiles.'support/sidebar.php');} function irc_connection(){ include($this->pluginfiles.'irc/config.php');} function irc_sync(){include($this->pluginfiles.'import/sync.php');} function render() { global $wp_meta_boxes, $language_json, $irc_currency; $messages[1] = __('Ibexrentacar action taken.', 'ibexrentacar'); if(isset($_GET['message']) && (int) $_GET['message']){ $message = $messages[$_GET['message']]; $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);} $title = __('Ibexrentacar', 'ibexrentacar'); $decparams = apidec(esc_attr($this->get_field_value('irc_apikey'))); $pirckey = $this->get_field_value('irc_apikey'); $param_url = $this->get_field_value('irc_url'); $param_user = $this->get_field_value('irc_username'); $param_pass = $this->get_field_value('irc_password'); $param_wpml = $this->get_field_value('irc_wpml'); $param_gMapsKey = $this->get_field_value('irc_gmaps_key'); $this->plugin_url = plugins_url('/', __FILE__); $this->ws_setting = array('irc_apikey'=>$pirckey,'irc_url'=>$param_url,'irc_username'=>$param_user,'irc_password'=>$param_pass,'irc_wpml'=>$param_wpml,'irc_sincro'=>$param_sync, 'irc_gmaps_key'=>$param_gMapsKey); $this->ircview = 1; $irc_currency = "EUR"; $this->plugin_url_base = trailingslashit(plugin_dir_path( __FILE__ )); $this->pluginfiles = trailingslashit(plugin_dir_path( __FILE__ )).'lib/irc/frontend/'; $this->is_ws_logged = false; $this->ircurl = $param_url; $this->wplang = substr(get_locale(),0,2); $this->wplanguages = api_getDefaultLanguages($this->plugin_url); $param_sync = 'post'; $insert_params = false; if($pirckey==""){$param_url="";$param_user="";} if($pirckey!='' && $param_pass!='')$insert_params = true; wp_register_style('ircadminstyle', $this->plugin_url.'/lib/css/ircwp.css'); wp_enqueue_style('ircadminstyle'); /*Language*/ if(defined('ICL_LANGUAGE_CODE'))$param_wpml='yes'; if(!isset($this->wplanguages[$this->wplang]))$this->wplang = "en"; if(isset($param_wpml) && $param_wpml=='yes' && defined('ICL_LANGUAGE_CODE'))$this->wplang = ICL_LANGUAGE_CODE; if(isset($param_wpml) && $param_wpml=='yes' && defined('ICL_LANGUAGE_CODE'))$this->wplanguages = api_getLanguages(); define('IRC_LANGUAGE_CODE',$this->wplang); if(!defined('ICL_LANGUAGE_CODE'))$this->wplanguages = array($this->wplang => $this->wplanguages[$this->wplang]); define('WPLANGUAGES',$this->wplanguages); /*WS API*/ $session_check = ws_request("/models/session/check",$this->ws_setting,array("view_id" => $this->ircview)); $session_user = ws_request("/models/user/visibleRecords",$this->ws_setting,array("view_id" => $this->ircview, "username" => $param_user)); $session_company = ws_request("/models/company/visibleRecords",$this->ws_setting,array("view_id" => $this->ircview)); if(isset($session_check['ok']))$this->is_ws_logged = true; if(isset($session_user['items'][0]))$this->ircuser = $session_user['items'][0]; if(isset($session_company['items'][0]))$this->irccompany = $session_company['items'][0]; if(isset($this->irccompany['currency']) && $this->irccompany['currency']!='')$irc_currency = $this->irccompany['currency']; include(trailingslashit(plugin_dir_path( __FILE__ )).'lib/language/language.php'); include(trailingslashit(plugin_dir_path( __FILE__ )).'lib/irc/js.php'); add_meta_box('ibexrentacar-version',_irct("Opciones generales"), array( $this, 'irc_connection'), $this->pagehook, 'main', 'high'); add_meta_box('ibexrentacar-publi', 'Ibexrentacar.com', array($this, 'irc_sidebar'), $this->pagehook, 'sidebar', 'high'); add_meta_box('ibexrentacar-company', _irct("Datos de empresa"), array($this, 'irc_company'), $this->pagehook, 'company', 'high'); add_meta_box('ibexrentacar-user', _irct("Mi cuenta"), array($this, 'irc_account'), $this->pagehook, 'user', 'high'); add_meta_box('ibexrentacar-irc', _irct("Documentación"), array($this, 'irc_docu'), $this->pagehook, 'irc', 'high'); add_meta_box('ibexrentacar-support', _irct("Atención al cliente"), array($this, 'irc_support'), $this->pagehook, 'support', 'high'); add_meta_box('ibexrentacar-shortcode', _irct("Integración"), array($this, 'irc_shortcodes'), $this->pagehook, 'shortcodes', 'high'); add_meta_box('ibexrentacar-import', _irct("Importar"), array($this, 'irc_sync'), $this->pagehook, 'import', 'high');  include($this->pluginfiles.'irc/layout/head.php'); include($this->pluginfiles.'irc/layout/layout.php'); include($this->pluginfiles.'irc/layout/foot.php'); } } endif;?>
  • ibexrentacar/trunk/readme.txt

    r1430888 r1931166  
    11=== Ibexrentacar ===
    22Contributors: Ibexestudio
    3 Donate link: http://www.ibexrentacar.com
    4 Tags: ibexrentacar, rent a car, fleet, alquiler coches
     3Tags: ibexrentacar, rent a car, fleet, alquiler coches, car rental software
    54Requires at least: 3.6.1
    6 Tested up to: 4.5.2
    7 Stable tag: 4.5.2
    8 License: GPLv2 or later
    9 License URI: http://www.gnu.org/licenses/gpl-2.0.html
     5Tested up to: 4.9.8
     6Stable tag: 1.2
     7License: GPLv3
     8License URI: https://www.gnu.org/licenses/gpl-3.0.html
    109
    11 Convert your Wordpress blog into a full online booking system connected to your Ibexrentacar. Technology and innovation for your car rental company.
     10Turn your WordPress blog into a full online booking system connected to your Ibexrentacar. Technology and innovation for your car rental company.
    1211
    1312== Description ==
     
    1716= The best car rental software solutions =
    1817
    19 
    2018= Business intelligence =
    2119
    22 Obtain the data necessary to drive the set of strategies and relevant aspects to enhance your business. Ibexrentacar gives you the ability to have real time all the company information (Booking, contracts, billing, control fleet, stock control, management inputs and outputs warehouses, CRM client, etc..) To have all the information the moment and can make better decisions at moment.
     20Obtain the necessary data to drive the set of strategies and all the relevant aspects to enhance your business. Ibexrentacar provides you with information in real time (Booking, contracts, billing, fleet control, stock control, vehicle pickup and return management, warehouses, CRM client, etc..) so you'll make the best decisions.
    2321
    24 Web solution allows all your business in a coordinated single point, all bookings are stored in the center taking stock control and management of all administrative operations of your business on one site.
     22Our web solution allows you to run your business from a single point in a coordinated manner. All bookings are stored and updated, taking stock control and managing all administrative operations of your business from one site.
    2523
    2624= Online booking engine =
    2725
    28 Improve the strategy of your online marketing, evaluating the trends in their potential market to optimize their campaigns, promotions, coupons, widget integratable with booking engine. Strategies for more information of your potential market and give your customers better services for car rental.
     26Ibexrentacar widget is an embeddable booking engine that works with any website, it’s completely customizable and, following an user-centered design process, improves your client's user experience (UX). Engineered to improve your online marketing strategy, optimize your campaigns and maximize your profits by providing your customers with promotions on additional products, recommendations on vehicles and tracing each one of your sales, so you can analyze and boost your ROI.
    2927
    3028= Cloud, 24/7 =
    3129
    32 Management software 100% cloud computing, low cost platform and quick installation. A sevice 24/7 allowing you to be assured that your business is always in operation, with automatic updates and having its management program provided with new technologies in the market.
     30100% cloud computing management software, it is a low cost and quick installation platform. A 24/7 service ensures that your business is always up and running, it includes automatic updates and a management system provided with state-of-the-art technologies in the market.
    3331
    34 With Ibexrentacar has the ability to resize your software every time according to the needs of your business.
     32Ibexrentacar is a resizable platform according to the needs of your business.
    3533
    3634= Affiliates =
    3735
    38 Expand your car rental company, is not limited to an agency. With Ibexrentacar can connect with affiliates (hotels, travel agencies, tour operators) and with all online agents (brokers, search engines, social networking, mobile applications). Expand exponentially their sales channels. With widget integrable systems and XML Webservice can give your agents tools that will enhance your online sales .
     36Expand your car rental company, it doesn’t have to be limited to a single agency. Connect your Ibexrentacar with your affiliates (hotels, travel agencies, tour operators) and with all your online agents (brokers, search engines, social networking, mobile applications).
    3937
    40 You can create your own affiliate network, and manage your reservations you can control who and what sells each affiliate, at all times taking control of quotas and tariffs.
     38With our embedded widget and XML Webservice system, you will be providing your agents with the tools that will enhance your online sales.
     39
     40You can create your own affiliate network, manage your bookings and control who and what sells each affiliate, at any time, taking control of corresponding bonuses and fees.
    4141
    4242= Mobile APP =
    4343
    44 Ibexrentacar mobile app is not just a mobile booking engine, offers the possibility to provide more services to your customer. Enhance your experience by offering new features such as notification of arrival at the airport, the roadside assistance, information about local points of interest or save the position of your vehicle in a parking lot. Have a high visibility in the stores of Google and Apple, currently 30% of online bookings are already being made from mobile devices.
     44A mobile booking engine that provides your customers with several features to enhance their renting experience such as roadside assistance, local points of interest, save vehicle's position in a parking lot, notice of arrival at the airport, direct contact with you, etc.
    4545
    46 More information: [Ibexrentacar](http://www.ibexrentacar.com/en) 
    47 [TRY IT NOW](http://www.ibexrentacar.com/en/try-it-now-car-rental-software/) 
     46Currently 30% of online bookings are being made from mobile devices, do not miss the opportunity to increase your visibility by offering your own car rental mobile app in the Google and Apple Stores..
     47
     48More information: [Ibexrentacar](http://www.ibexrentacar.com/en)
     49 
     50[TRY IT NOW](http://www.ibexrentacar.com/en/try-it-now-car-rental-software/)
    4851
    4952== Installation ==
    5053
    51 This section describes how to install the plugin and get it working.
     54This section describes how to install the plugin and get it working. 
    5255
    53 1. Download the Ibexrentacar Wordpress Plugin
    54 2. Login to your wordpress dashboard. Select the plugin option in the sidebar menu. Click "add new", upload the Ibexrentacar Wordpress Plugin
    55 3. After installation, navigate to your plugin page and activate the Ibexrentacar Wordpress Plugin
    56 4. On the left sidebar menu, select Ibexrentacar. Authenticate your Ibexrentacar account using your login credientials.
     56= Automatic Installation =
    5757
    58 More information: [Ibexrentacar](http://www.ibexrentacar.com/en)
     58Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser. To do an automatic install of Ibexrentacar, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
    5959
    60 == Frequently Asked Questions ==
     60In the search field type "Ibexrentacar" and click Search Plugins. Once you've found our rental plugin you can view details about it, but most importantly, you can install it by simply clicking "Install Now". 
     61
     62= Manual Installation = 
     63
     64You can log in to your WordPress dashboard with an administrator user name and password.
     65
     661. Click on the Plugins icon in the menu on the left.
     672. Click on the "Add new" button at the top of the Plugins menu.
     683. Search for "Ibexrentacar" or Select the plugins option → add new. Click on add new and export the previously downloaded add-on.
     694. Click on "Install."
     705. When the message "Plugin successfully installed" appears, click on the "Activate Plugin" link.
     716. If these steps are carried out correctly, you will find a new Ibexrentacar section in your left sidebar.
     72
     73You can also download our Ibexrentacar plugin and upload it to your webserver via your favorite FTP application, to do so, log in to your WordPress dashboard with an administrator user name and password.
     74
     751. Download the Ibexrentacar add-on for WordPress.
     762. Upload the unzipped plugin folder to your WordPress plugin folder (wp-content / plugins).
     773. Go to WordPress and click on the Plugins icon in your left sidebar menu.
     784. Activate the add-on.
     795. If these steps are carried out correctly, you will find a new Ibexrentacar section in your left sidebar.
     80
     81More information: [Ibexrentacar](http://www.ibexrentacar.com/en)
     82
     83== Frequently Asked Questions ==
     84
     85= Can the Ibexrentacar Plugin be installed in several websites? =
     86
     87Ibexrentacar can be registered in all your websites and in those developed for your clients.
     88You will access to the associated content through your login username and password.
     89
     90= Can I use my current WordPress theme? =
     91
     92Yes! Ibexrentacar works as soon as it is installed with any WordPress theme.
     93
     94= Is it compatible with WordPress multisite installations? =
     95
     96Yes, it is fully compatible
     97
     98= Can I use more than one shortcode in the same page? =
     99
     100Yes! You can insert as many shortcodes as you want in your pages.
     101
     102= If there are modifications in my fleet, will WP ask for a new synchronisation? =
     103
     104Yes! Ibexrentacar plugin will detect and display any changes in your fleet and will also display a request for new synchronisation.
    61105
    62106= I have more questions, where can I get help? =
     
    64108We're happy to help. Check [Ibexrentacar](http://www.ibexrentacar.com/en) for more information or post a question in the support tab within your ibexrentacar panel.
    65109
    66 More information: [Ibexrentacar](http://www.ibexrentacar.com/en) 
     110More information: [Ibexrentacar](http://www.ibexrentacar.com/en)
    67111
    68112== Screenshots ==
    69113
    70 1. screenshot-1.png
    71 2. screenshot-2.png
    72 3. screenshot-3.png
    73 4. screenshot-4.png
    74 5. screenshot-5.png
     1141. Shortcode Generator Preview
     1152. Import Fleet Preview
     1163. IRC connection
     1174. Search Engine Preview
     1185. Model Search Engine Preview
    75119
    76120== Changelog ==
    77121
    78 = 1.0 =
     122= 1.1 =
     123* Api connection.
     124* New shortcodes available.
    79125
    80 * Api connection.
    81 * Integration shortcodes.
     126== 1.2 ==
    82127
    83 = 1.1 =
    84 
    85 * New shortcodes available.
     128* Fix - Fix shortcode generator display.
     129* Fix - Added IRC connection.
     130* Fix - Added translations
  • ibexrentacar/trunk/uninstall.php

    r1430771 r1931166  
    1 <?php
    2 if (!defined('WP_UNINSTALL_PLUGIN')) {
    3     header('Status: 403 Forbidden');
    4     header('HTTP/1.1 403 Forbidden');
    5     exit();
    6 }
    7 
    8 
    9 if ( !is_user_logged_in() )
    10     wp_die( 'You must be logged in to run this script.' );
    11 
    12 if ( !current_user_can( 'install_plugins' ) )
    13     wp_die( 'You do not have permission to run this script.' );
    14 
    15 
    16 // Enter our plugin uninstall script below
    17 ?>
     1<?php if (!defined('WP_UNINSTALL_PLUGIN')) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit();}if(!is_user_logged_in())wp_die( 'You must be logged in to run this script.');if(!current_user_can('install_plugins'))wp_die( 'You do not have permission to run this script.');?>
Note: See TracChangeset for help on using the changeset viewer.