<?php
/* admin tab for Advanced Options */
     
function ttw_advanced_admin() {
    global $options;
    
    $myName = esc_attr( get_bloginfo( 'name', 'display' ) );
    $myDescrip = esc_attr( get_bloginfo( 'description', 'display' ) );
    
    $headText = "<!-- Fix these meta tags to describe your site. Add CSS to the style block for even more customization. -->
<meta name=\"description\" content=\" $myName - $myDescrip \" />
<meta name=\"keywords\" content=\"$myName blog, $myName\" />
<style type=\"text/css\">
</style>";

    if (!ttw_getopt('ttw_head_opts'))
	ttw_setopt('ttw_head_opts', $headText);
     ?>
        <div style="padding-left: 20px; padding-right: 20px;">
        <form name="ttw_options_form" method="post">
		<input type="hidden" name="updated" value="1" />
		
		<h3>Advanced Options </h3>
		<p><strong>Advanced Options - Insert your own code or snippets</strong></p>
		
		<span class="submit" style="border: none;"><input type="submit" name="saveadvanced" value="Update Advanced Options"/></span>
		
		<fieldset class="options">

		<p>The fields on this page allow you to save pieces of HTML code required by third-party plugins and widgets.
                You can also use them to save Google Maps/Analytics/AdSense javascript snippets. You will need to understand a bit of HTML
                coding to used these fields effectively.</p>
		
		<p>The values you put here are saved in the Wordpress database, and will survive theme upgrades and other changes.</p>

		<p>PLEASE NOTE: NO validation is made on the field values, so be careful not to paste invalid code.
                Invalid code is usually harmless, but it can make your site display incorrectlly. If your site looks broken after you add stuff here,
                please double check that what you entered uses valid HTML commands. Also note that backslashes will be stripped.</p>
                <hr />

		<label><b>&lt;HEAD&gt; Section</b></label><br/>

                Code entered in this box is included right before &lt;/HEAD&gt; tag in your site. You can add <em>custom CSS</em> here to further enhance the look of your site.
                There are examples of some custom CSS in the <b>Help</b> section. Another use is for &lt;META&gt; tags for description or bot search terms. (This field is also useful for entering links to javascript files or anything else that
                belongs in the &lt;HEAD&gt;, but this use will be uncommon - usually you can find a WP Plugin to do what you need.)
		<br />
                                
		<textarea name="ttw_head_opts" rows=7 style="width: 95%"><?php echo(str_replace("\\", "", ttw_getopt('ttw_head_opts'))); ?></textarea>
                
                <br /><br />
		
		<label><b>Site Footer Area</b></label><br/>
                This code will be inserted into the site footer area, right before the before the "Powered by" credits, but after any Footer widgets. This
                could include extra information, visit counters, etc. You can use HTML here (including
		<a href="http://codex.wordpress.org/Shortcode" target="_blank">WP shortcodes</a> - see next section), so include style tags if you want!
		<br />
     
		<textarea name="ttw_footer_opts" rows=5 style="width: 95%"><?php echo(str_replace("\\", "", ttw_getopt('ttw_footer_opts'))); ?></textarea>
		<br /><br />
		
		<label><b>Site Header Insert Code</b></label><br/>
                This must be HTML markup code (including <a href="http://codex.wordpress.org/Shortcode" target="_blank">WP shortcodes</a>),
		and will be inserted into the <em>#branding div</em> header area right above where the standard site
		header image goes. You can use it for logos, better site name text - whatever. When used in combination with hiding the site title,
		header image, and the menu, you can design a completely custom header. Note that this code will be after or before the default menu
		depending on the move menu setting. You can completely replace the default menu (hide it), but you will have to hard-wire the links
		to pages in your replacement menu. If you hide the title, image, and header, no other code is generated in the #branding div, so this
		code can be a complete header replacement. You will almost certainly need to add some CSS style, too. (We've added a class called
		ttw-center which you can use to div-wrap your insert code to center it: &lt;div class="ttw-center"&gt;[shortcode]&lt;/div&gt;)
		You can also override #branding, create a new div, or use in-line styling. You can also use WP shortcodes to embed plugins, including rotating image slideshows
		such as <a href="http://www.jleuze.com/plugins/meteor-slides/" target="_blank">Meteor Slides</a>.
		<br /> 
		<textarea name="ttw_header_insert" rows=5 style="width: 95%"><?php echo(str_replace("\\", "", ttw_getopt('ttw_header_insert'))); ?></textarea>
		<br />
		<label>Insert on Front Page Only: </label><input type="checkbox" name="ttw_header_frontpage_only" id="ttw_header_frontpage_only" <?php echo (ttw_getopt( 'ttw_header_frontpage_only' ) ? "checked" : ""); ?> >
		<small>If you check this box, then this Header code will be used only when the front page is displayed. Other
		pages will be displayed using normal header settings. Checking this will also automatically hide the standard
		header image on the front page so you can use a slide show on the front page, and standard header images on other pages.</small>
		<br /><br />

                <label><b>The Last Thing</b></label><br/>This code is inserted right before the closing &lt;/body&gt; tag.
                This is the best place for your Google analytics code and other final code that is not usually displayed.
		<br />
		                
		<textarea name="ttw_end_opts" rows=5 style="width: 95%"><?php echo(str_replace("\\", "", ttw_getopt('ttw_end_opts'))); ?></textarea>
                
                <br /><br />
		<label><b>Special Theme &lt;HEAD&gt; Section Overrides</b></label><br/>

                The entries in this field are usually generated by some of the example themes provided with Twenty Ten Weaver. You can fiddle with them,
		but it is generally better to use the regular HEAD overrides. (Note: this code is included before the standard HEAD section code above.)
		<br />
                   
		<textarea name="ttw_theme_head_opts" rows=3 style="width: 95%"><?php echo(str_replace("\\", "", ttw_getopt('ttw_theme_head_opts'))); ?></textarea>
    
		</fieldset>
					
		<p class="submit"><input type="submit" name="saveadvanced" value="Update Advanced Options"/></p>

	    </form>
     </div>
    
<hr />
<?php
}
?>