Beispiel #1
0
 /**
  * Language loader
  */
 function localize()
 {
     $text_domains = array(SO_TEXT_DOMAIN, 'smart_offers');
     // For Backward Compatibility
     $plugin_dirname = SO_PLUGIN_DIRNAME;
     foreach ($text_domains as $text_domain) {
         self::$text_domain = $text_domain;
         $locale = apply_filters('plugin_locale', get_locale(), self::$text_domain);
         $loaded = load_textdomain(self::$text_domain, WP_LANG_DIR . '/' . $plugin_dirname . '/' . self::$text_domain . '-' . $locale . '.mo');
         if (!$loaded) {
             $loaded = load_plugin_textdomain(self::$text_domain, false, $plugin_dirname . '/languages');
         }
         if ($loaded) {
             break;
         }
     }
 }
    /**
     * Intro text/links shown on all about pages.
     */
    private function intro()
    {
        if (is_callable('SA_Smart_Offers::get_smart_offers_plugin_data')) {
            $plugin_data = SA_Smart_Offers::get_smart_offers_plugin_data();
            $version = $plugin_data['Version'];
        } else {
            $version = '';
        }
        ?>
		<h1><?php 
        printf(__('Welcome to Smart Offers %s', SA_Smart_Offers::$text_domain), $version);
        ?>
</h1>

		<h3><?php 
        echo __('Thanks for installing! We hope you enjoy using Smart Offers.', SA_Smart_Offers::$text_domain);
        ?>
</h3>

		<div class="feature-section col two-col">
			<div class="col-1">
				<p class="woocommerce-actions">
					<a href="<?php 
        echo admin_url('edit.php?post_type=smart_offers');
        ?>
" class="button button-primary"><?php 
        echo __('Get Started!', SA_Smart_Offers::$text_domain);
        ?>
</a>
					<a href="<?php 
        echo admin_url('admin.php?page=wc-settings&tab=smart_offers');
        ?>
" class="button button-primary" target="_blank"><?php 
        echo __('Settings', SA_Smart_Offers::$text_domain);
        ?>
</a>
					<a href="<?php 
        echo esc_url(apply_filters('smart_offers_docs_url', 'http://www.storeapps.org/support/documentation/smart-offers/', SA_Smart_Offers::$text_domain));
        ?>
" class="docs button button-primary" target="_blank"><?php 
        echo __('Docs', SA_Smart_Offers::$text_domain);
        ?>
</a>
				</p>
			</div>

			<div class="col-2 last-feature">
				<p align="right">
					<?php 
        echo __('Questions? Need Help?', SA_Smart_Offers::$text_domain);
        ?>
<br>
		            <a class="thickbox" href="<?php 
        echo admin_url('#TB_inline?inlineId=smart_offers_post_query_form&post_type=smart_offers');
        ?>
">
		          		<?php 
        echo __('Contact Us', SA_Smart_Offers::$text_domain);
        ?>
		            </a>
				</p>
			</div>
		</div>
		<?php 
        if (get_option('smart_offers_sample_data_imported') != 'yes') {
            ?>
				<p>
					<h4><?php 
            echo __('Don\'t know, how to create offers? We\'ve created some sample offers for you!', SA_Smart_Offers::$text_domain);
            ?>
</h4>
					<a class="button button-primary" href="<?php 
            echo admin_url('index.php?page=so-about&action=import');
            ?>
">
						<?php 
            echo __('Edit & Publish it', SA_Smart_Offers::$text_domain);
            ?>
					</a>
				</p>
				<?php 
        }
        ?>
		<h2 class="nav-tab-wrapper">
			<a class="nav-tab <?php 
        if ($_GET['page'] == 'so-about') {
            echo 'nav-tab-active';
        }
        ?>
" href="<?php 
        echo esc_url(admin_url(add_query_arg(array('page' => 'so-about'), 'index.php')));
        ?>
">
				<?php 
        echo __('Know Smart Offers', SA_Smart_Offers::$text_domain);
        ?>
			</a>
			<a class="nav-tab <?php 
        if ($_GET['page'] == 'so-shortcode') {
            echo 'nav-tab-active';
        }
        ?>
" href="<?php 
        echo esc_url(admin_url(add_query_arg(array('page' => 'so-shortcode'), 'index.php')));
        ?>
">
				<?php 
        echo __('Shortcode', SA_Smart_Offers::$text_domain);
        ?>
			</a>
			<a class="nav-tab <?php 
        if ($_GET['page'] == 'so-faqs') {
            echo 'nav-tab-active';
        }
        ?>
" href="<?php 
        echo esc_url(admin_url(add_query_arg(array('page' => 'so-faqs'), 'index.php')));
        ?>
">
				<?php 
        echo __('FAQ\'s', SA_Smart_Offers::$text_domain);
        ?>
			</a>
		</h2>
		<?php 
    }