Plugin Directory

Changeset 767481


Ignore:
Timestamp:
09/05/2013 05:38:12 PM (13 years ago)
Author:
matthewbe
Message:

Bugfix

Location:
simple-language-switcher/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • simple-language-switcher/trunk/admin/options-page.php

    r721115 r767481  
    55    die;
    66}
     7/*
    78if ( !current_user_can( 'manage_options' ) )  {
    89    wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
    910}
     11*/
    1012
    1113class SimpleLanguageSwitcher_OptionsPage {
     
    2224   
    2325    function init_options() {
    24         $this->write_file_langs( array() );
    25         $options = update_option( 'sls_plugin_langs', array() );
    26        
    27         $this->write_file_links( array() );
    28         $options = update_option( 'sls_plugin_linking', array() );
     26        $arr_langs = $this->get_array_langs();
     27        if( empty( $arr_langs ) ) {
     28            $this->write_file_langs( array() );
     29            $options = update_option( 'sls_plugin_langs', array() );
     30        }
     31        else {
     32            $arr_langs = get_option( 'sls_plugin_langs_backup' );
     33            if( !empty( $arr_langs ) ) $this->write_file_langs( $arr_langs );
     34        }
     35       
     36        $arr_links = $this->get_array_links();
     37        if( empty( $arr_links ) ) {
     38            $this->write_file_links( array() );
     39            $options = update_option( 'sls_plugin_linking', array() );
     40        }
     41        else {
     42            $arr_links = get_option( 'sls_plugin_linking_backup' );
     43            if( !empty( $arr_links ) ) $this->write_file_links( $arr_links );
     44        }
    2945       
    3046        $options = get_option( 'sls_plugin_options' );
     
    420436    function write_file_langs($arr_langs) {
    421437        $this->write_file( $arr_langs, SLS_PATH . 'my-langs.php', 'write_file_langs_data' );
     438        update_option( 'sls_plugin_langs_backup', $arr_langs );
    422439    }
    423440   
     
    436453    function write_file_links($arr_links) {
    437454        $this->write_file( $arr_links, SLS_PATH . 'links.php', 'write_file_links_data' );
     455        update_option( 'sls_plugin_linking_backup', $arr_links );
    438456    }
    439457   
  • simple-language-switcher/trunk/readme.txt

    r721122 r767481  
    4141== Changelog ==
    4242
     43
     44= 1.1 =
     45* Bugfix
     46
    4347= 1.0 =
    4448* init
  • simple-language-switcher/trunk/simple-language-switcher.php

    r721115 r767481  
    22/*
    33Plugin Name: Simple Language Switcher
    4 Version: 1.0
     4Version: 1.1
    55Plugin URI: http://www.mendoweb.be/blog/wordpress-plugin-simple-language-switcher/
    66Description: A simple and lightweight language switcher.
Note: See TracChangeset for help on using the changeset viewer.