wp/wp-content/plugins/option-tree/includes/ot-functions-settings-page.php
changeset 0 d970ebf37754
child 5 5e2f62d02dcd
equal deleted inserted replaced
-1:000000000000 0:d970ebf37754
       
     1 <?php if ( ! defined( 'OT_VERSION' ) ) exit( 'No direct script access allowed' );
       
     2 /**
       
     3  * OptionTree settings page functions.
       
     4  *
       
     5  * @package   OptionTree
       
     6  * @author    Derek Herman <derek@valendesigns.com>
       
     7  * @copyright Copyright (c) 2013, Derek Herman
       
     8  * @since     2.0
       
     9  */
       
    10 
       
    11 /**
       
    12  * Create option type.
       
    13  *
       
    14  * @return    string
       
    15  *
       
    16  * @access    public
       
    17  * @since     2.0
       
    18  */
       
    19 if ( ! function_exists( 'ot_type_theme_options_ui' ) ) {
       
    20   
       
    21   function ot_type_theme_options_ui() {
       
    22     global $blog_id;
       
    23     
       
    24     echo '<form method="post" id="option-tree-settings-form">';
       
    25       
       
    26       /* form nonce */
       
    27       wp_nonce_field( 'option_tree_settings_form', 'option_tree_settings_nonce' );
       
    28       
       
    29       /* format setting outer wrapper */
       
    30       echo '<div class="format-setting type-textblock has-desc">';
       
    31         
       
    32         /* description */
       
    33         echo '<div class="description">';
       
    34           
       
    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>';
       
    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>';
       
    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>';
       
    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           
       
    43         echo '</div>';
       
    44         
       
    45         /* get the saved settings */
       
    46         $settings = get_option( 'option_tree_settings' );
       
    47 
       
    48         /* wrap settings array */
       
    49         echo '<div class="format-setting-inner">';
       
    50           
       
    51           /* set count to zero */
       
    52           $count = 0;
       
    53   
       
    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]">';
       
    56           
       
    57           if ( isset( $settings['sections'] ) ) {
       
    58           
       
    59             foreach( $settings['sections'] as $section ) {
       
    60               
       
    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>';
       
    63               
       
    64               /* increment item count */
       
    65               $count++;
       
    66               
       
    67               /* settings in this section */
       
    68               if ( isset( $settings['settings'] ) ) {
       
    69                 
       
    70                 foreach( $settings['settings'] as $setting ) {
       
    71                   
       
    72                   if ( isset( $setting['section'] ) && $setting['section'] == $section['id'] ) {
       
    73                     
       
    74                     echo '<li class="ui-state-default list-setting">' . ot_settings_view( 'option_tree_settings[settings]', $count, $setting ) . '</li>';
       
    75                     
       
    76                     /* increment item count */
       
    77                     $count++;
       
    78                     
       
    79                   }
       
    80                   
       
    81                 }
       
    82                 
       
    83               }
       
    84 
       
    85             }
       
    86             
       
    87           }
       
    88           
       
    89           echo '</ul>';
       
    90           
       
    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>';
       
    93           echo '<a href="javascript:void(0);" class="option-tree-setting-add option-tree-ui-button">' . __( 'Add Setting', 'option-tree' ) . '</a>';
       
    94           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Save Changes', 'option-tree' ) . '</button>';
       
    95           
       
    96           /* sidebar textarea */
       
    97           echo '
       
    98           <div class="format-setting-label" id="contextual-help-label">
       
    99             <h3 class="label">' . __( 'Contextual Help', 'option-tree' ) . '</h3>
       
   100           </div>
       
   101           <div class="format-settings" id="contextual-help-setting">
       
   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>
       
   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>
       
   106               </div>
       
   107             </div>
       
   108           </div>';
       
   109           
       
   110           /* set count to zero */
       
   111           $count = 0;
       
   112           
       
   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]">';
       
   115           
       
   116           if ( isset( $settings['contextual_help']['content'] ) ) {
       
   117           
       
   118             foreach( $settings['contextual_help']['content'] as $content ) {
       
   119               
       
   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>';
       
   122               
       
   123               /* increment content count */
       
   124               $count++;
       
   125 
       
   126             }
       
   127             
       
   128           }
       
   129           
       
   130           echo '</ul>';
       
   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>';
       
   133           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Save Changes', 'option-tree' ) . '</button>';
       
   134 
       
   135         echo '</div>';
       
   136         
       
   137       echo '</div>';
       
   138     
       
   139     echo '</form>';
       
   140     
       
   141   }
       
   142   
       
   143 }
       
   144 
       
   145 /**
       
   146  * Import XML option type.
       
   147  *
       
   148  * @return    string
       
   149  *
       
   150  * @access    public
       
   151  * @since     2.0
       
   152  */
       
   153 if ( ! function_exists( 'ot_type_import_xml' ) ) {
       
   154   
       
   155   function ot_type_import_xml() {
       
   156     
       
   157     echo '<form method="post" id="import-xml-form">';
       
   158       
       
   159       /* form nonce */
       
   160       wp_nonce_field( 'import_xml_form', 'import_xml_nonce' );
       
   161       
       
   162       /* format setting outer wrapper */
       
   163       echo '<div class="format-setting type-textblock has-desc">';
       
   164         
       
   165         /* description */
       
   166         echo '<div class="description">';
       
   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>';
       
   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>';
       
   171           
       
   172           /* button */
       
   173           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Import XML', 'option-tree' ) . '</button>';
       
   174           
       
   175         echo '</div>';
       
   176         
       
   177         echo '<div class="format-setting-inner">';
       
   178           
       
   179           /* build upload */
       
   180           echo '<div class="option-tree-ui-upload-parent">';
       
   181             
       
   182             /* input */
       
   183             echo '<input type="text" name="import_xml" id="import_xml" value="" class="widefat option-tree-ui-upload-input" />';
       
   184             
       
   185             /* get media post_id */
       
   186             $post_id = ( $id = ot_get_media_post_ID() ) ? (int) $id : 0;
       
   187           
       
   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>';
       
   190           
       
   191           echo '</div>';
       
   192           
       
   193         echo '</div>';
       
   194         
       
   195       echo '</div>';
       
   196       
       
   197     echo '</form>';
       
   198     
       
   199   }
       
   200   
       
   201 }
       
   202 
       
   203 /**
       
   204  * Import Settings option type.
       
   205  *
       
   206  * @return    string
       
   207  *
       
   208  * @access    public
       
   209  * @since     2.0
       
   210  */
       
   211 if ( ! function_exists( 'ot_type_import_settings' ) ) {
       
   212   
       
   213   function ot_type_import_settings() {
       
   214     
       
   215     echo '<form method="post" id="import-settings-form">';
       
   216       
       
   217       /* form nonce */
       
   218       wp_nonce_field( 'import_settings_form', 'import_settings_nonce' );
       
   219       
       
   220       /* format setting outer wrapper */
       
   221       echo '<div class="format-setting type-textarea has-desc">';
       
   222            
       
   223         /* description */
       
   224         echo '<div class="description">';
       
   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>';
       
   227           
       
   228           /* button */
       
   229           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Import Settings', 'option-tree' ) . '</button>';
       
   230           
       
   231         echo '</div>';
       
   232         
       
   233         /* textarea */
       
   234         echo '<div class="format-setting-inner">';
       
   235           
       
   236           echo '<textarea rows="10" cols="40" name="import_settings" id="import_settings" class="textarea"></textarea>';
       
   237 
       
   238         echo '</div>';
       
   239         
       
   240       echo '</div>';
       
   241     
       
   242     echo '</form>';
       
   243     
       
   244   }
       
   245   
       
   246 }
       
   247 
       
   248 /**
       
   249  * Import Data option type.
       
   250  *
       
   251  * @return    string
       
   252  *
       
   253  * @access    public
       
   254  * @since     2.0
       
   255  */
       
   256 if ( ! function_exists( 'ot_type_import_data' ) ) {
       
   257   
       
   258   function ot_type_import_data() {
       
   259     
       
   260     echo '<form method="post" id="import-data-form">';
       
   261       
       
   262       /* form nonce */
       
   263       wp_nonce_field( 'import_data_form', 'import_data_nonce' );
       
   264         
       
   265       /* format setting outer wrapper */
       
   266       echo '<div class="format-setting type-textarea has-desc">';
       
   267         
       
   268         /* description */
       
   269         echo '<div class="description">';
       
   270           
       
   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           
       
   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           
       
   275           /* button */
       
   276           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Import Theme Options', 'option-tree' ) . '</button>';
       
   277           
       
   278         echo '</div>';
       
   279         
       
   280         /* textarea */
       
   281         echo '<div class="format-setting-inner">';
       
   282           
       
   283           echo '<textarea rows="10" cols="40" name="import_data" id="import_data" class="textarea"></textarea>';
       
   284 
       
   285         echo '</div>';
       
   286         
       
   287       echo '</div>';
       
   288     
       
   289     echo '</form>';
       
   290     
       
   291   }
       
   292   
       
   293 }
       
   294 
       
   295 /**
       
   296  * Import Layouts option type.
       
   297  *
       
   298  * @return    string
       
   299  *
       
   300  * @access    public
       
   301  * @since     2.0
       
   302  */
       
   303 if ( ! function_exists( 'ot_type_import_layouts' ) ) {
       
   304   
       
   305   function ot_type_import_layouts() {
       
   306     
       
   307     echo '<form method="post" id="import-layouts-form">';
       
   308       
       
   309       /* form nonce */
       
   310       wp_nonce_field( 'import_layouts_form', 'import_layouts_nonce' );
       
   311       
       
   312       /* format setting outer wrapper */
       
   313       echo '<div class="format-setting type-textarea has-desc">';
       
   314         
       
   315         /* description */
       
   316         echo '<div class="description">';
       
   317           
       
   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           
       
   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           
       
   322           /* button */
       
   323           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Import Layouts', 'option-tree' ) . '</button>';
       
   324           
       
   325         echo '</div>';
       
   326         
       
   327         /* textarea */
       
   328         echo '<div class="format-setting-inner">';
       
   329           
       
   330           echo '<textarea rows="10" cols="40" name="import_layouts" id="import_layouts" class="textarea"></textarea>';
       
   331   
       
   332         echo '</div>';
       
   333         
       
   334       echo '</div>';
       
   335       
       
   336     echo '</form>';
       
   337     
       
   338   }
       
   339   
       
   340 }
       
   341 
       
   342 /**
       
   343  * Export Settings File option type.
       
   344  *
       
   345  * @return    string
       
   346  *
       
   347  * @access    public
       
   348  * @since     2.0.8
       
   349  */
       
   350 if ( ! function_exists( 'ot_type_export_settings_file' ) ) {
       
   351   
       
   352   function ot_type_export_settings_file() {
       
   353     global $blog_id;
       
   354     
       
   355     echo '<form method="post" id="export-settings-file-form">';
       
   356     
       
   357       /* form nonce */
       
   358       wp_nonce_field( 'export_settings_file_form', 'export_settings_file_nonce' );
       
   359       
       
   360       /* format setting outer wrapper */
       
   361       echo '<div class="format-setting type-textarea simple has-desc">';
       
   362         
       
   363         /* description */
       
   364         echo '<div class="description">';
       
   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>';
       
   367           
       
   368         echo '</div>';
       
   369           
       
   370         echo '<div class="format-setting-inner">';
       
   371             
       
   372           /* button */
       
   373           echo '<button class="option-tree-ui-button blue hug-left">' . __( 'Export Settings File', 'option-tree' ) . '</button>';
       
   374           
       
   375         echo '</div>';
       
   376         
       
   377       echo '</div>';
       
   378     
       
   379     echo '</form>';
       
   380     
       
   381   }
       
   382   
       
   383 }
       
   384 
       
   385 /**
       
   386  * Export Settings option type.
       
   387  *
       
   388  * @return    string
       
   389  *
       
   390  * @access    public
       
   391  * @since     2.0
       
   392  */
       
   393 if ( ! function_exists( 'ot_type_export_settings' ) ) {
       
   394   
       
   395   function ot_type_export_settings() {
       
   396     
       
   397     /* format setting outer wrapper */
       
   398     echo '<div class="format-setting type-textarea simple has-desc">';
       
   399       
       
   400       /* description */
       
   401       echo '<div class="description">';
       
   402         
       
   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>';
       
   404         
       
   405       echo '</div>';
       
   406         
       
   407       /* get theme options data */
       
   408       $settings = get_option( 'option_tree_settings' );
       
   409       $settings = ! empty( $settings ) ?  ot_encode( serialize( $settings ) ) : '';
       
   410         
       
   411       echo '<div class="format-setting-inner">';
       
   412         echo '<textarea rows="10" cols="40" name="export_settings" id="export_settings" class="textarea">' . $settings . '</textarea>';
       
   413       echo '</div>';
       
   414       
       
   415     echo '</div>';
       
   416     
       
   417   }
       
   418   
       
   419 }
       
   420 
       
   421 /**
       
   422  * Export Data option type.
       
   423  *
       
   424  * @return    string
       
   425  *
       
   426  * @access    public
       
   427  * @since     2.0
       
   428  */
       
   429 if ( ! function_exists( 'ot_type_export_data' ) ) {
       
   430   
       
   431   function ot_type_export_data() {
       
   432     
       
   433     /* format setting outer wrapper */
       
   434     echo '<div class="format-setting type-textarea simple has-desc">';
       
   435       
       
   436       /* description */
       
   437       echo '<div class="description">';
       
   438         
       
   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>';
       
   440         
       
   441       echo '</div>';
       
   442       
       
   443       /* get theme options data */
       
   444       $data = get_option( 'option_tree' );
       
   445       $data = ! empty( $data ) ? ot_encode( serialize( $data ) ) : '';
       
   446         
       
   447       echo '<div class="format-setting-inner">';
       
   448         echo '<textarea rows="10" cols="40" name="export_data" id="export_data" class="textarea">' . $data . '</textarea>';
       
   449       echo '</div>';
       
   450       
       
   451     echo '</div>';
       
   452     
       
   453   }
       
   454   
       
   455 }
       
   456 
       
   457 /**
       
   458  * Export Layouts option type.
       
   459  *
       
   460  * @return    string
       
   461  *
       
   462  * @access    public
       
   463  * @since     2.0
       
   464  */
       
   465 if ( ! function_exists( 'ot_type_export_layouts' ) ) {
       
   466   
       
   467   function ot_type_export_layouts() {
       
   468     
       
   469     /* format setting outer wrapper */
       
   470     echo '<div class="format-setting type-textarea simple has-desc">';
       
   471       
       
   472       /* description */
       
   473       echo '<div class="description">';
       
   474         
       
   475         echo '<p>' . __( 'Export your Layouts 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>Layouts</strong> textarea on another web site.', 'option-tree' ) . '</p>';
       
   476         
       
   477         
       
   478       echo '</div>';
       
   479       
       
   480       /* get layout data */
       
   481       $layouts = get_option( 'option_tree_layouts' );
       
   482       $layouts = ! empty( $layouts ) ? ot_encode( serialize( $layouts ) ) : '';
       
   483         
       
   484       echo '<div class="format-setting-inner">';
       
   485         echo '<textarea rows="10" cols="40" name="export_layouts" id="export_layouts" class="textarea">' . $layouts . '</textarea>';
       
   486       echo '</div>';
       
   487       
       
   488     echo '</div>';
       
   489     
       
   490   }
       
   491   
       
   492 }
       
   493 
       
   494 /**
       
   495  * Modify Layouts option type.
       
   496  *
       
   497  * @return    string
       
   498  *
       
   499  * @access    public
       
   500  * @since     2.0
       
   501  */
       
   502 if ( ! function_exists( 'ot_type_modify_layouts' ) ) {
       
   503   
       
   504   function ot_type_modify_layouts() {
       
   505     
       
   506     echo '<form method="post" id="option-tree-settings-form">';
       
   507       
       
   508       /* form nonce */
       
   509       wp_nonce_field( 'option_tree_modify_layouts_form', 'option_tree_modify_layouts_nonce' );
       
   510 
       
   511       /* format setting outer wrapper */
       
   512       echo '<div class="format-setting type-textarea has-desc">';
       
   513           
       
   514         /* description */
       
   515         echo '<div class="description">';
       
   516           
       
   517           echo '<p>' . __( 'To add a new layout enter a unique lower case alphanumeric string (dashes allowed) in the text field and click "Save Layouts".', 'option-tree' ) . '</p>';
       
   518           echo '<p>' . __( 'As well, you can activate, remove, and drag & drop the order; all situations require you to click "Save Layouts" for the changes to be applied.', 'option-tree' ) . '</p>';
       
   519           echo '<p>' . __( 'When you create a new layout it will become active and any changes made to the Theme Options will be applied to it. If you switch back to a different layout immediately after creating a new layout that new layout will have a snapshot of the current Theme Options data attached to it.', 'option-tree' ) . '</p>';
       
   520           if ( OT_SHOW_DOCS ) echo '<p>' . __( 'Visit <code>OptionTree->Documentation->Layouts Overview</code> to see a more in-depth description of what layouts are and how to use them.', 'option-tree' ) . '</p>';
       
   521           
       
   522         echo '</div>';
       
   523         
       
   524         echo '<div class="format-setting-inner">';
       
   525  
       
   526           /* get the saved layouts */
       
   527           $layouts = get_option( 'option_tree_layouts' );
       
   528       
       
   529           /* set active layout */
       
   530           $active_layout = isset( $layouts['active_layout'] ) ? $layouts['active_layout'] : '';
       
   531           
       
   532           echo '<input type="hidden" name="option_tree_layouts[active_layout]" value="' . esc_attr( $active_layout ) . '" class="active-layout-input" />';
       
   533           
       
   534           /* add new layout */
       
   535           echo '<input type="text" name="option_tree_layouts[_add_new_layout_]" value="" class="widefat option-tree-ui-input" autocomplete="off" />';
       
   536            
       
   537           /* loop through each layout */
       
   538           echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_layouts">';
       
   539           
       
   540           if ( is_array( $layouts ) && ! empty( $layouts ) ) {
       
   541           
       
   542             foreach( $layouts as $key => $data ) {
       
   543               
       
   544               /* skip active layout array */
       
   545               if ( $key == 'active_layout' )
       
   546                 continue;
       
   547                 
       
   548               /* content */
       
   549               echo '<li class="ui-state-default list-layouts">' . ot_layout_view( $key, $data, $active_layout ) . '</li>';
       
   550 
       
   551             }
       
   552             
       
   553           }
       
   554           
       
   555           echo '</ul>';
       
   556             
       
   557           echo '<button class="option-tree-ui-button blue right hug-right">' . __( 'Save Layouts', 'option-tree' ) . '</button>';
       
   558             
       
   559         echo '</div>';
       
   560         
       
   561       echo '</div>';
       
   562     
       
   563     echo '</form>';
       
   564     
       
   565   }
       
   566   
       
   567 }
       
   568 
       
   569 /* End of file ot-functions-settings-page.php */
       
   570 /* Location: ./includes/ot-functions-settings-page.php */