apache
wp-content
mu-plugins
plugins
activitypub
authLdap-2.4.2
companion-auto-update
disable-wordpress-core-update
gitium
gp-premium
menu-icons
simple-local-avatars
static-html-output-plugin
languages
plugin
CSSParser
FTP
URL2
WP2Static
Archive.php
ArchiveProcessor.php
CSSProcessor.php
DBSettings.php
Deployer.php
Dispatcher.php
Exporter.php
FileCopier.php
FileWriter.php
FilesHelper.php
HTMLProcessor.php
MimeTypes.php
Options.php
PostSettings.php
ProgressLog.php
Request.php
SiteCrawler.php
SitePublisher.php
TXTProcessor.php
TemplateHelper.php
View.php
WP2Static.php
WPSite.php
WsLog.php
deployers
WP2Static.php
wp2static-wp-cli-commands.php
views
readme.txt
wp2static.css
wp2static.php
wp-mail-smtp
wp-piwik
index.php
themes
index.php
.dbsetup
.gitignore
htaccess
php.ini
17 lines
1.5 KiB
PHP
17 lines
1.5 KiB
PHP
<?php
|
|
class TemplateHelper { public function __construct() { } public function displayCheckbox( $tpl_vars, $field_name, $field_label ) { echo "
|
|
<fieldset>
|
|
<label for='{$field_name}'>
|
|
<input name='{$field_name}' id='{$field_name}' value='1' type='checkbox' " . ( $tpl_vars->options->{$field_name} === '1' ? 'checked' : '' ) . ' />
|
|
<span>' . __( $field_label, 'static-html-output-plugin' ) . '</span>
|
|
</label>
|
|
</fieldset>
|
|
'; } public function displayTextfield( $tpl_vars, $field_name, $field_label, $description, $type = 'text' ) { echo "
|
|
<input name='{$field_name}' class='regular-text' id='{$field_name}' type='{$type}' value='" . esc_attr( $tpl_vars->options->{$field_name} ) . "' placeholder='" . __( $field_label, 'static-html-output-plugin' ) . "' />
|
|
<span class='description'>$description</span>
|
|
<br>
|
|
"; } public function displaySelectMenu( $tpl_vars, $menu_options, $field_name, $field_label, $description, $type = 'text' ) { $menu_code = "
|
|
<select name='{$field_name}' id='{$field_name}'>
|
|
<option></option>"; foreach ( $menu_options as $value => $text ) { if ( $tpl_vars->options->{$field_name} === $value ) { $menu_code .= "
|
|
<option value='{$value}' selected>{$text}</option>"; } else { $menu_code .= "
|
|
<option value='{$value}'>{$text}</option>"; } } $menu_code .= '</select>'; echo $menu_code; } public function ifNotEmpty( $value, $substitute = '' ) { $value = $value ? $value : $substitute; echo $value; } }
|