Ejemplo n.º 1
0
 function ApplyHead()
 {
     if (!empty($_GET['page']) && $_GET['page'] != 'Flutter_ThemeSettings') {
         return;
     }
     RCCWP_WritePostPage::CustomFieldsCSSScripts();
 }
Ejemplo n.º 2
0
    /**
     * Inserts CSS/Javascript code for Layout feature
     *
     */
    function AddHeaderLayoutCode()
    {
        global $flutter_domain;
        $layoutHeaderCode = "";
        //TODO Add CSS file links for rendering the page
        $layoutHeaderCode .= "\n\n<!-- TODO: CSS files for rendering pages-->\n";
        $layoutHeaderCode .= "<link rel='stylesheet' href='' type='text/css' media='screen' />\n";
        //TODO Call GenerateCSSSettings() to generate CSS code.
        $layoutHeaderCode .= FlutterLayout::GenerateCSSSettings($settings);
        //echo $layoutHeaderCode;
        //TODO If the user has enough privileges, add CSS/Javascript file links for editing the Layout
        if (current_user_can(FLUTTER_CAPABILITY_LAYOUT)) {
            require_once "RCCWP_WritePostPage.php";
            $FLUTTER_URI = FLUTTER_URI;
            $jquery_path = FLUTTER_URI . "js/layout/jquery.js";
            $jqueryui_path = FLUTTER_URI . "js/layout/jquery.ui.js";
            $ui_path = FLUTTER_URI . "js/layout/ui.js";
            $ui_css_path = FLUTTER_URI . "css/layout_style.css";
            global $template, $wpdb;
            $page = basename($template);
            RCCWP_WritePostPage::CustomFieldsCSSScripts();
            wp_enqueue_script('tiny_mce');
            $templateName = get_option('template');
            $LayoutSettings = $wpdb->get_var("SELECT settings FROM " . FLUTTER_TABLE_LAYOUT_SETTINGS . " WHERE theme = '{$templateName}' AND page='{$page}'");
            ?>

			<!-- TODO: CSS/JavaScript files for rendering admin tools on theme pages-->
			
			<link rel='stylesheet' href='<?php 
            echo $ui_css_path;
            ?>
' type='text/css' media='screen' />
			
			<script language="JavaScript" type="text/javascript" > 
				var JS_FLUTTER_URI = '<?php 
            echo $FLUTTER_URI;
            ?>
'; // Flutter URL
				var JS_FLUTTER_FILES_PATH = '<?php 
            echo FLUTTER_FILES_PATH;
            ?>
'; // Flutter URL
				var CURRENT_PAGE = '<?php 
            echo $page;
            ?>
'; // The name of the current page
			</script>
			<script type="text/javascript" src="<?php 
            echo $jquery_path;
            ?>
"></script>
			<script type="text/javascript" src="<?php 
            echo $jqueryui_path;
            ?>
"></script>
			<script type="text/javascript" src="<?php 
            echo $ui_path;
            ?>
"></script>
			
			
			<!-- Load theme settings-->
			<script type="text/javascript">
			// Configurable Settings
			var settings = <?php 
            echo $LayoutSettings;
            ?>
;
			
			if (settings.ie) {
				settings.incrementLeft = 10;
				settings.incrementRight = 30
				settings.incrementTop = 10
			}
			
			$(document).ready(function(){
				// Add extra margin to the bottom of entire page:
				$('div#container').css('margin-bottom', '250px');
			
				$('#tools-header li a').click(function() {
					switchTab($(this).attr('href'));
					$(this).addClass('current');
					return false;
				});
				
				$('div#leftcolumn .module, div#rightcolumn .module').dblclick(function() {
					$('div.tools-content').hide();
					$('#tools-header li a').removeClass('current');
					
					$('li#tools-module-properties').show().children('a').addClass('current');
					$('#tools-module-settings').show();
					
					$('#tools-settings-modulename').text('Module "'+$("h3",this).text()+'"');
					
					// load settings form
					$('#tools-form').load('http://www.freshout.co.uk/~fluttert/wp-content/themes/flutter/test.html', {block_id:1}, function() {
						if(window.console) console.log('loaded :)');
					});
					
					// add actions to buttons
					$('#tools-module-settings input[name=s]').click(function(){
						$('#formcontrols').append('<img src="http://www.freshout.co.uk/~fluttert/wp-content/themes/flutter/images/tools-loader.gif" width="16" height="16" border="0" id="forms-loader" />');
						
						// ajax submit was ok?
						if (1) {
							// show OK message
			//				$('#forms-loader').remove();
						} else {
							// show ERROR message
			//				$('#forms-loader').remove();
						}
						if(window.console) console.log('yay! do some ajax mambo!')
					});
					// add settings form
					
					//tb_show('','http://www.freshout.co.uk/~fluttert/wp-content/plugins/Flutter/canvas-plugin_form_test.php?zone=leftsidebar&position=1&block_id='+$(this).attr('rel')+'?height=400&width=500');
					//tb_show('','index.php#TB_inline?height=400&width=400&inlineId=moduleEdit');
					// /~fluttert/wp-content/plugins/Flutter/canvas-plugin_form.php?zone=leftsidebar&position=1&block_id=3
				})
			})
			</script>
			
			<?php 
        }
    }