function weaveriip_saverestore_admin()
{
    ?>
<p class='wvr-option-section'>Weaver II Pro Save/Restore Plus Settings <?php 
    weaveriip_help_link('pro-help.html#plus_admin', 'Save/Restore help');
    ?>
</p>


<p>You can save and restore Weaver II Pro settings to a file on your site's files.</p>


<h4>Save as file on this website's server</h4>
 <p>Please provide a name for your file, then click the "Save File" button. <b>Warning:</b> Duplicate names will
	automatically overwrite existing file without notification.</p>
	<form name="weaveriip_options_form" method="post">
		table>
	<td>Name for saved Plus Settings: <input type="text" name="wvp_save_name" size="30" />&nbsp;<small>(Please use a meaningful
	name - do not provide file extension. Name might be altered to standard form.)</small></td></tr>
		<tr>
		<td><span class='submit'><input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Plus Settings to File"/></span>&nbsp;&nbsp;
		<small><strong>Save Plus Settings in File</strong> - Settings will be saved in <em><?php 
    echo $ttw_theme_dir;
    ?>
</em> directory on your site server.</small></td>
		</tr>
	</table>
		<br />
		<input type="hidden" name="weaveriip_save_settings" value="Weaver II Pro Settings Saved" />
		<?php 
    weaverii_nonce_field('weaverii_pro_save_pro');
    ?>
	</form>
<?php 
}
function weaveriip_shortcoder_admin()
{
    if (!weaverii_pro_isset('wvpsc_num_opts')) {
        weaveriip_shortcoder_init();
    }
    $num_imgs = weaverii_pro_getopt('wvpsc_num_opts');
    if ($num_imgs < 1) {
        weaverii_pro_setopt('wvpsc_num_opts', 2);
        $num_imgs = 2;
    }
    ?>

	<div>
	<p class='wvr-option-section'>Weaver Shortcoder [weaver_sc] - <small>Define your own shortcodes.</small> <?php 
    weaveriip_help_link('pro-help.html#shortcoder', 'Shortcoder help');
    ?>
</p>
<p><code>[weaver_sc id="myname" v1="optional-replacement" ... v9="replacement"]</code></p>


	<p>This [weaver_sc] shortcode allows you to define your own named shortcodes. These really serve as "macros" - an easy way
	to define constant text or other fixed content you would like to add to your pages, posts, or widget areas.
	The content you define can include other <em>shortcodes</em> and <em>basic HTML</em>, as well as <em>Raw HTML</em>
	or <em>Scripts</em> if you have the role permissions to do that.</p>

	<p>[weaver_sc] supports nine (9) optional parameters, v1 to v9, that allow you to pass values to your shortcode
	definition text. The value of any parameter will replace the equivalent parameter specified as %v1% in your text.
	For example, if you had a shorcode "name" and definition text contained "My name is %v1%.", and you use the shortcode
	[weaver_sc id="name" v1="Bruce"], the output included in your content would be "My name is Bruce." This allows
	you to use the same short code in different pages or posts and supply variable content.</p>

	<form name="weaveriip_options_form" method="post">
	<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Plus Shortcoder Options"/>
	<br />
		<fieldset class="options">
		<br /><strong style="color:blue;">Define Custom Shortcodes</strong>
		<p>You can add an arbitrary number of your own [weaver_sc] definitions by id.</p>
		<?php 
    for ($i = 1; $i <= $num_imgs; ++$i) {
        weaveriip_sc_add($i);
    }
    ?>
	<br /><strong>Custom shortcodes definitions allowed:</strong><input name="wvpsc_num_opts" id="wvpsc_num_opts" type="text" style="width:40px;height:20px;" class="regular-text" value="<?php 
    weaverii_esc_textarea(weaverii_pro_getopt('wvpsc_num_opts'));
    ?>
" />
	&nbsp;<small>Enter number of Weaver Shortcoder definitions you need (25 max).</small>
	</fieldset>
	<br />
	<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Plus Shortcoder Options"/>
	<input type="hidden" name="weaveriip_save_shortcoder" value="Weaver II Pro Shortcoder Options Saved" />
	<?php 
    weaverii_nonce_field('weaverii_pro_save_pro');
    ?>
	</form>
	<hr />
	</div>
<?php 
}
function weaveriip_disclaimer_admin()
{
    ?>
<p class='wvr-option-section'>Weaver II Pro Comment Policy / Disclaimer <?php 
    weaveriip_help_link('pro-help.html#comment_policy', 'Comment Policy help');
    ?>
</p>


<p>Weaver II Pro Comment Disclaimer allows you to display a disclaimer, other comment policy, or any thing else (including
shortcodes) right under the Post Comment button. Nothing will be displayed if the text box below is empty.</p>

	<form name="weaveriip_options_form" method="post">
		<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Comment Disclaimer Text"/>
		<br /><br />
		<fieldset class="options">
		<span style="font-weight:bold; color:blue;">Weaver II Pro Comment Policy / Disclaimer</span><br />
		<p>
			Enter text for you disclaimer. You can use basic HTML to format your disclaimer text. The HTML
			will be wrapped with &lt;div class="weaver-comment-disclaimer"> so you can add style
			using Weaver's &lt;HEAD> Section. While designed to
			add comment policy text, you can add anything you want, including shortcodes. Need a widget area after
			a comment block? Use the [weaver_widget_area] short code to add one.
		</p>
		<p>
			<textarea name="wvr_disclaimer" rows=10 style="width: 90%"><?php 
    weaverii_esc_textarea(weaverii_pro_getopt('wvr_disclaimer'));
    ?>
</textarea>
		</p>

		</fieldset>
		<br />
		<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Comment Disclaimer Text"/>
		<input type="hidden" name="weaveriip_save_disclaimer" value="Weaver II Pro Posts Options Saved" />
		<?php 
    weaverii_nonce_field('weaverii_pro_save_pro');
    ?>
	</form>
	<hr />
<?php 
}
function weaverii_child_update_action()
{
    echo '<h3 class="wvr-option-subheader">*** Update Weaver II theme from .zip file on your computer. ***</h3>';
    if (!is_multisite() && current_user_can('install_themes') || is_multisite() && current_user_can('manage_network_themes')) {
        ?>
<form  enctype="multipart/form-data" action="<?php 
        echo $_SERVER["REQUEST_URI"];
        ?>
" method="POST">
<p style="font-weight:bold;">This action will update the version of Weaver II you are using right now with a version you've
downloaded from <em>WeaverTheme.com</em> or <em>Pro.WeaverTheme.com</em>. This option is most commonly used to update your version of Weaver II Pro, but you can also upgrade the free Weaver II version.</p>
    <table>
	<tr valign="top">
	    <td>
		<input name="uploaded_theme" type="file" />
		&nbsp;<strong>Select Weaver II or Weaver II Pro .zip file with version to update.</strong>
            </td>
	</tr>
        <tr><td>
	    <span class='submit'>
		<input name="upload_theme" type="submit" value="Update Weaver II Theme" />
	    </span>&nbsp;<strong>Update Weaver II</strong> -- Upload 'weaver-ii' or 'weaver-ii-pro' .zip file and upgrade theme.
	</td></tr>
    </table>
<?php 
        $max_upload = (int) ini_get('upload_max_filesize');
        $max_post = (int) ini_get('post_max_size');
        $memory_limit = (int) ini_get('memory_limit');
        $upload_mb = min($max_upload, $max_post, $memory_limit);
        if ($upload_mb < 2) {
            echo '<p><strong style="color:red">WARNING! -- It appears your system upload
file size limit is less than 2Mb, which is too small for the Weaver II theme .zip file. The upload
is likely to hang and fail if you continue. If your system limit is indeed less than 2Mb, you will need to have
it raised before you proceed. This may involve contacting your hosting company.</strong></p>';
        }
        weaverii_nonce_field('upload_theme');
        ?>
</form>
<br />
<p>Note - using this Weaver II theme update tool will directly update your /wp-content/themes/weaver-ii/ or
/wp-content/themes/weaver-ii-pro/ directory with the new version. Any files you may have added to one of those
directories, such as a new language translation file, will not be removed. Thus, this provides an easy way to
update Weaver II while retaining any new files you may have added.</p>
<?php 
    } else {
        echo '<p>You must be an Admin or Super-Admin to update Weaver II.</p>';
    }
}
예제 #5
0
function weaverii_saverestore()
{
    /* admin tab for saving and restoring theme */
    $download_path = weaverii_relative_url('includes/download.php');
    $download_img_path = weaverii_relative_url('images/icons/download.png');
    $nonce = wp_create_nonce('wii_download');
    ?>
	<br /><div class="wvr-option-subheader">Save/Restore Current Theme Settings using Your Computer</div>
<p>This option allows you to save and restore all current theme settings by uploading and downloading to your
own computer.</p>

<h4>Download Current Settings To Your Computer</h4>

<a href="<?php 
    echo $download_path . '?_wpnonce=' . $nonce;
    ?>
"><img src="<?php 
    echo $download_img_path;
    ?>
" alt="download" />&nbsp; <strong>Download</strong>&nbsp;</a> - <strong><em>All</em></strong> current settings to file <strong>weaver-ii-backup-settings.w2b</strong> on your computer. (Full settings backup, including &diams;.)
<br />
<br />
<a href="<?php 
    echo $download_path . '?_wpnoncet=' . $nonce;
    ?>
"><img src="<?php 
    echo $download_img_path;
    ?>
" alt="download" />&nbsp;<strong>Download</strong></a>&nbsp; - <strong><em>Only theme related</em></strong> current settings to file <strong>weaver-ii-theme-settings.w2t</strong> on your computer.
<br />
<br />

<form enctype="multipart/form-data" action="<?php 
    echo $_SERVER["REQUEST_URI"];
    ?>
" method="POST">
		<table>
			<tr><td><strong>Upload file saved on your computer</strong><br /><br /></td></tr>
				<tr valign="top">
						<td>Select theme/backup file to upload: <input name="uploaded" type="file" />
						<input type="hidden" name="uploadit" value="yes" />&nbsp;(Restores to current settings.)
						</td>
				</tr>
				<tr><td><span class='submit'><input name="uploadtheme" type="submit" value="Upload theme/backup" /></span>&nbsp;<small><strong>Upload and Restore</strong> a theme/backup from file on your computer. Will become current settings.</small></td></tr>
				<tr><td>&nbsp;</td></tr>
		</table>
		<?php 
    weaverii_nonce_field('uploadtheme');
    ?>
</form>
<?php 
}
function weaveriip_buttons_admin()
{
    if (!weaverii_pro_isset('buttons')) {
        weaveriip_init_buttons();
        // just in case!
    }
    $buttons = weaverii_pro_getopt('buttons');
    $maxbuttons = $buttons['maxbuttons'];
    ?>
<div>
<p class='wvr-option-section'>Link Buttons - [weaver_buttons] + Widget <?php 
    weaveriip_help_link('pro-help.html#link_buttons', 'Link Buttons help');
    ?>
</p>

<p><code>[weaver_buttons start='first-to-show' end='last-to-show' list='1,3,2']</code></p>

<p>The <code>[weaver_buttons]</code> short code allows you to add image buttons with links.
You can specify which image to begin with (1 to <?php 
    echo $maxbuttons;
    ?>
) with the 'start' parameter, and the same with the 'end'.
The defaults are start=1 and end=<?php 
    echo $maxbuttons;
    ?>
, but images with no image URL defined won't be displayed.
You can specify different sets of images with different instances of the shortcode. You can style with <em>.weaver-buttons</em>.</p>

<p>If you specify a comma separated list with the 'list' parameter (e.g, <code>list='7,4,1,2'</code>), you can specify an
arbitrary set and order of buttons. If you do specify a 'list' parameter, then 'begin' and 'end' will be ignored.</p>

<p>For each button you want to define, add a full URL to an image sized to the size you want your button to be.
It is best to keep the button image in your Media Library. Then add a hover message, and the complete URL to where the
button should link to (optional). Check the New Page box if you want the link to open a new tab or page when clicked.
</p>
<p>If you want to place your links over your header image, add the short code to the "Text" option of
a <em>Header Gadget</em>. You won't need to add an image or link url there since that information is provided here.
</p>

<p>The defined buttons will be displayed in a horizontal list that will wrap when the width of the enclosing HTML block is reached.</p>

<p>If you want to use the shortcode to include buttons Buttons on your menu bar, add the following code to the
<em>Main Options&rarr;Menus&rarr;Add HTML</em> settings:<br />
<code>&lt;div style="width:60px;padding-top:5px; padding-right:10px;">[weaver_buttons start=1 end=2]&lt;/div></code>. <br />
Note this example will display two buttons. Note that 24px height is optimal for the menu bar. The wrapping <code>div</code> is required
to get the buttons centered properly, and you will have to adjust the <code>width:</code> value depending on
how many buttons you want on your menu bar.</p>

<p><strong>Weaver II Pro Link Buttons Widget</strong> - When used in the <em>Weaver II Pro Link Buttons</em> widget, all buttons you've defined will be displayed
using their actual size in the order defined. There are no other options for the widget version.
</p>
<br />
<form name="weaveriip_linkbuttonoptions_form" method="post">
	<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Link Buttons"/>

		<fieldset class="options">
<p>
	<strong>Number of images:&nbsp;</strong>
	<input type="text" name="maxbuttons" id="maxbuttons"  style="width:40px;height:20px;" class="regular-text" value="<?php 
    echo esc_textarea($buttons['maxbuttons']);
    ?>
" />
	&nbsp;&nbsp;<small>Enter number of buttons you need to define.</small>
</p>

<?php 
    weaveriip_buttons_show_list();
    ?>
	<br />
		</fieldset>
	<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Link Buttons"/>
		<input type="hidden" name="weaveriip_save_buttons" value="Weaver Link Buttons Options Saved" />

<?php 
    weaverii_nonce_field('weaverii_pro_save_pro');
    ?>
</form>
</div>
<?php 
}
function wpwii_maint_admin()
{
    if (!function_exists('weaverii_submitted')) {
        return;
    }
    ?>
<div class="wrap">
    <h1>Weaver II Maintenance Tools Version 1.1 (<?php 
    echo WEAVERII_THEMEVERSION;
    ?>
)</h1>
	<h2>Clean Weaver II Settings</h2>
	    <p>When you click "Clear All Weaver II Settings", <strong>all</strong> Weaver II settings will be cleared from the data base. This includes both Weaver II Free version and Weaver II Pro settings.</p>
	    <form id="wpw_maintweaver" name="wpw_maintweaver" action="<?php 
    get_bloginfo('wpurl');
    ?>
/wp-admin/themes.php?page=weaverii_maintenance" method="post">
		<span class="submit"><input type="submit" name="resetm_weaverii" value="Clear All Weaver II Settings"/></span>
		<?php 
    weaverii_nonce_field('resetm_weaverii');
    ?>
	    </form>
	    <br /><br />
	<hr />
<?php 
    if (get_option('weaver_main_settings') || get_option('ttw_options') || get_option('ttw_myoptions') || get_option('ttw_adminoptions') || get_option('weaver-settings') || get_option('widget_weaver_login') || get_option('widget_weaver_text') || get_option('widget_weaver_login') || get_option('weaver_advanced_settings')) {
        ?>

	<h2>Clean Old Weaver Version Settings</h2>
	    <p>Settings from previous versions of the Weaver theme have been detected. When you click "Clean OLD Weaver", <strong>all</strong> settings from previous versions of Weaver will be cleared from the data base. This includes 2010 Weaver, Weaver 1.x, Weaver 2.x, and Weaver Plus.</p>
	    <p>
		<strong style="color:red">IMPORTANT!</strong> If you need to upgrade your Weaver 2.2.x settings to Weaver II, be sure to do that BEFORE you clear your old settings!</p>
	    <form id="wpw_cleanweaver" name="wpw_cleanweaver" action="<?php 
        get_bloginfo('wpurl');
        ?>
/wp-admin/themes.php?page=weaverii_maintenance" method="post">
		<span class="submit"><input type="submit" name="reset_old_weaver" value="Clear OLD Weaver"/></span>
		<?php 
        weaverii_nonce_field('reset_old_weaver');
        ?>
	    </form>
	    <br /><br />
	<hr />
<?php 
    }
    ?>
	<h2>Upgrade Weaver 2.2.x to Weaver II</h2>
<?php 
    /* see if old Weaver 2.0 settings found, and tell them how to upgrade */
    if (!get_option('weaver_main_settings')) {
        ?>
      <div style="background-color:#FFEEEE; border: 1px solid red; margin: 0px 60px 0px 20px; padding-left:10px;width:70%">
	<p><strong>Notice:</strong> No existing settings from an older version of Weaver have been found, no upgrade possible.
	</p>
      </div>
      <?php 
    } else {
        ?>
      <div style="background-color:#EEFFEE; border: 1px solid green; margin: 0px 60px 0px 20px; padding-left:10px;width:70%">
	<p><strong>Notice:</strong> Existing settings from an older version of Weaver have been found.
	Click the ? Help button for more information.
	<?php 
        weaverii_help_link('help.html#UpgradingWeaver', 'Help for Advanced Options');
        ?>
	</p>
      </div>
      <br /> <br />
      <form name="resetweaverii_form" method="post">
	    <strong>Click the Convert Old Weaver Settings button to convert the settings from the previous version to the
	    new Weaver II settings.</strong><br />
<?php 
        if (weaverii_init_base()) {
            ?>
	    This will also convert Weaver Plus settings if they are present.<br />
<?php 
        }
        ?>
	    <em>Warning: You will lose all current settings.</em> You should use the
	    Save/Restore tab to save a copy of your current settings before converting!<br /><br />
	    <span class="submit"><input type="submit" name="convertm_weaver" value="Convert Old Weaver Settings"/></span>
	    <?php 
        weaverii_nonce_field('convertm_weaver');
        ?>
	</form> <!-- wii_resetweaverii_form -->
      <?php 
    }
    ?>
</div>
<?php 
}
예제 #8
0
function weaverii_admin_saverestore()
{
    ?>

<div class="wvr-option-header" style="clear:both;">Save/Restore Theme Settings <?php 
    weaverii_help_link('help.html#SaveRestore', 'Help on Save/Restore Themes');
    ?>
</div><br />
<div class="wvr-option-subheader">Save/Restore Current Settings using WordPress Database</div>
<p>This option allows you to save and restore all current theme settings using your host's WordPress
database. Your options will be
preserved across Weaver II theme upgrades, as well when you change to different themes. There is only one
saved backup available. Weaver II Pro allows multiple saves using files.</p>
<p>Note: This save option saves <strong>all</strong> settings, including those marked with a &diams;. Other save options
(available with Weaver II Pro or the <em>Weaver II Theme Extras</em> plugin) will save all settings (backup save), or just
those settings that are theme related (settings <em>not</em> marked with  &diams;).</p>
<form name="wii_save_mysave_form" method="post">
		<span class="submit"><input type="submit" name="save_mytheme" value="Save Settings"/></span>
		<strong>Save all current settings in host WordPress database.</strong>
<?php 
    weaverii_nonce_field('save_mytheme');
    ?>
		<br /><br />
		<span class="submit"><input type="submit" name="restore_mytheme" value="Restore Settings"/></span>
		<strong>Restore from saved settings.</strong>
<?php 
    weaverii_nonce_field('restore_mytheme');
    ?>
	</form>

<?php 
    do_action('weaverii_child_saverestore');
    // allow additional save/restore in child */
    weaverii_saverestore();
    if (weaverii_init_base()) {
        weaverii_pro_saverestore();
    }
    do_action('weaverii_child_update');
    ?>
	<div class="wvr-option-subheader">Reset Current Settings to Default</div><br />
		<form name="resetweaverii_form" method="post" onSubmit="return confirm('Are you sure you want to reset all Weaver II settings?');">
			<strong>Click the Clear button to reset all Weaver II settings to the default values.</strong><br >
<?php 
    if (weaverii_init_base()) {
        ?>
			This will also include Weaver II Pro settings.<br />
<?php 
    }
    ?>
			<em>Warning: You will lose all current settings.</em> You should use the Save/Restore tab to save a copy
			of your current settings before clearing! <br />
			<span class="submit"><input type="submit" name="reset_weaverii" value="Clear All Weaver II Settings"/></span>
			<?php 
    weaverii_nonce_field('reset_weaverii');
    ?>
		</form> <!-- wii_resetweaverii_form -->
		<br /><hr />
<?php 
    $last = weaverii_getopt('wii_last_option');
    if ($last != 'WeaverII') {
        ?>
<p style="color:red">Possible Non-Standard Web Host Configuration detected. If your options
are not saving correctly, your host may have limited the default number of values that PHP can use for
settings. Try saving your settings again, and if this message persists, please contact your host and ask them to "Increase the PHP <em>max_input_vars</em> value for $_POST to at least 600." If that does not fix the issue,
please contact Weaver II support. (diagnostic info: last_option="<?php 
        echo $last;
        ?>
").
</p>
<?php 
    } else {
        echo "<p><small>{$last}</small></p>";
    }
}
예제 #9
0
function weaverii_pro_saverestore()
{
    /* admin tab for saving and restoring theme */
    $weaverii_theme_dir = weaverii_f_uploads_base_dir() . 'weaverii-theme/';
    ?>
    <div class="wvr-option-subheader">Save/Restore Settings using Files on your site host (&#9679;Pro)</div>
    <h4>You can save all your current settings in a backup file:</h4>
    <ol style="font-size: 90%">
     <li>Save <em>all</em> your current settings in a backup file on your site's file system (in <?php 
    echo $weaverii_theme_dir;
    ?>
). Automatically names the backup file to include current date and time.
     Survives Weaver II Theme updates. -or-</li>
    <li>Save only <em>theme related</em> settings to a file you name on your Site's file system (in <?php 
    echo $weaverii_theme_dir;
    ?>
.</li>
    </ol>
<?php 
    if (weaverii_allow_multisite()) {
        ?>
    <h4>You can restore a saved theme or backup file by:</h4>
    <ol style="font-size: 90%">
    <li>Restoring a theme/backup that you saved in a file on your site (to current settings). -or-</li>
    <li>Uploading a theme/backup from a file saved on your own computer (to current settings). </li>
    </ol>
<?php 
    }
    if (!weaverii_allow_multisite()) {
        ?>
    <h4>You will be unable to restore your saved file directly</h4>
    <p>Since this is a WordPress Multi-site installation, you are restricted from uploading
    a Weaver II theme/backup from a saved file. However, the save file capability gives you the ability
    to save your work so you can transfer it to a WordPress site where you have full admin
    capabilities (non-Multi-site installation, for example), or to share with others. Please
    note that you <em>can</em> save your settings in the WordPress Database which will allow you
    to explore other predefined themes without losing your work.
    </p>
<?php 
    }
    ?>
  <br />
    <div class="wvr-option-subheader">Save All Current Settings in Backup File (&#9679;Pro)</div><br />
     <strong>Backup</strong> <u>all</u> current options in a <strong>file</strong> on your
     WordPress Site's <em><?php 
    echo $weaverii_theme_dir;
    ?>
</em> directory named 'weaverii_backup_yyyy-mm-dd-hhmm.w2b'
     where the last part is a GMT based date and time stamp.
<?php 
    if (weaverii_allow_multisite()) {
        ?>
    You will be able to restore this theme later using the <strong>Restore Saved Theme/Backup</strong> section.
<?php 
    }
    ?>
    Please be sure you've saved any changes you might have made.<br />
     <form enctype="multipart/form-data" name='backup-settings' method='post'>
	<span class='submit'><input name='backup_settings' type='submit' value='Backup All Current Settings'/></span>
    <?php 
    weaverii_nonce_field('backup_settings');
    ?>
    </form><br />

    <div class="wvr-option-subheader">Save Current Theme Related Settings to File (&#9679;Pro)</div><br />
     <strong>Save</strong> current <em>theme related</em> settings, either by downloading
    to <strong>your computer</strong> or saving a <strong>file</strong> on your WordPress Site's <em><?php 
    echo $weaverii_theme_dir;
    ?>
</em> directory.
<?php 
    if (weaverii_allow_multisite()) {
        ?>
    You will be able to restore this theme later using the <strong>Restore Saved Theme/Backup</strong> section.
<?php 
    }
    ?>
    <em>Theme related</em> settings include most standard Weaver settings <em>except</em>: Site Copyright, SEO settings,
    Weaver Pro HTML Insert areas, Background Images, FavIcons, and Weaver II Pro shortcode settings.<br /><br />

  <strong>Save as file on this website's server</strong>
 <p>Please provide a name for your file, then click the "Save File" button. <b>Warning:</b> Duplicate names will
    automatically overwrite existing file without notification.</p>
 <form enctype="multipart/form-data" name='savetheme' method='post'><table cellspacing='10' cellpadding='5'>
    <tr>
    <td>Name for saved theme: <input type="text" name="savethemename" size="30" />&nbsp;<small>(Please use a meaningful
    name - do not provide file extension. Name might be altered to standard form.)</small></td></tr>
	<tr>
	<td><span class='submit'><input name='filesavetheme' type='submit' value='Save Theme in File'/></span>&nbsp;&nbsp;
	<strong>Save Theme in File</strong> - <small>Theme will be saved in <em><?php 
    echo $weaverii_theme_dir;
    ?>
</em>
	directory on your site server.</small></td>
        </tr>
    </table>
    <?php 
    weaverii_nonce_field('filesavetheme');
    ?>
 </form><br />

<?php 
    if (weaverii_allow_multisite()) {
        ?>


    <div class="wvr-option-subheader">Restore Saved Theme/Backup from file (&#9679;Pro)</div><br />
    You can restore a previously saved theme (.w2t) or backup (.w2b) file directly from your WordPress
    Site's <em><?php 
        echo $weaverii_theme_dir;
        ?>
</em> directory, or from a file saved on your computer.
    Note: after you restore a saved theme, it will be loaded into the current settings. A <em>theme</em> restore will
    replace only settings that are not site-specific. A <em>backup</em> file will replace all current settings.
    If you've uploaded the theme from your computer, you might then want to also save a local copy on your
    website server.<br /><br />

    <form enctype="multipart/form-data" name='localrestoretheme' method='post'><table cellspacing='10' cellpadding='5'>
    <table>
    <tr><td><strong>Restore from file saved on this website's server</strong></td></tr>
    <tr>
        <td>Select theme/backup file: <?php 
        weaverii_subtheme_list('wii_restorename');
        ?>
&nbsp;Note: <strong>.w2t</strong> are Theme definitions. <strong>.w2b</strong> are full backups. (Restores to current settings.)</td></tr>
	<tr>
	<td><span class='submit'><input name='restoretheme' type='submit' value='Restore Theme/Backup'/></span>&nbsp;&nbsp;
	<strong>Restore</strong> a theme/backup you've previously saved on your site's <em><?php 
        echo $weaverii_theme_dir;
        ?>
</em> directory. Will replace current settings.</td>
    </tr>
        <tr><td>&nbsp;</td></tr>
    </table>
    <?php 
        weaverii_nonce_field('restoretheme');
        ?>
    </form>

<div class="wvr-option-subheader">Save Settings for Alternate Mobile Theme (&#9679;Pro)<?php 
        weaverii_help_link('help.html#AltMobileTheme', 'Help on Alternate Mobile Theme');
        ?>
</div>
<p>This will save your current settings to a special Mobile Settings database entry. You can use this to create a totally
separate style used when the site is viewed from a Mobile device. You <strong>must</strong> enable the
<em>Use Alternate Mobile Theme</em> option on the Advanced:Mobile tab for these settings to be used. <strong>IMPORTANT!</strong> Be sure to save backup copies of both your normal and mobile theme settings using one of the above
save to file options. You will need them to be able to tweak the alternate mobile theme settings.</p>
  <form name="wii_save_mobile_form" method="post"
	<span class="submit"><input type="submit" name="save_mobiletheme" value="Save Settings for Mobile View"/></span>
	<strong>Save all current settings in Alternate Mobile Theme Settings.</strong>
<?php 
        weaverii_nonce_field('save_mobiletheme');
        ?>
    </form>


    <form enctype="multipart/form-data" name='themenames' method='post'>
    <div class="wvr-option-subheader">Theme Name and Description (&#9679;Pro)</div>
        <p>You can change the name an description of your current settings if you would like to create a new theme
	theme file for sharing with others, or for you own identification.
	</p>
	<input name="wii_themename" id="wii_themename" value="<?php 
        echo weaverii_getopt('wii_themename');
        ?>
" />
	<br />
	<textarea name="wii_theme_description" id="_wii_favicon_url" rows=2 style="width: 350px"><?php 
        echo esc_textarea(weaverii_getopt('wii_theme_description'));
        ?>
</textarea>
	<br />
        <span class='submit'><input name='renametheme' type='submit' value='Save Theme Name and Description'/></span>
        <?php 
        weaverii_nonce_field('renametheme');
        ?>
    </form>
    <br />

    <form enctype="multipart/form-data" name='maintaintheme' method='post'>
    <div class="wvr-option-subheader" >Subtheme and Backup File Maintenance (&#9679;Pro)</div><br />
        <?php 
        weaverii_subtheme_list('selectName');
        ?>

        <span class='submit'><input name='deletetheme' type='submit' value='Delete Subtheme/Backup File'/></span>
          <strong>Warning!</strong> This action can't be undone, so be sure you mean to delete a file!
	  <?php 
        weaverii_nonce_field('deletetheme');
        ?>
    </form>
<?php 
    }
    ?>
    <br />
<?php 
}
function weaveriip_social_admin()
{
    ?>
<p class='wvr-option-section'>Social Buttons - [weaver_social] Shortcode and Widget <?php 
    weaveriip_help_link('pro-help.html#social_buttons', 'Social Buttons help');
    ?>
</p>

<p><code>[weaver_social height='height' number='showcount']</code></p>

<p>The <code>[weaver_social]</code> short code allows you to add Social site buttons with links to your account or page.</p>

<p>To display social buttons,
check the buttons you want to show. Provide the full URL to your account link. For example: <code>http://twitter.com/wpweaver</code>.
You can specify the display order in the <em>Display Order</em> column using the WordPress ordering method used
to order your static pages: 10,15,30, etc. Lower numbers display first - they don't have to be sequential.
</p>
<p>If you want to use the shortcode to include Social Buttons on your menu bar, either set how many to show in the option
below. For more control or to place the buttons on the left side of the menu bar, add the following code to the
<em>Main Options&rarr;Menus&rarr;Add HTML</em> settings:<br />
<code>&lt;div style="width:56px; padding-right:14px;display:inline-block;">[weaver_social number=2]&lt;/div></code>. <br />
Note this example will display two buttons, 24px high (the default). The wrapping <code>div</code> is required
to get the buttons centered properly, and you will have to adjust the <code>width:</code> value depending on
how many buttons you want on your menu bar (number * 28).</p>
<p>You can place social buttons over your header area using a Header Gadget. Place the <code>[weaver_social]</code>
shortcode in the "Text" field of a Header Gadget. You don't need to fill in a link or image field since they
are provided by this shortcode.
</p>
<p>When used in the <em>Weaver II Pro Social Buttons</em> widget, all buttons you've selected will be displayed
using 32px high images. There are no other options for the widget version.
</p>
<p style="font-size:small;font-style:italic;"><strong>A note about the URL:</strong> The exact form of the URL you add
for each button will depend on the service in question. Almost all of these services allow you to set up an account,
and then provide a URL address for other people to view your account's public page.</p>
<p>
<small>Note: you can click a service's icon on the list to open the site's main home page if you want
to learn more about a particular service.</small>
</p>
<form name="weaveriip_linkbuttonoptions_form" method="post">
		<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Social Buttons"/>

<br />
		<fieldset class="options">
		<br /><strong style="color:blue;">Social Button Options</strong><br /><br />
			<table class="optiontable">

<?php 
    weaveriip_value_row('Add Social Buttons to Menu Bar', 'wvp_add_social_to_menu', 'Add up to number specified (34 max) Social Buttons to the right side of the Primary Menu Bar.');
    ?>
			</table>
			<br />
<?php 
    weaveriip_social_show_list();
    ?>
		<br />
		</fieldset>
		<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Social Buttons"/>
		<input type="hidden" name="weaveriip_save_social" value="Weaver Social Buttons Saved" />
		<?php 
    weaverii_nonce_field('weaverii_pro_save_pro');
    ?>
</form>
<?php 
}
function weaveriip_headergadget_admin()
{
    if (!weaverii_pro_isset('hdr_num_opts')) {
        weaveriip_header_init();
    }
    $num_imgs = weaverii_pro_getopt('hdr_num_opts');
    ?>

	<div>
	<p class='wvr-option-section'>Header Gadgets - <small>Links, Images & Text over the Header + [weaver_gadget] shortcode</small> <?php 
    weaveriip_help_link('pro-help.html#header_gadgets', 'Header Gadgets help');
    ?>
</p>


	<p>This tab allows you to add 'gadgets' (mini-widgets) anywhere over the site header. You can use images
	or text, and add links. You can place these anywhere over the header area of your site.</p>

	<h4>[weaver_gadget] shortcode</h4>
	<p>The gadgets defined here can also be used with a shortcode:
	<code>[weaver_gadget gadget=4]</code>
	where the 'gadget' parameter specifies the id number of which gadget to use. The shortcode version allows
	arbitrary placement of gadgets on the content area. You can split the usage of gadgets (some for the header,
	some for the shortcode) by specifying the "Max items" option at the bottom.
	</p>

	<form name="weaveriip_options_form" method="post">
	<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Plus Header Gadget Options"/>
	<br />
		<fieldset class="options">
		<br /><strong style="color:blue;">Add Gadgets (Images or Text) over Header Area</strong>
		<p>You can add an arbitrary number of gadgets (images or text strings) over your header. You can specify how far down
		from the top (y) and the left (x) each one is displayed, in px or % (negative and decimal values OK).
		Gadgets will be displayed <em>behind</em> menu bars. You can also add a link to the gadget. Images will work best
		if you use an image from your Media Library (click the little image button to open Media Library). </p>
		<p><em><strong>Please note!</strong> Gadgets can cause unexpected results with the mobile view.</em> Gadgets placed
		beyond 320px to the right will cause an incorrect view on Mobile devices. You can check where they display
		using the Mobile:Simulate Mobile. Use % for X and Y position to give better responsive layout for
		gadgets on mobile devices.
		Specify a CSS styling rule "max-width=10%" (or other appropriate %)
		to make gadget images responsive/flexible sized.
		You can also check the hide box for gadgets if they display outside the main 320px wide content.</p>
		<?php 
    for ($i = 1; $i <= $num_imgs; ++$i) {
        weaveriip_header_add($i);
    }
    ?>
	<br /><strong>Gadget items allowed:</strong><input name="hdr_num_opts" id="hdr_num_opts" type="text" style="width:40px;height:20px;" class="regular-text" value="<?php 
    echo esc_textarea(weaverii_pro_getopt('hdr_num_opts'));
    ?>
" />
	&nbsp;<small>Enter number of gadget items you need to define (32 Max).</small>

	<br /><strong>Max items displayed over Header:</strong><input name="hdr_use_for_header" id="hdr_use_for_header" type="text" style="width:40px;height:20px;" class="regular-text" value="<?php 
    echo esc_textarea(weaverii_pro_getopt('hdr_use_for_header'));
    ?>
" />
	&nbsp;<small>Only the first "n" gadgets will be displayed over the header. The rest can be uses with the [weaver_gadget] shortcode. (Default: use all defined. Use 0 to disable all over the header.)</small>
	</fieldset>
	<br />
	<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Plus Header Gadget Options"/>
	<input type="hidden" name="weaveriip_save_header" value="Weaver Plus Header Options Saved" />
	<?php 
    weaverii_nonce_field('weaverii_pro_save_pro');
    ?>
	</form>
	<hr />
	</div>
<?php 
}
예제 #12
0
function weaverii_st_pick_theme($list_in)
{
    // output the form to select a file list from weaverii-subthemes directory
    $list = $list_in;
    natcasesort($list);
    $cur_theme = weaverii_getopt('wii_theme_filename');
    if (!$cur_theme) {
        $cur_theme = 'antique-ivory';
    }
    // the default theme
    ?>
<form enctype="multipart/form-data" name='pick_theme' method='post'>
	&nbsp;&nbsp;<strong>Click a Radio Button below to select a subtheme: &nbsp;</strong>
	<span style="padding-left:100px;">Current theme: <strong>
<?php 
    $cur_addon = weaverii_getopt('wii_addon_name');
    if ($cur_addon == '') {
        echo ucwords(str_replace('-', ' ', $cur_theme));
    } else {
        echo 'Add-on Subheme: ' . ucwords(str_replace('-', ' ', $cur_addon));
        $cur_theme = '';
    }
    ?>
	</strong></span>

	<br /><br /><span class='submit'><input name="set_subtheme" type="submit" value="Set to Selected Subtheme" /></span>&nbsp;
	<small style="color:#b00;"><strong>Note:</strong> Selecting a new subtheme will change only theme related settings. Most Advanced Options will be retained.
	You can use the Save/Restore tab to save a copy of all your current settings first.</small><br /><br />
<?php 
    weaverii_nonce_field('set_subtheme');
    $thumbs = weaverii_relative_url('/subthemes/');
    foreach ($list as $addon) {
        $name = ucwords(str_replace('-', ' ', $addon));
        ?>
		<div style="float:left; width:200px;">
			<label><input type="radio" name="wii_theme_picked"
<?php 
        echo 'value="' . $addon . '" ' . ($cur_theme == $addon ? 'checked' : '') . '/> <strong>' . $name . '</strong><br />';
        if (!weaverii_getopt('_wii_hide_theme_thumbs')) {
            echo '<img style="border: 1px solid gray; margin: 5px 0px 10px 0px;" src="' . $thumbs . $addon . '.jpg" width="150px" height="113px" alt="thumb" /></label></div>' . "\n";
        } else {
            echo "</label></div>\n";
        }
    }
    if (!weaverii_getopt_checked('_wii_hide_theme_thumbs')) {
        ?>
	<div style="clear:both;"></div>
	<span class='submit' style='padding-top:6px;'><input name="set_subtheme" type="submit" value="Set to Selected Subtheme" /></span>
<?php 
    }
    ?>

	</form>
	<div style="clear:both;padding-top:6px;"></div>

	<form enctype="multipart/form-data" name='hide_thumbs_form' method='post'>
<?php 
    $hide_msg = weaverii_getopt('_wii_hide_theme_thumbs') ? 'Show Subtheme Thumbnails' : 'Hide Subtheme Thumbnails';
    ?>
	<input name="hide_thumbs" type="submit" value="<?php 
    echo $hide_msg;
    ?>
" />
<?php 
    weaverii_nonce_field('hide_thumbs');
    ?>
	</form>
	<div style="clear:both;"></div>
<?php 
}
function weaveriip_slider_admin()
{
    if (!weaverii_pro_isset('slider_number_sliders')) {
        weaveriip_slider_init();
    }
    ?>

	<div>
	<p class='wvr-option-section'>Slider Menu Shortcode - [weaver_slider] <?php 
    weaveriip_help_link('pro-help.html#slider', 'Slider help');
    ?>
</p>

	<p>This tab configures the Weaver II Pro Slider shortcode. These are the basic steps:
	<ol>
		<li>First, you <strong><em>MUST</em></strong> use the WP 3 Appearance->Menus admin option (Menu box
		in the upper right corner) to define
		a custom menu for each Slider you've defined. For each slider, you can define from 2 to 8 Menu items.
		Don't define sub-menus. Failure to follow these guidelines will result in a broken-looking slider.</li>
		<li>Set the options for each Slider. Create and specify images to be used. You can change the default sizes. The actual
		display width (or height for vertical menus) of each image on the menus is automatically adjusted.</li>
		<li><strong style="color:red;">Show your Slider!</strong> Add the <code>[weaver_slider id=1]</code> shortcode to your site
		for each Slider. For example, add <code>[weaver_slider]</code> to "Site Header Insert Code"
		from "Advanced Options&rarr;HTML Insertion" to display the first slider (id=1, the default) in your <strong>site header</strong>.
		Add <code>[weaver_slider id=2]</code>
		to a standard <em>Text Widget</em> to add a vertical slider to a <strong>sidebar</strong>.
		If you are placing a horizontal slider in the header, you likely will want to disable the standard header
		image. (Set "Header Image Height" to 0 in Main Options->Header Options)</li>
		<li>Once you have defined any Slider Menus, you must check "Enable Slider Menu". None will display until you do.
		</li>

	</ol>
	</p>
	<form name="weaveriip_options_form" method="post">
		<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Slider Options"/>
		<br /><br />
		<fieldset class="options">
		<table class="optiontable">
		<tr>
			<th scope="row" align="right" style="width:200px;">Enable Slider Menu:&nbsp;</th>
			<td>
			<input type="checkbox" name="slider_enable" id="slider_enable" <?php 
    echo weaverii_pro_getopt('slider_enable') ? "checked" : "";
    ?>
 />
			</td>
			<td style="padding-left: 10px"><small>Enable Sliders. The <code>[weaver_slider]</code> shortcode will not be recognized until you Enable Sliders.</small></td>
		</tr>
		<tr>
			<th scope="row" align="right">Number of Sliders:&nbsp;</th>
			<td>
				<input name="slider_number_sliders" id="slider_number_sliders" type="text" style="width:30px;height:20px;" class="regular-text" value="<?php 
    weaverii_esc_textarea(weaverii_pro_getopt('slider_number_sliders'));
    ?>
" />
			<td style="padding-left: 10px"><small>Number of Sliders. Need a unique slider defined for each <code>[weaver_slider]</code> shortcode used. Default is 1, max is 10.</small></td>
			</td>
		</tr>
		</table>
<?php 
    for ($i = 1; $i <= weaverii_pro_getopt('slider_number_sliders'); $i++) {
        // opts for each slider
        weaveriip_slider_sform($i);
    }
    ?>
	<input type="hidden" name="weaveriip_save_slider" value="Weaver Slider Options Saved" />
<?php 
    weaverii_nonce_field('weaverii_pro_save_pro');
    ?>
	</form>
   </div>
	<hr />
<?php 
}
function weaveriip_totalcss_admin()
{
    /* options - these are coded into Weaver
    	  'wvp_post_pretitle', 'wvp_post_prebody', 'wvp_post_postbody'
    	*/
    global $weaveriip_css;
    if (!weaverii_pro_isset('wvp_css')) {
        weaveriip_totalcss_init();
    }
    ?>

	<div><a name="total_css_top"></a>
	<p class='wvr-option-section'>Weaver II Pro - Total CSS <?php 
    weaveriip_help_link('pro-help.html#TotalCSS', 'Total CSS help');
    ?>
</p>
<?php 
    echo '&nbsp;|&nbsp;';
    $count = 0;
    foreach ($weaveriip_css as $option => $row) {
        if ($row['id'][0] == '_') {
            echo '<a href="#' . $row['id'] . '">' . $row['tag'] . '</a>&nbsp;|&nbsp;';
        } else {
            $count++;
        }
    }
    ?>
<br />
	<p>These settings will be most useful for advanced web designers. This tab allows you to add custom CSS rules to almost every CSS tag used by Weaver.
	There are <?php 
    echo $count;
    ?>
 CSS tags listed here.
	These rules are emitted, in the order shown here, at the <em>end</em> of the generated style file (or in-line style), but come before styles in the &lt;HEAD&gt; Section. Rules for the main menu
	areas (#access, etc.) are not included here. Most links are handled in the Main Options. Many of
	these tags duplicate equivalent cases in Main Options. <span style="color:red">If your rules here don't seem to work, try adding !important
	to the rule since there can be existing rues that can take CSS precedence over some of these rules.</span></p>

	<p><small>Weaver II will auto-add the required {}'s. If you want to double up on rules, you can add rules after the first {} - e.g. {background:green;} #main {border:1px solid red;}. You can't add any tags before the first {}. Just leave an empty {} if needed.</small>
	</p>

	<form name="weaveriip_options_form" method="post">

		<fieldset class="options">
		<span style="font-weight:bold; color:blue;">Weaver CSS Rules</span><br />
		<table class="optiontable">
<?php 
    foreach ($weaveriip_css as $option => $val) {
        weaveriip_css_row($val);
    }
    ?>
	<tr><td>&nbsp;</td></tr>
	<tr>
		<th scope="row" align="right" style="color:blue;">CSS Box Lines:&nbsp;</th>
		<td>
			<input type="text" style="width:30px;height:22px;" class="regular-text" name="css_edit_lines"
				id="css_edit_lines" value="<?php 
    weaverii_esc_textarea(weaverii_pro_getopt('css_edit_lines'));
    ?>
" />
			<small>Option: Number of lines to display in each edit box on this page.</small>
		</td>
	</tr>
		</table>
		</fieldset>
		<br />
		<input class="button-primary" type="submit" name="weaverii_pro_save_pro" value="Save Total CSS Options"/>
		<input type="hidden" name="weaveriip_save_totalcss" value="Weaver II Pro Total CSS Options Saved" />
		<?php 
    weaverii_nonce_field('weaverii_pro_save_pro');
    ?>
	</form>
	<hr />
	</div>
<?php 
}