1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

Poll interface cleanup and TinyMce pref fixes

This commit is contained in:
CaMer0n
2009-09-22 18:28:49 +00:00
parent 13a4843ca0
commit b9d3cf0142
7 changed files with 244 additions and 175 deletions

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/poll/admin_config.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/poll/admin_config.php,v $
| $Revision: 1.8 $ | $Revision: 1.9 $
| $Date: 2009-07-10 14:25:22 $ | $Date: 2009-09-22 18:28:45 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -36,7 +36,6 @@ if(isset($_POST))
$_POST = strip_if_magic($_POST); $_POST = strip_if_magic($_POST);
} }
$rs = new form; $rs = new form;
$poll = new poll; $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']); 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); 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']); 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']) 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']); unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']);
} }
else 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(); $row = $sql->db_Fetch();
extract($row); extract($row);
@@ -94,6 +127,7 @@ if (POLLACTION == "edit" && !$_POST['preview'] && !$_POST['submit'])
$_POST['poll_option'][] = $option; $_POST['poll_option'][] = $option;
} }
$_POST['poll_id'] = $id;
$_POST['activate'] = $poll_active; $_POST['activate'] = $poll_active;
$_POST['option_count'] = count($_POST['poll_option']); $_POST['option_count'] = count($_POST['poll_option']);
$_POST['poll_title'] = $poll_title; $_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 $sql = e107::getDb();
if (($_POST['pollUserclass'] == e_UC_PUBLIC) && ($_POST['storageMethod'] == 2)) $_POST['pollUserclass'] = e_UC_MEMBER; $ns = e107::getRender();
$poll->render_poll($_POST, "preview"); $tp = e107::getParser();
} $frm = new e_form(true);
if (isset($message))
{ global $user_pref;
$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>"); if(isset($_POST['submit-e-columns'])) //TODO User
} {
$user_pref['admin_poll_columns'] = $_POST['e-columns'];
$text = "<div style='text-align:center'><div style='padding : 1px; ".ADMIN_WIDTH."; height : 200px; overflow : auto; margin-left: auto; margin-right: auto;'> save_prefs('user');
<form action='".e_SELF."' method='post' id='del_poll'>";
if ($poll_total = $sql->db_Select("polls", "*", "poll_type=1"))
{
$text .= "<table class='adminlist' cellpadding='0' cellspacing='0'>
<colgroup span='3'>
<col style='width:5%' />
<col style='width:75%' />
<col style='width:20%' />
</colgroup>
<thead>
<tr>
<th>ID
<input type='hidden' name='del_poll_confirm' id='del_poll_confirm' value='1' />
</th>
<th>".POLLAN_3."</th>
<th class='center'>".POLLAN_4."</th>
</tr>
</thead>
<tbody>";
while ($row = $sql->db_Fetch()) {
extract($row);
$text .= "<tr>
<td style='width:5%' >$poll_id</td>
<td style='width:75%' class='forumheader3'>".$tp -> toHTML($poll_title, TRUE,"no_hook, emotes_off, defs")."</td>
<td style='width:20%; text-align:center' class='forumheader3'><div>". $rs->form_button("button", "main_edit_{$poll_id}", POLLAN_5, "onclick=\"document.location='".e_SELF."?edit.$poll_id'\""). $rs->form_button("submit", "main_delete_{$poll_id}", POLLAN_6, "onclick=\"confirm_($poll_id)\"")."
</div></td>
</tr>";
} }
$text .= "</tbody></table>";
$fieldpref = (varset($user_pref['admin_poll_columns'])) ? $user_pref['admin_poll_columns'] : array("poll_id","poll_title","poll_options","poll_vote_userclass"); ;
//TODO Add more column options.
$fields = array(
'poll_id' => array('title'=> ID, 'width'=>'5%', 'forced'=> TRUE),
'poll_title' => array('title'=> POLLAN_3, 'width'=>'auto'),
'poll_options' => array('title'=> POLLAN_4, 'type' => 'text', 'width' => 'auto', 'thclass' => 'center' ), // No real vetting
// 'poll_start_datestamp' => array('title'=> LAN_AUTHOR, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first'), // Display name
// 'poll_end_datestamp' => array('title'=> LAN_DATE, 'type' => 'text', 'width' => 'auto'), // User name
'poll_vote_userclass' => array('title'=> LAN_USERCLASS, 'type' => 'text', 'width' => 'auto'), // Photo
'options' => array('title'=> LAN_OPTIONS, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last')
);
$text = "<div style='text-align:center'><div>
<form action='".e_SELF."' method='post' id='del_poll'>";
if ($poll_total = $sql->db_Select("polls", "*", "poll_type=1"))
{
$text .= "<table class='adminlist' cellpadding='0' cellspacing='0'>";
$text .= $frm->colGroup($fields,$fieldpref).
$frm->thead($fields,$fieldpref);
$text .= "<tbody>";
while ($row = $sql->db_Fetch())
{
extract($row);
$text .= "<tr>
<td>$poll_id</td>";
$text .= (in_array("poll_title",$fieldpref)) ? "<td class='left'>".$tp -> toHTML($poll_title, TRUE,"no_hook, emotes_off, defs")."</td>" : "";
$text .= (in_array("poll_options",$fieldpref)) ? "<td class='left'>".(str_replace(chr(1),"<br />",$poll_options))."</td>" : "";
$text .= (in_array("poll_comment",$fieldpref)) ? "<td>".($poll_comment ? LAN_YES : LAN_NO)."</td>" : "";
$text .= (in_array("poll_vote_userclass",$fieldpref)) ? "<td>".(r_userclass_name($poll_vote_userclass))."</td>" : "";
$text .= "
<td class='center'>
<input type='image' name='edit[{$poll_id}]' value='edit' src='".ADMIN_EDIT_ICON_PATH."' alt='".LAN_EDIT."' title='".LAN_EDIT."' style='border:0px' />
<input type='image' name='delete[$poll_id]' value='del' onclick=\"return jsconfirm('".$tp->toJS(LAN_CONFIRMDEL." [".$poll_id."]")."') \" src='".ADMIN_DELETE_ICON_PATH."' alt='".LAN_DELETE."' title='".LAN_DELETE."' style='border:0px' />
</td>
</tr>";
}
$text .= "</tbody></table>";
}
else
{
$text .= "<div style='text-align:center'>".POLLAN_7."</div>";
}
$text .= "</form></div></div>";
$emessage = eMessage::getInstance();
$ns->tablerender(POLLAN_MENU_CAPTION." :: ".POLLAN_1,$emessage->render(). $text);
} }
else
function admin_config_adminmenu()
{ {
$text .= "<div style='text-align:center'>".POLLAN_7."</div>"; $action = varset($_GET['mode']) ? $_GET['mode'] : "list";
} $var['list']['text'] = POLLAN_1;
$text .= "</form></div></div>"; $var['list']['link'] = e_SELF;
$ns->tablerender(POLLAN_1, $text); $var['list']['perm'] = "P";
$var['create']['text'] = POLLAN_2 ;
$poll_total = $sql->db_Select("polls"); $var['create']['link'] = e_SELF."?mode=create";
$var['create']['perm'] = "P";
$text = $poll -> renderPollForm(); /* $var['import']['text'] = GSLAN_23;
$var['import']['link'] = e_SELF."?import";
$ns->tablerender(POLLAN_2, $text); $var['import']['perm'] = "0";*/
require_once(e_ADMIN."footer.php"); show_admin_menu(POLLAN_MENU_CAPTION, $action, $var);
function headerjs()
{
global $tp;
$headerjs = "<script type=\"text/javascript\">
function confirm_(poll_id)
{
var x=confirm(\"Delete this poll? [ID: \" + poll_id + \"]\");
if (x)
{
document.getElementById('del_poll').action='".e_SELF."?delete.' + poll_id;
document.getElementById('del_poll').submit();
}
}
</script>";
return $headerjs;
} }
?> ?>

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/poll/languages/English.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/poll/languages/English.php,v $
| $Revision: 1.3 $ | $Revision: 1.4 $
| $Date: 2008-08-16 16:25:45 $ | $Date: 2009-09-22 18:28:47 $
| $Author: e107steved $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -28,10 +28,10 @@
define("POLLAN_MENU_CAPTION", "Poll"); define("POLLAN_MENU_CAPTION", "Poll");
//define("POLLAN_1", "Existing polls"); define("POLLAN_1", "Existing polls");
//define("POLLAN_2", "Create / edit polls"); define("POLLAN_2", "Create / edit polls");
//define("POLLAN_3", "Poll question"); define("POLLAN_3", "Poll question");
//define("POLLAN_4", "Options"); define("POLLAN_4", "Poll Options");
//define("POLLAN_5", "Edit"); //define("POLLAN_5", "Edit");
//define("POLLAN_6", "Delete"); //define("POLLAN_6", "Delete");
//define("POLLAN_7", "No polls yet."); //define("POLLAN_7", "No polls yet.");

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/poll/languages/English_admin_poll.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/poll/languages/English_admin_poll.php,v $
| $Revision: 1.1 $ | $Revision: 1.2 $
| $Date: 2008-12-10 21:49:54 $ | $Date: 2009-09-22 18:28:48 $
| $Author: e107steved $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -29,12 +29,12 @@ define("POLL_ADLAN08", "Poll deleted");
define("POLLAN_MENU_CAPTION", "Poll"); define("POLLAN_MENU_CAPTION", "Poll");
define("POLLAN_1", "Existing polls"); //define("POLLAN_1", "Existing polls");
define("POLLAN_2", "Create / edit polls"); //define("POLLAN_2", "Create / edit polls");
define("POLLAN_3", "Poll question"); //define("POLLAN_3", "Poll Question");
define("POLLAN_4", "Options"); //define("POLLAN_4", "Poll Options");
define("POLLAN_5", "Edit"); //define("POLLAN_5", "Edit");
define("POLLAN_6", "Delete"); //define("POLLAN_6", "Delete");
define("POLLAN_7", "No polls yet."); define("POLLAN_7", "No polls yet.");
/* /*
define("POLLAN_8", "Add another option"); define("POLLAN_8", "Add another option");
@@ -75,7 +75,7 @@ define("POLLAN_42", "This poll is restricted to administrators only");
define("POLLAN_43", "You do not have the required permissions to vote in this poll"); define("POLLAN_43", "You do not have the required permissions to vote in this poll");
define("POLLAN_44", "Delete this poll?"); define("POLLAN_44", "Delete this poll?");
*/ */
define("POLLAN_45", "Poll successfully updated");
define("POLLAN_46", "Field(s) left blank"); define("POLLAN_46", "Field(s) left blank");
// Log messages // Log messages

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/poll/poll_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/poll/poll_class.php,v $
| $Revision: 1.16 $ | $Revision: 1.17 $
| $Date: 2009-08-15 11:55:30 $ | $Date: 2009-09-22 18:28:47 $
| $Author: marj_nl_fr $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
@@ -64,12 +64,13 @@ class poll
$active_end = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear'])); $active_end = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']));
$poll_options = ""; $poll_options = "";
$_POST['poll_option'] = array_filter($_POST['poll_option']);
foreach($_POST['poll_option'] as $key => $value) foreach($_POST['poll_option'] as $key => $value)
{ {
$poll_options .= $tp->toDB($value).chr(1); $poll_options .= $tp->toDB($value).chr(1);
} }
if(POLLACTION == "edit") if(POLLACTION == "edit" || vartrue($_POST['poll_id']))
{ {
$sql -> db_Update("polls", "poll_title='{$poll_title}', $sql -> db_Update("polls", "poll_title='{$poll_title}',
poll_options='{$poll_options}', poll_options='{$poll_options}',
@@ -463,7 +464,10 @@ class poll
$mode = "admin" :: called from admin_config.php $mode = "admin" :: called from admin_config.php
$mode = "forum" :: called from forum_post.php $mode = "forum" :: called from forum_post.php
*/ */
global $tp; $tp = e107::getParser();
//TODO Hardcoded FORUM code needs to be moved somewhere.
if($mode == "forum") if($mode == "forum")
{ {
$text = "<tr> $text = "<tr>
@@ -530,9 +534,9 @@ class poll
<tr> <tr>
<td style='width:30%'><div class='normaltext'>".POLLAN_3.":</div></td> <td style='width:30%'><div class='normaltext'>".POLLAN_3.":</div></td>
<td style='width:70%'> <td style='width:70%'>
<input class='tbox' type='text' name='poll_title' size='70' value='".$tp -> post_toForm($_POST['poll_title'])."' maxlength='200' />"; <input class='tbox' type='text' name='poll_title' size='70' value='".$tp -> post_toForm(varset($_POST['poll_title']))."' maxlength='200' />";
$option_count = (count($_POST['poll_option']) ? count($_POST['poll_option']) : 1); $option_count = (varset($_POST['poll_option']) && count($_POST['poll_option']) ? count($_POST['poll_option']) : 2);
$text .= "</td></tr><tr> $text .= "</td></tr><tr>
<td style='width:30%;vertical-align:top'>".LAN_OPTIONS." :</td> <td style='width:30%;vertical-align:top'>".LAN_OPTIONS." :</td>
@@ -541,10 +545,6 @@ class poll
for($count = 1; $count <= $option_count; $count++) for($count = 1; $count <= $option_count; $count++)
{ {
if($count != 1 && $_POST['poll_option'][($count-1)] =="")
{
break;
}
$opt = ($count==1) ? "id='pollopt'" : ""; $opt = ($count==1) ? "id='pollopt'" : "";
$text .="<span $opt><input class='tbox' type='text' name='poll_option[]' size='40' value=\"".$tp -> post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />"; $text .="<span $opt><input class='tbox' type='text' name='poll_option[]' size='40' value=\"".$tp -> post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />";
$text .= "</span><br />"; $text .= "</span><br />";
@@ -556,55 +556,67 @@ class poll
<tr> <tr>
<td style='width:30%'>".POLLAN_9."</td> <td style='width:30%'>".POLLAN_9."</td>
<td style='width:70%'> <td style='width:70%'>
<input type='radio' name='multipleChoice' value='1'".($_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLLAN_10."&nbsp;&nbsp; <input type='radio' name='multipleChoice' value='1'".(varset($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".POLLAN_10."&nbsp;&nbsp;
<input type='radio' name='multipleChoice' value='0'".(!$_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLLAN_11." <input type='radio' name='multipleChoice' value='0'".(!varset($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".POLLAN_11."
</td> </td>
</tr> </tr>
<tr> <tr>
<td style='width:30%'>".POLLAN_12."</td> <td style='width:30%'>".POLLAN_12."</td>
<td style='width:70%'> <td style='width:70%'>
<input type='radio' name='showResults' value='0'".(!$_POST['showResults'] ? " checked='checked'" : "")." /> ".POLLAN_13."<br /> <input type='radio' name='showResults' value='0'".(!varset($_POST['showResults']) ? " checked='checked'" : "")." /> ".POLLAN_13."<br />
<input type='radio' name='showResults' value='1'".($_POST['showResults'] ? " checked='checked'" : "")." /> ".POLLAN_14." <input type='radio' name='showResults' value='1'".(varset($_POST['showResults']) ? " checked='checked'" : "")." /> ".POLLAN_14."
</td> </td>
</tr> </tr>
<tr> <tr>
<td style='width:30%'>".POLLAN_15."</td> <td style='width:30%'>".POLLAN_15."</td>";
<td>".r_userclass("pollUserclass", $_POST['pollUserclass'], 'off', "public,member,admin,classes,matchclass")."</td>
$uclass = (ADMIN) ? "" : "public,member,admin,classes,matchclass";
$text .= "
<td>".r_userclass("pollUserclass", $_POST['pollUserclass'], 'off', $uclass)."</td>
</tr> </tr>
<tr> <tr>
<td style='width:30%'>".POLLAN_16."</td> <td style='width:30%'>".POLLAN_16."</td>
<td> <td>
<input type='radio' name='storageMethod' value='0'".(!$_POST['storageMethod'] ? " checked='checked'" : "")." /> ".POLLAN_17."<br /> <input type='radio' name='storageMethod' value='0'".(!varset($_POST['storageMethod']) ? " checked='checked'" : "")." /> ".POLLAN_17."<br />
<input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] ==1 ? " checked='checked'" : "")." /> ".POLLAN_18."<br /> <input type='radio' name='storageMethod' value='1'".(varset($_POST['storageMethod']) ==1 ? " checked='checked'" : "")." /> ".POLLAN_18."<br />
<input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".POLLAN_19." <input type='radio' name='storageMethod' value='2'".(varset($_POST['storageMethod']) ==2 ? " checked='checked'" : "")." /> ".POLLAN_19."
</td></tr> </td></tr>
<tr> <tr>
<td>".POLLAN_20.": </td><td class='forumheader3'> <td>".POLLAN_20.": </td><td>
<input type='radio' name='poll_comment' value='1'".($_POST['poll_comment'] ? " checked='checked'" : "")." /> ".POLLAN_10." <input type='radio' name='poll_comment' value='1'".(varset($_POST['poll_comment']) ? " checked='checked'" : "")." /> ".POLLAN_10."
<input type='radio' name='poll_comment' value='0'".(!$_POST['poll_comment'] ? " checked='checked'" : "")." /> ".POLLAN_11." <input type='radio' name='poll_comment' value='0'".(!varset($_POST['poll_comment']) ? " checked='checked'" : "")." /> ".POLLAN_11."
</td> </td>
</tr> </tr>
</table> </table>
<div class='buttons-bar center'>"; <div class='buttons-bar center'>";
if (isset($_POST['preview'])) { if (isset($_POST['preview']) || varset($_POST['edit']))
$text .= "<input class='button' type='submit' name='preview' value='".POLLAN_21."' /> "; {
if (POLLACTION == "edit") { $text .= "<input class='button' type='submit' name='preview' value='".POLLAN_24."' /> ";
$text .= "<input class='button' type='submit' name='submit' value='".POLLAN_22."' /> ";
} else { if (POLLACTION == "edit")
{
$text .= "<input class='button' type='submit' name='submit' value='".POLLAN_22."' />
<input type='hidden' name='poll_id' value='".intval($_POST['poll_id'])."' /> ";
}
else
{
$text .= "<input class='button' type='submit' name='submit' value='".POLLAN_23."' /> "; $text .= "<input class='button' type='submit' name='submit' value='".POLLAN_23."' /> ";
} }
} else { } else {
$text .= "<input class='button' type='submit' name='preview' value='".POLLAN_24."' /> "; $text .= "<input class='button' type='submit' name='preview' value='".POLLAN_24."' /> ";
} }
if (POLLID) {
if (defset('POLLID')) {
$text .= "<input class='button' type='submit' name='reset' value='".POLLAN_25."' /> "; $text .= "<input class='button' type='submit' name='reset' value='".POLLAN_25."' /> ";
} }

View File

@@ -9,8 +9,8 @@
* Plugin Administration - gsitemap * Plugin Administration - gsitemap
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/admin_config.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/admin_config.php,v $
* $Revision: 1.6 $ * $Revision: 1.7 $
* $Date: 2009-09-21 21:54:26 $ * $Date: 2009-09-22 18:28:49 $
* $Author: e107coders $ * $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. if($_POST['save_settings']) // Needs to be saved before e_meta.php is loaded by auth.php.
{ {
$pref['tinymce']['customjs'] = $_POST['customjs']; $tpref['customjs'] = $_POST['customjs'];
$pref['tinymce']['theme_advanced_buttons1'] = $_POST['theme_advanced_buttons1']; $tpref['theme_advanced_buttons1'] = $_POST['theme_advanced_buttons1'];
$pref['tinymce']['theme_advanced_buttons2'] = $_POST['theme_advanced_buttons2']; $tpref['theme_advanced_buttons2'] = $_POST['theme_advanced_buttons2'];
$pref['tinymce']['theme_advanced_buttons3'] = $_POST['theme_advanced_buttons3']; $tpref['theme_advanced_buttons3'] = $_POST['theme_advanced_buttons3'];
$pref['tinymce']['theme_advanced_buttons4'] = $_POST['theme_advanced_buttons4']; $tpref['theme_advanced_buttons4'] = $_POST['theme_advanced_buttons4'];
$pref['tinymce']['plugins'] = $_POST['mce_plugins']; $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"); require_once(e_ADMIN."auth.php");
@@ -59,24 +62,24 @@ if($_POST['save_settings']) // is there an if $emessage? $emessage->hasMessage
sort($plug_array); 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) 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 .= "<div style='width:25%;float:left'><input type='checkbox' name='mce_plugins[]' value='".$mce_plg."' $checked /> $mce_plg </div>"; $text .= "<div style='width:25%;float:left'><input type='checkbox' name='mce_plugins[]' value='".$mce_plg."' $checked /> $mce_plg </div>";
} }
@@ -122,7 +125,7 @@ if($_POST['save_settings']) // is there an if $emessage? $emessage->hasMessage
for ($i=1; $i<=4; $i++) for ($i=1; $i<=4; $i++)
{ {
$rowNm = "theme_advanced_buttons".$i; $rowNm = "theme_advanced_buttons".$i;
$text .= "\t<input class='tbox' style='width:97%' type='text' name='".$rowNm."' value='".$pref['tinymce'][$rowNm]."' />\n"; $text .= "\t<input class='tbox' style='width:97%' type='text' name='".$rowNm."' value='".$tpref[$rowNm]."' />\n";
} }
$text .= " $text .= "
@@ -132,7 +135,7 @@ if($_POST['save_settings']) // is there an if $emessage? $emessage->hasMessage
<tr> <tr>
<td>Custom TinyMce Javascript</td> <td>Custom TinyMce Javascript</td>
<td> <td>
<textarea rows='5' cols='10' name='customjs' class='tbox' style='width:80%'>".$pref['tinymce']['customjs']."</textarea> <textarea rows='5' cols='10' name='customjs' class='tbox' style='width:80%'>".$tpref['customjs']."</textarea>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -3,7 +3,7 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
| e107 website system | e107 website system
| |
| <20>Steve Dunstan 2001-2002 | <20>Steve Dunstan 2001-2002
| http://e107.org | http://e107.org
| jalist@e107.org | jalist@e107.org
| |
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/e_meta.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/e_meta.php,v $
| $Revision: 1.4 $ | $Revision: 1.5 $
| $Date: 2009-07-10 14:27:31 $ | $Date: 2009-09-22 18:28:49 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -22,7 +22,7 @@ if (!defined('e107_INIT')) { exit; }
if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php")) if(e_WYSIWYG || strpos(e_SELF,"tinymce/admin_config.php"))
{ {
require_once(e_PLUGIN."tinymce/wysiwyg.php"); require_once(e_PLUGIN."tinymce/wysiwyg.php");
echo wysiwyg($e_wysiwyg); echo wysiwyg();
} }

View File

@@ -4,8 +4,8 @@
| e107 website system - Tiny MCE controller file. | e107 website system - Tiny MCE controller file.
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/wysiwyg.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/tinymce/wysiwyg.php,v $
| $Revision: 1.14 $ | $Revision: 1.15 $
| $Date: 2009-09-21 16:31:02 $ | $Date: 2009-09-22 18:28:49 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -13,6 +13,8 @@
function wysiwyg($formids) function wysiwyg($formids)
{ {
$tinyMcePrefs = e107::getPlugConfig('tinymce')->getPref();
global $pref,$HANDLERS_DIRECTORY,$PLUGINS_DIRECTORY,$IMAGES_DIRECTORY; global $pref,$HANDLERS_DIRECTORY,$PLUGINS_DIRECTORY,$IMAGES_DIRECTORY;
$lang = e_LANGUAGE; $lang = e_LANGUAGE;
@@ -45,7 +47,7 @@ if(!$tinylang[$lang])
$admin_only = array("ibrowser","code"); $admin_only = array("ibrowser","code");
foreach($pref['tinymce']['plugins'] as $val) foreach($tinyMcePrefs['plugins'] as $val)
{ {
if(in_array($val,$admin_only) && !ADMIN) if(in_array($val,$admin_only) && !ADMIN)
{ {
@@ -115,10 +117,10 @@ $text .= ",theme_advanced_buttons3 : ''";
*/ */
$text .= ", $text .= ",
theme_advanced_buttons1 : '".$pref['tinymce']['theme_advanced_buttons1']."', theme_advanced_buttons1 : '".$tinyMcePrefs['theme_advanced_buttons1']."',
theme_advanced_buttons2 : '".$pref['tinymce']['theme_advanced_buttons2']."', theme_advanced_buttons2 : '".$tinyMcePrefs['theme_advanced_buttons2']."',
theme_advanced_buttons3 : '".$pref['tinymce']['theme_advanced_buttons3']."', theme_advanced_buttons3 : '".$tinyMcePrefs['theme_advanced_buttons3']."',
theme_advanced_buttons4 : '".$pref['tinymce']['theme_advanced_buttons4']."', theme_advanced_buttons4 : '".$tinyMcePrefs['theme_advanced_buttons4']."',
theme_advanced_toolbar_location : \"bottom\", theme_advanced_toolbar_location : \"bottom\",
theme_advanced_toolbar_align : \"left\", theme_advanced_toolbar_align : \"left\",
theme_advanced_statusbar_location : \"bottom\", theme_advanced_statusbar_location : \"bottom\",
@@ -144,7 +146,7 @@ $text .= ",verify_css_classes : false\n";
$text .= ",cleanup_callback : \"tinymce_html_bbcode_control\" \n"; $text .= ",cleanup_callback : \"tinymce_html_bbcode_control\" \n";
$text .= (ADMIN) ? "\n, external_link_list_url: '../".e_PLUGIN_ABS."tiny_mce/filelist.php'\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, $text .= "\n,
@@ -171,7 +173,7 @@ $text .= "
function tinymce_html_bbcode_control(type, source) { function tinymce_html_bbcode_control(type, source) {
"; ";
if(in_array("bbcode",$pref['tinymce']['plugins'])) if(in_array("bbcode",$tinyMcePrefs['plugins']))
{ {
// $text .= " return source; "; // $text .= " return source; ";
} }