mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Plugin Builder: Added _menu and simple frontend file to addons list.
This commit is contained in:
@@ -2602,13 +2602,13 @@ class pluginBuilder
|
|||||||
|
|
||||||
foreach($list as $addon)
|
foreach($list as $addon)
|
||||||
{
|
{
|
||||||
|
$addonDest = str_replace("_blank",$this->pluginName,$addon);
|
||||||
$source = e_PLUGIN."_blank/".$addon.".php";
|
$source = e_PLUGIN."_blank/".$addon.".php";
|
||||||
$destination = e_PLUGIN.$this->pluginName. "/".$addon.".php";
|
$destination = e_PLUGIN.$this->pluginName. "/".$addonDest.".php";
|
||||||
|
|
||||||
if(file_exists($destination))
|
if(file_exists($destination))
|
||||||
{
|
{
|
||||||
$result[] = "Skipped (already exists) : ".$addon;
|
$result[] = "Skipped (already exists) : ".$addonDest;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2620,12 +2620,12 @@ class pluginBuilder
|
|||||||
{
|
{
|
||||||
if(file_put_contents($destination,$content))
|
if(file_put_contents($destination,$content))
|
||||||
{
|
{
|
||||||
$result[] = LAN_CREATED." : ".$addon;
|
$result[] = LAN_CREATED." : ".$addonDest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$result[] = "Skipped (already exists) : ".$addon;
|
$result[] = "Skipped (already exists) : ".$addonDest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2649,12 +2649,24 @@ class pluginBuilder
|
|||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
$text = "<table class='table table-striped adminlist' >";
|
$text = "<table class='table table-striped adminlist' >";
|
||||||
|
|
||||||
$setupDiz = "Create default table data during install, upgrade, uninstall etc";
|
|
||||||
|
|
||||||
array_unshift($list,$this->pluginName.'_setup');
|
//Todo LANS
|
||||||
|
$dizOther = array(
|
||||||
|
'_blank' => "Simple frontend script",
|
||||||
|
'_blank_setup' => "Create default table data during install, upgrade, uninstall etc",
|
||||||
|
'_blank_menu' => "Menu item for use in the menu manager."
|
||||||
|
);
|
||||||
|
|
||||||
|
array_unshift($list,'_blank', '_blank_setup', '_blank_menu');
|
||||||
|
|
||||||
$templateFiles = scandir(e_PLUGIN."_blank");
|
$templateFiles = scandir(e_PLUGIN."_blank");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//print_a($list);
|
||||||
|
// $list[] = "_blank";
|
||||||
|
// $list[] = "_blank_setup";
|
||||||
|
|
||||||
foreach($list as $v)
|
foreach($list as $v)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2663,12 +2675,13 @@ class pluginBuilder
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$diz = !empty($dizOther[$v]) ? $dizOther[$v] : $plg->getAddonsDiz($v);
|
||||||
$diz = ($v == $this->pluginName.'_setup') ? $setupDiz : $plg->getAddonsDiz($v);
|
$label = str_replace("_blank", $this->pluginName, $v);
|
||||||
|
$id = str_replace('_blank', 'blank', $v);
|
||||||
|
|
||||||
$text .= "<tr>";
|
$text .= "<tr>";
|
||||||
$text .= "<td>".$frm->checkbox('addons[]',$v,false, $v)."</td>";
|
$text .= "<td>".$frm->checkbox('addons[]',$v,false,$label)."</td>";
|
||||||
$text .= "<td><label for='".$frm->name2id('addons-'.$v)."'>".$diz."</label></td>";
|
$text .= "<td><label for='".$frm->name2id('addons-'.$id)."'>".$diz."</label></td>";
|
||||||
$text .= "</tr>";
|
$text .= "</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2915,7 +2928,7 @@ class pluginBuilder
|
|||||||
$required = true;
|
$required = true;
|
||||||
$size = 130;
|
$size = 130;
|
||||||
$placeholder= " ";
|
$placeholder= " ";
|
||||||
$pattern = "[A-Za-z \.0-9]*";
|
$pattern = "[A-Za-z -\.0-9]*";
|
||||||
$xsize = 'block-level';
|
$xsize = 'block-level';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2940,7 +2953,7 @@ class pluginBuilder
|
|||||||
$required = true;
|
$required = true;
|
||||||
$size = 100;
|
$size = 100;
|
||||||
$placeholder = " ";
|
$placeholder = " ";
|
||||||
$pattern = "[A-Za-z \.0-9]*";
|
$pattern = "[A-Za-z -\.0-9]*";
|
||||||
$xsize = 'block-level';
|
$xsize = 'block-level';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -9,26 +9,38 @@
|
|||||||
* e107 Blank Plugin
|
* e107 Blank Plugin
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
require_once("../../class2.php");
|
if (!defined('e107_INIT'))
|
||||||
|
|
||||||
|
|
||||||
e107::js('_blank','js/my.js','jquery'); // Load Plugin javascript and include jQuery framework
|
|
||||||
e107::css('_blank','css/my.css'); // load css file
|
|
||||||
e107::lan('_blank'); // load language file ie. e107_plugins/_blank/languages/English.php
|
|
||||||
e107::meta('keywords','some words'); // add meta data to <HEAD>
|
|
||||||
|
|
||||||
require_once(HEADERF); // render the header (everything before the main content area)
|
|
||||||
|
|
||||||
|
|
||||||
$sql = e107::getDB(); // mysql class object
|
|
||||||
$tp = e107::getParser(); // parser for converting to HTML and parsing templates etc.
|
|
||||||
$frm = e107::getForm(); // Form element class.
|
|
||||||
$ns = e107::getRender(); // render in theme box.
|
|
||||||
|
|
||||||
$text = "";
|
|
||||||
|
|
||||||
if($rows = $sql->retrieve('blank','*',false,'',true)) // combined select and fetch function - returns an array.
|
|
||||||
{
|
{
|
||||||
|
require_once("../../class2.php");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class _blank_front
|
||||||
|
{
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
e107::js('_blank','js/my.js','jquery'); // Load Plugin javascript and include jQuery framework
|
||||||
|
e107::css('_blank','css/my.css'); // load css file
|
||||||
|
e107::lan('_blank'); // load language file ie. e107_plugins/_blank/languages/English.php
|
||||||
|
e107::meta('keywords','some words'); // add meta data to <HEAD>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql = e107::getDB(); // mysql class object
|
||||||
|
$tp = e107::getParser(); // parser for converting to HTML and parsing templates etc.
|
||||||
|
$frm = e107::getForm(); // Form element class.
|
||||||
|
$ns = e107::getRender(); // render in theme box.
|
||||||
|
|
||||||
|
$text = '';
|
||||||
|
|
||||||
|
if($rows = $sql->retrieve('blank','*',false,'',true)) // combined select and fetch function - returns an array.
|
||||||
|
{
|
||||||
// print_a($rows);
|
// print_a($rows);
|
||||||
foreach($rows as $key=>$value) // loop throug
|
foreach($rows as $key=>$value) // loop throug
|
||||||
{
|
{
|
||||||
@@ -37,8 +49,23 @@ if($rows = $sql->retrieve('blank','*',false,'',true)) // combined select and fe
|
|||||||
|
|
||||||
$ns->tablerender("My Caption", $text);
|
$ns->tablerender("My Caption", $text);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$_blankFront = new _blank_front;
|
||||||
|
require_once(HEADERF); // render the header (everything before the main content area)
|
||||||
|
$_blankFront->run();
|
||||||
require_once(FOOTERF); // render the footer (everything after the main content area)
|
require_once(FOOTERF); // render the footer (everything after the main content area)
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
35
e107_plugins/_blank/_blank_menu.php
Normal file
35
e107_plugins/_blank/_blank_menu.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* e107 website system
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008-2016 e107 Inc (e107.org)
|
||||||
|
* Released under the terms and conditions of the
|
||||||
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
*
|
||||||
|
* _blank menu file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
// $sql = e107::getDB(); // mysql class object
|
||||||
|
// $tp = e107::getParser(); // parser for converting to HTML and parsing templates etc.
|
||||||
|
// $frm = e107::getForm(); // Form element class.
|
||||||
|
// $ns = e107::getRender(); // render in theme box.
|
||||||
|
|
||||||
|
$text = "Empty Menu";
|
||||||
|
|
||||||
|
if(!empty($parm))
|
||||||
|
{
|
||||||
|
$text .= print_a($parm,true); // e_menu.php form data.
|
||||||
|
}
|
||||||
|
|
||||||
|
e107::getRender()->tablerender("_blank", $text);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
Reference in New Issue
Block a user