Files
2010-04-22 00:54:16 -04:00

181 lines
10 KiB
PHTML

<?php include W3TC_DIR . '/inc/options/common/header.phtml'; ?>
<h3><acronym title="Content Delivery Network">CDN</acronym> Settings</h3>
<p><acronym title="Content Delivery Network">CDN</acronym> support is currently <span class="w3tc-<?php if ($cdn_enabled): ?>enabled">enabled<?php else: ?>disabled">disabled<?php endif; ?></span>.</p>
<?php if ($cdn_mirror): ?>
<p>
You can <input id="cdn_rename_domain" class="button" type="button" value="modify attachment URLs" />,
<input id="cdn_import_library" class="button" type="button" value="import attachments into the Media Library" /> now.
</p>
<?php else: ?>
<p>
You can <input id="cdn_export_library" class="button" type="button" value="export media library to CDN" />,
<input id="cdn_import_library" class="button" type="button" value="import attachments into the Media Library" />,
<input id="cdn_queue" class="button" type="button" value="view unsuccessful file transfers" /> or
<input id="cdn_rename_domain" class="button" type="button" value="modify attachment URLs" /> now.
</p>
<?php endif; ?>
<form action="options-general.php?page=<?php echo urldecode(W3TC_FILE); ?>&amp;tab=<?php echo $this->_tab; ?>" method="post">
<fieldset id="cdn-general">
<legend>General</legend>
<table class="form-table">
<tr>
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
<input type="hidden" name="cdn.includes.enable" value="0" />
<label><input type="checkbox" name="cdn.includes.enable" value="1"<?php checked($this->_config->get_boolean('cdn.includes.enable'), true); ?> /> Host wp-includes/ files</label><br />
<span class="description">If checked, WordPress static core file types specified in the "wp-includes file types to upload" field below will be hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</th>
<?php if (! $cdn_mirror): ?>
<td>
<input class="button cdn_export" type="button" name="includes" value="Upload includes files" />
</td>
<?php endif; ?>
</tr>
<tr>
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
<input type="hidden" name="cdn.theme.enable" value="0" />
<label><input type="checkbox" name="cdn.theme.enable" value="1"<?php checked($this->_config->get_boolean('cdn.theme.enable'), true); ?> /> Host active theme files</label><br />
<span class="description">If checked, all active theme file types specified in the "theme file types to upload" field below will be hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</th>
<?php if (! $cdn_mirror): ?>
<td>
<input class="button cdn_export" type="button" name="theme" value="Upload theme files" />
</td>
<?php endif; ?>
</tr>
<tr>
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
<input type="hidden" name="cdn.minify.enable" value="0"<?php if (! W3TC_PHP5 || ! $minify_enabled): ?> disabled="disabled"<?php endif; ?> />
<label><input type="checkbox" name="cdn.minify.enable" value="1"<?php checked($this->_config->get_boolean('cdn.minify.enable'), true); ?><?php if (! W3TC_PHP5 || ! $minify_enabled): ?> disabled="disabled"<?php endif; ?> /> Host minified <acronym title="Cascading Style Sheet">CSS</acronym> and <acronym title="JavaScript">JS</acronym> files</label><br />
<span class="description">If checked, minified <acronym>CSS</acronym> and <acronym>JS</acronym> files will be hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</th>
<?php if (! $cdn_mirror): ?>
<td>
<input class="button cdn_export" type="button" name="minify" value="Upload minify files"<?php if (! W3TC_PHP5 || ! $minify_enabled): ?> disabled="disabled"<?php endif; ?> />
</td>
<?php endif; ?>
</tr>
<tr>
<th<?php if ($cdn_mirror): ?> colspan="2"<?php endif; ?>>
<input type="hidden" name="cdn.custom.enable" value="0" />
<label><input type="checkbox" name="cdn.custom.enable" value="1"<?php checked($this->_config->get_boolean('cdn.custom.enable'), true); ?> /> Host custom files</label><br />
<span class="description">If checked, any file names or paths specified in the "custom file list" field below will be hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</th>
<?php if (! $cdn_mirror): ?>
<td>
<input class="button cdn_export" type="button" name="custom" value="Upload custom files" />
</td>
<?php endif; ?>
</tr>
<?php if (! $cdn_mirror): ?>
<tr>
<th colspan="2">
<input type="hidden" name="cdn.force.rewrite" value="0" />
<label><input type="checkbox" name="cdn.force.rewrite" value="1"<?php checked($this->_config->get_boolean('cdn.force.rewrite'), true); ?> /> Force over-writing of existing files</label><br />
<span class="description">If modified files are not always detected and replaced, use this option to over-write them.</span>
</th>
</tr>
<tr>
<th colspan="2">
<input type="hidden" name="cdn.import.external" value="0" />
<label><input type="checkbox" name="cdn.import.external" value="1"<?php checked($this->_config->get_boolean('cdn.import.external'), true); ?> /> Import external media library attachments</label><br />
<span class="description">Download attachments hosted elsewhere into your media library and deliver them via <acronym title="Content Delivery Network">CDN</acronym>.</span>
</th>
</tr>
<?php endif; ?>
</table>
<p class="submit">
<input type="submit" name="Submit" class="button-primary" value="Save changes" />
</p>
</fieldset>
<fieldset>
<legend>Configuration</legend>
<table class="form-table">
<?php
switch ($cdn_engine) {
case 'mirror':
case 'ftp':
case 's3':
case 'cf':
include W3TC_DIR . '/inc/options/cdn/' . $cdn_engine . '.phtml';
break;
}
?>
</table>
<p class="submit">
<input type="submit" name="Submit" class="button-primary" value="Save changes" />
</p>
</fieldset>
<fieldset>
<legend>Advanced</legend>
<table class="form-table">
<?php if (! $cdn_mirror): ?>
<tr>
<th><label for="cdn_limit_queue">Re-transfer cycle limit:</label></th>
<td>
<input id="cdn_limit_queue" type="text" name="cdn.queue.limit" value="<?php echo htmlspecialchars($this->_config->get_integer('cdn.queue.limit')); ?>" size="10" /><br />
<span class="description">Number of files processed per upload attempt.</span>
</td>
</tr>
<?php endif; ?>
<tr>
<th style="width: 300px;"><label for="cdn_includes_files">wp-includes file types to upload:</label></th>
<td>
<input id="cdn_includes_files" type="text" name="cdn.includes.files" value="<?php echo htmlspecialchars($this->_config->get_string('cdn.includes.files')); ?>" size="100" /><br />
<span class="description">Specify the file types within the WordPress core to host with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</td>
</tr>
<tr>
<th><label for="cdn_theme_files">Theme file types to upload:</label></th>
<td>
<input id="cdn_theme_files" type="text" name="cdn.theme.files" value="<?php echo htmlspecialchars($this->_config->get_string('cdn.theme.files')); ?>" size="100" /><br />
<span class="description">Specify the file types in the active theme to host with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</td>
</tr>
<tr>
<th><label for="cdn_import_files">File types to import:</label></th>
<td>
<input id="cdn_import_files" type="text" name="cdn.import.files" value="<?php echo htmlspecialchars($this->_config->get_string('cdn.import.files')); ?>" size="100" /><br />
<span class="description">Automatically import files hosted with 3rd parties of these types (if used in your posts / pages) to your media library.</span>
</td>
</tr>
<tr>
<th valign="top"><label for="cdn_custom_files">Custom file list:</label></th>
<td>
<textarea id="cdn_custom_files" name="cdn.custom.files" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('cdn.custom.files'))); ?></textarea><br />
<span class="description">Specify any files outside of theme or other common directories to host with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</td>
</tr>
<tr>
<th valign="top"><label for="cdn_reject_ua">Rejected user agents:</label></th>
<td>
<textarea id="cdn_reject_ua" name="cdn.reject.ua" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('cdn.reject.ua'))); ?></textarea><br />
<span class="description">Specify user agents that should not access files hosted with the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</td>
</tr>
<tr>
<th valign="top"><label for="cdn_reject_files">Rejected files:</label></th>
<td>
<textarea id="cdn_reject_files" name="cdn.reject.files" cols="40" rows="5"><?php echo htmlspecialchars(implode("\r\n", $this->_config->get_array('cdn.reject.files'))); ?></textarea><br />
<span class="description">Specify the path of files that should not use the <acronym title="Content Delivery Network">CDN</acronym>.</span>
</td>
</tr>
</table>
<p class="submit">
<input type="submit" name="Submit" class="button-primary" value="Save changes" />
</p>
</fieldset>
</form>
<?php include W3TC_DIR . '/inc/options/common/footer.phtml'; ?>