From b36aa5088b57640d54a4043cd48e841090764b2e Mon Sep 17 00:00:00 2001 From: Moc Date: Wed, 25 Jun 2014 20:32:21 +0200 Subject: [PATCH] #647 - Poll input fields layout (also fixed 'Add another answer' button) --- e107_plugins/forum/e_meta.php | 15 +++++++++ e107_plugins/poll/poll_class.php | 58 ++++++++++++++++++-------------- 2 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 e107_plugins/forum/e_meta.php diff --git a/e107_plugins/forum/e_meta.php b/e107_plugins/forum/e_meta.php new file mode 100644 index 000000000..f76302b3c --- /dev/null +++ b/e107_plugins/forum/e_meta.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index 5fdbbc5a5..3a8ead72a 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -605,7 +605,7 @@ class poll // echo "MODE=".$mode; //XXX New v2.x default for front-end. Currently used by forum-post in bootstrap mode. - // TODO Moc - Needs a more generic LAN rewrite when used on another area than forum + // TODO LAN - Needs a more generic LAN rewrite when used on another area than forum if ($mode == 'front') { @@ -615,31 +615,38 @@ class poll ".LAN_FORUM_3029." -
-
- +
+
+ + ".$frm->text('poll_title', $tp->post_toForm(vartrue($_POST['poll_title'])), '200', array('placeholder' => LAN_FORUM_3030, 'id' => 'poll_title'))."
"; $option_count = vartrue($_POST['poll_option']) ? count($_POST['poll_option']) : 2; $text .= " -
"; - +
+ "; + for($count = 1; $count <= $option_count; $count++) { - if ($count != 1 && $_POST['poll_option'][($count-1)] =="") - { - // break; - } - $opt = ($count==1) ? "id='pollopt' class='btn-group input-append' " : ""; - $text .=""; - $text .= "
"; + // if ($count != 1 && $_POST['poll_option'][($count-1)] =="") + // { + // // break; + // } + + $opt = ($count==1) ? "id='poll_answer'" : ""; + + $text .= "
+ ".$frm->text('poll_option[]', $_POST['poll_option'][($count-1)], '200', array('placeholder' => LAN_FORUM_3031, 'id' => $opt))." +
"; } - - $text .="
-
-
-
-
"; + + $text .= "
"; // end pollsection div + + $text .= "
+ +
+ + "; //FIXME - get this looking good with Bootstrap CSS only. @@ -647,14 +654,13 @@ class poll // Set to IP address.. Can add a pref to Poll admin for 'default front-end storage method' if demand is there for it. - $text .= " + $text .= "
- -
- ". $frm->radio('multipleChoice',$opts, vartrue($_POST['multipleChoice'], 0) ).$frm->hidden('storageMethod',1)." -
-
- + +
+ ". $frm->radio('multipleChoice',$opts, vartrue($_POST['multipleChoice'], 0) ).$frm->hidden('storageMethod', 1)." +
+
"; return $text;