New features

This commit is contained in:
Diego Najar 2015-06-12 01:00:04 -03:00
parent 1e327e31b5
commit b2afd691d8
9 changed files with 81 additions and 27 deletions

View File

@ -17,11 +17,12 @@ if($Login->role()!=='admin') {
// POST Method // POST Method
// ============================================================================ // ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
setSettings($_POST);
}
// ============================================================================ // ============================================================================
// Main // Main
// ============================================================================ // ============================================================================
$pluginClassName = $layout['parameters'];
$Plugin = new $pluginClassName;
$Plugin->install();
Redirect::page('admin', 'plugins');

View File

@ -0,0 +1,28 @@
<?php defined('BLUDIT') or die('Bludit CMS.');
// ============================================================================
// Check role
// ============================================================================
if($Login->role()!=='admin') {
Alert::set('You do not have sufficient permissions to access this page, contact the administrator.');
Redirect::page('admin', 'dashboard');
}
// ============================================================================
// Functions
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main
// ============================================================================
$pluginClassName = $layout['parameters'];
$Plugin = new $pluginClassName;
$Plugin->uninstall();
Redirect::page('admin', 'plugins');

View File

@ -71,7 +71,6 @@ a:hover {
/* ----------- CONTENT ----------- */ /* ----------- CONTENT ----------- */
#content { #content {
overflow: auto;
margin: 20px; margin: 20px;
} }
@ -98,6 +97,20 @@ p.advOptions {
font-size: 0.8em; font-size: 0.8em;
} }
/* ----------- PLUGINS ----------- */
div.pluginBox {
background: rgba(234, 234, 234, 0.18) none repeat scroll 0 0;
border-radius: 2px;
padding: 10px;
width: 70%;
box-shadow: 0 2px 5px 0 rgba(183, 183, 183, 0.26);
margin-bottom: 20px;
}
div.pluginBox p {
margin-bottom: 10px;
}
/* ----------- SUB-NAVBAR ----------- */ /* ----------- SUB-NAVBAR ----------- */
.sublinks a { .sublinks a {
color: #2672ec; color: #2672ec;

View File

@ -1,9 +1,20 @@
<h2 class="title"><i class="fa fa-rocket"></i> Plugins</h2> <h2 class="title"><i class="fa fa-rocket"></i> Plugins</h2>
<p>Not implemented...</p>
<?php <?php
foreach($plugins['all'] as $Plugin) foreach($plugins['all'] as $Plugin)
{ {
echo '<div class="pluginBox">';
echo '<p>'.$Plugin->title().'</p>'; echo '<p>'.$Plugin->title().'</p>';
echo '<p>'.$Plugin->description().'</p>';
if($Plugin->installed()) {
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'" class="btn btn-blue btn-small">Uninstall plugin</a>';
}
else {
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'install-plugin/'.$Plugin->className().'" class="btn btn-blue btn-small">Install plugin</a>';
}
echo '</div>';
} }
?> ?>

View File

@ -44,10 +44,27 @@ class Plugin {
public function title() public function title()
{ {
//var_dump($this->db); if(isset($this->db['title'])) {
return $this->db['title']; return $this->db['title'];
} }
return '';
}
public function description()
{
if(isset($this->db['description'])) {
return $this->db['description'];
}
return '';
}
public function className()
{
return $this->className;
}
// Return TRUE if the installation success, otherwise FALSE. // Return TRUE if the installation success, otherwise FALSE.
public function install() public function install()
{ {

View File

@ -110,6 +110,7 @@ else
} }
else else
{ {
// Build post for the site, without the drafts posts
build_posts_per_page($Url->pageNumber(), $Site->postsPerPage(), false); build_posts_per_page($Url->pageNumber(), $Site->postsPerPage(), false);
} }
} }

View File

@ -1,16 +0,0 @@
<?php
class pluginAbout extends Plugin {
public function init()
{
$this->dbFields = array(
'title'=>'',
'description'=>''
);
}
}
?>

View File

@ -6,7 +6,7 @@ class pluginOpenGraph extends Plugin {
{ {
$this->dbFields = array( $this->dbFields = array(
'title'=>'Open Graph', 'title'=>'Open Graph',
'description'=>'' 'description'=>'The Open Graph protocol enables any web page to become a rich object in a social graph.'
); );
} }

View File

@ -55,7 +55,6 @@ pre, code {
code { code {
font-size: 13px !important; font-size: 13px !important;
padding: 5px !important;
} }
#layout { #layout {