Skip to content

Commit

Permalink
General updates
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchatfield committed Jul 25, 2012
1 parent 855bddf commit 34cfea4
Show file tree
Hide file tree
Showing 12 changed files with 142 additions and 6 deletions.
48 changes: 44 additions & 4 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,56 @@ class Volcanic_Pixels_Private_Blog extends Lava_Plugin {
public $_plugin_name = "Private Blog";
public $_plugin_version = 4.05;

public $_plugin_actions = array(
'do_authentication',
'do_login_display'
);

public $_plugin_filters = array(
'is_authorised'
);

###########################################
## lava hooks
###########################################

function _init() {
parent::_init();
}

function _register_settings() {
parent::_register_settings();
function _get_header() {
$this->_do_plugin_action( 'do_authentication' );
}

function _register_pages() {
parent::_register_pages();
function _register_widgets() {
die('asd');
}

###########################################
## lava hooks
###########################################

/*
Plugin hooks
*/
function do_authentication() {
$is_authorised = $this->_apply_plugin_filters( 'is_authorised', false );
if( ! $is_authorised ) {
$this->_do_plugin_action( 'do_login_display' );
exit; //better to be safe
}
}

function is_authorised( $current ) {
return false;
}


/*
Displays the login page
*/
function do_login_display() {
$this->_skins()->_display_template( 'login' );
}
}

Expand Down
Binary file added skins/default/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions skins/default/settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# settings.yaml contains the setting definitions in a nice human-readable format
#

logo:
type: image
default: /images/logo.png
get_url: true # this automatically changes the default value into an absolute url
1 change: 1 addition & 0 deletions skins/default/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions skins/default/styles.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@import "../../lava/assets/less/mixins.less";

body {
background: #fefefe;
}

#logo{
background-repeat: no-repeat;
background-position: bottom center;
min-height: 100px;
max-height: 500px;

img {
margin-left: -1000px;
opacity: 0;
z-index: -1;
}
}

#login_form_cntr {
margin-left: auto;
margin-right: auto;
background: white;
border: 1px solid #BEBEBE;
width: 300px;
padding: 20px;

.box-shadow(0 1px 3px rgba(0, 0, 0, 0.2) );
.border-radius( 3px );
}
26 changes: 26 additions & 0 deletions skins/default/templates/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>{{ get_bloginfo( 'name' ) }} | Login</title>
{{ head() }}
{{ styles() }}
<style type="text/css">
#logo {
background-image:url({{ logo }});
}
</style>
{{ scripts() }}
</head>
<body class="" >
<div id="logo">
{# The logo is actually displayed using the background-image but this is used to make sure the height is correct #}
<img src="{{ logo }}" />
</div>
<div id="login_form_cntr">
<form id="login_form" method="post">
{{ widget( 'form' ) }}
</form>
</div>
</body>
</html>
3 changes: 3 additions & 0 deletions skins/spec.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file outlines the guidelines that all skins should follow to ensure compatibility with extensions.

The login form should have the id login_form
Empty file added skins/stacked/settings.yaml
Empty file.
11 changes: 11 additions & 0 deletions skins/stacked/templates/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ watermark }}
<meta charset="utf-8" />
<title>{{ environment.blog_name }} | Login</title>
<link rel="stylesheet" type="text/css" href="{{ environment.static_url }}/styles.css" />
</head>
<body class="{{ body_class }}" >
</body>
</html>
Binary file added skins/stacked/thumb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion vendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,27 @@
Add licensing to bar
*/
class Volcanic_Pixels_Private_Blog_Vendor extends Lava_Extension {
class Volcanic_Pixels_Private_Blog_Vendor extends Lava_Vendor {

public $apiVersion = 1;

function _construct() {
parent::_construct( dirname(__file__), 'vendor' );
}














function init() {
$this->registerLicensingSettings();
}
Expand Down

0 comments on commit 34cfea4

Please sign in to comment.