diff --git a/e107_plugins/poll/admin_config.php b/e107_plugins/poll/admin_config.php
index 855bd0023..480dc41d7 100644
--- a/e107_plugins/poll/admin_config.php
+++ b/e107_plugins/poll/admin_config.php
@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+
| e107 website system
|
-| ©Steve Dunstan 2001-2002
+| �Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/poll/admin_config.php,v $
-| $Revision: 1.8 $
-| $Date: 2009-07-10 14:25:22 $
+| $Revision: 1.9 $
+| $Date: 2009-09-22 18:28:45 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -36,7 +36,6 @@ if(isset($_POST))
$_POST = strip_if_magic($_POST);
}
-
$rs = new form;
$poll = new poll;
@@ -45,23 +44,15 @@ if (isset($_POST['reset']))
unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['multipleChoice'], $_POST['showResults'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear']);
define("RESET", TRUE);
}
-elseif (e_QUERY)
-{
- list($action, $id) = explode(".", e_QUERY);
- define("POLLACTION", $action);
- define("POLLID", $id);
-}
-else
-{
- define("POLLACTION", FALSE);
- define("POLLID", FALSE);
-}
-if ($action == "delete")
+ $emessage = eMessage::getInstance();
+
+if (varset($_POST['delete']))
{
- $message = $poll->delete_poll($id);
+ $message = $poll->delete_poll(key($_POST['delete']));
unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate']);
+ $_GET['mode']='list';
}
@@ -69,21 +60,63 @@ if (isset($_POST['submit']))
{
if($_POST['poll_title'])
{
- $message = $poll -> submit_poll();
+ define("POLLID",$_POST['poll_id']);
+ $emessage->add($poll -> submit_poll(), E_MESSAGE_SUCCESS);
unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']);
}
else
{
- $message = POLLAN_46;
+ $emessage->add(POLLAN_46, E_MESSAGE_SUCCESS);
}
+ $_GET['mode']='list';
+
+}
+
+if (isset($_POST['preview']))
+{
+ // Can't have everyone voting if tracking method is user ID
+ if (($_POST['pollUserclass'] == e_UC_PUBLIC) && ($_POST['storageMethod'] == 2)) $_POST['pollUserclass'] = e_UC_MEMBER;
+ $poll->render_poll($_POST, "preview");
+}
+
+if (varset($_POST['edit']) || varset($_GET['mode'])=='create' && !varset($_POST['submit']))
+{
+ $_GET['mode']='create';
+ if($_POST['edit'])
+ {
+ edit_poll();
+ define("POLLACTION",'edit');
+ }
+
+ $poll_total = $sql->db_Select("polls");
+ $text = $poll -> renderPollForm();
+ $ns->tablerender(POLLAN_MENU_CAPTION." :: ".POLLAN_2, $text);
}
-if (POLLACTION == "edit" && !$_POST['preview'] && !$_POST['submit'])
-{
- if ($sql->db_Select("polls", "*", "poll_id=".POLLID))
+if (isset($message))
+{
+ $emessage->add($message, E_MESSAGE_SUCCESS);
+
+}
+
+if(!varset($_POST['edit']) && ($_GET['mode']=="list" || !$_GET['mode']))
+{
+ poll_list();
+}
+
+require_once(e_ADMIN."footer.php");
+
+function edit_poll()
+{
+
+ $sql = e107::getDb();
+ $id = key($_POST['edit']);
+
+ if ($sql->db_Select("polls", "*", "poll_id=".$id))
{
+ $_GET['mode'] = 'create';
$row = $sql->db_Fetch();
extract($row);
@@ -94,6 +127,7 @@ if (POLLACTION == "edit" && !$_POST['preview'] && !$_POST['submit'])
$_POST['poll_option'][] = $option;
}
+ $_POST['poll_id'] = $id;
$_POST['activate'] = $poll_active;
$_POST['option_count'] = count($_POST['poll_option']);
$_POST['poll_title'] = $poll_title;
@@ -122,80 +156,98 @@ if (POLLACTION == "edit" && !$_POST['preview'] && !$_POST['submit'])
}
}
-if (isset($_POST['preview']))
+function poll_list()
{
- // Can't have everyone voting if tracking method is user ID
- if (($_POST['pollUserclass'] == e_UC_PUBLIC) && ($_POST['storageMethod'] == 2)) $_POST['pollUserclass'] = e_UC_MEMBER;
- $poll->render_poll($_POST, "preview");
-}
-
-if (isset($message))
-{
- $ns->tablerender("", "
";
- if (isset($_POST['preview'])) {
- $text .= "
";
- if (POLLACTION == "edit") {
- $text .= "
";
- } else {
+ if (isset($_POST['preview']) || varset($_POST['edit']))
+ {
+ $text .= "
";
+
+ if (POLLACTION == "edit")
+ {
+ $text .= "
+
";
+ }
+ else
+ {
$text .= "
";
}
} else {
$text .= "
";
}
- if (POLLID) {
+
+ if (defset('POLLID')) {
$text .= "
";
}
diff --git a/e107_plugins/tinymce/admin_config.php b/e107_plugins/tinymce/admin_config.php
index 54331ead6..c011f03de 100644
--- a/e107_plugins/tinymce/admin_config.php
+++ b/e107_plugins/tinymce/admin_config.php
@@ -9,8 +9,8 @@
* Plugin Administration - gsitemap
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/admin_config.php,v $
- * $Revision: 1.6 $
- * $Date: 2009-09-21 21:54:26 $
+ * $Revision: 1.7 $
+ * $Date: 2009-09-22 18:28:49 $
* $Author: e107coders $
*
*/
@@ -31,16 +31,19 @@ $emessage = &eMessage::getInstance();
if($_POST['save_settings']) // Needs to be saved before e_meta.php is loaded by auth.php.
{
- $pref['tinymce']['customjs'] = $_POST['customjs'];
- $pref['tinymce']['theme_advanced_buttons1'] = $_POST['theme_advanced_buttons1'];
- $pref['tinymce']['theme_advanced_buttons2'] = $_POST['theme_advanced_buttons2'];
- $pref['tinymce']['theme_advanced_buttons3'] = $_POST['theme_advanced_buttons3'];
- $pref['tinymce']['theme_advanced_buttons4'] = $_POST['theme_advanced_buttons4'];
- $pref['tinymce']['plugins'] = $_POST['mce_plugins'];
+ $tpref['customjs'] = $_POST['customjs'];
+ $tpref['theme_advanced_buttons1'] = $_POST['theme_advanced_buttons1'];
+ $tpref['theme_advanced_buttons2'] = $_POST['theme_advanced_buttons2'];
+ $tpref['theme_advanced_buttons3'] = $_POST['theme_advanced_buttons3'];
+ $tpref['theme_advanced_buttons4'] = $_POST['theme_advanced_buttons4'];
+ $tpref['plugins'] = $_POST['mce_plugins'];
- save_prefs();
+ e107::getPlugConfig('tinymce')->setPref($tpref);
+ e107::getPlugConfig('tinymce')->save();
}
+ $tpref = e107::getPlugConfig('tinymce')->getPref();
+
require_once(e_ADMIN."auth.php");
@@ -59,24 +62,24 @@ if($_POST['save_settings']) // is there an if $emessage? $emessage->hasMessage
sort($plug_array);
}
- if(!$pref['tinymce']['theme_advanced_buttons1'])
+ if(!$tpref['theme_advanced_buttons1'])
{
- $pref['tinymce']['theme_advanced_buttons1'] = "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect";
+ $tpref['theme_advanced_buttons1'] = "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect";
}
- if(!$pref['tinymce']['theme_advanced_buttons2'])
+ if(!$tpref['theme_advanced_buttons2'])
{
- $pref['tinymce']['theme_advanced_buttons2'] = "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor";
+ $tpref['theme_advanced_buttons2'] = "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor";
}
- if(!$pref['tinymce']['theme_advanced_buttons3'])
+ if(!$tpref['theme_advanced_buttons3'])
{
- $pref['tinymce']['theme_advanced_buttons3'] = "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen,emoticons,ibrowser";
+ $tpref['theme_advanced_buttons3'] = "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen,emoticons,ibrowser";
}
- if(!$pref['tinymce']['theme_advanced_buttons4'])
+ if(!$tpref['theme_advanced_buttons4'])
{
- $pref['tinymce']['theme_advanced_buttons4'] = "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage";
+ $tpref['theme_advanced_buttons4'] = "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage";
}
@@ -106,7 +109,7 @@ if($_POST['save_settings']) // is there an if $emessage? $emessage->hasMessage
foreach($plug_array as $mce_plg)
{
- $checked = (in_array($mce_plg,$pref['tinymce']['plugins'])) ? "checked='checked'" : "";
+ $checked = (in_array($mce_plg,$tpref['plugins'])) ? "checked='checked'" : "";
$text .= "
$mce_plg
";
}
@@ -122,7 +125,7 @@ if($_POST['save_settings']) // is there an if $emessage? $emessage->hasMessage
for ($i=1; $i<=4; $i++)
{
$rowNm = "theme_advanced_buttons".$i;
- $text .= "\t
\n";
+ $text .= "\t
\n";
}
$text .= "
@@ -132,7 +135,7 @@ if($_POST['save_settings']) // is there an if $emessage? $emessage->hasMessage
Custom TinyMce Javascript |
-
+
|
diff --git a/e107_plugins/tinymce/e_meta.php b/e107_plugins/tinymce/e_meta.php
index e6c6d71f2..9b904efec 100644
--- a/e107_plugins/tinymce/e_meta.php
+++ b/e107_plugins/tinymce/e_meta.php
@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+
| e107 website system
|
-| ©Steve Dunstan 2001-2002
+| �Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/e_meta.php,v $
-| $Revision: 1.4 $
-| $Date: 2009-07-10 14:27:31 $
+| $Revision: 1.5 $
+| $Date: 2009-09-22 18:28:49 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -22,7 +22,7 @@ if (!defined('e107_INIT')) { exit; }
if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php"))
{
require_once(e_PLUGIN."tinymce/wysiwyg.php");
- echo wysiwyg($e_wysiwyg);
+ echo wysiwyg();
}
diff --git a/e107_plugins/tinymce/wysiwyg.php b/e107_plugins/tinymce/wysiwyg.php
index dbc14b82a..1c03c158d 100644
--- a/e107_plugins/tinymce/wysiwyg.php
+++ b/e107_plugins/tinymce/wysiwyg.php
@@ -4,8 +4,8 @@
| e107 website system - Tiny MCE controller file.
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/wysiwyg.php,v $
-| $Revision: 1.14 $
-| $Date: 2009-09-21 16:31:02 $
+| $Revision: 1.15 $
+| $Date: 2009-09-22 18:28:49 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -13,6 +13,8 @@
function wysiwyg($formids)
{
+ $tinyMcePrefs = e107::getPlugConfig('tinymce')->getPref();
+
global $pref,$HANDLERS_DIRECTORY,$PLUGINS_DIRECTORY,$IMAGES_DIRECTORY;
$lang = e_LANGUAGE;
@@ -45,7 +47,7 @@ if(!$tinylang[$lang])
$admin_only = array("ibrowser","code");
-foreach($pref['tinymce']['plugins'] as $val)
+foreach($tinyMcePrefs['plugins'] as $val)
{
if(in_array($val,$admin_only) && !ADMIN)
{
@@ -115,10 +117,10 @@ $text .= ",theme_advanced_buttons3 : ''";
*/
$text .= ",
-theme_advanced_buttons1 : '".$pref['tinymce']['theme_advanced_buttons1']."',
-theme_advanced_buttons2 : '".$pref['tinymce']['theme_advanced_buttons2']."',
-theme_advanced_buttons3 : '".$pref['tinymce']['theme_advanced_buttons3']."',
-theme_advanced_buttons4 : '".$pref['tinymce']['theme_advanced_buttons4']."',
+theme_advanced_buttons1 : '".$tinyMcePrefs['theme_advanced_buttons1']."',
+theme_advanced_buttons2 : '".$tinyMcePrefs['theme_advanced_buttons2']."',
+theme_advanced_buttons3 : '".$tinyMcePrefs['theme_advanced_buttons3']."',
+theme_advanced_buttons4 : '".$tinyMcePrefs['theme_advanced_buttons4']."',
theme_advanced_toolbar_location : \"bottom\",
theme_advanced_toolbar_align : \"left\",
theme_advanced_statusbar_location : \"bottom\",
@@ -144,7 +146,7 @@ $text .= ",verify_css_classes : false\n";
$text .= ",cleanup_callback : \"tinymce_html_bbcode_control\" \n";
$text .= (ADMIN) ? "\n, external_link_list_url: '../".e_PLUGIN_ABS."tiny_mce/filelist.php'\n" : "";
-if($pref['tinymce']['customjs'])
+if($tinyMcePrefs['customjs'])
{
$text .= "\n,
@@ -171,7 +173,7 @@ $text .= "
function tinymce_html_bbcode_control(type, source) {
";
- if(in_array("bbcode",$pref['tinymce']['plugins']))
+ if(in_array("bbcode",$tinyMcePrefs['plugins']))
{
// $text .= " return source; ";
}