diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php
index a3c12080f..5ee78af57 100644
--- a/e107_admin/plugin.php
+++ b/e107_admin/plugin.php
@@ -28,7 +28,7 @@ define("ADMIN_GITSYNC_ICON", e107::getParser()->toGlyph('fa-refresh', array('siz
global $user_pref;
-
+/*
if(!deftrue('e_DEBUG_PLUGMANAGER'))
{
@@ -39,7 +39,7 @@ if(!deftrue('e_DEBUG_PLUGMANAGER'))
define("e_PAGETITLE",ADLAN_98." - ".$pman->pagetitle);
}
-
+*/
if(isset($_POST['uninstall_cancel']))
{
@@ -304,12 +304,15 @@ class plugin_ui extends e_admin_ui
}
- $text = "
";
+ $text = "";
@@ -359,7 +362,15 @@ class plugin_ui extends e_admin_ui
function buildPage()
{
$pc = new pluginBuilder;
- return false;
+ $ret = $pc->run();
+
+ if(is_array($ret))
+ {
+ $this->addTitle($ret['caption']);
+ return $ret['text'];
+ }
+
+ return $ret;
}
@@ -434,8 +445,7 @@ class plugin_ui extends e_admin_ui
function upgradePage()
{
-
-
+ $this->pluginUpgrade();
}
@@ -1498,7 +1508,7 @@ class plugin_form_online_ui extends e_admin_form_ui
-if(deftrue('e_DEBUG_PLUGMANAGER'))
+//if(deftrue('e_DEBUG_PLUGMANAGER'))
{
new plugman_adminArea();
require_once(e_ADMIN."auth.php");
@@ -1534,7 +1544,7 @@ if(deftrue('e_DEBUG_PLUGMANAGER'))
// --------------------------------------
-
+/*
class pluginmanager_form extends e_form
{
@@ -1635,27 +1645,19 @@ class pluginmanager_form extends e_form
}
-
-
+*/
+/*
require_once("auth.php");
$pman->pluginObserver();
$mes = e107::getMessage();
-$frm = e107::getForm();
-
-function e_help()
-{
- $help_text = str_replace('[x]', (PLUGIN_SCAN_INTERVAL ? PLUGIN_SCAN_INTERVAL / 60 : 0), EPL_ADLAN_228);
- return array(
- 'caption' => EPL_ADLAN_227,
- 'text' => $help_text."".EPL_ADLAN_229."
"
- );
-}
+$frm = e107::getForm();*/
require_once("footer.php");
exit;
// FIXME switch to admin UI
+/*
class pluginManager{
var $plugArray;
@@ -1666,10 +1668,7 @@ class pluginManager{
var $titlearray = array();
var $pagetitle;
- /**
- * Marketplace handler instance
- * @var e_marketplace
- */
+
var $mp;
protected $pid = 'plugin_id';
@@ -1725,26 +1724,11 @@ class pluginManager{
$keys = array_keys($this -> titlearray);
$this->pagetitle = (in_array($this->action,$keys)) ? $this -> titlearray[$this->action] : $this -> titlearray['installed'];
-/* if(isset($_POST['uninstall-selected']))
- {
- foreach($_POST['checkboxes'] as $val)
- {
- $this -> id = intval($val);
- $this -> pluginUninstall();
- }
- $this -> action = "installed";
- $this -> pluginRenderList();
- return;
- // Complicated, as each uninstall system is different.
- }*/
}
- /**
- * Temporary, e107::getMarketplace() coming soon
- * @return e_marketplace
- */
+
public function getMarketplace()
{
if(null === $this->mp)
@@ -1954,20 +1938,7 @@ class pluginManager{
$total = $xdata['params']['count'];
// OLD BIT OF CODE ------------------------------->
- /*
- // $file = SITEURLBASE.e_PLUGIN_ABS."release/release.php"; // temporary testing
- $file = "http://e107.org/feed?type=plugin&frm=".$from."&srch=".$srch."&limit=10";
-
- $xml->setOptArrayTags('plugin'); // make sure 'plugin' tag always returns an array
- $xdata = $xml->loadXMLfile($file,'advanced');
- $total = $xdata['@attributes']['total'];
-
- echo 'file='.$file;
- // print_a($xdata);
-
- $xdata['data'] = $xdata['plugin'];
- */
// OLD BIT OF CODE END ------------------------------->
@@ -2091,14 +2062,7 @@ class pluginManager{
{
// print_a($data);
-
- /*
- if(!e107::getFile()->hasAuthKey())
- {
- // return "Download and Install";
-
- }
- */
+
//$url = e_SELF."?src=".base64_encode($d);
@@ -2120,22 +2084,13 @@ class pluginManager{
$url = e_SELF.'?mode=download&src='.base64_encode($d);
$dicon = ''.ADMIN_INSTALLPLUGIN_ICON.'';
- /*
- // DEBUGGER .
- $base64 = base64_encode($d);
- $tmp = base64_decode($base64);
- parse_str($tmp, $data);
- // XXX Suhosin has a 512 char limit for $_GET strings.
- e107::getDebug()->log($data['plugin_name'].' : '.strlen($base64)."
".print_a($data,true)); //FIXME - enable when needed to debug.
- */
-
- // Temporary Pop-up version.
+ // Temporary Pop-up version.
// $dicon = '
';
-
+
// $dicon = "
";
-
+
return "
{$dicon}
";
@@ -2277,99 +2232,7 @@ class pluginManager{
return true;
- // ----------------- Everything below is unused.
- /*
- extract($_FILES);
- if(!is_writable(e_PLUGIN))
- {
- // still not writable - spawn error message
- e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_39);
- }
- else
- {
- // e_PLUGIN is writable
- require_once(e_HANDLER."upload_handler.php");
- $fileName = $file_userfile['name'][0];
- $fileSize = $file_userfile['size'][0];
- $fileType = $file_userfile['type'][0];
-
- if(strstr($file_userfile['type'][0], "gzip"))
- {
- $fileType = "tar";
- }
- else if (strstr($file_userfile['type'][0], "zip"))
- {
- $fileType = "zip";
- }
- else
- {
- // not zip or tar - spawn error message
- e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_41);
- return false;
- }
-
- if ($fileSize)
- {
- $uploaded = file_upload(e_PLUGIN);
- $archiveName = $uploaded[0]['name'];
-
- // attempt to unarchive
-
- if($fileType == "zip")
- {
- require_once(e_HANDLER."pclzip.lib.php");
- $archive = new PclZip(e_PLUGIN.$archiveName);
- $unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_PLUGIN, PCLZIP_OPT_SET_CHMOD, 0666));
- }
- else
- {
- require_once(e_HANDLER."pcltar.lib.php");
- $unarc = ($fileList = PclTarExtract($archiveName, e_PLUGIN));
- }
-
- if(!$unarc)
- {
- // unarc failed ...
- if($fileType == "zip")
- {
- $error = EPL_ADLAN_46." '".$archive -> errorName(TRUE)."'";
- }
- else
- {
- $error = EPL_ADLAN_47.PclErrorString().", ".EPL_ADLAN_48.intval(PclErrorCode());
- }
- e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_42." ".$archiveName." ".$error);
- require_once("footer.php");
- exit;
- }
-
- // ok it looks like the unarc succeeded - continue
-
- // get folder name ...
-
- $folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/")));
-
- if(file_exists(e_PLUGIN.$folderName."/plugin.php") || file_exists(e_PLUGIN.$folderName."/plugin.xml"))
- {
-
- e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_43);
- }
- elseif(file_exists(e_PLUGIN.$folderName."/theme.php") || file_exists(e_PLUGIN.$folderName."/theme.xml"))
- {
-
- e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_45);
- }
- else
- {
- // upload is unlocatable
- e107::getRender()->tablerender(EPL_ADLAN_40, EPL_ADLAN_98.' '.$fileList[0]['stored_filename']);
- }
-
- // attempt to delete uploaded archive
- @unlink(e_PLUGIN.$archiveName);
- }
- }*/
}
@@ -2567,7 +2430,6 @@ class pluginManager{
//TODO 'install' checkbox in plugin upload form. (as it is for theme upload)
- /* plugin upload form */
if(!is_writable(e_PLUGIN))
{
@@ -2804,16 +2666,7 @@ class pluginManager{
$pgf->plug = $plug;
$text .= $pgf->renderTableRow($this->fields, $this->fieldpref, $data, 'plugin_id');
-/*
- $folder = $plug['plugin_path'];
- if(!empty($versions[$folder]['version']) && version_compare( $plug['plugin_version'], $versions[$folder]['version'], '<'))
- {
- $link = "".$versions[$folder]['name']."";
- $lan = "A newer version of [x] is available for download.";
- e107::getMessage()->addInfo($tp->lanVars($lan,$link));
- e107::getMessage()->addDebug("Local version: ".$plug['plugin_version']." Remote version: ".$versions[$folder]['version']);
- }*/
}
}
@@ -3011,17 +2864,14 @@ class pluginManager{
$text .= $frm->admin_button('uninstall_confirm',EPL_ADLAN_3,'submit');
$text .= $frm->admin_button('uninstall_cancel',EPL_ADLAN_62,'cancel');
- /*
- $text .= "
- ";
- */
+
// $frm->admin_button($name, $value, $action = 'submit', $label = '', $options = array());
$text .= "
";
- e107::getRender()->tablerender(EPL_ADLAN_63.SEP.$tp->toHtml($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"),$mes->render(). $text);
+ // e107::getRender()->tablerender(EPL_ADLAN_63.SEP.$tp->toHtml($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"),$mes->render(). $text);
}
@@ -3080,14 +2930,14 @@ class pluginManager{
} // end of Class.
+*/
-
-
+/*
function plugin_adminmenu()
{
global $pman;
$pman -> pluginMenuOptions();
-}
+}*/
@@ -3570,27 +3420,31 @@ class pluginBuilder
$this->special['checkboxes'] = array('title'=> '','type' => null, 'data' => null, 'width'=>'5%', 'thclass' =>'center', 'forced'=> TRUE, 'class'=>'center', 'toggle' => 'e-multiselect', 'fieldpref'=>true);
$this->special['options'] = array( 'title'=> 'LAN_OPTIONS', 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced'=>TRUE, 'fieldpref'=>true);
+
+ }
+
+
+ function run()
+ {
+
if(!empty($_GET['newplugin']))
{
$this->pluginName = e107::getParser()->filter($_GET['newplugin'],'file');
}
-
+
if(!empty($_GET['createFiles']))
{
- $this->createFiles = true;
+ $this->createFiles = true;
}
if(vartrue($_POST['step']) == 4)
{
- $this->step4();
- return null;
+ return $this->step4();
}
if(vartrue($_GET['step']) == 3)
{
-
- $this->step3();
- return null;
+ return $this->step3();
}
@@ -3604,6 +3458,8 @@ class pluginBuilder
return $this->step1();
+
+
}
@@ -3676,9 +3532,9 @@ class pluginBuilder
$text .= $frm->close();
+ return $text;
-
- $ns->tablerender(ADLAN_98.SEP.EPL_ADLAN_114, $mes->render() . $text);
+ // $ns->tablerender(ADLAN_98.SEP.EPL_ADLAN_114, $mes->render() . $text);
@@ -3728,8 +3584,9 @@ class pluginBuilder
function step3()
{
- require_once(e_HANDLER."db_verify_class.php");
- $dv = new db_verify;
+ // require_once(e_HANDLER."db_verify_class.php");
+ // $dv = new db_verify;
+ $dv = e107::getSingleton('db_verify', e_HANDLER."db_verify_class.php");
$frm = e107::getForm();
$ns = e107::getRender();
@@ -3760,7 +3617,7 @@ class pluginBuilder
// $this->buildTable = true;
}
- $text = $frm->open('newplugin-step3','post', e_SELF.'?mode=create&newplugin='.$newplug.'&createFiles='.$this->createFiles.'&step=3');
+ $text = $frm->open('newplugin-step3','post', e_SELF.'?mode=create&action=build&newplugin='.$newplug.'&createFiles='.$this->createFiles.'&step=3');
$text .= "\n";
$text .= "- ".EPL_ADLAN_109."
";
@@ -3834,8 +3691,8 @@ class pluginBuilder
$mes->addInfo(EPL_ADLAN_113);
-
- $ns->tablerender(ADLAN_98.SEP.EPL_ADLAN_114.SEP.EPL_ADLAN_115, $mes->render() . $text);
+ return array('caption'=>EPL_ADLAN_115, 'text'=> $text);
+ // $ns->tablerender(ADLAN_98.SEP.EPL_ADLAN_114.SEP., $mes->render() . $text);
}
@@ -3904,7 +3761,8 @@ class pluginBuilder
');*/
$ns = e107::getRender();
- $ns->tablerender(ADLAN_98.SEP.EPL_ADLAN_114.SEP.EPL_ADLAN_115, $text);
+ return array('caption'=>EPL_ADLAN_115, 'text'=>$text);
+ // $ns->tablerender(ADLAN_98.SEP.EPL_ADLAN_114.SEP.EPL_ADLAN_115, $text);
return $text;
@@ -5358,21 +5216,28 @@ exit;
}
else
{
- $mes->addInfo(EPL_ADLAN_219);
+ $mes->addSuccess(EPL_ADLAN_219);
}
- echo $mes->render();
+ // echo $mes->render();
+
+ $ret = "plugin.xml
";
+ $ret .= "
".$xmlText."
";
+ $ret .= "admin_config.php
";
+ $ret .= "".$text."
";
+
+ return array('caption'=>EPL_ADLAN_253, 'text'=> $ret);
- $ns->tablerender(ADLAN_98.SEP.EPL_ADLAN_114.SEP." plugin.xml", "".$xmlText."
");
+ // $text =$ns->tablerender(ADLAN_98.SEP.EPL_ADLAN_114.SEP." plugin.xml", "".$xmlText."
", 'default', true);
- $ns->tablerender("admin_config.php", "".$text."
");
+ $text .= $ns->tablerender("admin_config.php", "".$text."
");
//
return;
diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php
index f686cda08..aacc6a74b 100644
--- a/e107_handlers/admin_ui.php
+++ b/e107_handlers/admin_ui.php
@@ -5098,6 +5098,11 @@ class e_admin_ui extends e_admin_controller_ui
*/
public function ListObserver()
{
+ $table = $this->getTableName();
+ if(empty($table))
+ {
+ return;
+ }
$this->getTreeModel()->setParam('db_query', $this->_modifyListQry(false, false, false, false, $this->listQry))->load();
$this->addTitle();
}
diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php
index 1b90ca40b..5e7407d28 100644
--- a/e107_handlers/theme_handler.php
+++ b/e107_handlers/theme_handler.php
@@ -2418,10 +2418,6 @@ class themeHandler
case 2: // admin
- if(e_DEVELOPER !== true || e_DEBUG !== true)
- {
- return array();
- }
if($vl['name'] == "style.css" || empty($vl['info'])) // Hide the admin css unless it has a header. eg. /* info: Default stylesheet */
{
diff --git a/e107_languages/English/admin/lan_plugin.php b/e107_languages/English/admin/lan_plugin.php
index 00b084eec..454320fb7 100644
--- a/e107_languages/English/admin/lan_plugin.php
+++ b/e107_languages/English/admin/lan_plugin.php
@@ -292,7 +292,9 @@ define ("EPL_ADLAN_246","Deleting All Media Categories owned by : [x]");
define ("EPL_ADLAN_249","Adding Extended Field: ");
define ("EPL_ADLAN_250","Removing Extended Field: ");
define ("EPL_ADLAN_251","Extended Field left in place: ");
-define ("EPL_ADLAN_252","Perm: ");
+define ("EPL_ADLAN_252","Perm: ");
+
+define("EPL_ADLAN_253", "Completed");
define ("LAN_RELEASED", "Released");
define ("LAN_REPAIR_PLUGIN_SETTINGS", "Repair plugin settings");
@@ -305,4 +307,6 @@ define("LAN_INSTALL_FAIL", "Installation failed!");
define("LAN_UNINSTALL_FAIL", "Unable to uninstall!");
define("LAN_PLUGIN_IS_USED", "[x] plugin is used by:");
+
+
?>