function ot_type_theme_options_ui()
 {
     global $blog_id;
     echo '<form method="post" id="option-tree-settings-form">';
     /* form nonce */
     wp_nonce_field('option_tree_settings_form', 'option_tree_settings_nonce');
     /* format setting outer wrapper */
     echo '<div class="format-setting type-textblock has-desc">';
     /* description */
     echo '<div class="description">';
     echo '<h4>' . __('Warning!', 'option-tree') . '</h4>';
     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>';
     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>';
     echo '<h4>' . __('Things could break or be improperly displayed to the end-user if you do one of the following:', 'option-tree') . '</h4>';
     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>';
     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>';
     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>';
     echo '</div>';
     /* get the saved settings */
     $settings = get_option(ot_settings_id());
     /* wrap settings array */
     echo '<div class="format-setting-inner">';
     /* set count to zero */
     $count = 0;
     /* loop through each section and its settings */
     echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_list" data-name="' . ot_settings_id() . '[settings]">';
     if (isset($settings['sections'])) {
         foreach ($settings['sections'] as $section) {
             /* section */
             echo '<li class="' . ($count == 0 ? 'ui-state-disabled' : 'ui-state-default') . ' list-section">' . ot_sections_view(ot_settings_id() . '[sections]', $count, $section) . '</li>';
             /* increment item count */
             $count++;
             /* settings in this section */
             if (isset($settings['settings'])) {
                 foreach ($settings['settings'] as $setting) {
                     if (isset($setting['section']) && $setting['section'] == $section['id']) {
                         echo '<li class="ui-state-default list-setting">' . ot_settings_view(ot_settings_id() . '[settings]', $count, $setting) . '</li>';
                         /* increment item count */
                         $count++;
                     }
                 }
             }
         }
     }
     echo '</ul>';
     /* buttons */
     echo '<a href="javascript:void(0);" class="option-tree-section-add option-tree-ui-button button hug-left">' . __('Add Section', 'option-tree') . '</a>';
     echo '<a href="javascript:void(0);" class="option-tree-setting-add option-tree-ui-button button">' . __('Add Setting', 'option-tree') . '</a>';
     echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Changes', 'option-tree') . '</button>';
     /* sidebar textarea */
     echo '
       <div class="format-setting-label" id="contextual-help-label">
         <h3 class="label">' . __('Contextual Help', 'option-tree') . '</h3>
       </div>
       <div class="format-settings" id="contextual-help-setting">
         <div class="format-setting type-textarea no-desc">
           <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>
           <div class="format-setting-inner">
             <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>
           </div>
         </div>
       </div>';
     /* set count to zero */
     $count = 0;
     /* loop through each contextual_help content section */
     echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_help" data-name="' . ot_settings_id() . '[contextual_help][content]">';
     if (isset($settings['contextual_help']['content'])) {
         foreach ($settings['contextual_help']['content'] as $content) {
             /* content */
             echo '<li class="ui-state-default list-contextual-help">' . ot_contextual_help_view(ot_settings_id() . '[contextual_help][content]', $count, $content) . '</li>';
             /* increment content count */
             $count++;
         }
     }
     echo '</ul>';
     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>';
     echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Changes', 'option-tree') . '</button>';
     echo '</div>';
     echo '</div>';
     echo '</form>';
 }
