From f3f672d41aa0795023b9735a9eb42ba0dfb2f197 Mon Sep 17 00:00:00 2001 From: Daniel Chatfield Date: Sun, 15 Apr 2012 10:22:59 +0100 Subject: [PATCH] Restructure Signed-off-by: Daniel Chatfield --- README | 1 - _classes/lavaPrivateBlogAccessLogsPage.php | 2 +- lava/_classes/lavaAdvancedTablePage.php | 65 ++++++++++++++++++++++ lava/_classes/lavaMiscFunctions.php | 2 +- lava/_classes/lavaPages.php | 1 + lava/_classes/lavaTable.php | 2 + lava/_static/scripts.js | 2 +- lava/_static/scripts_new.js | 0 lava/_static/table_scripts.js | 0 readme.txt | 2 +- vendor.php | 6 +- 11 files changed, 76 insertions(+), 7 deletions(-) delete mode 100644 README create mode 100644 lava/_classes/lavaAdvancedTablePage.php create mode 100644 lava/_static/scripts_new.js create mode 100644 lava/_static/table_scripts.js diff --git a/README b/README deleted file mode 100644 index efc6c98..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -Privacy Plugin is a wordpress plugin that allows you to password protect an entire wordpress site with a password. \ No newline at end of file diff --git a/_classes/lavaPrivateBlogAccessLogsPage.php b/_classes/lavaPrivateBlogAccessLogsPage.php index 9c755b7..56b8f18 100644 --- a/_classes/lavaPrivateBlogAccessLogsPage.php +++ b/_classes/lavaPrivateBlogAccessLogsPage.php @@ -1,5 +1,5 @@ addAction( "toolbarButtons" ); + $this->_pages()->addScript( $this->_slug( "lavaTableScripts" ), "lava/_static/table_scripts.js", array( "jquery" ) ); + } + + function setDataSource( $dataSource ) + { + $this->dataSource = $dataSource; + return $this->_pages( false ); + } + + function setDisplayOrder( $displayString ) + { + $this->displayOrder = explode( ";", $displayString ); + $dataSourceSlug = $this->dataSource; + $hookTag = "_dataSourceAjax_row/dataSource:{$dataSourceSlug}"; + $this->addFilter( $hookTag, "doDisplayOrder" ); + return $this->_pages( false ); + } + + function setOrderBy( $order ) { + $this->_tables()->fetchTable( $this->dataSource )->setOrderBy( $order ); + return $this->_pages( false ); + } + + function displayPage() { + if( is_null( $this->dataSource ) ) { + $this->dieWith( "No data source specified for this page" ); + } + $this->doTablePage(); + } + + function doTablePage() { + //$this->setHiddenField( "" ) + ?> +
+
+ +
+
+ +
+ + +
+ \ No newline at end of file diff --git a/lava/_classes/lavaMiscFunctions.php b/lava/_classes/lavaMiscFunctions.php index d0096b7..384c6fa 100644 --- a/lava/_classes/lavaMiscFunctions.php +++ b/lava/_classes/lavaMiscFunctions.php @@ -64,7 +64,7 @@ function versionMatch( $ver1, $ver2 = null ) { if( $ver1 == $ver2 ) { return true; } - return fasle; + return false; } function userAgentInfo() { diff --git a/lava/_classes/lavaPages.php b/lava/_classes/lavaPages.php index 8765479..085ebc0 100644 --- a/lava/_classes/lavaPages.php +++ b/lava/_classes/lavaPages.php @@ -44,6 +44,7 @@ function lavaConstruct() //$this->addStyle( $this->_slug( "colorpicker-theme" ), "lava/_static/colorpicker/colorpicker.css" ); $this->addScript( $this->_slug( "lavaScripts" ), "lava/_static/scripts.js", array( "jquery" ) ); + $this->addScript( $this->_slug( "lavaScriptsNew" ), "lava/_static/scripts_new.js", array( "jquery" ) ); $this->addScript( $this->_slug( "dropkick" ), "lava/_static/dropkick.js", array( "jquery" ) ); $this->addScript( $this->_slug( "modernizr" ), "lava/_static/modernizr.js" ); $this->addScript( $this->_slug( "tiptip" ), "lava/_static/tiptip.js", array( "jquery" ) ); diff --git a/lava/_classes/lavaTable.php b/lava/_classes/lavaTable.php index 0014094..05f6beb 100644 --- a/lava/_classes/lavaTable.php +++ b/lava/_classes/lavaTable.php @@ -115,6 +115,8 @@ function doInstall() { $sql .= "\n);"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); + + dbDelta($sql); return true; } diff --git a/lava/_static/scripts.js b/lava/_static/scripts.js index c3a7792..499133a 100644 --- a/lava/_static/scripts.js +++ b/lava/_static/scripts.js @@ -295,7 +295,7 @@ function bindButtons() { hideUnderground(); }); //not implemented buttons - jQuery(".lava-btn.not-implemented").addClass("lava-btn-disabled").addClass("tiptip-right").attr("title", "This feature hasn't been imlemented yet :("); + jQuery(".lava-btn.not-implemented").addClass("lava-btn-disabled").addClass("tiptip-right").attr("title", "This feature hasn't been implemented yet :("); } function bindSticky() diff --git a/lava/_static/scripts_new.js b/lava/_static/scripts_new.js new file mode 100644 index 0000000..e69de29 diff --git a/lava/_static/table_scripts.js b/lava/_static/table_scripts.js new file mode 100644 index 0000000..e69de29 diff --git a/readme.txt b/readme.txt index 1ac32c8..4b5e834 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: http://www.spiders-design.co.uk/donate/ Tags: password,protect,password protect,wordpress,blog, security Requires at least: 3.3.1 Tested up to: 3.3.1 -Stable tag: 3.9 +Stable tag: 3.9.1 This plugin password protects your wordpress blog with a single password. diff --git a/vendor.php b/vendor.php index dd004ca..f95e9ba 100644 --- a/vendor.php +++ b/vendor.php @@ -8,7 +8,6 @@ */ class private_blog_vendor extends lavaExtension { - public $isLocal = false; public $apiVersion = 1; function init() { @@ -161,7 +160,10 @@ function getInstallId() { } function getVendorUrl( $append = "" ) { - if( $this->isLocal ) { + if( ! defined( 'LAVA_API_IS_LOCAL' ) ) { + define( 'LAVA_API_IS_LOCAL', false ); + } + if( LAVA_API_IS_LOCAL ) { return "http://localhost:8082/" . $append; } else { return 'http://www.volcanicpixels.com/' . $append;