Permalink
Browse files

Re-organized modules.

  • Loading branch information...
mvied committed Jul 28, 2012
1 parent 220d591 commit 5d11d5220d629db3b7298363a46dfe413092eb17
@@ -0,0 +1,19 @@
+<?php
+
+if ( array_key_exists('ajax', $_POST) ) {
+ error_reporting(0);
+ while(@ob_end_clean());
+ if ( sizeof( $errors ) > 0 ) {
+ echo "<div class=\"error below-h2 fade wphttps-message\" id=\"message\">\n\t<ul>\n";
+ foreach ( $errors as $error ) {
+ echo "\t\t<li><p>".$error."</p></li>\n";
+ }
+ echo "\t</ul>\n</div>\n";
+ } else {
+ echo "<div class=\"updated below-h2 fade wphttps-message\" id=\"message\"><p>" . $message . "</p></div>\n";
+ if ( $logout || $reload ) {
+ echo "<script type=\"text/javascript\">window.location.reload();</script>";
+ }
+ }
+ exit();
+}
@@ -56,7 +56,7 @@
</tr>
</table>
-<input type="hidden" name="action" value="settings-save" />
+<input type="hidden" name="action" value="wphttps-domain-mapping" />
<p class="button-controls">
<input type="submit" name="domain_mapping-save" value="Save Changes" class="button-primary" id="domain_mapping-save" />
@@ -11,7 +11,7 @@
</td>
</tr>
</table>
-<input type="hidden" name="action" value="settings-save" />
+<input type="hidden" name="action" value="wphttps-filters" />
<p class="button-controls">
<input type="submit" name="filters-save" value="Save Changes" class="button-primary" id="filters-save" />
<input type="submit" name="filters-reset" value="Reset" class="button-secondary" id="filters-reset" />
@@ -1,7 +1,7 @@
<form name="<?php echo $this->getPlugin()->getSlug(); ?>_settings_form" id="<?php echo $this->getPlugin()->getSlug(); ?>_settings_form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
<?php settings_fields($this->getPlugin()->getSlug()); ?>
-<input type="hidden" name="action" value="network-save" />
+<input type="hidden" name="action" value="wphttps-network" />
<p class="button-controls">
<input type="submit" name="settings-save" value="Save Changes" class="button-primary" id="network-settings-save" />
@@ -111,7 +111,7 @@
</tr>
</table>
-<input type="hidden" name="action" value="settings-save" />
+<input type="hidden" name="action" value="wphttps-settings" />
<input type="hidden" name="ssl_host_subdomain" value="<?php echo (($this->getPlugin()->getSetting('ssl_host_subdomain') != 1) ? 0 : 1); ?>" />
<input type="hidden" name="ssl_host_diff" value="<?php echo (($this->getPlugin()->getSetting('ssl_host_diff') != 1) ? 0 : 1); ?>" />
View
@@ -432,4 +432,27 @@ public function redirect( $scheme = 'https' ) {
}
}
+ /**
+ * Get relevent files and directories within WordPress
+ *
+ * @param none
+ * @return void
+ */
+ public function getDirectories() {
+ $directories = array();
+ $scannedDirectories = array();
+ $directories[] = get_theme_root() . '/' . get_template();
+
+ foreach( $directories as $directory ) {
+ $scannedDirectories[$directory]['name'] = $directory;
+ if ( is_readable($directory) && ($files = scandir($directory)) ) {
+ $scannedDirectories[$directory]['files'] = $files;
+ unset($files);
+ } else {
+ $scannedDirectories[$directory]['error'] = "Unable to read directory.";
+ }
+ }
+ return $scannedDirectories;
+ }
+
}
@@ -18,13 +18,6 @@ class WordPressHTTPS_Module_Admin extends Mvied_Plugin_Module implements Mvied_P
* @return void
*/
public function init() {
- // Add admin menus
- add_action('admin_menu', array(&$this, 'admin_menu'));
-
- if ( is_multisite() ) {
- //add_action('network_admin_menu', array(&$this, 'network_admin_menu'));
- }
-
// Load on plugins page
if ( isset($GLOBALS['pagenow']) && $GLOBALS['pagenow'] == 'plugins.php' ) {
add_filter( 'plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
@@ -45,32 +38,6 @@ public function admin_enqueue_scripts() {
wp_enqueue_style($this->getPlugin()->getSlug() . '-admin-global', $this->getPlugin()->getPluginUrl() . '/admin/css/admin.css', array(), $this->getPlugin()->getVersion());
}
- /**
- * Admin panel menu option
- * WordPress Hook - admin_menu
- *
- * @param none
- * @return void
- */
- public function admin_menu() {
- if ( $this->getPlugin()->getSetting('admin_menu') === 'side' ) {
- add_menu_page('HTTPS', 'HTTPS', 'manage_options', $this->getPlugin()->getSlug(), array($this->getPlugin()->getModule('Admin\Settings'), 'dispatch'), '', 88);
- } else {
- add_options_page('HTTPS', 'HTTPS', 'manage_options', $this->getPlugin()->getSlug(), array($this->getPlugin()->getModule('Admin\Settings'), 'dispatch'));
- }
- }
-
- /**
- * Network admin panel menu option
- * WordPress Hook - network_admin_menu
- *
- * @param none
- * @return void
- */
- public function network_admin_menu() {
- add_menu_page('HTTPS', 'HTTPS', 'manage_options', $this->getPlugin()->getSlug(), array($this->getPlugin()->getModule('Admin\Network'), 'dispatch'), '', 88);
- }
-
/**
* Renders a meta box
*
Oops, something went wrong.

0 comments on commit 5d11d52

Please sign in to comment.