Esempio n. 2
0
 /**
  * AJAX utility function for adding new contextual help content.
  */
 public function add_the_contextual_help()
 {
     echo ot_contextual_help_view($_REQUEST['name'], $_REQUEST['count']);
     die;
 }
    function rj_taxonomy_ot_metabox_callback()
    {
        global $blog_id;
        echo '

	<h2>Taxonomy Custom Fields UI</h2>

	<form method="post" id="option-tree-settings-form">';
        /* form nonce */
        wp_nonce_field('rj_option_tree_settings_form', 'option_tree_settings_nonce');
        /* format setting outer wrapper */
        echo '<div class="format-setting type-textblock has-desc">';
        /* get the saved settings */
        $settings = get_option('rj_taxonomy_' . ot_settings_id());
        /* wrap settings array */
        echo '<div class="format-setting-inner">';
        /* set count to zero */
        $count = 0;
        /* loop through each section and its settings */
        echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_list" data-name="' . ot_settings_id() . '[settings]">';
        if (isset($settings['sections'])) {
            foreach ($settings['sections'] as $section) {
                /* section */
                echo '<li class="' . ($count == 0 ? 'ui-state-disabled' : 'ui-state-default') . ' list-section">' . ot_taxonomy_sections_view(ot_settings_id() . '[sections]', $count, $section) . '

			  </li>';
                /* increment item count */
                $count++;
                /* settings in this section */
                if (isset($settings['settings'])) {
                    foreach ($settings['settings'] as $setting) {
                        if (isset($setting['section']) && $setting['section'] == $section['id']) {
                            echo '<li class="ui-state-default list-setting">' . ot_settings_view(ot_settings_id() . '[settings]', $count, $setting) . '</li>';
                            /* increment item count */
                            $count++;
                        }
                    }
                }
            }
        }
        echo '</ul>';
        /* buttons */
        echo '<a href="javascript:void(0);" class="option-tree-section-add option-tree-ui-button button hug-left">' . __('Add Section', 'option-tree') . '</a>';
        echo '<a href="javascript:void(0);" class="option-tree-setting-add option-tree-ui-button button">' . __('Add Setting', 'option-tree') . '</a>';
        echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Changes', 'option-tree') . '</button>';
        /* sidebar textarea */
        echo '

          <div class="format-setting-label" id="contextual-help-label">

            <h3 class="label">' . __('Contextual Help', 'option-tree') . '</h3>

          </div>

          <div class="format-settings" id="contextual-help-setting">

            <div class="format-setting type-textarea no-desc">

              <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>

              <div class="format-setting-inner">

                <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>

              </div>

            </div>

          </div>';
        /* set count to zero */
        $count = 0;
        /* loop through each contextual_help content section */
        echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_help" data-name="' . ot_settings_id() . '[contextual_help][content]">';
        if (isset($settings['contextual_help']['content'])) {
            foreach ($settings['contextual_help']['content'] as $content) {
                /* content */
                echo '<li class="ui-state-default list-contextual-help">' . ot_contextual_help_view(ot_settings_id() . '[contextual_help][content]', $count, $content) . '</li>';
                /* increment content count */
                $count++;
            }
        }
        echo '</ul>';
        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>';
        echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Changes', 'option-tree') . '</button>';
        echo '</div>';
        echo '</div>';
        echo '</form>';
        ?>
	
     <form name="seamless-donations-form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <div class="seamless-donations-forms-error-message" style="display:none"></div>
  <div id="dgx-donate-container">
    <div id="dgx-donate-form-donation-section" class="dgx-donate-form-section">
      <div id="donation_header">
        <div id="donation_header-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <h2>Donation Information</h2>
      </div>
      <div id="header_desc">
        <div id="header_desc-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <p>I would like to make a donation in the amount of:</p>
      </div>
      <span id="dgx_donate_giving_level_1000"><span id="dgx_donate_giving_level_1000-error-message" style="display:none" class="seamless-donations-error-message-field"></span>
      <input type="radio" name="_dgx_donate_amount" checked="" value="1000"  onclick="document.querySelector('#anmdna2').value='1000';document.querySelector('#anmdna').value='1000';" data-conceal=".other-donation-level">
      $1,000</span><span id="dgx_donate_giving_level_500" class="horiz"><span id="dgx_donate_giving_level_500-error-message" style="display:none" class="seamless-donations-error-message-field"></span>
      <input type="radio" name="_dgx_donate_amount" value="500"   onclick="document.querySelector('#anmdna').value='500';document.querySelector('#anmdna2').value='500';" data-conceal=".other-donation-level">
      $500</span><span id="dgx_donate_giving_level_100" class="horiz"><span id="dgx_donate_giving_level_100-error-message" style="display:none" class="seamless-donations-error-message-field"></span>
      <input type="radio" name="_dgx_donate_amount" value="100"   onclick="document.querySelector('#anmdna').value='100';document.querySelector('#anmdna2').value='100';" data-conceal=".other-donation-level">
      $100</span><span id="dgx_donate_giving_level_50" class="horiz"><span id="dgx_donate_giving_level_50-error-message" style="display:none" class="seamless-donations-error-message-field"></span>
      <input type="radio" name="_dgx_donate_amount" value="50"  onclick="document.querySelector('#anmdna').value='50';document.querySelector('#anmdna2').value='50';" data-conceal=".other-donation-level">
      $50</span><span id="other_radio_button" class="horiz"><span id="other_radio_button-error-message" style="display:none" class="seamless-donations-error-message-field"></span>
      <input type="radio" name="_dgx_donate_amount" value="OTHER" onclick="document.querySelector('#_dgx_donate_user_amount').style.display='block'" id="dgx-donate-other-radio" data-reveal=".other-donation-level">
      Other</span>
      <div id="_dgx_donate_user_amount" class="aftertext other-donation-level" style="display:none">
        <div id="_dgx_donate_user_amount-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        Other:
        <input type="text" name="_dgx_donate_user_amount" onkeyup="document.querySelector('#anmdna').value=this.value;document.querySelector('#anmdna2').value=this.value;" value="" size="15" id="_dgx_donate_user_amount" data-validate="currency">
      </div>
      <div>
        <div id="_dgx_donate_repeating">
          <div id="_dgx_donate_repeating-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
          <p>
            <input type="checkbox" name="_dgx_donate_repeating" id="dgx-donate-repeating" onclick="document.querySelector('#donation_astype').value='_xclick-subscriptions'">
            I would like this donation to automatically repeat each month</p>
        </div>
      </div>
    </div>
    <div></div>
    <div id="dgx-donate-form-paypal-hidden-section" class="dgx-donate-form-section" style="display:none">
      <div id="cmd">
        <div id="cmd-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="cmd" id="donation_astype" value="_donations">
      </div>
      <div id="business">
        <div id="business-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="business" value="*****@*****.**">
      </div>
      <div id="return">
        <div id="return-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="return" value="http://localhost/wordpress/?page_id=28&amp;thanks=1&amp;sessionid=sojguvpni55imjngd251sd5s12">
      </div>
      <div id="first_name">
        <div id="first_name-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="first_name" value="Asd">
      </div>
      <div id="last_name">
        <div id="last_name-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="last_name" value="asd">
      </div>
      <div id="address1">
        <div id="address1-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="address1" value="">
      </div>
      <div id="address2">
        <div id="address2-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="address2" value="">
      </div>
      <div id="city">
        <div id="city-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="city" value="">
      </div>
      <div id="state">
        <div id="state-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="state" value="">
      </div>
      <div id="zip">
        <div id="zip-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="zip" value="">
      </div>
      <div id="country">
        <div id="country-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="country" value="">
      </div>
      <div id="email">
        <div id="email-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="email" value="<?php 
        bloginfo('admin_email');
        ?>
">
      </div>
      <div id="custom">
        <div id="custom-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="custom" value="dgxdonate_sojguvpni5_1439312765">
      </div>
      <div id="notify_url">
        <div id="notify_url-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="notify_url" value="http://localhost/wordpress/wp-content/plugins/seamless-donations/dgx-donate-paypalstd-ipn.php">
      </div>
      <div id="item_name">
        <div id="item_name-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="item_name" value="Donation">
      </div>
      <div id="amount">
        <div id="amount-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="amount" id="anmdna2" value="1000">
      </div>
      <div id="quantity">
        <div id="quantity-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="quantity" value="1">
      </div>
      <div id="currency_code">
        <div id="currency_code-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="currency_code" value="USD">
      </div>
      <div id="no_note">
        <div id="no_note-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="no_note" value="1">
      </div>
      <div id="src">
        <div id="src-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="src" value="1">
      </div>
      <div id="p3">
        <div id="p3-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="p3" value="1">
      </div>
      <div id="t3">
        <div id="t3-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="t3" value="M">
      </div>
      <div id="a3">
        <div id="a3-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="hidden" name="a3" id="anmdna" value="1000">
      </div>
    </div>
    <div id="dgx-donate-form-payment-section" class="dgx-donate-form-section">
      <div id="dgx-donate-pay-enabled" class="dgx-donate-pay-enabled">
        <div id="dgx-donate-pay-enabled-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
        <input type="image" name="dgx-donate-pay-enabled" value="Donate Now" src="<?php 
        echo RJ_OT_URL;
        ?>
images/paypal_btn_donate_lg.gif">
      </div>
    </div>
  </div>
</form>

	<?php 
    }