예제 #1
0
 /**
  * Includes.
  */
 protected function includes()
 {
     require_once dirname(__FILE__) . '/functions.php';
     require_once dirname(__FILE__) . '/mexp-template.php';
     if (mexp_gdrive_is_user_profile_page_enabled() && is_main_site()) {
         require_once dirname(__FILE__) . '/admin-profile.php';
         if (function_exists('buddypress')) {
             require_once dirname(__FILE__) . '/buddypress.php';
         }
     }
 }
예제 #2
0
    /**
     * Search template.
     *
     * Kind of abused here to handle other stuff :)
     *
     * @param string $id  The file ID.
     * @param string $tab The MEXP tab.
     */
    public function search($id, $tab)
    {
        switch ($tab) {
            case 'gauth':
                ?>
				<form action="#" class="mexp-toolbar-container clearfix">
					<div id="gauth">
						<?php 
                if (is_main_site() || mexp_gdrive_is_subdomain_auth_supported()) {
                    ?>
							<button id="signinButton"><img src="https://developers.google.com/identity/images/btn_google_signin_dark_normal_web.png" alt="<?php 
                    _e('Sign in with Google', 'gdrive');
                    ?>
" /></button>
							<p><?php 
                    _e("We'll open a new page to help you connect to your Google Drive account.", 'gdrive');
                    ?>
</p>

						<?php 
                } elseif (mexp_gdrive_is_user_profile_page_enabled()) {
                    ?>

							<a href="<?php 
                    echo esc_url(mexp_gdrive_get_user_profile_url());
                    ?>
" class="button-primary button-larger" target="_blank"><?php 
                    _e('Set up Google Drive', 'gdrive');
                    ?>
</a>

							<p><?php 
                    _e('Before you can embed items from your Google Drive, you need to authenticate with Google.', 'gdrive');
                    ?>
</p>
							<p><?php 
                    _e('Click on the button above to connect your Google Drive account to this site and then reload this page.', 'gdrive');
                    ?>
</p>

						<?php 
                }
                ?>

					</div>
					<span class="description" style="display:none;"><?php 
                _e('Listing contents of your Google Drive.', 'gdrive');
                ?>
</span>
				</form>

				<?php 
                break;
            case 'gmine':
                ?>
				<form action="#" class="mexp-toolbar-container clearfix">
					<span class="description"><?php 
                _e('Listing contents of your Google Drive.', 'gdrive');
                ?>
</span>
					<input type="hidden" name="type" value="mine">
					<div class="spinner"></div>
				</form>
				<?php 
                break;
            case 'gsearch':
                ?>
				<form action="#" class="mexp-toolbar-container clearfix">
					<input
						type="text"
						name="q"
						value="{{ data.params.q }}"
						class="mexp-input-text mexp-input-search"
						size="40"
						placeholder="<?php 
                esc_attr_e('Search', 'gdrive');
                ?>
"
					>
					<input class="button button-large" type="submit" value="<?php 
                esc_attr_e('Search', 'gdrive');
                ?>
">
					<div class="spinner"></div>
				</form>
				<?php 
                break;
        }
    }