wordpress/wp-content/plugins/kt-tinymce-color-grid/index.php
/**
         * Update procedures for export/import file
         * @since 1.9
         * @param array $options passed by reference
         */
Update procedures for export/import file
@since 1.9
@param array $options passed by reference
Update procedures for export / import file @since 1 . 9 @param array $options passed by reference
protected function update_import(&$options) {
            $version = $options[self::ACTIVE_VERSION];
            unset($options[self::ACTIVE_VERSION]);
            while ($version != KT_CENTRAL_PALETTE) {
                switch ($version) {
                    case 19:
                    case 191:
                    case 192:
                    case 193:
                        $version = 1100;
                        $key = 'kt_color_grid_palette';
                        if (!is_array($options[$key])) {
                            break;
                        }
                        $palette = array();
                        foreach ($options[$key] as $set) {
                            $palette[] = array($set[0], 100, $set[1]);
                        }
                        $options[$key] = $palette;
                        break;
                    case 1100:
                    case 1110:
                    case '1.11':
                    case '1.12':
                    case '1.12.1':
                    case '1.12.2':
                    case '1.12.3':
                    case '1.12.4':
                    case '1.12.5':
                    case '1.12.6':
                        $version = '1.13';
                        $index = 0;
                        $key = 'kt_color_grid_palette';
                        if (!is_array($options[$key])) {
                            break;
                        }
                        $palette = array();
                        foreach ($options[$key] as $set) {
                            list($color, $alpha, $name) = $set;
                            $color = '#' . ltrim($color, '#');
                            $index++;
                            $status = self::COLOR_ACTIVE;
                            $palette[] = compact('color', 'alpha', 'name', 'index', 'status');
                        }
                        $options[$key] = $palette;
                        $alpha = 'kt_color_grid_alpha';
                        if (isset($options[$alpha]) && $options[$alpha]) {
                            $options['kt_color_grid_oceanwp_alpha'] = 1;
                            $options['kt_color_grid_gp_alpha'] = 1;
                        }
                        unset($options[$alpha]);
                        break;
                    case '1.13':
                    case '1.13.1':
                    case '1.13.2':
                    case '1.13.3':
                    case '1.13.4':
                    case '1.13.5':
                    case '1.13.6':
                    case '1.13.7':
                    case '1.13.8':
                    case '1.13.9':
                    case '1.13.10':
                    case '1.13.11':
                        $version = '1.14';
                        $key = 'kt_color_grid_palette';
                        if (!is_array($options[$key])) {
                            break;
                        }
                        for ($i = 0, $l = count($options[$key]); $i < $l; $i++) {
                            $options[$key][$i]['hex'] = $options[$key][$i]['color'];
                            $options[$key][$i]['type'] = 1; 
                        }
                        break;
                    case '1.14':
                    case '1.14.1':
                    case '1.14.2':
                    case '1.14.3':
                    case '1.14.4':
                    case '1.14.5':
                        $version = '1.14.6';
                        $key = 'kt_color_grid_astra_theme';
                        $options[$key] = '1';
                        break;
                    case '1.14.6':
                    case '1.14.7':
                        $version = '1.15';
                        $key = 'kt_color_grid_palette';
                        if (!is_array($options[$key])) {
                            break;
                        }
                        for ($i = 0, $l = count($options[$key]); $i < $l; $i++) {
                            if (!$options[$key][$i]) {
                                continue;
                            }
                            $options[$key][$i]['variable'] = $this->get_css_class_name($options[$key][$i]);
                        }
                        break;
                    default:
                        $version = KT_CENTRAL_PALETTE;
                }
            }
        }
protected function update_import ( & $ options ) { $ version = $ options [ self :: ACTIVE_VERSION ] ; unset ( $ options [ self :: ACTIVE_VERSION ] ) ; while ( $ version != KT_CENTRAL_PALETTE ) { switch ( $ version ) { case 19 : case 191 : case 192 : case 193 : $ version = 1100 ; $ key = 'kt_color_grid_palette' ; if ( ! is_array ( $ options [ $ key ] ) ) { break ; } $ palette = array ( ) ; foreach ( $ options [ $ key ] as $ set ) { $ palette [ ] = array ( $ set [ 0 ] , 100 , $ set [ 1 ] ) ; } $ options [ $ key ] = $ palette ; break ; case 1100 : case 1110 : case '1.11' : case '1.12' : case '1.12.1' : case '1.12.2' : case '1.12.3' : case '1.12.4' : case '1.12.5' : case '1.12.6' : $ version = '1.13' ; $ index = 0 ; $ key = 'kt_color_grid_palette' ; if ( ! is_array ( $ options [ $ key ] ) ) { break ; } $ palette = array ( ) ; foreach ( $ options [ $ key ] as $ set ) { list ( $ color , $ alpha , $ name ) = $ set ; $ color = '#' . ltrim ( $ color , '#' ) ; $ index ++ ; $ status = self :: COLOR_ACTIVE ; $ palette [ ] = compact ( 'color' , 'alpha' , 'name' , 'index' , 'status' ) ; } $ options [ $ key ] = $ palette ; $ alpha = 'kt_color_grid_alpha' ; if ( isset ( $ options [ $ alpha ] ) && $ options [ $ alpha ] ) { $ options [ 'kt_color_grid_oceanwp_alpha' ] = 1 ; $ options [ 'kt_color_grid_gp_alpha' ] = 1 ; } unset ( $ options [ $ alpha ] ) ; break ; case '1.13' : case '1.13.1' : case '1.13.2' : case '1.13.3' : case '1.13.4' : case '1.13.5' : case '1.13.6' : case '1.13.7' : case '1.13.8' : case '1.13.9' : case '1.13.10' : case '1.13.11' : $ version = '1.14' ; $ key = 'kt_color_grid_palette' ; if ( ! is_array ( $ options [ $ key ] ) ) { break ; } for ( $ i = 0 , $ l = count ( $ options [ $ key ] ) ; $ i < $ l ; $ i ++ ) { $ options [ $ key ] [ $ i ] [ 'hex' ] = $ options [ $ key ] [ $ i ] [ 'color' ] ; $ options [ $ key ] [ $ i ] [ 'type' ] = 1 ; } break ; case '1.14' : case '1.14.1' : case '1.14.2' : case '1.14.3' : case '1.14.4' : case '1.14.5' : $ version = '1.14.6' ; $ key = 'kt_color_grid_astra_theme' ; $ options [ $ key ] = '1' ; break ; case '1.14.6' : case '1.14.7' : $ version = '1.15' ; $ key = 'kt_color_grid_palette' ; if ( ! is_array ( $ options [ $ key ] ) ) { break ; } for ( $ i = 0 , $ l = count ( $ options [ $ key ] ) ; $ i < $ l ; $ i ++ ) { if ( ! $ options [ $ key ] [ $ i ] ) { continue ; } $ options [ $ key ] [ $ i ] [ 'variable' ] = $ this -> get_css_class_name ( $ options [ $ key ] [ $ i ] ) ; } break ; default : $ version = KT_CENTRAL_PALETTE ; } } }
Update procedures for export/import file
 @since 1.9
 @param array $options passed by reference
Update procedures for export / import file @since 1 . 9 @param array $options passed by reference
// hex;