Bug fixes
This commit is contained in:
parent
903b3a5293
commit
e42c900c17
|
@ -32,7 +32,7 @@ if($_Plugin===false) {
|
|||
}
|
||||
|
||||
// Check if the plugin has the method form()
|
||||
if($_Plugin->form()===false) {
|
||||
if(!method_exists($_Plugin, 'form')) {
|
||||
Redirect::page('admin', 'plugins');
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
echo '<span class="version">'.$Language->g('Version').': '.$Plugin->version().'</span><span class="author">'.$Language->g('author').': <a targe="_blank" href="'.$Plugin->website().'">'.$Plugin->author().'</a></span>';
|
||||
|
||||
if($Plugin->installed()) {
|
||||
if($Plugin->form()) {
|
||||
if(method_exists($Plugin, 'form')) {
|
||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'configure-plugin/'.$Plugin->className().'" class="btn btn-smaller">'.$Language->g('Configure plugin').'</a>';
|
||||
}
|
||||
echo '<a href="'.HTML_PATH_ADMIN_ROOT.'uninstall-plugin/'.$Plugin->className().'" class="btn btn-red btn-smaller">'.$Language->g('Uninstall plugin').'</a>';
|
||||
|
|
|
@ -191,110 +191,4 @@ class Plugin {
|
|||
// The user can define your own dbFields.
|
||||
}
|
||||
|
||||
// HOOKS
|
||||
|
||||
|
||||
|
||||
// Before the posts load.
|
||||
public function beforePostsLoad()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// After the posts load.
|
||||
public function afterPostsLoad()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Before the pages load.
|
||||
public function beforePagesLoad()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// After the pages load.
|
||||
public function afterPagesLoad()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// SITE HOOKS
|
||||
|
||||
public function beforeSiteLoad() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function afterSiteLoad() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function siteHead() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function siteBodyBegin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function siteBodyEnd() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function siteSidebar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function postBegin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function postEnd() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function pageBegin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function pageEnd() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// LOGIN HOOKS
|
||||
|
||||
public function loginHead() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function loginBodyBegin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function loginBodyEnd() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ADMIN HOOKS
|
||||
|
||||
public function adminHead() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function adminBodyBegin() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function adminBodyEnd() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function adminSidebar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function form() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -88,11 +88,7 @@ function build_plugins()
|
|||
{
|
||||
foreach($pluginsEvents as $event=>$value)
|
||||
{
|
||||
/*
|
||||
if($Plugin->onSiteHead()!==false)
|
||||
array_push($plugins['onSiteHead'], $Plugin);
|
||||
*/
|
||||
if($Plugin->{$event}()!==false) {
|
||||
if(method_exists($Plugin, $event)) {
|
||||
array_push($plugins[$event], $Plugin);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,6 @@
|
|||
"you-can-modify-the-url-which-identifies":"You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.",
|
||||
"this-field-can-help-describe-the-content": "This field can help describe the content in a few words. No more than 150 characters.",
|
||||
"write-the-tags-separeted-by-comma": "Write the tags separeted by comma. eg: tag1, tag2, tag3",
|
||||
"delete": "Delete",
|
||||
"delete-the-user-and-all-its-posts":"Delete the user and all its posts",
|
||||
"delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user",
|
||||
"read-more": "Read more",
|
||||
|
|
|
@ -114,28 +114,27 @@
|
|||
"number-of-posts-to-show-per-page": "Number of posts to show per page.",
|
||||
"the-url-of-your-site": "The URL of your site.",
|
||||
"add-or-edit-description-tags-or": "Add or edit description, tags or modify the friendly URL.",
|
||||
"select-your-sites-language": "Select your site's language.",
|
||||
"select-your-sites-language": "Seleccione el lenguage de su sitio.",
|
||||
"select-a-timezone-for-a-correct": "Select a timezone for a correct date/time display on your site.",
|
||||
"you-can-use-this-field-to-define-a-set-of": "You can use this field to define a set of parameters related to the languege, country and special preferences.",
|
||||
"you-can-modify-the-url-which-identifies":"You can modify the URL which identifies a page or post using human-readable keywords. No more than 150 characters.",
|
||||
"this-field-can-help-describe-the-content": "This field can help describe the content in a few words. No more than 150 characters.",
|
||||
"write-the-tags-separeted-by-comma": "Write the tags separeted by comma. eg: tag1, tag2, tag3",
|
||||
"delete": "Delete",
|
||||
"delete-the-user-and-all-its-posts":"Delete the user and all its posts",
|
||||
"delete-the-user-and-associate-its-posts-to-admin-user": "Delete the user and associate its posts to admin user",
|
||||
"read-more": "Read more",
|
||||
"show-blog": "Show blog",
|
||||
"default-home-page": "Default home page",
|
||||
"read-more": "Leer mas",
|
||||
"show-blog": "Mostrar blog",
|
||||
"default-home-page": "Pagina de inicio predeterminada",
|
||||
"version": "Version",
|
||||
"there-are-no-drafts": "There are no drafts.",
|
||||
"there-are-no-drafts": "No hay borradores.",
|
||||
"create-a-new-article-for-your-blog":"Create a new article for your blog.",
|
||||
"create-a-new-page-for-your-website":"Create a new page for your website.",
|
||||
"invite-a-friend-to-collaborate-on-your-website":"Invite a friend to collaborate on your website.",
|
||||
"change-your-language-and-region-settings":"Change your language and region settings.",
|
||||
"language-and-timezone":"Language and timezone",
|
||||
"author": "Author",
|
||||
"start-here": "Start here",
|
||||
"install-theme": "Install theme",
|
||||
"language-and-timezone":"Lenguage y zona horaria",
|
||||
"author": "Autor",
|
||||
"start-here": "Comience aqui",
|
||||
"install-theme": "Instalar tema",
|
||||
"first-post": "Primer post",
|
||||
"congratulations-you-have-successfully-installed-your-bludit": "Congratulations you have successfully installed your **Bludit**",
|
||||
"whats-next": "Que sigue",
|
||||
|
@ -143,7 +142,7 @@
|
|||
"follow-bludit-on": "Siga Bludit en",
|
||||
"visit-the-support-forum": "Visite el [foro](http://forum.bludit.com) para soporte",
|
||||
"read-the-documentation-for-more-information": "Lea la [documentacion](http://docs.bludit.com) para mas informacion",
|
||||
"share-with-your-friends-and-enjoy": "Share with your friends and enjoy",
|
||||
"the-page-has-not-been-found": "The page has not been found.",
|
||||
"share-with-your-friends-and-enjoy": "Comparti con tus amigos y a disfrutar",
|
||||
"the-page-has-not-been-found": "La pagina no fue encontrada.",
|
||||
"error": "Error"
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "Maintenance mode",
|
||||
"description": "Set your site on maintenance mode, you can access to admin area.",
|
||||
"author": "Bludit",
|
||||
"email": "",
|
||||
"website": "http://www.bludit.com",
|
||||
"version": "0.1",
|
||||
"releaseDate": "2015-08-02"
|
||||
},
|
||||
|
||||
"enable-maintence-mode": "Enable maintence mode",
|
||||
"message": "Message"
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
class pluginMaintanceMode extends Plugin {
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->dbFields = array(
|
||||
'enable'=>true,
|
||||
'message'=>'Temporarily down for maintenance.'
|
||||
);
|
||||
}
|
||||
|
||||
public function form()
|
||||
{
|
||||
global $Language;
|
||||
|
||||
$html = '<div>';
|
||||
$html .= '<input name="enable" id="jsenable" type="checkbox" value="true" '.($this->getDbField('enable')?'checked':'').'>';
|
||||
$html .= '<label class="forCheckbox" for="jsenable">'.$Language->get('Enable maintence mode').'</label>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>'.$Language->get('Message').'</label>';
|
||||
$html .= '<input name="message" id="jsmessage" type="text" value="'.$this->getDbField('message').'">';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function beforeSiteLoad()
|
||||
{
|
||||
if($this->getDbField('enable')) {
|
||||
exit( $this->getDbField('message') );
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue