Plugin Directory

Changeset 1599538


Ignore:
Timestamp:
02/20/2017 08:47:43 AM (9 years ago)
Author:
DeusTron
Message:

Version 1.2.3

Location:
mpcx-accordion/trunk
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • mpcx-accordion/trunk/admin/delete.php

    r1541458 r1599538  
    1212if ( $id !== 0 ) {
    1313    unset( $accordions[ $id ] );
    14     update_option( 'mpcx_accordion', json_encode( $accordions ) );
     14    update_option( 'mpcx_accordion', $accordions );
    1515}
    1616
  • mpcx-accordion/trunk/admin/edit.php

    r1546646 r1599538  
    1111
    1212if ( $id === 0 ) {
    13     $id  = 1 + (int) $accordions[0]['index'];
     13    $id  = 1 + (int) $accordions['index'];
    1414    $new = true;
    1515}
     
    1717if ( isset( $_POST['submit'] ) === true ) {
    1818    if ( isset( $_POST['index'] ) === true ) {
    19         $accordions[0]['index'] = $_POST['index'];
     19        $accordions['index'] = $_POST['index'];
    2020    }
    2121    if ( isset( $_POST['headline'] ) === true && is_array( $_POST['text'] ) === true ) {
     
    3232    $accordions[ $id ]['title'] = stripslashes( $_POST['title'] );
    3333    $accordions[ $id ]['open']  = stripslashes( $_POST['open'] );
    34     update_option( 'mpcx_accordion', json_encode( $accordions ) );
     34    update_option( 'mpcx_accordion', $accordions );
    3535    echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The changes are saved.', 'mpcx-accordion' ) . '</p></div>';
    3636}
  • mpcx-accordion/trunk/admin/list.php

    r1541458 r1599538  
    3232        </thead>
    3333        <tbody>
    34         <?php foreach ( $accordions as $key => $accordion ): ?>
    35             <?php if ( $key === 0 ) {
    36                 continue;
    37             } ?>
     34        <?php
     35            for ( $key = 1; $key <= $accordions['index']; $key++ ) {
     36                if ( isset( $accordions[ $key ]) === false ) {
     37                    continue;
     38                }
     39                $accordion = $accordions[ $key ];
     40        ?>
    3841            <tr>
    3942                <td class="column-title column-primary">
     
    5760                </td>
    5861            </tr>
    59         <?php endforeach; ?>
     62        <?php
     63            }
     64        ?>
    6065        </tbody>
    6166    </table>
  • mpcx-accordion/trunk/admin/options.php

    r1541458 r1599538  
    88defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
    99
    10 $accordions = json_decode( get_option( 'mpcx_accordion' ), true );
     10$accordions = get_option( 'mpcx_accordion' );
    1111
    1212if ( $accordions === null ) {
    13     $accordions = array( 0 => array( 'version' => '1.2.0' ) );
     13    $accordions = array( 'version' => MPCX_ACCORDION_VERSION );
    1414}
    1515
  • mpcx-accordion/trunk/mpcx-accordion.php

    r1546646 r1599538  
    99 * Plugin URI:        https://github.com/tronsha/wp-accordion-plugin
    1010 * Description:       Just an Accordion Plugin.
    11  * Version:           1.2.2
     11 * Version:           1.2.3
    1212 * Author:            Stefan Hüsges
    1313 * Author URI:        http://www.mpcx.net/
     
    2121defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
    2222
    23 define( 'MPCX_ACCORDION_VERSION', '1.2.2' );
     23define( 'MPCX_ACCORDION_VERSION', '1.2.3' );
    2424
    25 load_plugin_textdomain( 'mpcx-accordion', false, dirname( plugin_basename( __FILE__ ) ) . '/localization' );
     25load_plugin_textdomain( 'mpcx-accordion', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
    2626
    2727register_activation_hook(
    2828    __FILE__,
    2929    function () {
    30         add_option( 'mpcx_accordion', json_encode( array( 0 => array( 'version' => MPCX_ACCORDION_VERSION ) ) ) );
     30        add_option( 'mpcx_accordion', array( 'version' => MPCX_ACCORDION_VERSION ) );
    3131    }
     32);
     33
     34add_action(
     35    'upgrader_process_complete',
     36    function ( $object, $options ) {
     37        if ( $options['action'] === 'update' && $options['type'] === 'plugin' ) {
     38            if ( in_array( plugin_basename( __FILE__ ), $options['plugins'] ) === true ) {
     39                include plugin_dir_path( __FILE__ ) . 'update.php';
     40            }
     41        }
     42    },
     43    10,
     44    2
    3245);
    3346
     
    8295        function ( $att = array(), $content = null ) {
    8396            if ( isset( $att['id'] ) === true && $att['id'] > 0 ) {
    84                 $accordion = json_decode( get_option( 'mpcx_accordion' ), true );
     97                $accordion = get_option( 'mpcx_accordion' );
    8598                $content   = '';
    8699                $first     = true;
     
    92105                $content = do_shortcode( $content );
    93106            }
    94             return '<div class="accordion"' . ( intval( $att['id'] ) > 0 ? ' id="accordion-' . $att['id'] . '"' : '' ) . '>' . $content . '</div>';
     107
     108            return '<div class="accordion no-js"' . ( intval( $att['id'] ) > 0 ? ' id="accordion-' . $att['id'] . '"' : '' ) . '>' . $content . '</div>';
    95109        }
    96110    );
  • mpcx-accordion/trunk/public/css/accordion.min.css

    r1543570 r1599538  
    1 .accordion>h2,.accordion>h3,.accordion>h4,.accordion>h5,.accordion>h6,.accordion>strong{background:#0e0e0e;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7D7E7D',endColorstr='#0E0E0E',GradientType=0);border-radius:3px;color:#fff;cursor:pointer;display:block;margin:4px 0 0 0 !important;max-width:100%;padding:4px 8px !important}.accordion .arrow-icons{font-family:dashicons;font-size:75%;font-style:normal;font-weight:400;margin-right:2px}.accordion>div{display:block;height:0;margin:4px 0 0 0;max-width:100%;padding:0 8px;overflow:hidden}html.no-js .accordion>div{height:auto}
     1.accordion>h2,.accordion>h3,.accordion>h4,.accordion>h5,.accordion>h6,.accordion>strong{background:#0e0e0e;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7D7E7D',endColorstr='#0E0E0E',GradientType=0);border-radius:3px;color:#fff;cursor:pointer;display:block;margin:4px 0 0 0 !important;max-width:100%;padding:4px 8px !important}.accordion .arrow-icons{font-family:dashicons;font-size:75%;font-style:normal;font-weight:400;margin-right:2px}.accordion>div{display:block;height:0;margin:4px 0 0 0;max-width:100%;padding:0 8px;overflow:hidden}.accordion.no-js>div{height:auto}
  • mpcx-accordion/trunk/public/js/accordion.min.js

    r1541458 r1599538  
    1 jQuery(document).ready(function(){var b=jQuery;var a=b(".accordion");a.children("h2, h3, h4, h5, h6, strong").each(function(){var d=b(this);var c=d.next("div");if("#"+d.attr("data-hash")===window.location.hash||(c.hasClass("open")===true&&(window.location.hash===""||window.location.hash==="#!"))){d.prepend('<span class="arrow-icons dashicons-arrow-down"></span>');c.addClass("open").css("height","auto")}else{d.prepend('<span class="arrow-icons dashicons-arrow-right"></span>');c.removeClass("open").css("height","0")}d.bind("click",function(){var e=d.next("div");if(e.hasClass("open")===false){if(d.attr("data-hash")!==undefined){window.location.hash=d.attr("data-hash")}a.children("div.open").each(function(){b(this).animate({height:0},500);b(this).removeClass("open")});a.find(".dashicons-arrow-down").each(function(){b(this).removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")});e.css("height","auto");var f=e.height();e.css("height","0");e.addClass("open");e.animate({height:f},500,function(){e.css("height","auto");if(d.length&&a.hasClass("scroll")){var g=6;if(b("#wpadminbar").length){g+=parseInt(b("html").css("margin-top"))}b("html,body").animate({scrollTop:(d.offset().top-g)},250)}});d.find(".arrow-icons").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down")}else{if(d.attr("data-hash")!==undefined){window.location.hash="!"}e.removeClass("open");e.animate({height:0},500);d.find(".arrow-icons").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")}})})});
     1jQuery(document).ready(function(){var b=jQuery;var a=b(".accordion");a.removeClass("no-js");a.children("h2, h3, h4, h5, h6, strong").each(function(){var d=b(this);var c=d.next("div");if("#"+d.attr("data-hash")===window.location.hash||(c.hasClass("open")===true&&(window.location.hash===""||window.location.hash==="#!"))){d.prepend('<span class="arrow-icons dashicons-arrow-down"></span>');c.addClass("open").css("height","auto")}else{d.prepend('<span class="arrow-icons dashicons-arrow-right"></span>');c.removeClass("open").css("height","0")}d.bind("click",function(){var e=d.next("div");if(e.hasClass("open")===false){if(d.attr("data-hash")!==undefined){window.location.hash=d.attr("data-hash")}a.children("div.open").each(function(){b(this).animate({height:0},500);b(this).removeClass("open")});a.find(".dashicons-arrow-down").each(function(){b(this).removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")});e.css("height","auto");var f=e.height();e.css("height","0");e.addClass("open");e.animate({height:f},500,function(){e.css("height","auto");if(d.length&&a.hasClass("scroll")){var g=6;if(b("#wpadminbar").length){g+=parseInt(b("html").css("margin-top"))}b("html,body").animate({scrollTop:(d.offset().top-g)},250)}});d.find(".arrow-icons").removeClass("dashicons-arrow-right").addClass("dashicons-arrow-down")}else{if(d.attr("data-hash")!==undefined){window.location.hash="!"}e.removeClass("open");e.animate({height:0},500);d.find(".arrow-icons").removeClass("dashicons-arrow-down").addClass("dashicons-arrow-right")}})})});
  • mpcx-accordion/trunk/readme.txt

    r1546646 r1599538  
    22Contributors: DeusTron
    33Donate link: http://www.mpcx.net/wordpress/donate/
    4 Tags: accordion, jquery, shortcode, plugin
     4Tags: accordion, jquery, shortcode, javascript, js, plugin
    55Requires at least: 4.0
    66Tested up to: 4.7
    7 Stable tag: 1.2.2
     7Stable tag: 1.2.3
    88License: MIT
    99License URI: https://raw.githubusercontent.com/tronsha/wp-accordion-plugin/master/LICENSE
Note: See TracChangeset for help on using the changeset viewer.