Permalink
Browse files

Updated Mvied library to use view rendering. Re-organized css, js, im…

…age and template files.
  • Loading branch information...
mvied committed Mar 29, 2013
1 parent ce98cde commit 0e9139ad37cde3ca85d209ce416cc01a9c776245
@@ -2,16 +2,14 @@
#adminmenu .menu-top.toplevel_page_wordpress-https.wp-has-current-submenu .wp-menu-image,
#adminmenu .menu-top.toplevel_page_wordpress-https:hover .wp-menu-image,
#adminmenu .menu-top.toplevel_page_wordpress-https.focused .wp-menu-image {
- /* background-position: -360px -1px; */
background-position: 0% 0%;
}
#adminmenu .menu-top.toplevel_page_wordpress-https .wp-menu-image img {
display: none;
}
#adminmenu .menu-top.toplevel_page_wordpress-https div.wp-menu-image {
- /* background: url('../../../../../wp-admin/images/menu.png') no-repeat scroll -360px -33px; */
- background: url('images/admin-icon.png') no-repeat 0% 100%;;
+ background: url('../img/admin-icon.png') no-repeat 0% 100%;;
}
#side-sortables #wordpress-https .inside {
padding: 0;
File renamed without changes.
@@ -12,7 +12,7 @@
}
#wphttps-main #icon-options-https {
- background: url(images/admin-icon32.png) no-repeat;
+ background: url(../img/admin-icon32.png) no-repeat;
}
#wphttps-main .meta-box-sortables {
@@ -95,7 +95,8 @@
margin-right: 10px;
}
#wphttps-main #ssl_host {
- width: 70%;
+ width: 80%;
+ margin-top: 3px;
}
#wphttps-main #exclusive_https_row label {
padding-top: 5px;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Submodule Mvied updated 3 files
+449 −0 Modular.php
+2 −402 Plugin.php
+1 −380 Theme.php
@@ -35,7 +35,7 @@ public function init() {
* @return void
*/
public function admin_enqueue_scripts() {
- wp_enqueue_style($this->getPlugin()->getSlug() . '-admin-global', $this->getPlugin()->getPluginUrl() . '/admin/css/admin.css', array(), $this->getPlugin()->getVersion());
+ wp_enqueue_style($this->getPlugin()->getSlug() . '-admin-global', $this->getPlugin()->getPluginUrl() . '/css/admin.css', array(), $this->getPlugin()->getVersion());
}
/**
@@ -47,7 +47,7 @@ public function admin_enqueue_scripts() {
*/
public function meta_box_render( $module, $metabox = array() ) {
if ( isset($metabox['args']['metabox']) ) {
- include($this->getPlugin()->getDirectory() . '/admin/templates/metabox/' . $metabox['args']['metabox'] . '.php');
+ $this->getPlugin()->renderView('metabox/' . $metabox['args']['metabox'], array('metabox' => $metabox));
}
}
@@ -84,7 +84,7 @@ public function reset() {
$this->getPlugin()->setSetting('ssl_host_mapping', WordPressHTTPS::$ssl_host_mapping);
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/ajax_message.php');
+ $this->getPlugin()->renderView('ajax_message');
}
/**
@@ -110,7 +110,7 @@ public function save() {
}
$this->getPlugin()->setSetting('ssl_host_mapping', $ssl_host_mapping);
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/ajax_message.php');
+ $this->getPlugin()->renderView('ajax_message');
}
}
@@ -94,7 +94,7 @@ public function dispatch() {
* @return void
*/
public function admin_enqueue_scripts() {
- wp_enqueue_style($this->getPlugin()->getSlug() . '-network-admin-page', $this->getPlugin()->getPluginUrl() . '/admin/css/network.css', array($this->getPlugin()->getSlug() . '-admin-page'), $this->getPlugin()->getVersion());
+ wp_enqueue_style($this->getPlugin()->getSlug() . '-network-admin-page', $this->getPlugin()->getPluginUrl() . '/css/network.css', array($this->getPlugin()->getSlug() . '-admin-page'), $this->getPlugin()->getVersion());
}
/**
@@ -104,7 +104,7 @@ public function admin_enqueue_scripts() {
* @return void
*/
public function render() {
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/network.php');
+ $this->getPlugin()->renderView('network');
}
/**
@@ -156,7 +156,7 @@ public function save() {
wp_logout();
}
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/ajax_message.php');
+ $this->getPlugin()->renderView('ajax_message');
}
}
@@ -165,7 +165,7 @@ public function ajax_metabox() {
* @return void
*/
public function admin_enqueue_scripts() {
- wp_enqueue_style($this->getPlugin()->getSlug() . '-admin-page', $this->getPlugin()->getPluginUrl() . '/admin/css/settings.css', array(), $this->getPlugin()->getVersion());
+ wp_enqueue_style($this->getPlugin()->getSlug() . '-admin-page', $this->getPlugin()->getPluginUrl() . '/css/settings.css', array(), $this->getPlugin()->getVersion());
wp_enqueue_script('jquery-form');
wp_enqueue_script('post');
@@ -181,7 +181,7 @@ public function admin_enqueue_scripts() {
* @return void
*/
public function render() {
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/settings.php');
+ $this->getPlugin()->renderView('settings');
}
/**
@@ -204,7 +204,7 @@ public function reset() {
}
$this->getPlugin()->install();
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/ajax_message.php');
+ $this->getPlugin()->renderView('ajax_message');
}
/**
@@ -293,7 +293,7 @@ public function save() {
wp_logout();
}
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/ajax_message.php');
+ $this->getPlugin()->renderView('ajax_message');
}
}
@@ -86,7 +86,7 @@ public function reset() {
$this->getPlugin()->setSetting('secure_filter', array());
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/ajax_message.php');
+ $this->getPlugin()->renderView('ajax_message');
}
/**
@@ -108,7 +108,7 @@ public function save() {
$filters = array_filter($filters); // Removes blank array items
$this->getPlugin()->setSetting('secure_filter', $filters);
- require_once($this->getPlugin()->getDirectory() . '/admin/templates/ajax_message.php');
+ $this->getPlugin()->renderView('ajax_message');
}
}
File renamed without changes.
@@ -1,6 +1,6 @@
<?php
if ( !defined('ABSPATH') ) exit;
-$nonce = wp_create_nonce($this->getPlugin()->getSlug());
+$nonce = wp_create_nonce($this->getSlug());
?><script type="text/javascript">
jQuery(document).ready(function($) {
var loading = $('<img alt="Loading..." src="<?php echo admin_url('/images/wpspin_light.gif'); ?>" class="loading" />');
@@ -9,7 +9,7 @@
$('#<?php echo $metabox['id']; ?> .handlediv .loading').fadeIn('fast');
$.post(ajaxurl, {
- action : '<?php echo $this->getPlugin()->getSlug(); ?>_ajax_metabox',
+ action : '<?php echo $this->getSlug(); ?>_ajax_metabox',
id : '<?php echo $metabox['id']; ?>',
url : '<?php echo $metabox['args']['url']; ?>',
_nonce : '<?php echo $nonce; ?>'
@@ -1,8 +1,8 @@
<?php
if ( !defined('ABSPATH') ) exit;
?>
-<form name="<?php echo $this->getPlugin()->getSlug(); ?>_domain_mapping_form" id="<?php echo $this->getPlugin()->getSlug(); ?>_domain_mapping_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
-<?php wp_nonce_field($this->getPlugin()->getSlug()); ?>
+<form name="<?php echo $this->getSlug(); ?>_domain_mapping_form" id="<?php echo $this->getSlug(); ?>_domain_mapping_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
+<?php wp_nonce_field($this->getSlug()); ?>
<input type="hidden" name="action" id="action" value="" />
<p><?php printf( __('Domain mapping allows you to map external domains that host their HTTPS content on a different domain. You may use %s regular expressions %s','wordpress-https'),'<a href="#TB_inline?height=155&width=350&inlineId=regex-help&" class="thickbox" title="' . __('Regular Expressions Help','wordpress-https') . '">', '</a>') ; ?>.</p>
@@ -11,7 +11,7 @@
<thead>
</thead>
<?php
- $ssl_host_mapping = ( is_array($this->getPlugin()->getSetting('ssl_host_mapping')) ? $this->getPlugin()->getSetting('ssl_host_mapping') : array() );
+ $ssl_host_mapping = ( is_array($this->getSetting('ssl_host_mapping')) ? $this->getSetting('ssl_host_mapping') : array() );
foreach( $ssl_host_mapping as $http_domain => $https_domain ) {
?>
<tr valign="top" class="domain_mapping_row">
@@ -68,12 +68,12 @@
</form>
<script type="text/javascript">
jQuery(document).ready(function($) {
- var form = $('#<?php echo $this->getPlugin()->getSlug(); ?>_domain_mapping_form').first();
+ var form = $('#<?php echo $this->getSlug(); ?>_domain_mapping_form').first();
$('#domain-mapping-save').click(function() {
- $(form).find('input[name="action"]').val('<?php echo $this->getPlugin()->getSlug(); ?>_domain_mapping_save');
+ $(form).find('input[name="action"]').val('<?php echo $this->getSlug(); ?>_domain_mapping_save');
});
$('#domain-mapping-reset').click(function() {
- $(form).find('input[name="action"]').val('<?php echo $this->getPlugin()->getSlug(); ?>_domain_mapping_reset');
+ $(form).find('input[name="action"]').val('<?php echo $this->getSlug(); ?>_domain_mapping_reset');
});
$(form).submit(function(e) {
e.preventDefault();
@@ -1,8 +1,8 @@
<?php
if ( !defined('ABSPATH') ) exit;
?>
-<form name="<?php echo $this->getPlugin()->getSlug(); ?>_filters_form" id="<?php echo $this->getPlugin()->getSlug(); ?>_filters_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
-<?php wp_nonce_field($this->getPlugin()->getSlug()); ?>
+<form name="<?php echo $this->getSlug(); ?>_filters_form" id="<?php echo $this->getSlug(); ?>_filters_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
+<?php wp_nonce_field($this->getSlug()); ?>
<input type="hidden" name="action" id="action" value="" />
<table class="form-table">
@@ -12,7 +12,7 @@
<p class="description"><?php printf( __("Example: If you have an E-commerce shop and all of the URL's begin with /store/, you could secure all store links by entering '/store/' on one line. You may use %s regular expressions %s",'wordpress-https'),'<a href="#TB_inline?height=155&width=350&inlineId=regex-help" class="thickbox" title="' . __('Regular Expressions Help','wordpress-https') . '">','</a>'); ?>.</p>
</th>
<td>
- <textarea name="secure_filter" id="secure_filter"><?php echo implode("\n", $this->getPlugin()->getSetting('secure_filter')); ?></textarea>
+ <textarea name="secure_filter" id="secure_filter"><?php echo implode("\n", $this->getSetting('secure_filter')); ?></textarea>
</td>
</tr>
</table>
@@ -26,12 +26,12 @@
<script type="text/javascript">
jQuery(document).ready(function($) {
- var form = $('#<?php echo $this->getPlugin()->getSlug(); ?>_filters_form').first();
+ var form = $('#<?php echo $this->getSlug(); ?>_filters_form').first();
$('#filters-save').click(function() {
- $(form).find('input[name="action"]').val('<?php echo $this->getPlugin()->getSlug(); ?>_filters_save');
+ $(form).find('input[name="action"]').val('<?php echo $this->getSlug(); ?>_filters_save');
});
$('#filters-reset').click(function() {
- $(form).find('input[name="action"]').val('<?php echo $this->getPlugin()->getSlug(); ?>_filters_reset');
+ $(form).find('input[name="action"]').val('<?php echo $this->getSlug(); ?>_filters_reset');
});
$(form).submit(function(e) {
e.preventDefault();
@@ -1,8 +1,8 @@
<?php
if ( !defined('ABSPATH') ) exit;
?>
-<form name="<?php echo $this->getPlugin()->getSlug(); ?>_network_settings_form" id="<?php echo $this->getPlugin()->getSlug(); ?>_network_settings_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
-<?php wp_nonce_field($this->getPlugin()->getSlug()); ?>
+<form name="<?php echo $this->getSlug(); ?>_network_settings_form" id="<?php echo $this->getSlug(); ?>_network_settings_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
+<?php wp_nonce_field($this->getSlug()); ?>
<input type="hidden" name="action" id="action" value="" />
<table id="blog-table">
@@ -23,37 +23,37 @@
global $wpdb;
$blogs = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM " . $wpdb->blogs, NULL));
foreach($blogs as $blog_id) {
- $ssl_host = ($this->getPlugin()->getSetting('ssl_host', $blog_id) != '' ? $this->getPlugin()->getSetting('ssl_host', $blog_id) : get_site_url($blog_id, '', 'https'));
+ $ssl_host = ($this->getSetting('ssl_host', $blog_id) != '' ? $this->getSetting('ssl_host', $blog_id) : get_site_url($blog_id, '', 'https'));
$ssl_host = preg_replace('/http[s]?:\/\//', '', $ssl_host);
$ssl_host = rtrim(str_replace(parse_url(get_site_url($blog_id, ''), PHP_URL_PATH), '', $ssl_host), '/');
?>
<tr>
<td class="blog-blog"><strong><?php echo preg_replace('/http[s]?:\/\//', '', get_site_url($blog_id)); ?></strong></td>
<td class="blog-host"><input name="blog[<?php echo $blog_id; ?>][ssl_host]" type="text" class="regular-text code" value="<?php echo $ssl_host; ?>" /></td>
- <td class="blog-ssl_admin"><input type="hidden" name="blog[<?php echo $blog_id; ?>][ssl_admin]" value="<?php echo ((force_ssl_admin() && $this->getPlugin()->getSetting('ssl_admin', $blog_id) == 1) ? 1 : 0); ?>" /><input name="blog[<?php echo $blog_id; ?>][ssl_admin]" type="checkbox" value="1"<?php echo ((force_ssl_admin()) ? ' disabled="disabled" title="FORCE_SSL_ADMIN is true in wp-config.php"' : '') . ($this->getPlugin()->getSetting('ssl_admin', $blog_id) ? ' checked="checked"' : ''); ?> /></td>
- <td class="blog-exclusive_https"><input type="hidden" name="blog[<?php echo $blog_id; ?>][exclusive_https]" value="0" /><input name="blog[<?php echo $blog_id; ?>][exclusive_https]" type="checkbox" value="1"<?php echo (($this->getPlugin()->getSetting('exclusive_https', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
- <td class="blog-remove_unsecure"><input type="hidden" name="blog[<?php echo $blog_id; ?>][remove_unsecure]" value="0" /><input name="blog[<?php echo $blog_id; ?>][remove_unsecure]" type="checkbox" value="1"<?php echo (($this->getPlugin()->getSetting('remove_unsecure', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
- <td class="blog-debug"><input type="hidden" name="blog[<?php echo $blog_id; ?>][debug]" value="0" /><input name="blog[<?php echo $blog_id; ?>][debug]" type="checkbox" value="1"<?php echo (($this->getPlugin()->getSetting('debug', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
+ <td class="blog-ssl_admin"><input type="hidden" name="blog[<?php echo $blog_id; ?>][ssl_admin]" value="<?php echo ((force_ssl_admin() && $this->getSetting('ssl_admin', $blog_id) == 1) ? 1 : 0); ?>" /><input name="blog[<?php echo $blog_id; ?>][ssl_admin]" type="checkbox" value="1"<?php echo ((force_ssl_admin()) ? ' disabled="disabled" title="FORCE_SSL_ADMIN is true in wp-config.php"' : '') . ($this->getSetting('ssl_admin', $blog_id) ? ' checked="checked"' : ''); ?> /></td>
+ <td class="blog-exclusive_https"><input type="hidden" name="blog[<?php echo $blog_id; ?>][exclusive_https]" value="0" /><input name="blog[<?php echo $blog_id; ?>][exclusive_https]" type="checkbox" value="1"<?php echo (($this->getSetting('exclusive_https', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
+ <td class="blog-remove_unsecure"><input type="hidden" name="blog[<?php echo $blog_id; ?>][remove_unsecure]" value="0" /><input name="blog[<?php echo $blog_id; ?>][remove_unsecure]" type="checkbox" value="1"<?php echo (($this->getSetting('remove_unsecure', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
+ <td class="blog-debug"><input type="hidden" name="blog[<?php echo $blog_id; ?>][debug]" value="0" /><input name="blog[<?php echo $blog_id; ?>][debug]" type="checkbox" value="1"<?php echo (($this->getSetting('debug', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
<td class="blog-proxy">
<select name="blog[<?php echo $blog_id; ?>][ssl_proxy]">
- <option value="0"<?php echo ((! $this->getPlugin()->getSetting('ssl_proxy', $blog_id)) ? ' selected="selected"' : ''); ?>><?php _e('No','wordpress-https'); ?></option>
- <option value="auto"<?php echo (($this->getPlugin()->getSetting('ssl_proxy', $blog_id) === 'auto') ? ' selected="selected"' : ''); ?>><?php _e('Auto','wordpress-https'); ?></option>
- <option value="1"<?php echo (($this->getPlugin()->getSetting('ssl_proxy', $blog_id) == 1) ? ' selected="selected"' : ''); ?>><?php _e('Yes','wordpress-https'); ?></option>
+ <option value="0"<?php echo ((! $this->getSetting('ssl_proxy', $blog_id)) ? ' selected="selected"' : ''); ?>><?php _e('No','wordpress-https'); ?></option>
+ <option value="auto"<?php echo (($this->getSetting('ssl_proxy', $blog_id) === 'auto') ? ' selected="selected"' : ''); ?>><?php _e('Auto','wordpress-https'); ?></option>
+ <option value="1"<?php echo (($this->getSetting('ssl_proxy', $blog_id) == 1) ? ' selected="selected"' : ''); ?>><?php _e('Yes','wordpress-https'); ?></option>
</select>
</td>
<td class="blog-admin_menu">
<select name="blog[<?php echo $blog_id; ?>][admin_menu]">
- <option value="side"<?php echo (($this->getPlugin()->getSetting('admin_menu', $blog_id) === 'side') ? ' selected="selected"' : ''); ?>><?php _e('Sidebar','wordpress-https'); ?></option>
- <option value="settings"<?php echo (($this->getPlugin()->getSetting('admin_menu', $blog_id) === 'settings') ? ' selected="selected"' : ''); ?>><?php _e('Settings','wordpress-https'); ?></option>
+ <option value="side"<?php echo (($this->getSetting('admin_menu', $blog_id) === 'side') ? ' selected="selected"' : ''); ?>><?php _e('Sidebar','wordpress-https'); ?></option>
+ <option value="settings"<?php echo (($this->getSetting('admin_menu', $blog_id) === 'settings') ? ' selected="selected"' : ''); ?>><?php _e('Settings','wordpress-https'); ?></option>
</select>
</td>
</tr>
<?php
}
- $defaults = $this->getPlugin()->getSetting('network_defaults');
+ $defaults = $this->getSetting('network_defaults');
if ( sizeof($defaults) == 0 ) {
- foreach( $this->getPlugin()->getSettings() as $setting => $default ) {
+ foreach( $this->getSettings() as $setting => $default ) {
$defaults[$setting] = $default;
}
}
@@ -91,9 +91,9 @@
</form>
<script type="text/javascript">
jQuery(document).ready(function($) {
- var form = $('#<?php echo $this->getPlugin()->getSlug(); ?>_network_settings_form').first();
+ var form = $('#<?php echo $this->getSlug(); ?>_network_settings_form').first();
$('#network-settings-save').click(function() {
- $(form).find('input[name="action"]').val('<?php echo $this->getPlugin()->getSlug(); ?>_network_settings_save');
+ $(form).find('input[name="action"]').val('<?php echo $this->getSlug(); ?>_network_settings_save');
});
$(form).submit(function(e) {
e.preventDefault();
@@ -16,7 +16,7 @@
}
}
-wp_nonce_field($this->getPlugin()->getSlug(), $this->getPlugin()->getSlug());
+wp_nonce_field($this->getSlug(), $this->getSlug());
?>
<div class="misc-pub-section">
Oops, something went wrong.

0 comments on commit 0e9139a

Please sign in to comment.