wp/wp-content/plugins/option-tree/includes/ot-functions-settings-page.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 11 bf1778c34b9a
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
    31         
    31         
    32         /* description */
    32         /* description */
    33         echo '<div class="description">';
    33         echo '<div class="description">';
    34           
    34           
    35           echo '<h4>'. __( 'Warning!', 'option-tree' ) . '</h4>';
    35           echo '<h4>'. __( 'Warning!', 'option-tree' ) . '</h4>';
    36           echo '<p class="warning">' . sprintf( __( 'Go to the %s page if you want to save data, this page is for adding settings.', 'option-tree' ), '<a href="' . get_admin_url( $blog_id, 'themes.php?page=ot-theme-options' ) . '"><code>Appearance->Theme Options</code></a>' ) . '</p>';
    36           echo '<p class="warning">' . sprintf( __( 'Go to the %s page if you want to save data, this page is for adding settings.', 'option-tree' ), '<a href="' . get_admin_url( $blog_id, apply_filters( 'ot_theme_options_parent_slug', 'themes.php' ) . '?page=' . apply_filters( 'ot_theme_options_menu_slug', 'ot-theme-options' ) ) . '"><code>Appearance->Theme Options</code></a>' ) . '</p>';
    37           echo '<p class="warning">' . sprintf( __( 'If you\'re unsure or not completely positive that you should be editing these settings, you should read the %s first.', 'option-tree' ), '<a href="' . get_admin_url( $blog_id, 'admin.php?page=ot-documentation' ) . '"><code>OptionTree->Documentation</code></a>' ) . '</p>';
    37           echo '<p class="warning">' . sprintf( __( 'If you\'re unsure or not completely positive that you should be editing these settings, you should read the %s first.', 'option-tree' ), '<a href="' . get_admin_url( $blog_id, 'admin.php?page=ot-documentation' ) . '"><code>OptionTree->Documentation</code></a>' ) . '</p>';
    38           echo '<h4>'. __( 'Things could break or be improperly displayed to the end-user if you do one of the following:', 'option-tree' ) . '</h4>';
    38           echo '<h4>'. __( 'Things could break or be improperly displayed to the end-user if you do one of the following:', 'option-tree' ) . '</h4>';
    39           echo '<p class="warning">' . __( 'Give two sections the same ID, give two settings the same ID, give two contextual help content areas the same ID, don\'t create any settings, or have a section at the end of the settings list.', 'option-tree' ) . '</p>';
    39           echo '<p class="warning">' . __( 'Give two sections the same ID, give two settings the same ID, give two contextual help content areas the same ID, don\'t create any settings, or have a section at the end of the settings list.', 'option-tree' ) . '</p>';
    40           echo '<p>' . __( 'You can create as many settings as your project requires and use them how you see fit. When you add a setting here, it will be available on the Theme Options page for use in your theme. To separate your settings into sections, click the "Add Section" button, fill in the input fields, and a new navigation menu item will be created.', 'option-tree' ) . '</p>';
    40           echo '<p>' . __( 'You can create as many settings as your project requires and use them how you see fit. When you add a setting here, it will be available on the Theme Options page for use in your theme. To separate your settings into sections, click the "Add Section" button, fill in the input fields, and a new navigation menu item will be created.', 'option-tree' ) . '</p>';
    41           echo '<p>' . __( 'All of the settings can be sorted and rearranged to your liking with Drag & Drop. Don\'t worry about the order in which you create your settings, you can always reorder them.', 'option-tree' ) . '</p>';
    41           echo '<p>' . __( 'All of the settings can be sorted and rearranged to your liking with Drag & Drop. Don\'t worry about the order in which you create your settings, you can always reorder them.', 'option-tree' ) . '</p>';
    42           
    42           
    43         echo '</div>';
    43         echo '</div>';
    44         
    44         
    45         /* get the saved settings */
    45         /* get the saved settings */
    46         $settings = get_option( 'option_tree_settings' );
    46         $settings = get_option( ot_settings_id() );
    47 
    47 
    48         /* wrap settings array */
    48         /* wrap settings array */
    49         echo '<div class="format-setting-inner">';
    49         echo '<div class="format-setting-inner">';
    50           
    50           
    51           /* set count to zero */
    51           /* set count to zero */
    52           $count = 0;
    52           $count = 0;
    53   
    53   
    54           /* loop through each section and its settings */
    54           /* loop through each section and its settings */
    55           echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_list" data-name="option_tree_settings[settings]">';
    55           echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_list" data-name="' . ot_settings_id() . '[settings]">';
    56           
    56           
    57           if ( isset( $settings['sections'] ) ) {
    57           if ( isset( $settings['sections'] ) ) {
    58           
    58           
    59             foreach( $settings['sections'] as $section ) {
    59             foreach( $settings['sections'] as $section ) {
    60               
    60               
    61               /* section */
    61               /* section */
    62               echo '<li class="' . ( $count == 0 ? 'ui-state-disabled' : 'ui-state-default' ) . ' list-section">' . ot_sections_view( 'option_tree_settings[sections]', $count, $section ) . '</li>';
    62               echo '<li class="' . ( $count == 0 ? 'ui-state-disabled' : 'ui-state-default' ) . ' list-section">' . ot_sections_view( ot_settings_id() . '[sections]', $count, $section ) . '</li>';
    63               
    63               
    64               /* increment item count */
    64               /* increment item count */
    65               $count++;
    65               $count++;
    66               
    66               
    67               /* settings in this section */
    67               /* settings in this section */
    69                 
    69                 
    70                 foreach( $settings['settings'] as $setting ) {
    70                 foreach( $settings['settings'] as $setting ) {
    71                   
    71                   
    72                   if ( isset( $setting['section'] ) && $setting['section'] == $section['id'] ) {
    72                   if ( isset( $setting['section'] ) && $setting['section'] == $section['id'] ) {
    73                     
    73                     
    74                     echo '<li class="ui-state-default list-setting">' . ot_settings_view( 'option_tree_settings[settings]', $count, $setting ) . '</li>';
    74                     echo '<li class="ui-state-default list-setting">' . ot_settings_view( ot_settings_id() . '[settings]', $count, $setting ) . '</li>';
    75                     
    75                     
    76                     /* increment item count */
    76                     /* increment item count */
    77                     $count++;
    77                     $count++;
    78                     
    78                     
    79                   }
    79                   }
    87           }
    87           }
    88           
    88           
    89           echo '</ul>';
    89           echo '</ul>';
    90           
    90           
    91           /* buttons */
    91           /* buttons */
    92           echo '<a href="javascript:void(0);" class="option-tree-section-add option-tree-ui-button hug-left">' . __( 'Add Section', 'option-tree' ) . '</a>';
    92           echo '<a href="javascript:void(0);" class="option-tree-section-add option-tree-ui-button button hug-left">' . __( 'Add Section', 'option-tree' ) . '</a>';
    93           echo '<a href="javascript:void(0);" class="option-tree-setting-add option-tree-ui-button">' . __( 'Add Setting', 'option-tree' ) . '</a>';
    93           echo '<a href="javascript:void(0);" class="option-tree-setting-add option-tree-ui-button button">' . __( 'Add Setting', 'option-tree' ) . '</a>';
    94           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Save Changes', 'option-tree' ) . '</button>';
    94           echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __( 'Save Changes', 'option-tree' ) . '</button>';
    95           
    95           
    96           /* sidebar textarea */
    96           /* sidebar textarea */
    97           echo '
    97           echo '
    98           <div class="format-setting-label" id="contextual-help-label">
    98           <div class="format-setting-label" id="contextual-help-label">
    99             <h3 class="label">' . __( 'Contextual Help', 'option-tree' ) . '</h3>
    99             <h3 class="label">' . __( 'Contextual Help', 'option-tree' ) . '</h3>
   100           </div>
   100           </div>
   101           <div class="format-settings" id="contextual-help-setting">
   101           <div class="format-settings" id="contextual-help-setting">
   102             <div class="format-setting type-textarea no-desc">
   102             <div class="format-setting type-textarea no-desc">
   103               <div class="description"><strong>' . __( 'Contextual Help Sidebar', 'option-tree' ) . '</strong>: ' . __( 'If you decide to add contextual help to the Theme Option page, enter the optional "Sidebar" HTML here. This would be an extremely useful place to add links to your themes documentation or support forum. Only after you\'ve added some content below will this display to the user.', 'option-tree' ) . '</div>
   103               <div class="description"><strong>' . __( 'Contextual Help Sidebar', 'option-tree' ) . '</strong>: ' . __( 'If you decide to add contextual help to the Theme Option page, enter the optional "Sidebar" HTML here. This would be an extremely useful place to add links to your themes documentation or support forum. Only after you\'ve added some content below will this display to the user.', 'option-tree' ) . '</div>
   104               <div class="format-setting-inner">
   104               <div class="format-setting-inner">
   105                 <textarea class="textarea" rows="10" cols="40" name="option_tree_settings[contextual_help][sidebar]">' . ( isset( $settings['contextual_help']['sidebar'] ) ? esc_html( $settings['contextual_help']['sidebar'] ) : '' ) . '</textarea>
   105                 <textarea class="textarea" rows="10" cols="40" name="' . ot_settings_id(). '[contextual_help][sidebar]">' . ( isset( $settings['contextual_help']['sidebar'] ) ? esc_html( $settings['contextual_help']['sidebar'] ) : '' ) . '</textarea>
   106               </div>
   106               </div>
   107             </div>
   107             </div>
   108           </div>';
   108           </div>';
   109           
   109           
   110           /* set count to zero */
   110           /* set count to zero */
   111           $count = 0;
   111           $count = 0;
   112           
   112           
   113           /* loop through each contextual_help content section */
   113           /* loop through each contextual_help content section */
   114           echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_help" data-name="option_tree_settings[contextual_help][content]">';
   114           echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_help" data-name="' . ot_settings_id(). '[contextual_help][content]">';
   115           
   115           
   116           if ( isset( $settings['contextual_help']['content'] ) ) {
   116           if ( isset( $settings['contextual_help']['content'] ) ) {
   117           
   117           
   118             foreach( $settings['contextual_help']['content'] as $content ) {
   118             foreach( $settings['contextual_help']['content'] as $content ) {
   119               
   119               
   120               /* content */
   120               /* content */
   121               echo '<li class="ui-state-default list-contextual-help">' . ot_contextual_help_view( 'option_tree_settings[contextual_help][content]',  $count, $content ) . '</li>';
   121               echo '<li class="ui-state-default list-contextual-help">' . ot_contextual_help_view( ot_settings_id() . '[contextual_help][content]',  $count, $content ) . '</li>';
   122               
   122               
   123               /* increment content count */
   123               /* increment content count */
   124               $count++;
   124               $count++;
   125 
   125 
   126             }
   126             }
   127             
   127             
   128           }
   128           }
   129           
   129           
   130           echo '</ul>';
   130           echo '</ul>';
   131 
   131 
   132           echo '<a href="javascript:void(0);" class="option-tree-help-add option-tree-ui-button hug-left">' . __( 'Add Contextual Help Content', 'option-tree' ) . '</a>';
   132           echo '<a href="javascript:void(0);" class="option-tree-help-add option-tree-ui-button button hug-left">' . __( 'Add Contextual Help Content', 'option-tree' ) . '</a>';
   133           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Save Changes', 'option-tree' ) . '</button>';
   133           echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __( 'Save Changes', 'option-tree' ) . '</button>';
   134 
   134 
   135         echo '</div>';
   135         echo '</div>';
   136         
   136         
   137       echo '</div>';
   137       echo '</div>';
   138     
   138     
   165         /* description */
   165         /* description */
   166         echo '<div class="description">';
   166         echo '<div class="description">';
   167           
   167           
   168           echo '<p class="deprecated">' . __( 'This import method has been deprecated. That means it has been replaced by a new method and is no longer supported, and may be removed from future versions. All themes that use this import method should be converted to use its replacement below.', 'option-tree' ) . '</p>';
   168           echo '<p class="deprecated">' . __( 'This import method has been deprecated. That means it has been replaced by a new method and is no longer supported, and may be removed from future versions. All themes that use this import method should be converted to use its replacement below.', 'option-tree' ) . '</p>';
   169           
   169           
   170           echo '<p>' . __( 'If you were given a Theme Options XML file with a premium or free theme, locate it on your hard drive and upload that file by clicking the blue upload button. A popup window will appear, upload the XML file and click "Send to OptionTree". The file URL should be in the upload input, if it is click "Import XML".', 'option-tree' ) . '</p>';
   170           echo '<p>' . sprintf( __( 'If you were given a Theme Options XML file with a premium or free theme, locate it on your hard drive and upload that file by clicking the upload button. A popup window will appear, upload the XML file and click "%s". The file URL should be in the upload input, if it is click "Import XML".', 'option-tree' ), apply_filters( 'ot_upload_text', __( 'Send to OptionTree', 'option-tree' ) ) ) . '</p>';
   171           
   171           
   172           /* button */
   172           /* button */
   173           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Import XML', 'option-tree' ) . '</button>';
   173           echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __( 'Import XML', 'option-tree' ) . '</button>';
   174           
   174           
   175         echo '</div>';
   175         echo '</div>';
   176         
   176         
   177         echo '<div class="format-setting-inner">';
   177         echo '<div class="format-setting-inner">';
   178           
   178           
   184             
   184             
   185             /* get media post_id */
   185             /* get media post_id */
   186             $post_id = ( $id = ot_get_media_post_ID() ) ? (int) $id : 0;
   186             $post_id = ( $id = ot_get_media_post_ID() ) ? (int) $id : 0;
   187           
   187           
   188             /* add xml button */
   188             /* add xml button */
   189             echo '<a href="javascript:void(0);" class="ot_upload_media option-tree-ui-button blue light" rel="' . $post_id . '" title="' . __( 'Add XML', 'option-tree' ) . '"><span class="icon upload">' . __( 'Add XML', 'option-tree' ) . '</span></a>';
   189             echo '<a href="javascript:void(0);" class="ot_upload_media option-tree-ui-button button button-primary light" rel="' . $post_id . '" title="' . __( 'Add XML', 'option-tree' ) . '"><span class="icon ot-icon-plus-circle"></span>' . __( 'Add XML', 'option-tree' ) . '</a>';
   190           
   190           
   191           echo '</div>';
   191           echo '</div>';
   192           
   192           
   193         echo '</div>';
   193         echo '</div>';
   194         
   194         
   224         echo '<div class="description">';
   224         echo '<div class="description">';
   225           
   225           
   226           echo '<p>' . __( 'To import your Settings copy and paste what appears to be a random string of alpha numeric characters into this textarea and press the "Import Settings" button.', 'option-tree' ) . '</p>';
   226           echo '<p>' . __( 'To import your Settings copy and paste what appears to be a random string of alpha numeric characters into this textarea and press the "Import Settings" button.', 'option-tree' ) . '</p>';
   227           
   227           
   228           /* button */
   228           /* button */
   229           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Import Settings', 'option-tree' ) . '</button>';
   229           echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __( 'Import Settings', 'option-tree' ) . '</button>';
   230           
   230           
   231         echo '</div>';
   231         echo '</div>';
   232         
   232         
   233         /* textarea */
   233         /* textarea */
   234         echo '<div class="format-setting-inner">';
   234         echo '<div class="format-setting-inner">';
   271           if ( OT_SHOW_SETTINGS_IMPORT ) echo '<p>' . __( 'Only after you\'ve imported the Settings should you try and update your Theme Options.', 'option-tree' ) . '</p>';
   271           if ( OT_SHOW_SETTINGS_IMPORT ) echo '<p>' . __( 'Only after you\'ve imported the Settings should you try and update your Theme Options.', 'option-tree' ) . '</p>';
   272           
   272           
   273           echo '<p>' . __( 'To import your Theme Options copy and paste what appears to be a random string of alpha numeric characters into this textarea and press the "Import Theme Options" button.', 'option-tree' ) . '</p>';
   273           echo '<p>' . __( 'To import your Theme Options copy and paste what appears to be a random string of alpha numeric characters into this textarea and press the "Import Theme Options" button.', 'option-tree' ) . '</p>';
   274           
   274           
   275           /* button */
   275           /* button */
   276           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Import Theme Options', 'option-tree' ) . '</button>';
   276           echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __( 'Import Theme Options', 'option-tree' ) . '</button>';
   277           
   277           
   278         echo '</div>';
   278         echo '</div>';
   279         
   279         
   280         /* textarea */
   280         /* textarea */
   281         echo '<div class="format-setting-inner">';
   281         echo '<div class="format-setting-inner">';
   318           if ( OT_SHOW_SETTINGS_IMPORT ) echo '<p>' . __( 'Only after you\'ve imported the Settings should you try and update your Layouts.', 'option-tree' ) . '</p>';
   318           if ( OT_SHOW_SETTINGS_IMPORT ) echo '<p>' . __( 'Only after you\'ve imported the Settings should you try and update your Layouts.', 'option-tree' ) . '</p>';
   319           
   319           
   320           echo '<p>' . __( 'To import your Layouts copy and paste what appears to be a random string of alpha numeric characters into this textarea and press the "Import Layouts" button. Keep in mind that when you import your layouts, the active layout\'s saved data will write over the current data set for your Theme Options.', 'option-tree' ) . '</p>';
   320           echo '<p>' . __( 'To import your Layouts copy and paste what appears to be a random string of alpha numeric characters into this textarea and press the "Import Layouts" button. Keep in mind that when you import your layouts, the active layout\'s saved data will write over the current data set for your Theme Options.', 'option-tree' ) . '</p>';
   321           
   321           
   322           /* button */
   322           /* button */
   323           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Import Layouts', 'option-tree' ) . '</button>';
   323           echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __( 'Import Layouts', 'option-tree' ) . '</button>';
   324           
   324           
   325         echo '</div>';
   325         echo '</div>';
   326         
   326         
   327         /* textarea */
   327         /* textarea */
   328         echo '<div class="format-setting-inner">';
   328         echo '<div class="format-setting-inner">';
   361       echo '<div class="format-setting type-textarea simple has-desc">';
   361       echo '<div class="format-setting type-textarea simple has-desc">';
   362         
   362         
   363         /* description */
   363         /* description */
   364         echo '<div class="description">';
   364         echo '<div class="description">';
   365           
   365           
   366           echo '<p>' . sprintf( __( 'Export your Settings into a fully functional <code>theme-options.php</code> file by clicking this button. For more information on how to use this file read the theme mode %s. Remember, you should always check the file for errors before including it in your theme.', 'option-tree' ), '<a href="' . get_admin_url( $blog_id, 'admin.php?page=ot-documentation#section_theme_mode' ) . '"><code>OptionTree->Documentation</code></a>' ) . '</p>';
   366           echo '<p>' . sprintf( __( 'Export your Settings into a fully functional %s file. If you want to add your own custom %s text domain to the file, enter it into the text field before exporting. For more information on how to use this file read the documentation on %s. Remember, you should always check the file for errors before including it in your theme.', 'option-tree' ), '<code>theme-options.php</code>', '<a href="http://codex.wordpress.org/I18n_for_WordPress_Developers" target="_blank">I18n</a>', '<a href="' . get_admin_url( $blog_id, 'admin.php?page=ot-documentation#section_theme_mode' ) . '">' . __( 'Theme Mode', 'option-tree' ) . '</a>' ) . '</p>';
   367           
   367           
   368         echo '</div>';
   368         echo '</div>';
   369           
   369           
   370         echo '<div class="format-setting-inner">';
   370         echo '<div class="format-setting-inner">';
   371             
   371           
       
   372           echo '<input type="text" name="domain" value="" class="widefat option-tree-ui-input" placeholder="text-domain" autocomplete="off" />';
       
   373           
   372           /* button */
   374           /* button */
   373           echo '<button class="option-tree-ui-button blue hug-left">' . __( 'Export Settings File', 'option-tree' ) . '</button>';
   375           echo '<button class="option-tree-ui-button button button-primary hug-left">' . __( 'Export Settings File', 'option-tree' ) . '</button>';
   374           
   376           
   375         echo '</div>';
   377         echo '</div>';
   376         
   378         
   377       echo '</div>';
   379       echo '</div>';
   378     
   380     
   403         echo '<p>' . __( 'Export your Settings by highlighting this text and doing a copy/paste into a blank .txt file. Then save the file for importing into another install of WordPress later. Alternatively, you could just paste it into the <code>OptionTree->Settings->Import</code> <strong>Settings</strong> textarea on another web site.', 'option-tree' ) . '</p>';
   405         echo '<p>' . __( 'Export your Settings by highlighting this text and doing a copy/paste into a blank .txt file. Then save the file for importing into another install of WordPress later. Alternatively, you could just paste it into the <code>OptionTree->Settings->Import</code> <strong>Settings</strong> textarea on another web site.', 'option-tree' ) . '</p>';
   404         
   406         
   405       echo '</div>';
   407       echo '</div>';
   406         
   408         
   407       /* get theme options data */
   409       /* get theme options data */
   408       $settings = get_option( 'option_tree_settings' );
   410       $settings = get_option( ot_settings_id() );
   409       $settings = ! empty( $settings ) ?  ot_encode( serialize( $settings ) ) : '';
   411       $settings = ! empty( $settings ) ?  ot_encode( serialize( $settings ) ) : '';
   410         
   412         
   411       echo '<div class="format-setting-inner">';
   413       echo '<div class="format-setting-inner">';
   412         echo '<textarea rows="10" cols="40" name="export_settings" id="export_settings" class="textarea">' . $settings . '</textarea>';
   414         echo '<textarea rows="10" cols="40" name="export_settings" id="export_settings" class="textarea">' . $settings . '</textarea>';
   413       echo '</div>';
   415       echo '</div>';
   439         echo '<p>' . __( 'Export your Theme Options data by highlighting this text and doing a copy/paste into a blank .txt file. Then save the file for importing into another install of WordPress later. Alternatively, you could just paste it into the <code>OptionTree->Settings->Import</code> <strong>Theme Options</strong> textarea on another web site.', 'option-tree' ) . '</p>';
   441         echo '<p>' . __( 'Export your Theme Options data by highlighting this text and doing a copy/paste into a blank .txt file. Then save the file for importing into another install of WordPress later. Alternatively, you could just paste it into the <code>OptionTree->Settings->Import</code> <strong>Theme Options</strong> textarea on another web site.', 'option-tree' ) . '</p>';
   440         
   442         
   441       echo '</div>';
   443       echo '</div>';
   442       
   444       
   443       /* get theme options data */
   445       /* get theme options data */
   444       $data = get_option( 'option_tree' );
   446       $data = get_option( ot_options_id() );
   445       $data = ! empty( $data ) ? ot_encode( serialize( $data ) ) : '';
   447       $data = ! empty( $data ) ? ot_encode( serialize( $data ) ) : '';
   446         
   448         
   447       echo '<div class="format-setting-inner">';
   449       echo '<div class="format-setting-inner">';
   448         echo '<textarea rows="10" cols="40" name="export_data" id="export_data" class="textarea">' . $data . '</textarea>';
   450         echo '<textarea rows="10" cols="40" name="export_data" id="export_data" class="textarea">' . $data . '</textarea>';
   449       echo '</div>';
   451       echo '</div>';
   476         
   478         
   477         
   479         
   478       echo '</div>';
   480       echo '</div>';
   479       
   481       
   480       /* get layout data */
   482       /* get layout data */
   481       $layouts = get_option( 'option_tree_layouts' );
   483       $layouts = get_option( ot_layouts_id() );
   482       $layouts = ! empty( $layouts ) ? ot_encode( serialize( $layouts ) ) : '';
   484       $layouts = ! empty( $layouts ) ? ot_encode( serialize( $layouts ) ) : '';
   483         
   485         
   484       echo '<div class="format-setting-inner">';
   486       echo '<div class="format-setting-inner">';
   485         echo '<textarea rows="10" cols="40" name="export_layouts" id="export_layouts" class="textarea">' . $layouts . '</textarea>';
   487         echo '<textarea rows="10" cols="40" name="export_layouts" id="export_layouts" class="textarea">' . $layouts . '</textarea>';
   486       echo '</div>';
   488       echo '</div>';
   522         echo '</div>';
   524         echo '</div>';
   523         
   525         
   524         echo '<div class="format-setting-inner">';
   526         echo '<div class="format-setting-inner">';
   525  
   527  
   526           /* get the saved layouts */
   528           /* get the saved layouts */
   527           $layouts = get_option( 'option_tree_layouts' );
   529           $layouts = get_option( ot_layouts_id() );
   528       
   530       
   529           /* set active layout */
   531           /* set active layout */
   530           $active_layout = isset( $layouts['active_layout'] ) ? $layouts['active_layout'] : '';
   532           $active_layout = isset( $layouts['active_layout'] ) ? $layouts['active_layout'] : '';
   531           
   533           
   532           echo '<input type="hidden" name="option_tree_layouts[active_layout]" value="' . esc_attr( $active_layout ) . '" class="active-layout-input" />';
   534           echo '<input type="hidden" name="' . ot_layouts_id() . '[active_layout]" value="' . esc_attr( $active_layout ) . '" class="active-layout-input" />';
   533           
   535           
   534           /* add new layout */
   536           /* add new layout */
   535           echo '<input type="text" name="option_tree_layouts[_add_new_layout_]" value="" class="widefat option-tree-ui-input" autocomplete="off" />';
   537           echo '<input type="text" name="' . ot_layouts_id() . '[_add_new_layout_]" value="" class="widefat option-tree-ui-input" autocomplete="off" />';
   536            
   538            
   537           /* loop through each layout */
   539           /* loop through each layout */
   538           echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_layouts">';
   540           echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_layouts">';
   539           
   541           
   540           if ( is_array( $layouts ) && ! empty( $layouts ) ) {
   542           if ( is_array( $layouts ) && ! empty( $layouts ) ) {
   552             
   554             
   553           }
   555           }
   554           
   556           
   555           echo '</ul>';
   557           echo '</ul>';
   556             
   558             
   557           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Save Layouts', 'option-tree' ) . '</button>';
   559           echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __( 'Save Layouts', 'option-tree' ) . '</button>';
   558             
   560             
   559         echo '</div>';
   561         echo '</div>';
   560         
   562         
   561       echo '</div>';
   563       echo '</div>';
   562     
   564