Beispiel #1
0
function parabola_page_fn()
{
    // Load the import form page if the import button has been pressed
    if (isset($_POST['parabola_import'])) {
        parabola_import_form();
        return;
    }
    // Load the import form  page after upload button has been pressed
    if (isset($_POST['parabola_import_confirmed'])) {
        parabola_import_file();
        return;
    }
    // Load the presets  page after presets button has been pressed
    if (isset($_POST['parabola_presets'])) {
        parabola_init_fn();
        parabola_presets();
        return;
    }
    if (!current_user_can('edit_theme_options')) {
        wp_die(__('Sorry, but you do not have sufficient permissions to access this page.', 'parabola'));
    }
    ?>


<div class="wrap"><!-- Admin wrap page -->

<div id="lefty"><!-- Left side of page - the options area -->
<div>
	<div id="admin_header"><img src="<?php 
    echo get_template_directory_uri() . '/admin/images/parabola-logo.png';
    ?>
" /> </div>
	<div id="admin_links">
		<a target="_blank" href="http://www.cryoutcreations.eu/parabola">Parabola Homepage</a>
		<a target="_blank" href="http://www.cryoutcreations.eu/forum">Support</a>
		<a target="_blank" href="http://www.cryoutcreations.eu">Cryout Creations</a>
	</div>
	<div style="clear: both;"></div>
</div>
<?php 
    if (isset($_GET['settings-updated'])) {
        echo "<div class='updated fade' style='clear:left;'><p>";
        echo _e('Parabola settings updated successfully.', 'parabola');
        echo "</p></div>";
    }
    ?>
<div id="jsAlert" class=""><b>Checking jQuery functionality...</b><br/><em>If this message remains visible after the page has loaded then there is a problem with your WordPress jQuery library. This can have several causes, including incompatible plugins.
The Parabola Settings page cannot function without jQuery. </em></div>

	<div id="main-options">
		<form name="parabola_form" action="options.php" method="post" enctype="multipart/form-data">
			<div id="accordion">
				<?php 
    settings_fields('parabola_settings');
    ?>
				<?php 
    do_settings_sections(__FILE__);
    ?>
			</div>
			<div id="submitDiv">
			    <br>
				<input class="button" name="parabola_settings[parabola_submit]" type="submit" style="float:right;"   value="<?php 
    _e('Save Changes', 'parabola');
    ?>
" />
				<input class="button" name="parabola_settings[parabola_defaults]" id="parabola_defaults" type="submit" style="float:left;" value="<?php 
    _e('Reset to Defaults', 'parabola');
    ?>
" />
				</div>
		</form>
		<?php 
    $parabola_theme_data = get_transient('parabola_theme_info');
    ?>
		<span id="version">
		Parabola v<?php 
    echo PARABOLA_VERSION;
    ?>
 by <a href="http://www.cryoutcreations.eu" target="_blank">Cryout Creations</a>
		</span>
	</div><!-- main-options -->
</div><!--lefty -->


<div id="righty" ><!-- Right side of page - Coffee, RSS tips and others -->
	<div class="postbox donate">
		<h3 class="hndle"> Coffee Break </h3>
		<div class="inside"><?php 
    echo "<p>Great power comes with great responsibility. We have complete faith that you will only use Parabola for good. You will not use it to destroy worlds, but to create them. You will not use it to control minds, but to expand them. You will not use it to enslave your peers but you will introduce them to Parabola so that they may one day become your equals. We *know* our theme won't be crippled in your hands, you'll nourish it and use it to its full potential.</p>\r\n\t\t<p>But if you feel the dark forces are somehow taking over, if you sense Parabola is not serving its true, original purpose... buy us a coffee and we'll stay up all night to restore the balance. We know the dark forces very well ;)</p> ";
    ?>
			<div style="display:block;float:none;margin:0 auto;text-align:center;">
				<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
					<input type="hidden" name="cmd" value="_donations">
					<input type="hidden" name="business" value="KYL26KAN4PJC8">
					<input type="hidden" name="item_name" value="Cryout Creations / Parabola Theme donation">
					<input type="hidden" name="currency_code" value="EUR">
					<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_SM.gif:NonHosted">
					<input type="image" src="<?php 
    echo get_template_directory_uri() . '/admin/images/coffee.png';
    ?>
" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
					<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
				</form>	
			</div>
			<p>Or socially smother, caress and embrace us:</p>
			<div style="display:table;float:none;margin:0 auto;">
				<div id="fb-root"></div><div class="fb-like" data-href="https://www.facebook.com/CryoutCreations" data-layout="button" data-action="like" data-show-faces="false" data-share="false"></div>
				<a href="https://twitter.com/cryoutcreations" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false">Follow @cryoutcreations</a>
				<script src="https://apis.google.com/js/platform.js" async defer></script> <div class="g-plusone" data-href="https://plus.google.com/+CryoutcreationsEuCR2"  data-size="medium" data-annotation="none"></div>
			</div>
		</div><!-- inside -->
	</div><!-- donate -->

    <div class="postbox export non-essential-option" style="overflow:hidden;">
        <div class="head-wrap">
            <div title="Click to toggle" class="handlediv"><br /></div>
           	<h3 class="hndle"><?php 
    _e('Import/Export Settings', 'parabola');
    ?>
</h3>
        </div><!-- head-wrap -->
        <div class="panel-wrap inside">
				<form action="" method="post">
                	<?php 
    wp_nonce_field('parabola-export', 'parabola-export');
    ?>
                    <input type="hidden" name="parabola_export" value="true" />
                    <input type="submit" class="button" value="<?php 
    _e('Export Theme options', 'parabola');
    ?>
" />
					<p class="imex-text"><?php 
    _e("It's that easy: a mouse click away - the ability to export your Parabola settings and save them on your computer. Feeling safer? You should!", "parabola");
    ?>
</p>
                </form>
				<br />
                <form action="" method="post">
                    <input type="hidden" name="parabola_import" value="true" />
                    <input type="submit" class="button" value="<?php 
    _e('Import Theme options', 'parabola');
    ?>
" />
					<p class="imex-text"><?php 
    _e("Without the import, the export would just be a fool's exercise. Make sure you have the exported file ready and see you after the mouse click.", "parabola");
    ?>
</p>
                </form>
				<br />
				<form action="" method="post">
                    <input type="hidden" name="parabola_presets" value="true" />
                    <input type="submit" class="button" id="presets_button" value="<?php 
    _e('Color Schemes', 'parabola');
    ?>
" />
					<p class="imex-text"><?php 
    _e("A collection of preset color schemes to use as the starting point for your site. Just load one up and see your blog in a different light.", "parabola");
    ?>
</p>
                </form> 

		</div><!-- inside -->
	</div><!-- export -->

    <div class="postbox news" >
            <div>
        		<h3 class="hndle"><?php 
    _e('Parabola Latest News', 'parabola');
    ?>
</h3>
            </div>
            <div class="panel-wrap inside" style="height:200px;overflow:auto;">
                <?php 
    $parabola_news = fetch_feed(array('http://www.cryoutcreations.eu/cat/parabola/feed/'));
    $maxitems = 0;
    if (!is_wp_error($parabola_news)) {
        $maxitems = $parabola_news->get_item_quantity(10);
        $news_items = $parabola_news->get_items(0, $maxitems);
    }
    ?>
                <ul class="news-list">
                	<?php 
    if ($maxitems == 0) {
        echo '<li>' . __('No news items.', 'parabola') . '</li>';
    } else {
        foreach ($news_items as $news_item) {
            ?>
                    	<li>
                        	<a class="news-header" href='<?php 
            echo esc_url($news_item->get_permalink());
            ?>
'><?php 
            echo esc_html($news_item->get_title());
            ?>
</a><br />
                   <span class="news-item-date"><?php 
            _e('Posted on', 'parabola');
            echo $news_item->get_date(' j F Y, H:i');
            ?>
</span>
                            
					<br><a class="news-read" href='<?php 
            echo esc_url($news_item->get_permalink());
            ?>
'>Read the full post &raquo;</a><br />
                        </li>
                    <?php 
        }
    }
    ?>
                </ul>
            </div><!-- inside -->
    </div><!-- news -->


</div><!--  righty -->
</div><!--  wrap -->

<script type="text/javascript">
var reset_confirmation = '<?php 
    echo esc_html(__('Reset Parabola Settings to Defaults?', 'parabola'));
    ?>
'; 

function tooltip_terain() {
	jQuery('#accordion small').parent('div').append('<a class="tooltip"><img src="<?php 
    echo get_template_directory_uri();
    ?>
/images/icon-tooltip.png" /></a>').
		each(function() {
			/*jQuery(this).children('a.tooltip').attr('title',jQuery(this).children('small').html() );*/
			var tooltip_info = jQuery(this).children('small').html();
			jQuery(this).children('.tooltip').tooltip({content : tooltip_info});
			jQuery(this).children('.tooltip').tooltip( "option", "items", "a" );
			/*jQuery(this).children('.tooltip').tooltip( "option", "show", "false");*/
			jQuery(this).children('.tooltip').tooltip( "option", "hide", "false");
			jQuery(this).children('small').remove();
			if (!jQuery(this).hasClass('slmini') && !jQuery(this).hasClass('slidercontent') && !jQuery(this).hasClass('slideDivs')) jQuery(this).addClass('tooltip_div');
		});
}

/* jQuery confim window on reset to defaults */
jQuery('#parabola_defaults').click (function() {
		if (!confirm(reset_confirmation)) { return false;}
});

/* jQuery confim window on loading a color scheme */
jQuery('#load-color-scheme').click (function() {
		if (!confirm(scheme_confirmation)) { return false;}
});

jQuery(document).ready(function(){
	/* var _jQueryVer = parseFloat('.'+jQuery().jquery.replace(/\./g, ''));  // jQuery version as float, eg: 0.183
	var _jQueryUIVer = parseFloat('.'+jQuery.ui.version.replace(/\./g, '')); // jQuery UI version as float, eg: 0.192
	//if (_jQueryUIVer >= 0.190) { */
	if (vercomp(jQuery.ui.version,"1.9.0")) {
		tooltip_terain();
		jQuery('.colorthingy').each(function(){
			id = "#"+jQuery(this).attr('id');
			startfarb(id,id+'2');
		});
	} else {
		jQuery("#main-options").addClass('oldwp');
		setTimeout(function(){jQuery('#parabola_slideType').trigger('click')},1000);
		jQuery('.colorthingy').each(function(){
			id = "#"+jQuery(this).attr('id');
			jQuery(this).on('keyup',function(){coloursel(this)});
			coloursel(this);
		});
		/* warn about the old partially unsupported version */
		jQuery("#jsAlert").after("<div class='updated fade' style='clear:left; font-size: 16px;'><p>Parabola has detected you are running an older version of Wordpress (jQuery) and will be running in compatibility mode. Some features may not work correctly. Consider updating your Wordpress to the latest version.</p></div>");
	}
});
jQuery('#jsAlert').hide();
</script>

<?php 
}
Beispiel #2
0
function parabola_page_fn()
{
    // Load the import form page if the import button has been pressed
    if (isset($_POST['parabola_import'])) {
        parabola_import_form();
        return;
    }
    // Load the import form  page after upload button has been pressed
    if (isset($_POST['parabola_import_confirmed'])) {
        parabola_import_file();
        return;
    }
    // Load the presets  page after presets button has been pressed
    if (isset($_POST['parabola_presets'])) {
        parabola_init_fn();
        parabola_presets();
        return;
    }
    if (!current_user_can('edit_theme_options')) {
        wp_die(__('Sorry, but you do not have sufficient permissions to access this page.', 'parabola'));
    }
    ?>


<div class="wrap"><!-- Admin wrap page -->

<div id="lefty"><!-- Left side of page - the options area -->
<div>
	<div id="admin_header"><img src="<?php 
    echo get_template_directory_uri() . '/admin/images/parabola-logo.png';
    ?>
" /> </div>
	<div id="admin_links">
		<a target="_blank" href="http://www.cryoutcreations.eu/parabola">Parabola Homepage</a>
		<a target="_blank" href="http://www.cryoutcreations.eu/forum">Support</a>
		<a target="_blank" href="http://www.cryoutcreations.eu">Cryout Creations</a>
	</div>
	<div style="clear: both;"></div>
</div>
<div id="jsAlert" class="error" style="padding:5px 10px;">If this message remains visible after the page has loaded then there is a problem with your WordPress jQuery library. This can have several causes, including incompatible plugins.<br> 
The Parabola Settings page cannot function without jQuery. You need to fix this issue before you can configure Parabola.</div>
<?php 
    if (isset($_GET['settings-updated'])) {
        echo "<div class='updated fade' style='clear:left;'><p>";
        echo _e('Parabola settings updated successfully.', 'parabola');
        echo "</p></div>";
    }
    ?>

	<div id="main-options">
		<form name="parabola_form" action="options.php" method="post" enctype="multipart/form-data">
			<div id="accordion">
				<?php 
    settings_fields('parabola_settings');
    ?>
				<?php 
    do_settings_sections(__FILE__);
    ?>
			</div>
			<div id="submitDiv">
			    <br>
				<input class="button" name="parabola_settings[parabola_submit]" type="submit" style="float:right;"   value="<?php 
    _e('Save Changes', 'parabola');
    ?>
" />
				<input class="button" name="parabola_settings[parabola_defaults]" id="parabola_defaults" type="submit" style="float:left;" value="<?php 
    _e('Reset to Defaults', 'parabola');
    ?>
" />
				</div>
		</form>
		<?php 
    $parabola_theme_data = get_transient('parabola_theme_info');
    ?>
		<span id="version">
		Parabola v<?php 
    echo PARABOLA_VERSION;
    ?>
 by <a href="http://www.cryoutcreations.eu" target="_blank">Cryout Creations</a>
		</span>
	</div><!-- main-options -->
</div><!--lefty -->


<div id="righty" ><!-- Right side of page - Coffee, RSS tips and others -->
	<div class="postbox donate">
		<h3 class="hndle"> Coffee Break </h3>
		<div class="inside"><?php 
    echo "<p>Great power comes with great responsibility. We have complete faith that you will only use Parabola for good. You will not use it to destroy worlds, but to create them. You will not use it to control minds, but to expand them. You will not use it to enslave your peers but you will introduce them to Parabola so that they may one day become your equals. We *know* our theme won't be crippled in your hands, you'll nourish it and use it to its full potential.</p>\r\n\t\t<p>But if you feel the dark forces are somehow taking over, if you sense Parabola is not serving its true, original purpose... buy us a coffee and we'll stay up all night to restore the balance. We know the dark forces very well ;)</p> ";
    ?>
			<div style="display:block;float:none;margin:0 auto;text-align:center;">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
">
<input type="image" src="<?php 
    echo get_template_directory_uri() . '/admin/images/coffee.png';
    ?>
" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
			</div>
		</div><!-- inside -->
	</div><!-- donate -->

    <div class="postbox export non-essential-option" style="overflow:hidden;">
        <div class="head-wrap">
            <div title="Click to toggle" class="handlediv"><br /></div>
           	<h3 class="hndle"><?php 
    _e('Import/Export Settings', 'parabola');
    ?>
</h3>
        </div><!-- head-wrap -->
        <div class="panel-wrap inside">
				<form action="" method="post">
                	<?php 
    wp_nonce_field('parabola-export', 'parabola-export');
    ?>
                    <input type="hidden" name="parabola_export" value="true" />
                    <input type="submit" class="button" value="<?php 
    _e('Export Theme options', 'parabola');
    ?>
" />
					<p style="display:block;float:left;clear:left;margin-top:0;"><?php 
    _e("It's that easy: a mouse click away - the ability to export your Parabola settings and save them on your computer. Feeling safer? You should!", "parabola");
    ?>
</p>
                </form>
				<br />
                <form action="" method="post">
                    <input type="hidden" name="parabola_import" value="true" />
                    <input type="submit" class="button" value="<?php 
    _e('Import Theme options', 'parabola');
    ?>
" />
					<p style="display:block;float:left;clear:left;margin-top:0;"><?php 
    _e("Without the import, the export would just be a fool's exercise. Make sure you have the exported file ready and see you after the mouse click.", "parabola");
    ?>
</p>
                </form>
				<br />
				<form action="" method="post">
                    <input type="hidden" name="parabola_presets" value="true" />
                    <input type="submit" class="button" id="presets_button" value="<?php 
    _e('Color Schemes', 'parabola');
    ?>
" />
					<p style="display:block;float:left;clear:left;margin-top:0;"><?php 
    _e("A collection of preset color schemes to use as the starting point for your site. Just load one up and see your blog in a different light.", "parabola");
    ?>
</p>
                </form> 

		</div><!-- inside -->
	</div><!-- export -->

    <div class="postbox news" >
            <div>
        		<h3 class="hndle"><?php 
    _e('Parabola Latest News', 'parabola');
    ?>
</h3>
            </div>
            <div class="panel-wrap inside" style="height:200px;overflow:auto;">
                <?php 
    $parabola_news = fetch_feed(array('http://www.cryoutcreations.eu/cat/parabola/feed/'));
    if (!is_wp_error($parabola_news)) {
        $maxitems = $parabola_news->get_item_quantity(10);
        $news_items = $parabola_news->get_items(0, $maxitems);
    }
    ?>
                <ul class="news-list">
                	<?php 
    if ($maxitems == 0) {
        echo '<li>' . __('No news items.', 'parabola') . '</li>';
    } else {
        foreach ($news_items as $news_item) {
            ?>
                    	<li>
                        	<a class="news-header" href='<?php 
            echo esc_url($news_item->get_permalink());
            ?>
'><?php 
            echo esc_html($news_item->get_title());
            ?>
</a><br />
                   <span class="news-item-date"><?php 
            _e('Posted on', 'parabola');
            echo $news_item->get_date(' j F Y, H:i');
            ?>
</span><br />
                            <?php 
            echo parabola_truncate_words(strip_tags($news_item->get_description()), 40, '...');
            ?>
					<br><a class="news-read" href='<?php 
            echo esc_url($news_item->get_permalink());
            ?>
'>Read more &raquo;</a><br />
                        </li>
                    <?php 
        }
    }
    ?>
                </ul>
            </div><!-- inside -->
    </div><!-- news -->


</div><!--  righty -->
</div><!--  wrap -->

<script type="text/javascript">
var reset_confirmation = '<?php 
    echo esc_html(__('Reset Parabola Settings to Defaults?', 'parabola'));
    ?>
'; 

function startfarb(a,b) {
	jQuery(b).css('display','none');
	jQuery(b).farbtastic(a).addtitle({id: a});

	jQuery(a).click(function() {
			if(jQuery(b).css('display') == 'none')	{
                                        			jQuery(b).parents('div:eq(0)').addClass('ui-accordion-content-overflow');
                                                       jQuery(b).css('display','inline-block').hide().show(150);
                                                       }
	});

	jQuery(document).mousedown( function() {
			jQuery(b).hide(300, function(){ jQuery(b).parents('div:eq(0)').removeClass('ui-accordion-content-overflow'); });
			// todo: find a better way to remove class after the fade on IEs
	});
}

function tooltip_terain() {
jQuery('#accordion small').parent('div').append('<a class="tooltip"><img src="<?php 
    echo get_template_directory_uri();
    ?>
/images/icon-tooltip.png" /></a>').
	each(function() {
	//jQuery(this).children('a.tooltip').attr('title',jQuery(this).children('small').html() );
	var tooltip_info = jQuery(this).children('small').html();
	jQuery(this).children('.tooltip').tooltip({content : tooltip_info});
     jQuery(this).children('.tooltip').tooltip( "option", "items", "a" );
	//jQuery(this).children('.tooltip').tooltip( "option", "show", "false");
	jQuery(this).children('.tooltip').tooltip( "option", "hide", "false");
	jQuery(this).children('small').remove();
	if (!jQuery(this).hasClass('slmini') && !jQuery(this).hasClass('slidercontent') && !jQuery(this).hasClass('slideDivs')) jQuery(this).addClass('tooltip_div');
	});
}

function coloursel(el){
	var id = "#"+jQuery(el).attr('id');
	jQuery(id+"2").hide();
	var bgcolor = jQuery(id).val();
	if (bgcolor <= "#666666") { jQuery(id).css('color','#ffffff'); } else { jQuery(id).css('color','#000000'); };
	jQuery(id).css('background-color',jQuery(id).val());
}

function vercomp(ver, req) {
    var v = ver.split('.');
    var q = req.split('.');
    for (var i = 0; i < v.length; ++i) {
        if (q.length == i) { return true; } // v is bigger
        if (parseInt(v[i]) == parseInt(q[i])) { continue; } // nothing to do here, move along
        else if (parseInt(v[i]) > parseInt(q[i])) { return true; } // v is bigger
        else { return false; } // q is bigger
    }
    if (v.length != q.length) { return false; } // q is bigger
    return true; // v = q;
}

// farbtastic title addon function
(function($){
        $.fn.extend({
            addtitle: function(options) {
                var defaults = {
                    id: ''
                }
                var options = $.extend(defaults, options);
            return this.each(function() {
                    var o = options;
					var title = jQuery(o.id).attr('title');
                    if (title===undefined) { } else { jQuery(o.id+'2').children('.farbtastic').append('<span class="mytitle">'+title+'</span>'); }
            });
        }
        });
})(jQuery);


jQuery(document).ready(function(){
	//var _jQueryVer = parseFloat('.'+jQuery().jquery.replace(/\./g, ''));  // jQuery version as float, eg: 0.183
	//var _jQueryUIVer = parseFloat('.'+jQuery.ui.version.replace(/\./g, '')); // jQuery UI version as float, eg: 0.192
	//if (_jQueryUIVer >= 0.190) {
	if (vercomp(jQuery.ui.version,"1.9.0")) {
		tooltip_terain();
		jQuery('.colorthingy').each(function(){
			id = "#"+jQuery(this).attr('id');
			startfarb(id,id+'2');
		});
	} else {
		jQuery("#main-options").addClass('oldwp');
		setTimeout(function(){jQuery('#parabola_slideType').trigger('click')},1000);
		jQuery('.colorthingy').each(function(){
			id = "#"+jQuery(this).attr('id');
			jQuery(this).on('keyup',function(){coloursel(this)});
			coloursel(this);
		});
		// warn about the old partially unsupported version
		jQuery("#jsAlert").after("<div class='updated fade' style='clear:left; font-size: 16px;'><p>Parabola has detected you are running an older version of Wordpress (jQuery) and will be running in compatibility mode. Some features may not work correctly. Consider updating your Wordpress to the latest version.</p></div>");
	}
});
jQuery('#jsAlert').hide();
</script>

<?php 
}