diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 1a35c26b0..667cc9504 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -864,6 +864,7 @@ class e_form $rows = '10'; $height = "style='height:375px'"; // inline required for wysiwyg + $size = "input-block-level"; break; case 'large': @@ -890,7 +891,7 @@ class e_form $ret .= e107::getBB()->renderButtons($template,$help_tagid); - $ret .= $this->textarea($name, $value, $rows, 150, $options, $counter); + $ret .= $this->textarea($name, $value, $rows, 70, $options, $counter); // higher thank 70 will break some layouts. $ret .= "\n"; diff --git a/e107_plugins/forum/forum_update.php b/e107_plugins/forum/forum_update.php index 5cca95af2..752d833f4 100644 --- a/e107_plugins/forum/forum_update.php +++ b/e107_plugins/forum/forum_update.php @@ -43,9 +43,24 @@ $sql = e107::getDb(); if(e_AJAX_REQUEST) { - step6_ajax(); - exit; + if(!vartrue($_GET['mode'])) + { + echo "data-progress-mode not set!"; + exit; + } + $func = 'step'.intval($_GET['mode'])."_ajax"; + + if(function_exists($func)) + { + call_user_func($func); + } + else + { + echo $func ."() doesn't exist!"; + } + + exit; } @@ -616,7 +631,7 @@ function step6()
- Begin thread data move + Begin thread data move '; @@ -719,6 +734,18 @@ function step7() $ns->tablerender($stepCaption, $text); } + +function step7_ajax() //TODO +{ + + + + + +} + + + function step8() { $e107 = e107::getInstance(); @@ -754,6 +781,21 @@ function step8() e107::getRender()->tablerender($stepCaption, $text); } + + +function step8_ajax() //TODO +{ + + + + + +} + + + + + function step9() { $e107 = e107::getInstance(); @@ -818,6 +860,15 @@ function step9() "; e107::getRender()->tablerender($stepCaption, $text); +} + +function step9_ajax() //TODO +{ + + + + + } function step10() @@ -1050,7 +1101,14 @@ function step10() $ns->tablerender($stepCaption, $text); } - +function step10_ajax() //TODO +{ + + + + + +} function step11() { @@ -1152,6 +1210,9 @@ function step11() } } + + + function step12() { $sql = e107::getDb(); diff --git a/e107_plugins/poll/admin_config.php b/e107_plugins/poll/admin_config.php index f91b19de7..0d686bf6b 100644 --- a/e107_plugins/poll/admin_config.php +++ b/e107_plugins/poll/admin_config.php @@ -164,7 +164,7 @@ function poll_list() $fields = array( 'poll_id' => array('title'=> LAN_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_options' => array('title'=> POLLAN_4, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left' ), // 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 @@ -188,18 +188,22 @@ function poll_list() { extract($row); // FIXME + $pollopts = explode(chr(1),$poll_options); + + $pollopts = array_filter($pollopts); + $text .= " $poll_id"; $text .= (in_array("poll_title",$fieldpref)) ? "".$tp -> toHTML($poll_title, TRUE,"no_hook, emotes_off, defs")."" : ""; - $text .= (in_array("poll_options",$fieldpref)) ? "".(str_replace(chr(1),"
",$poll_options))."" : ""; + $text .= (in_array("poll_options",$fieldpref)) ? "" : ""; $text .= (in_array("poll_comment",$fieldpref)) ? "".($poll_comment ? LAN_YES : LAN_NO)."" : ""; $text .= (in_array("poll_vote_userclass",$fieldpref)) ? "".(r_userclass_name($poll_vote_userclass))."" : ""; $text .= " - - - toJS(LAN_CONFIRMDEL." [".$poll_id."]")."') \" src='".ADMIN_DELETE_ICON_PATH."' alt='".LAN_DELETE."' title='".LAN_DELETE."' style='border:0px' /> + + + toJS(LAN_CONFIRMDEL." [".$poll_id."]")."') \" src='".ADMIN_DELETE_ICON_PATH."' alt='".LAN_DELETE."' title='".LAN_DELETE."' style='border:0px' /> "; } diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index 815d5d619..5334486cb 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -323,7 +323,7 @@ class poll if ($type == 'preview') { - $optionArray = $pollArray['poll_option']; + $optionArray = array_filter($pollArray['poll_option']); $voteArray = array(); $voteArray = array_pad($voteArray, count($optionArray), 0); $pollArray['poll_allow_multiple'] = $pollArray['multipleChoice']; @@ -378,18 +378,32 @@ class poll require(e_PLUGIN.'poll/templates/poll_template.php'); } - if($type == 'forum' && e_BOOTSTRAP === true) + + + if(deftrue('e_BOOTSTRAP')) { - require_once(e_PLUGIN."forum/templates/forum_poll_template.php"); + if($type == 'forum') + { + require_once(e_PLUGIN."forum/templates/forum_poll_template.php"); + + $POLL_FORUM_NOTVOTED_START = $FORUM_POLL_TEMPLATE['form']['start']; + $POLL_FORUM_NOTVOTED_LOOP = $FORUM_POLL_TEMPLATE['form']['item']; + $POLL_FORUM_NOTVOTED_END = $FORUM_POLL_TEMPLATE['form']['end']; + + $POLL_FORUM_VOTED_START = $FORUM_POLL_TEMPLATE['results']['start']; + $POLL_FORUM_VOTED_LOOP = $FORUM_POLL_TEMPLATE['results']['item']; + $POLL_FORUM_VOTED_END = $FORUM_POLL_TEMPLATE['results']['end']; + } - $POLL_FORUM_NOTVOTED_START = $FORUM_POLL_TEMPLATE['form']['start']; - $POLL_FORUM_NOTVOTED_LOOP = $FORUM_POLL_TEMPLATE['form']['item']; - $POLL_FORUM_NOTVOTED_END = $FORUM_POLL_TEMPLATE['form']['end']; + $POLL_NOTVOTED_START = $POLL_TEMPLATE['form']['start']; + $POLL_NOTVOTED_LOOP = $POLL_TEMPLATE['form']['item']; + $POLL_NOTVOTED_END = $POLL_TEMPLATE['form']['end']; + + $POLL_VOTED_START = $POLL_TEMPLATE['results']['start']; + $POLL_VOTED_LOOP = $POLL_TEMPLATE['results']['item']; + $POLL_VOTED_END = $POLL_TEMPLATE['results']['end']; - $POLL_FORUM_VOTED_START = $FORUM_POLL_TEMPLATE['results']['start']; - $POLL_FORUM_VOTED_LOOP = $FORUM_POLL_TEMPLATE['results']['item']; - $POLL_FORUM_VOTED_END = $FORUM_POLL_TEMPLATE['results']['end']; } @@ -469,7 +483,7 @@ class poll $SUBMITBUTTON = ""; if (('preview' == $type || $preview == TRUE) && strpos(e_SELF, "viewtopic") === FALSE) { - $SUBMITBUTTON = "[".POLLAN_30."]"; + $SUBMITBUTTON = ""; } $text .= "\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_END : $POLL_NOTVOTED_END))."\n"; @@ -530,7 +544,7 @@ class poll if ($type == 'preview') { - $caption = POLLAN_23; + $caption = POLLAN_23.SEP."Preview"; $text = "
\n\n\n
\n$text\n
"; } elseif ($type == 'forum') diff --git a/e107_plugins/poll/templates/poll_template.php b/e107_plugins/poll/templates/poll_template.php index afd3484bb..f119a161a 100644 --- a/e107_plugins/poll/templates/poll_template.php +++ b/e107_plugins/poll/templates/poll_template.php @@ -179,4 +179,63 @@ $POLL_FORUM_VOTED_END = " "; + + +/* v2.x template for polls when user has not voted */ + +$POLL_TEMPLATE = array(); + + +$POLL_TEMPLATE['form']['start'] = " +
+
+
+ +
+
+
+ {SUBMITBUTTON} +
+
+
+
+"; + + + +/* v2.x template for polls when user HAS voted */ + +$POLL_TEMPLATE['results']['start'] = " +
+
+
Poll: {QUESTION}
+"; + +$POLL_TEMPLATE['results']['item'] = " + {OPTION}{PERCENTAGE} + {BAR} +"; + +$POLL_TEMPLATE['results']['end'] = " +
{VOTE_TOTAL}
+
+
+"; + + + + + ?> \ No newline at end of file