diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php
index 5b73e0d94..7c0295725 100644
--- a/e107_admin/plugin.php
+++ b/e107_admin/plugin.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $
-| $Revision: 1.50 $
-| $Date: 2009-10-23 14:16:08 $
+| $Revision: 1.51 $
+| $Date: 2009-10-30 09:13:31 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -211,16 +211,11 @@ class pluginManager{
{
$eplug_folder = $plug['plugin_path'];
$_path = e_PLUGIN.$plug['plugin_path'].'/';
- $eplug_folder = $plug['plugin_path'];
+
if(file_exists($_path.'plugin.xml'))
- {
- $options = array(
- 'del_tables' => varset($_POST['delete_tables'],FALSE),
- 'del_userclasses' => varset($_POST['delete_userclasses'],FALSE),
- 'del_extended' => varset($_POST['delete_xfields'],FALSE),
- 'del_ipool' => varset($_POST['delete_ipool'],FALSE)
- );
- $text .= $plugin->install_plugin_xml($this->id, 'uninstall', $options);
+ {
+ unset($_POST['uninstall_confirm']);
+ $text .= $plugin->install_plugin_xml($this->id, 'uninstall', $_POST); //$_POST must be used.
}
else
{ // Deprecated - plugin uses plugin.php
@@ -959,45 +954,87 @@ class pluginManager{
".EPL_ADLAN_55." |
".LAN_YES." |
-
-
- ".EPL_ADLAN_57." |
- ".$frm->selectbox('delete_tables','yesno',1)."
- ".EPL_ADLAN_58."
- |
";
+
+ $opts = array();
+
+ $opts['delete_tables'] = array(
+ 'label' => EPL_ADLAN_57,
+ 'helpText' => EPL_ADLAN_58,
+ 'itemList' => array(1=>LAN_YES,0=>LAN_NO),
+ 'itemDefault' => 1
+ );
if ($userclasses)
- {
- $text .= "
- ".EPL_ADLAN_78." ".$userclasses." |
- ".$frm->selectbox('delete_userclasses','yesno',1)."
- ".EPL_ADLAN_79."
- |
-
";
+ {
+ $opts['delete_userclasses'] = array(
+ 'label' => EPL_ADLAN_78,
+ 'preview' => $userclasses,
+ 'helpText' => EPL_ADLAN_79,
+ 'itemList' => array(1=>LAN_YES,0=>LAN_NO),
+ 'itemDefault' => 1
+ );
}
if ($eufields)
{
- $text .= "
-
- ".EPL_ADLAN_80." ".$eufields."
- |
- ".$frm->selectbox('delete_xfields','yesno',0)."
- ".EPL_ADLAN_79." |
-
";
+ $opts['delete_xfields'] = array(
+ 'label' => EPL_ADLAN_80,
+ 'preview' => $eufields,
+ 'helpText' => EPL_ADLAN_79,
+ 'itemList' => array(1=>LAN_YES,0=>LAN_NO),
+ 'itemDefault' => 0
+ );
}
-
- if(e107::getConfig('ipool')->getPref('plugin-'.$plug['plugin_path']))
+
+ if(count($icons = e107::getConfig('ipool')->getPref('plugin-'.$plug['plugin_path']))>1)
{
- $text .= "
- Remove icons from icon-pool ".$eufields."
- |
- ".$frm->selectbox('delete_ipool','yesno',1)."
- ".EPL_ADLAN_79." |
-
";
+ foreach($icons as $key=>$val)
+ {
+ $iconText .= "
";
+ }
+
+ $opts['delete_ipool'] = array(
+ 'label' =>'Remove icons from icon-pool',
+ 'preview' => $iconText,
+ 'helpText' => EPL_ADLAN_79,
+ 'itemList' => array(1=>LAN_YES,0=>LAN_NO),
+ 'itemDefault' => 1
+ );
+ }
+
+ if(is_readable(e_PLUGIN.$plug['plugin_path']."/".$plug['plugin_path']."_setup.php"))
+ {
+ include_once(e_PLUGIN.$plug['plugin_path']."/".$plug['plugin_path']."_setup.php");
+
+ $mes = e107::getMessage();
+ $mes->add("Loading ".e_PLUGIN.$plug['plugin_path']."/".$plug['plugin_path']."_setup.php", E_MESSAGE_DEBUG);
+
+ $class_name = $plug['plugin_path']."_setup";
+
+ if(class_exists($class_name))
+ {
+ $obj = new $class_name;
+ if(method_exists($obj,'uninstall_options'))
+ {
+ $arr = call_user_func(array($obj,'uninstall_options'), $this);
+ foreach($arr as $key=>$val)
+ {
+ $newkey = $plug['plugin_path']."_".$key;
+ $opts[$newkey] = $val;
+ }
+ }
+ }
}
+ foreach($opts as $key=>$val)
+ {
+ $text .= "\n".$tp->toHTML($val['label'],FALSE,'TITLE');
+ $text .= varset($val['preview']) ? " ".$val['preview']." " : "";
+ $text .= " | \n".$frm->selectbox($key,$val['itemList'],$val['itemDefault']);
+ $text .= varset($val['helpText']) ? " ".$val['helpText']." " : "";
+ $text .= " | \n
\n";
+ }
$text .="
@@ -1018,7 +1055,7 @@ class pluginManager{
";
- e107::getRender()->tablerender(EPL_ADLAN_63." ".$tp->toHtml($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"), $text);
+ e107::getRender()->tablerender(EPL_ADLAN_63." ".$tp->toHtml($plug_vars['@attributes']['name'], "", "defs,emotes_off, no_make_clickable"),$mes->render(). $text);
}
diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php
index f95ecd934..fc79bb278 100644
--- a/e107_handlers/e_parse_class.php
+++ b/e107_handlers/e_parse_class.php
@@ -9,8 +9,8 @@
* Text processing and parsing functions
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/e_parse_class.php,v $
-* $Revision: 1.68 $
-* $Date: 2009-10-26 10:55:39 $
+* $Revision: 1.69 $
+* $Date: 2009-10-30 09:13:31 $
* $Author: e107coders $
*
*/
@@ -723,7 +723,15 @@ class e_parse
-
+ /**
+ *
+ * @param string $text
+ * @param boolean $parseBB [optional]
+ * @param string $modifiers [optional] TITLE|SUMMARY|DESCRIPTION|BODY|RAW|LINKTEXT etc.
+ * @param mixed $postID [optional]
+ * @param boolean $wrap [optional]
+ * @return
+ */
function toHTML($text, $parseBB = FALSE, $modifiers = "", $postID = "", $wrap=FALSE)
{
if ($text == '') return $text;
diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php
index 2609a682e..79eee34d7 100644
--- a/e107_handlers/plugin_class.php
+++ b/e107_handlers/plugin_class.php
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
-| $Revision: 1.108 $
-| $Date: 2009-10-29 13:55:08 $
-| $Author: marj_nl_fr $
+| $Revision: 1.109 $
+| $Date: 2009-10-30 09:13:31 $
+| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -309,7 +309,7 @@ class e107plugin
if($plugin && ($function == 'uninstall') )
{
- if(vartrue($this->unInstallOpts['del_ipool'], FALSE))
+ if(vartrue($this->unInstallOpts['delete_ipool'], FALSE))
{
$ipool_entry = 'plugin-'.$plugin;
e107::getConfig('ipool')->remove($ipool_entry); // FIXME - ipool removal issue.
@@ -871,25 +871,23 @@ class e107plugin
$txt .='
';
return $txt;
}
-
-
- //----------------------------------------------------------
- // Install routine for XML file
- //----------------------------------------------------------
- // $id - the number of the plugin in the DB
- // Values for $function:
- // 'install'
- // 'upgrade'
- // 'uninstall'
- // 'refresh' - adds things that are missing, but doesn't change any existing settings
- // $options is an array of possible options - ATM used only for uninstall:
- // 'del_userclasses' - to delete userclasses created
- // 'del_tables' - to delete DB tables
- // 'del_extended' - to delete extended fields
+
+ /**
+ * Install routine for XML file
+ * @param object $id (the number of the plugin in the DB)
+ * @param object $function install|upgrade|uninstall|refresh (adds things that are missing, but doesn't change any existing settings)
+ * @param object $options [optional] an array of possible options - ATM used only for uninstall:
+ * 'delete_userclasses' - to delete userclasses created
+ * 'delete_tables' - to delete DB tables
+ * 'delete_xfields' - to delete extended fields
+ * 'delete_ipool' - to delete icon pool entry
+ * + any defined in _setup.php in the uninstall_options() method.
+ * @return
+ */
function install_plugin_xml($id, $function='', $options = FALSE)
{
global $pref;
-
+
$sql = e107::getDb();
$mes = eMessage::getInstance();
@@ -998,7 +996,7 @@ class e107plugin
case 'refresh' : // Leave things alone
break;
case 'uninstall' :
- if (varsettrue($options['del_tables'], FALSE))
+ if (vartrue($options['delete_tables'], FALSE))
{
$txt = "Removing table {$ct[1]}
";
$status = $this->manage_tables('remove', array($ct[1])) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; // Delete the table
@@ -1348,7 +1346,7 @@ class e107plugin
case 'uninstall': //If uninstalling, remove all userclasses (active or inactive)
- if (varsettrue($this->unInstallOpts['del_userclasses'], FALSE))
+ if (varsettrue($this->unInstallOpts['delete_userclasses'], FALSE))
{
$status = $this->manage_userclass('remove', $name, $description) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$mes->add('Removing Userclass: '.$name, $status);
@@ -1404,7 +1402,7 @@ class e107plugin
case 'uninstall': //If uninstalling, remove all extended fields (active or inactive)
- if (varsettrue($this->unInstallOpts['del_extended'], FALSE))
+ if (varsettrue($this->unInstallOpts['delete_xfields'], FALSE))
{
$status = ($this->manage_extended_field('remove', $name, $source)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$mes->add('Removing Extended Field: '.$name.' ... ', $status);
@@ -1514,7 +1512,7 @@ class e107plugin
else
{
$setup_file = e_PLUGIN.$this->plugFolder.'/'.$this->plugFolder.'_setup.php';
- }
+ }
if(is_readable($setup_file))
{
@@ -1854,7 +1852,7 @@ class e107plugin
echo $plugin_path."/".$addon.".php - ".$passfail."
";
}
$mes = e107::getMessage();
- $mes->add('Detected addon: '.$addon.'', E_MESSAGE_DEBUG);
+ // $mes->add('Detected addon: '.$addon.'', E_MESSAGE_DEBUG);
$p_addons[] = $addon;
}
diff --git a/e107_plugins/tinymce/plugins/e107bbcode/editor_plugin.js b/e107_plugins/tinymce/plugins/e107bbcode/editor_plugin.js
index 0787a1d8a..000090baa 100644
--- a/e107_plugins/tinymce/plugins/e107bbcode/editor_plugin.js
+++ b/e107_plugins/tinymce/plugins/e107bbcode/editor_plugin.js
@@ -1,5 +1,5 @@
/**
- * $Id: editor_plugin.js,v 1.1 2009-10-12 06:38:01 e107coders Exp $
+ * $Id: editor_plugin.js,v 1.2 2009-10-30 09:13:36 e107coders Exp $
*
* @author Moxiecode
* @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
@@ -42,6 +42,8 @@
function rep(re, str) {
s = s.replace(re, str);
};
+
+
// example: to [b]
rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");
@@ -53,7 +55,10 @@
rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");
rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");
rep(/(.*?)<\/font>/gi,"$1");
- rep(//gi,"[img]$1[/img]");
+ // rep(//gi,"[img]$1[/img]");
+ // rep(/(.*?)\/>/gi,"[img style=$1]$2[/img]");
+
+ rep(//gi,"[img style=$1;width:$4px; height:$5;]$2[/img]");
rep(/(.*?)<\/span>/gi,"[code]$1[/code]");
rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]");
rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
@@ -110,13 +115,13 @@
rep(/\[\/u\]/gi,"");
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2");
rep(/\[url\](.*?)\[\/url\]/gi,"$1");
- rep(/\[img\](.*?)\[\/img\]/gi,"
");
+ rep(/\[img.*?\](.*?)\[\/img\]/gi,"
");
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2");
rep(/\[code\](.*?)\[\/code\]/gi,"$1 ");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 ");
// e107 FIXME!
-
+ // rep("/\[list\](.+?)\[\/list\]/is", '');
rep(/\[list\]/gi,"");
diff --git a/e107_plugins/tinymce/tinymce_setup.php b/e107_plugins/tinymce/tinymce_setup.php
index e46292745..a22831a91 100644
--- a/e107_plugins/tinymce/tinymce_setup.php
+++ b/e107_plugins/tinymce/tinymce_setup.php
@@ -9,8 +9,8 @@
* Custom TinyMce install/uninstall/update routines
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/tinymce_setup.php,v $
-* $Revision: 1.2 $
-* $Date: 2009-10-21 12:53:00 $
+* $Revision: 1.3 $
+* $Date: 2009-10-30 09:13:37 $
* $Author: e107coders $
*
*/
@@ -27,7 +27,7 @@ class tinymce_setup
function install_post($var)
{
$sql = e107::getDb();
- $mes = eMessage::getInstance();
+ $mes = e107::getMessage();
$query = "INSERT INTO #tinymce (
`tinymce_id`, `tinymce_name`, `tinymce_userclass`, `tinymce_plugins`, `tinymce_buttons1`, `tinymce_buttons2`, `tinymce_buttons3`, `tinymce_buttons4`, `tinymce_custom`, `tinymce_prefs`) VALUES
@@ -47,10 +47,16 @@ class tinymce_setup
}
}
-/*
+/*
+ function uninstall_options()
+ {
+
+ }
+
+
function uninstall_post($var)
{
- // $sql = e107::getDb();
+ // print_a($var);
}
function upgrade_post($var)