WordPress.org

Making WordPress.org


Ignore:
Timestamp:
06/01/2018 05:34:59 PM (4 years ago)
Author:
iandunn
Message:

WordCamp Post Types: Add print button and stylesheet to schedule shortcode.

As a result, UI tabs were introduced, and some corresponding "email" references were renamed, to reflect the more generic nature that the form now has.

Props egmanekki.
See #2733.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-post-types/wc-post-types.php

    r7220 r7261  
    706706        $html .= '</tbody>';
    707707        $html .= '</table>';
    708         $html .= $this->fav_session_email_form();
     708        $html .= $this->fav_session_share_form();
    709709        return $html;
    710710    }
     
    745745     * @return string HTML code that represents the form to send emails and a link to show and hide it.
    746746     */
    747     function fav_session_email_form() {
    748         static $email_form_count = 0;
    749 
    750         // Skip email form if it is disabled or it was already added to document.
    751         if ( email_fav_sessions_disabled() || $email_form_count !== 0 ) {
     747    function fav_session_share_form() {
     748        static $share_form_count = 0;
     749
     750        // Skip share form if it was already added to document.
     751        if ( 0 !== $share_form_count ) {
    752752            return '';
    753753        }
     
    757757
    758758        <div class="email-form fav-session-email-form-hide">
    759             <div id="fav-session-email-form">
    760                 <?php esc_html_e( 'Send me my favorite sessions:', 'wordcamporg' ); ?>
    761 
    762                 <form id="fav-sessions-form">
    763                     <input type="text" name="email_address" id="fav-sessions-email-address" placeholder="my@email.com" />
    764                     <input type="submit" value="<?php esc_attr_e( 'Send', 'wordcamporg' ); ?>" />
    765                 </form>
     759            <!-- Tab links -->
     760            <div class="fav-session-share-tab">
     761                <?php if ( ! email_fav_sessions_disabled() ) : ?>
     762                    <div class="fav-session-tablinks" id="fav-session-btn-email">
     763                        <?php esc_html_e( 'Email', 'wordcamporg' ); ?>
     764                    </div>
     765                <?php endif; ?>
     766
     767                <div class="fav-session-tablinks" id="fav-session-btn-print">
     768                    <?php esc_html_e( 'Print', 'wordcamporg' ); ?>
     769                </div>
    766770            </div>
    767             <div class="fav-session-email-wait-spinner"></div>
    768             <div class="fav-session-email-result"></div>
     771
     772            <!-- Tab content -->
     773            <?php if ( ! email_fav_sessions_disabled() ) : ?>
     774                <div id="fav-session-tab-email" class="fav-session-share-tabcontent">
     775                    <div id="fav-session-email-form">
     776                        <?php esc_html_e( 'Send me my favorite sessions:', 'wordcamporg' ); ?>
     777
     778                        <form id="fav-sessions-form">
     779                            <input type="text" name="email_address" id="fav-sessions-email-address" placeholder="me@protonmail.com" />
     780                            <input type="submit" value="<?php esc_attr_e( 'Send', 'wordcamporg' ); ?>" />
     781                        </form>
     782                    </div>
     783
     784                    <div class="fav-session-email-wait-spinner"></div>
     785                    <div class="fav-session-email-result"></div>
     786                </div>
     787            <?php endif; ?>
     788
     789            <div id="fav-session-tab-print" class="fav-session-share-tabcontent">
     790                <button id="fav-session-print">
     791                    <?php esc_html_e( 'Print favorite sessions', 'wordcamporg' ); ?>
     792                </button>
     793            </div>
    769794        </div>
    770795
     
    775800
    776801        <?php
    777         $email_form = ob_get_clean();
    778 
    779         $email_form_count++;
    780 
    781         return $email_form;
     802        $share_form = ob_get_clean();
     803
     804        $share_form_count++;
     805
     806        return $share_form;
    782807    }
    783808
Note: See TracChangeset for help on using the changeset viewer.