static function listitems($option, $pkg, &$form, $page, &$rows, $prevmode, &$checkedIds) { global $ff_processor, $ff_mospath, $ff_mossite, $ff_admicon, $ff_comsite, $ff_config, $ff_request, $ff_version, $database, $my; $mainframe = JFactory::getApplication(); $database = JFactory::getDBO(); $ff_mossite = JURI::root(); ?> <script type="text/javascript"> <!-- var bf_submitbutton = function(pressbutton) { var form = document.adminForm; switch (pressbutton) { case 'close': location.href="index.php?option=com_breezingforms&act=manageforms"; return; break; case 'copy': case 'move': case 'publish': case 'unpublish': case 'remove': if (form.boxchecked.value==0) { alert("<?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SELELEMENTS'); ?> "); return; } // if break; default: break; } // switch switch (pressbutton) { case 'share': form.act.value = 'share'; break; case 'sort': if (!confirm("<?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ASKSORT'); ?> ")) return; break; case 'remove': if (!confirm("<?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ASKDELELEMENTS'); ?> ")) return; break; case 'delpage': if (!confirm("<?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ASKDELPAGE'); ?> ")) return; break; case 'movepos': if (form.movepixels.value=='') { alert("<?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_ENTPIXMOVE'); ?> "); return; } // if var nonDigits = /\D/; if (nonDigits.test(form.movepixels.value)) { alert("<?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_PIXMOVEINT'); ?> "); return; } // if break; default: break; } // switch submitform(pressbutton); }; // submitbutton if(typeof Joomla != "undefined"){ Joomla.submitbutton = bf_submitbutton; } submitbutton = bf_submitbutton; function changepage(newpage) { document.adminForm.page.value = newpage; submitform(''); } // changepage function listItemTask( id, task ) { var f = document.adminForm; cb = eval( 'f.' + id ); if (cb) { for (i = 0; true; i++) { cbx = eval('f.cb'+i); if (!cbx) break; cbx.checked = false; } // for cb.checked = true; f.boxchecked.value = 1; submitbutton(task); } return false; } // listItemTask <?php if ($form->prevmode > 0) { ?> ff_coords = [ <?php for ($i = 0; $i < count($rows); $i++) { $row = $rows[$i]; if ($i) { echo ",\n"; } echo "\t\t\t\t[" . intval(isVisibleElement($row->type)) . ',' . intval($row->posx) . ',' . intval($row->posx) . ',' . intval($row->posxmode) . ',' . intval($row->posy) . ',' . intval($row->posy) . ',' . intval($row->posymode) . ']'; } // for if ($i) { echo "\n"; } else { echo "\t\t\t\t0"; } ?> ]; var highlightTmpColor = ""; var highlightTmpPadding = ""; function highlightElement( elementIndex ){ var f = document.adminForm; <?php if ($ff_config->stylesheet) { ?> var fd = ff_prevframe.document; <?php } else { ?> var fd = document; <?php } // endif ?> var cb = eval('f.cb'+elementIndex); highlightTmpColor = fd.getElementById('ff_div'+cb.value).style.backgroundColor; highlightTmpPadding = fd.getElementById('ff_div'+cb.value).style.padding; fd.getElementById('ff_div'+cb.value).style.backgroundColor = "red"; fd.getElementById('ff_div'+cb.value).style.padding = "5px"; } function unhighlightElement( elementIndex ){ var f = document.adminForm; <?php if ($ff_config->stylesheet) { ?> var fd = ff_prevframe.document; <?php } else { ?> var fd = document; <?php } // endif ?> var cb = eval('f.cb'+elementIndex); fd.getElementById('ff_div'+cb.value).style.backgroundColor = highlightTmpColor; fd.getElementById('ff_div'+cb.value).style.padding = highlightTmpPadding; } function moveElements(direction) { var f = document.adminForm; var step = parseInt(f.id_movepixels.value); if (step==0) return; <?php if ($ff_config->stylesheet) { ?> var fd = ff_prevframe.document; <?php } else { ?> var fd = document; <?php } // endif ?> var i; for (i = 0; i < <?php echo count($rows); ?> ; i++) { var cb = eval('f.cb'+i); if (cb.checked && ff_coords[i][0]) { var el = fd.getElementById('ff_div'+cb.value).style; var x,y,u; switch (direction) { case 'left': x = ff_coords[i][2]; if (ff_coords[i][3]) u = '%'; else u = 'px'; if (x >= 0) { if (x > step) x -= step; else x = 0; el.left = x+u; } else { x -= step; el.right = (-x)+u; } // if ff_coords[i][2] = x; break; case 'right': x = ff_coords[i][2]; if (ff_coords[i][3]) u = '%'; else u = 'px'; if (x >= 0) { x += step; el.left = x+u; } else { if ((-x) > step) x += step; else x = -1; el.right = (-y)+u; } // if ff_coords[i][2] = x; break; case 'up': y = ff_coords[i][5]; if (ff_coords[i][6]) u = '%'; else u = 'px'; if (y >= 0) { if (y > step) y -= step; else y = 0; el.top = y+u; } else { y -= step; el.bottom = (-y)+u; } // if ff_coords[i][5] = y; break; case 'down': y = ff_coords[i][5]; if (ff_coords[i][6]) u = '%'; else u = 'px'; if (y >= 0) { y += step; el.top = y+u; } else { if ((-y) > step) y += step; else y = -1; el.bottom = (-y)+u; } // if ff_coords[i][5] = y; break; default:; } // switch } // if } // for var disabled = true; for (i = 0; i < <?php echo count($rows); ?> ; i++) if (ff_coords[i][1]!=ff_coords[i][2] || ff_coords[i][4]!=ff_coords[i][5]) { disabled = false; break; } // if f.savepos.disabled = disabled; f.restpos.disabled = disabled; } // moveElements function savePositions() { var f = document.adminForm; <?php if ($ff_config->stylesheet) { ?> var fd = ff_prevframe.document; <?php } else { ?> var fd = document; <?php } // endif ?> var i; var pos = ''; for (i = 0; i < <?php echo count($rows); ?> ; i++) if (ff_coords[i][1]!=ff_coords[i][2] || ff_coords[i][4]!=ff_coords[i][5]) { var cb = eval('f.cb'+i); var el = fd.getElementById('ff_div'+cb.value).style; if (pos != '') pos += ','; pos += cb.value+','+ff_coords[i][2]+','+ff_coords[i][5]; } // if f.movepositions.value = pos; submitbutton('movepos'); } // savePositions function restorePositions() { var f = document.adminForm; <?php if ($ff_config->stylesheet) { ?> var fd = ff_prevframe.document; <?php } else { ?> var fd = document; <?php } // endif ?> var i; for (i = 0; i < <?php echo count($rows); ?> ; i++) if (ff_coords[i][1]!=ff_coords[i][2] || ff_coords[i][4]!=ff_coords[i][5]) { var cb = eval('f.cb'+i); var el = fd.getElementById('ff_div'+cb.value).style; var x = ff_coords[i][2] = ff_coords[i][1]; var y = ff_coords[i][5] = ff_coords[i][4]; var u; if (ff_coords[i][3]) u = '%'; else u = 'px'; if (x >= 0) el.left = x+u; else el.right = (-x)+u; if (ff_coords[i][6]) u = '%'; else u = 'px'; if (y >= 0) el.top = y+u; else el.bottom = (-y)+u; } // if f.savepos.disabled = true; f.restpos.disabled = true; } // restorePositions <?php } // endif ?> <?php if ($prevmode == 'submit') { ?> onload = function() { submitform(''); } // onload <?php } // endif ?> //--> </script> <div id="overDiv" style="position:absolute;visibility:hidden;z-index:1000;"></div> <?php //echo bf_alert('Get BreezingForms Full Version', 'http://crosstec.de/en/extensions/joomla-forms-download.html'); ?> <?php //echo bf_alert('More features, no footers, no messages', 'http://crosstec.de/en/extensions/joomla-forms-download.html'); ?> <table cellpadding="4" cellspacing="1" border="0"> <tr> <td nowrap> <table class="adminheading"> <tr><th class="edit" nowrap>BreezingForms <?php echo $ff_version; ?> <br/><span class="componentheading"><?php echo $form->title; ?> <?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_PAGE'); ?> <?php echo $page; ?> </span></th></tr> </table> </td> <td width="100%" align="right" nowrap> <?php JToolBarHelper::custom('new', 'new.png', 'new_f2.png', BFText::_('COM_BREEZINGFORMS_TOOLBAR_NEW'), false); JToolBarHelper::custom('editform', 'edit.png', 'edit_f2.png', BFText::_('COM_BREEZINGFORMS_TOOLBAR_EDITFORM'), false); JToolBarHelper::custom('copy', 'copy.png', 'copy_f2.png', BFText::_('COM_BREEZINGFORMS_TOOLBAR_COPY'), false); JToolBarHelper::custom('move', 'move.png', 'move_f2.png', BFText::_('COM_BREEZINGFORMS_TOOLBAR_MOVE'), false); JToolBarHelper::custom('publish', 'publish.png', 'publish_f2.png', BFText::_('COM_BREEZINGFORMS_TOOLBAR_PUBLISH'), false); JToolBarHelper::custom('unpublish', 'unpublish.png', 'unpublish_f2.png', BFText::_('COM_BREEZINGFORMS_TOOLBAR_UNPUBLISH'), false); JToolBarHelper::custom('remove', 'delete.png', 'delete_f2.png', BFText::_('COM_BREEZINGFORMS_TOOLBAR_DELETE'), false); JToolBarHelper::custom('close', 'cancel.png', 'cancel_f2.png', BFText::_('COM_BREEZINGFORMS_TOOLBAR_QUICKMODE_CLOSE'), false); ?> </td> </tr> </table> <form action="index.php" method="post" name="adminForm" id="adminForm" class="adminForm"> <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist table table-striped"> <tr> <th nowrap align="center"><input type="checkbox" name="toggle" value="" onclick="<?php $version = new JVersion(); echo version_compare($version->getShortVersion(), '3.0', '>=') ? 'Joomla.checkAll(this);' : 'checkAll(' . count($rows) . ');'; ?> " /></th> <th nowrap align="left"><?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TITLE'); ?> </th> <th nowrap align="left"><?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_NAME'); ?> </th> <th nowrap align="left"><?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_TYPE'); ?> </th> <th nowrap align="center"><?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_PUBLISHED'); ?> </th> <th nowrap align="center" colspan="2"><a href="#sort" onclick="submitbutton('sort')"><?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_REORDER'); ?> </a></th> <th nowrap align="center">X</th> <th nowrap align="center">Y</th> <th nowrap align="center"><?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SCRIPTID'); ?> </th> <th width="100%"></th> </tr> <?php $k = 0; $boxchecked = 0; for ($i = 0; $i < count($rows); $i++) { $row = $rows[$i]; $checked = ''; if (in_array($row->id, $checkedIds)) { $checked = 'checked="checked"'; $boxchecked++; } // if ?> <tr class="row<?php echo $k; ?> "> <td nowrap align="center"><input type="checkbox" id="cb<?php echo $i; ?> " name="ids[]" value="<?php echo $row->id; ?> " onclick="<?php jimport('joomla.version'); $version = new JVersion(); echo version_compare($version->getShortVersion(), '3.0', '>=') ? 'Joomla.isChecked(this.checked);' : 'isChecked(this.checked);'; ?> " <?php echo $checked; ?> /></td> <td nowrap align="left"><div id="hoverItem_ff_div<?php echo $row->id; ?> "><a href="#edit" onmouseout="unhighlightElement(<?php echo $i; ?> )" onmouseover="highlightElement(<?php echo $i; ?> )" onclick="return listItemTask('cb<?php echo $i; ?> ','edit')"><?php echo $row->title; ?> </a></div></td> <td nowrap align="left"><?php echo $row->name; ?> </td> <td nowrap align="left"><?php echo HTML_facileFormsElement::displayType($row->type); ?> </td> <td nowrap align="center"> <?php if ($row->published == "1") { echo "<a href=\"#unpublish\" onClick=\"return listItemTask('cb" . $i . "','unpublish')\"><img src=\"components/com_breezingforms/images/icons/publish_g.png\" alt=\"+\" border=\"0\" /></a>"; } else { echo "<a href=\"#publish\" onClick=\"return listItemTask('cb" . $i . "','publish')\"><img src=\"components/com_breezingforms/images/icons/publish_x.png\" alt=\"-\" border=\"0\" /></a>"; } // if ?> </td> <td nowrap align="right"> <?php if ($i > 0) { echo "<a href=\"#orderup\" onClick=\"return listItemTask('cb" . $i . "','orderup')\"><img src=\"components/com_breezingforms/images/icons/uparrow.png\" alt=\"^\" border=\"0\" /></a>"; } ?> </td> <td nowrap align="left"> <?php if ($i < count($rows) - 1) { echo "<a href=\"#orderdown\" onClick=\"return listItemTask('cb" . $i . "','orderdown')\"><img src=\"components/com_breezingforms/images/icons/downarrow.png\" alt=\"v\" border=\"0\" /></a>"; } ?> </td> <td nowrap align="right"><?php echo $row->posx; if ($row->posxmode) { echo '%'; } else { echo 'px'; } ?> </td> <td nowrap align="right"><?php echo $row->posy; if ($row->posymode) { echo '%'; } else { echo 'px'; } ?> </td> <td nowrap align="right"><?php echo $row->id; ?> </td> <td></td> </tr> <?php $k = 1 - $k; } // for ?> </table> <?php if ($form->prevmode > 0) { if ($form->prevmode == 1) { ?> <br /> <br /> <?php } else { ?> <script type="text/javascript" src="<?php echo JURI::root() . 'administrator/components/com_breezingforms/libraries/wz_dragdrop/wz_dragdrop.js'; ?> "></script> <!-- BEGIN OF SURFACE --> <div id="SelectOptionDialog" style="background-color: #cccccc;position:absolute;top:233px;right:15px;z-index:100;"> <?php } ?> <table cellpadding="4" cellspacing="1" border="0" class="adminform" style="width:100%;"> <tr><th colspan="2" class="title">BreezingForms - <?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_PAGELAY'); ?> </th></tr> <tr> <td colspan="2"> <table class="menubar" cellpadding="3" cellspacing="0" border="0"> <tr><td nowrap class="menudottedline" align="right"> <input class="btn btn-warning" onclick="submitbutton('addbefore');" type="submit" value="<?php echo htmlentities(BFText::_('COM_BREEZINGFORMS_ELEMENTS_ADDPAGEBEFORE'), ENT_QUOTES, 'UTF-8'); ?> "/> <input class="btn btn-warning" onclick="submitbutton('addbehind');" type="submit" value="<?php echo htmlentities(BFText::_('COM_BREEZINGFORMS_ELEMENTS_ADDPAGEBEHIND'), ENT_QUOTES, 'UTF-8'); ?> "/> <?php if ($form->pages > 1) { ?> <input class="btn btn-primary" onclick="submitbutton('movepage');" type="submit" value="<?php echo htmlentities(BFText::_('COM_BREEZINGFORMS_ELEMENTS_MOVEPG'), ENT_QUOTES, 'UTF-8'); ?> "/> <input class="btn btn-primary" onclick="submitbutton('delpage');" type="submit" value="<?php echo htmlentities(BFText::_('COM_BREEZINGFORMS_ELEMENTS_DELPAGE'), ENT_QUOTES, 'UTF-8'); ?> "/> <?php } // if ?> </td></tr> </table> </td> </tr> <tr> <td valign="top"> <table class="menubar" cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap colspan="5" style="text-align:center"> <?php if ($form->prevmode == 2) { ?> <?php echo BFText::_('COM_BREEZINGFORMS_DRAGGING'); ?> <br/> <?php echo BFText::_('COM_BREEZINGFORMS_DRAGGING_ON'); ?> <input type="radio" id="draggingEnabled" name="dragToggle" onclick="dd.elements.SelectOptionDialog.setDraggable(true);"/> <?php echo BFText::_('COM_BREEZINGFORMS_DRAGGING_OFF'); ?> <input id="draggingDisabled" checked type="radio" name="dragToggle" onclick="dd.elements.SelectOptionDialog.setDraggable(false);"/> <br/> <?php } ?> <input type="checkbox" id="gridshow" name="gridshow" onclick="submitbutton('gridshow');" value="1"<?php if ($ff_config->gridshow == 1) { echo ' checked="checked"'; } ?> /><label for="gridshow"> <?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_GRID'); ?> </label> <hr/> </td> </tr> <tr> <td nowrap colspan="5" style="text-align:center"> <?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_MOVEPIX'); ?> :<br/> <input type="text" size="6" maxlength="6" id="id_movepixels" name="movepixels" value="<?php echo is_int($ff_config->movepixels) ? is_int($ff_config->movepixels) : 5; ?> " class="inputbox"/> <br/> </td> </tr> <tr> <td></td> <td></td> <td align="center"> <a href="javascript:moveElements('up');"> <img src="<?php echo $ff_admicon; ?> /moveup_f2.png" width="16" height="16" alt="up" name="moveup" border="0" align="middle" /> </a> </td> <td></td> <td></td> </tr> <tr> <td></td> <td> <a href="javascript:moveElements('left');"> <img src="<?php echo $ff_admicon; ?> /movelt_f2.png" width="16" height="16" alt="left" name="moveleft" border="0" align="middle" /> </a> </td> <td></td> <td align="right"> <a href="javascript:moveElements('right');"> <img src="<?php echo $ff_admicon; ?> /movert_f2.png" width="16" height="16" alt="right" name="moveright" border="0" align="middle" /> </a> </td> <td></td> </tr> <tr> <td></td> <td></td> <td align="center"> <a href="javascript:moveElements('down');"> <img src="<?php echo $ff_admicon; ?> /movedn_f2.png" width="16" height="16" alt="down" name="movedown" border="0" align="middle" /> </a> </td> <td></td> <td><hr/></td> </tr> <tr> <td colspan="5" style="text-align:center"> <input class="btn btn-primary" id="savepos" type="button" value="<?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_SAVE'); ?> " onclick="savePositions();" disabled="disabled"/><br/> <hr/> <input class="btn btn-primary" id="restpos" type="button" value="<?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_RESTORE'); ?> " onclick="restorePositions();" disabled="disabled"/> <hr/> </td> </tr> <tr> <td colspan="5" style="text-align:center"> <?php for ($p = 1; $p <= $form->pages; $p++) { $attribute = ''; if ($p == $page) { $attribute = 'disabled="disabled"'; } echo '<input class="btn btn-primary" type="button" value="' . BFText::_('COM_BREEZINGFORMS_ELEMENTS_PAGE') . ' ' . $p . '" onclick="changepage(\'' . $p . '\');" ' . $attribute . '/><br/>'; } // for ?> </td> </tr> </table> </td> <td align="center"> <?php if ($ff_config->stylesheet) { // compose iframe url $url = $ff_mossite . 'index.php' . '?option=com_breezingforms' . '&tmpl=component' . '&Itemid=0' . '&ff_form=' . $form->id . '&ff_frame=1' . '&ff_runmode=' . _FF_RUNMODE_PREVIEW . '&ff_page=' . $page; reset($ff_request); while (list($prop, $val) = each($ff_request)) { $url .= '&' . $prop . '=' . urlencode($val); } // prepare iframe width $framewidth = 'width="'; if ($form->widthmode) { $framewidth .= $form->prevwidth . '" '; } else { $framewidth .= $form->width . '" '; } // prepare iframe height $frameheight = ''; if (!$form->heightmode) { $frameheight = 'height="' . $form->height . '" '; } // assemble iframe parameters $params = 'name="ff_prevframe" ' . 'id="ff_prevframe" ' . 'src="' . $url . '" ' . $framewidth . $frameheight . 'frameborder="0" ' . 'scrolling="no"'; ?> <iframe <?php echo $params; ?> > <p><?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BROWSER1'); ?> </p> <p><?php echo BFText::_('COM_BREEZINGFORMS_ELEMENTS_BROWSER2'); ?> </p> </iframe> <?php } else { $tstyle = ' style="'; $dstyle = ''; if ($form->widthmode) { $tstyle .= 'width:' . $form->prevwidth . 'px;'; } else { $tstyle .= 'width:' . $form->width . 'px;'; $dstyle .= 'width:' . $form->width . 'px;'; } // else if (!$form->heightmode) { $tstyle .= 'height:' . $form->height . 'px;'; $dstyle .= 'height:' . $form->height . 'px;'; } // if $tstyle .= '"'; ?> <table cellpadding="0" cellspacing="0" border="0"<?php echo $tstyle; ?> > <tr><td> <div style="position:relative;left:0px;top:0px;<?php echo $dstyle; ?> "> <?php $myUser = JFactory::getUser(); $database->setQuery("select id from #__users where lower(username)=lower('" . $myUser->get('username', '') . "')"); $id = $database->loadResult(); if ($id) { $myUser->get('id', -1); } $curdir = getcwd(); chdir($ff_mospath); $ff_processor = new HTML_facileFormsProcessor(_FF_RUNMODE_PREVIEW, false, $form->id, $page, $option); if ($prevmode == 'submit') { $ff_processor->submit(); } else { $ff_processor->view(); } chdir($curdir); ?> </div> </td></tr> </table> <?php } // if ?> </td> </tr> </table> <?php if ($form->prevmode == 2) { ?> </div> <script type="text/javascript"> <!-- SET_DHTML('SelectOptionDialog'); dd.elements.SelectOptionDialog.setDraggable(false); //--> </script> <input type="hidden" id="ff_itemPositions" name="ff_itemPositions" value=""/> <?php } // if } // if $form->prevmode > 0 ?> <input type="hidden" name="boxchecked" value="<?php echo $boxchecked; ?> " /> <input type="hidden" name="pkg" value="<?php echo $pkg; ?> " /> <input type="hidden" name="option" value="<?php echo $option; ?> " /> <input type="hidden" name="act" value="editpage" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="form" value="<?php echo $form->id; ?> " /> <input type="hidden" name="page" value="<?php echo $page; ?> " /> <input type="hidden" name="movepositions" value="" /> </form> <?php }
$database->setQuery("select id from #__users where lower(username)=lower('".$myUser->get('username','')."')"); $id = $database->loadResult(); if ($id) $myUser->get('id',-1); require_once($ff_compath.'/facileforms.process.php'); if ($task == 'view') { echo '<div id="overDiv" style="position:absolute;visibility:hidden;z-index:1000;"></div>'."\n"; $divstyle = 'width:'.$form->width; $divstyle .= ($form->widthmode) ? '%;' : 'px;';; if (!$form->heightmode) $divstyle .= 'height:'.$form->height.'px;'; $tablestyle = ($divstyle=='') ? '' : ' style="'.$divstyle.'"'; echo '<table cellpadding="0" cellspacing="0" border="'.$border.'"'.$tablestyle.'>'."\n". "<tr><td>\n". '<div style="left:0px;top:0px;'.$divstyle.'position:relative;">'."\n"; } // if $curdir = getcwd(); chdir($ff_mospath); $ff_processor = new HTML_facileFormsProcessor( _FF_RUNMODE_BACKEND, false, $form->id, $page, $option, null, $border ); chdir($curdir); if ($task == 'submit') $ff_processor->submit(); else { $ff_processor->view(); echo "</div>\n</td></tr>\n</table>\n"; } // if } // if ?>
public function process(&$dataObject, $parent = null, $parentPage = null, $index = 0, $childrenLength = 0) { if (isset($dataObject['attributes']) && isset($dataObject['properties'])) { $options = array('type' => 'normal', 'displayType' => 'breaks'); if ($parent != null && $parent['type'] == 'section') { $options['type'] = $parent['bfType']; $options['displayType'] = $parent['displayType']; } $class = ' class="bfBlock"'; $wrapper = 'bfWrapperBlock'; if ($options['displayType'] == 'inline') { $class = ' class="bfInline"'; $wrapper = 'bfWrapperInline'; } $mdata = $dataObject['properties']; if ($mdata['type'] == 'page') { $parentPage = $mdata; if ($parentPage['pageNumber'] > 1) { echo '</div><!-- bfPage end -->' . "\n"; // closing previous pages } $display = ' style="display:none;"'; if (JRequest::getInt('ff_form_submitted', 0) == 0 && JRequest::getInt('ff_page', 1) == $parentPage['pageNumber']) { $display = ''; } else { if (JRequest::getInt('ff_form_submitted', 0) == 1 && $this->rootMdata['lastPageThankYou'] && $parentPage['pageNumber'] == count($this->dataObject['children'])) { $display = ''; } else { if (JRequest::getInt('ff_form_submitted', 0) == 1 && false == $this->rootMdata['lastPageThankYou'] && $parentPage['pageNumber'] == 1) { $display = ''; } } } echo '<div id="bfPage' . $parentPage['pageNumber'] . '" class="bfPage"' . $display . '>' . "\n"; // opening current page /* translatables */ if (isset($mdata['pageIntro_translation' . $this->language_tag]) && $mdata['pageIntro_translation' . $this->language_tag] != '') { $mdata['pageIntro'] = $mdata['pageIntro_translation' . $this->language_tag]; } /* translatables end */ if (trim($mdata['pageIntro']) != '') { echo '<div class="bfPageIntro">' . "\n"; $regex = '/{loadposition\\s+(.*?)}/i'; $introtext = $mdata['pageIntro']; preg_match_all($regex, $introtext, $matches, PREG_SET_ORDER); jimport('joomla.version'); $version = new JVersion(); if ($matches && version_compare($version->getShortVersion(), '1.6', '>=')) { $document = JFactory::getDocument(); $renderer = $document->loadRenderer('modules'); $options = array('style' => 'xhtml'); foreach ($matches as $match) { $matcheslist = explode(',', $match[1]); $position = trim($matcheslist[0]); $output = $renderer->render($position, $options, null); $introtext = preg_replace("|{$match['0']}|", addcslashes($output, '\\'), $introtext, 1); } } echo $introtext . "\n"; echo '</div><div style="padding-bottom: 10px;"></div>' . "\n"; } if (!$this->useErrorAlerts) { echo '<span class="bfErrorMessage" style="color: red; display:none;"></span>' . "\n"; } } else { if ($mdata['type'] == 'section') { if (isset($dataObject['properties']['name']) && isset($mdata['off']) && $mdata['off']) { echo '<script type="text/javascript"><!--' . "\n" . 'bfDeactivateSection.push("' . $dataObject['properties']['name'] . '");' . "\n" . '//--></script>' . "\n"; } /* translatables */ if (isset($mdata['title_translation' . $this->language_tag]) && $mdata['title_translation' . $this->language_tag] != '') { $mdata['title'] = $mdata['title_translation' . $this->language_tag]; } /* translatables end */ if ($mdata['bfType'] == 'section') { echo '<div data-theme="b" data-role="collapsible-set"' . (isset($mdata['off']) && $mdata['off'] ? ' style="display:none" ' : '') . (isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != "" ? ' id="' . $dataObject['properties']['name'] . '"' : '') . '><div data-role="collapsible" data-collapsed="false">' . "\n"; if (trim($mdata['title']) != '') { echo '<h3>' . htmlentities(trim($mdata['title']), ENT_QUOTES, 'UTF-8') . '</h3>' . "\n"; } } else { if ($mdata['bfType'] == 'normal') { if (isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != '') { echo '<div ' . (isset($mdata['off']) && $mdata['off'] ? 'style="display:none" ' : '') . 'class="bfNoSection"' . (isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != "" ? ' id="' . $dataObject['properties']['name'] . '"' : '') . '>' . "\n"; } } } /* translatables */ if (isset($mdata['description_translation' . $this->language_tag]) && $mdata['description_translation' . $this->language_tag] != '') { $mdata['description'] = $mdata['description_translation' . $this->language_tag]; } /* translatables end */ if (trim($mdata['description']) != '') { echo '<div>' . "\n"; $regex = '/{loadposition\\s+(.*?)}/i'; $introtext = $mdata['description']; preg_match_all($regex, $introtext, $matches, PREG_SET_ORDER); jimport('joomla.version'); $version = new JVersion(); if ($matches && version_compare($version->getShortVersion(), '1.6', '>=')) { $document = JFactory::getDocument(); $renderer = $document->loadRenderer('modules'); $options = array('style' => 'xhtml'); foreach ($matches as $match) { $matcheslist = explode(',', $match[1]); $position = trim($matcheslist[0]); $output = $renderer->render($position, $options, null); $introtext = preg_replace("|{$match['0']}|", addcslashes($output, '\\'), $introtext, 1); } } echo $introtext . "\n"; echo '</div><div style="padding-bottom: 10px;"></div>' . "\n"; } } else { if ($mdata['type'] == 'element') { //echo '<div class="bfElemWrap"'.(isset($mdata['off']) && $mdata['off'] ? ' style="display:none" ' : '').'>'; // if labels left if (true) { echo '<div' . (isset($mdata['off']) && $mdata['off'] ? ' style="display:none" ' : '') . ' id="fieldcontain' . $mdata['bfName'] . '" class="bfElemWrap" data-role="fieldcontain">'; } $onclick = ''; if ($mdata['actionClick'] == 1) { $onclick = 'onclick="' . $mdata['actionFunctionName'] . '(this,\'click\');" '; } $onblur = ''; if ($mdata['actionBlur'] == 1) { $onblur = 'onblur="' . $mdata['actionFunctionName'] . '(this,\'blur\');" '; } $onchange = ''; if ($mdata['actionChange'] == 1) { $onchange = 'onchange="' . $mdata['actionFunctionName'] . '(this,\'change\');" '; } $onfocus = ''; if ($mdata['actionFocus'] == 1) { $onfocus = 'onfocus="' . $mdata['actionFunctionName'] . '(this,\'focus\');" '; } $onselect = ''; if (isset($mdata['actionSelect']) && $mdata['actionSelect'] == 1) { $onselect = 'onselect="' . $mdata['actionFunctionName'] . '(this,\'select\');" '; } $legend = ''; if (!$mdata['hideLabel'] && $mdata['bfType'] != 'bfPayPal' && $mdata['bfType'] != 'bfSofortueberweisung') { $maxlengthCounter = ''; if ($mdata['bfType'] == 'bfTextarea' && isset($mdata['maxlength']) && $mdata['maxlength'] > 0 && isset($mdata['showMaxlengthCounter']) && $mdata['showMaxlengthCounter']) { $maxlengthCounter = ' <span class=***bfMaxLengthCounter*** id=***bfMaxLengthCounter' . $mdata['dbId'] . '***>(' . $mdata['maxlength'] . ' ' . BFText::_('COM_BREEZINGFORMS_CHARS_LEFT') . ')</span>'; } $for = ''; if ($mdata['bfType'] == 'bfTextfield' || $mdata['bfType'] == 'bfTextarea' || $mdata['bfType'] == 'bfCheckbox' || $mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfCalendar' || $mdata['bfType'] == 'bfCalendarReponsive' || $mdata['bfType'] == 'bfSelect' || $mdata['bfType'] == 'bfRadioGroup' || $mdata['bfType'] == 'bfFile' && (!isset($mdata['flashUploader']) && !isset($mdata['html5']) || isset($mdata['flashUploader']) && !$mdata['flashUploader'] && (isset($mdata['html5']) && !$mdata['html5']))) { $for = 'for="ff_elem' . $mdata['dbId'] . '"'; } if ($mdata['bfType'] == 'bfCaptcha' || $mdata['bfType'] == 'bfReCaptcha') { $for = 'for="bfCaptchaEntry"'; if (JFactory::getApplication()->isSite()) { $captcha_url = JURI::root(true) . '/components/com_breezingforms/images/captcha/securimage_show.php'; } else { $captcha_url = JURI::root(true) . '/administrator/components/com_breezingforms/images/captcha/securimage_show.php'; } echo '<div align="center"><img alt="" border="0" width="230" id="ff_capimgValue" class="ff_capimg" src="' . $captcha_url . '"/></div><br/>' . "\n"; } //else if($mdata['bfType'] == 'bfReCaptcha'){ // $for = 'for="recaptcha_response_field"'; //} $req = ''; if ($mdata['required']) { $req = '<span class="bfRequired"> * </span>' . "\n"; } /* translatables */ if (isset($mdata['label_translation' . $this->language_tag]) && $mdata['label_translation' . $this->language_tag] != '') { $mdata['label'] = $mdata['label_translation' . $this->language_tag]; } /* translatables end */ $labelText = trim($mdata['label']) . $req . str_replace("***", "\"", $maxlengthCounter); if (true && ($mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfRadioGroup')) { $legend = '<legend id="bfLabel' . $mdata['dbId'] . '">' . str_replace("***", "\"", $labelText) . '</legend>' . "\n"; } else { if ($mdata['bfType'] == 'bfSummarize') { $legend = $labelText; } else { echo '<label id="bfLabel' . $mdata['dbId'] . '" ' . $for . '>' . str_replace("***", "\"", $labelText) . '</label>' . "\n"; } } } $readonly = ''; if ($mdata['readonly']) { $readonly = 'readonly="readonly" '; } $tabIndex = ''; if ($mdata['tabIndex'] != -1 && is_numeric($mdata['tabIndex'])) { $tabIndex = 'tabindex="' . intval($mdata['tabIndex']) . '" '; } for ($i = 0; $i < $this->p->rowcount; $i++) { $row = $this->p->rows[$i]; if ($mdata['bfName'] == $row->name) { if ((isset($mdata['value']) || isset($mdata['list']) || isset($mdata['group'])) && ($mdata['bfType'] == 'bfTextfield' || $mdata['bfType'] == 'bfTextarea' || $mdata['bfType'] == 'bfCheckbox' || $mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfSubmitButton' || $mdata['bfType'] == 'bfHidden' || $mdata['bfType'] == 'bfCalendar' || $mdata['bfType'] == 'bfCalendarResponsive' || $mdata['bfType'] == 'bfSelect' || $mdata['bfType'] == 'bfRadioGroup')) { if ($mdata['bfType'] == 'bfSelect') { $mdata['list'] = $this->p->replaceCode($row->data2, "data2 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } else { if ($mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfRadioGroup') { $mdata['group'] = $this->p->replaceCode($row->data2, "data2 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } else { $mdata['value'] = $this->p->replaceCode($row->data1, "data1 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } } } if (isset($mdata['checked']) && $mdata['bfType'] == 'bfCheckbox') { $mdata['checked'] = $row->flag1 == 1 ? true : false; } break; } } $flashUploader = ''; switch ($mdata['bfType']) { case 'bfTextfield': $type = 'text'; if ($mdata['password']) { $type = 'password'; } $maxlength = ''; if (is_numeric($mdata['maxLength'])) { $maxlength = 'maxlength="' . intval($mdata['maxLength']) . '" '; } /* translatables */ if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['value_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } if (isset($mdata['placeholder_translation' . $this->language_tag]) && $mdata['placeholder_translation' . $this->language_tag] != '') { $mdata['placeholder'] = $mdata['placeholder_translation' . $this->language_tag]; } /* translatables end */ echo '<input ' . (isset($mdata['placeholder']) && $mdata['placeholder'] ? 'placeholder="' . htmlentities($mdata['placeholder'], ENT_QUOTES, 'UTF-8') . '" ' : '') . 'class="ff_elem" ' . $tabIndex . $maxlength . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; if ($mdata['mailbackAsSender']) { echo '<input type="hidden" name="mailbackSender[' . $mdata['bfName'] . ']" value="true"/>' . "\n"; } break; case 'bfTextarea': $width = ''; if ($mdata['width'] != '') { $width = 'width:' . htmlentities(strip_tags($mdata['width'])) . ' !important; min-width:' . htmlentities(strip_tags($mdata['width'])) . ' !important;'; } $height = ''; if ($mdata['height'] != '') { $height = 'height:' . htmlentities(strip_tags($mdata['height'])) . ';'; } $size = ''; if ($height != '' || $width != '') { $size = 'style="' . $width . $height . '" '; } $onkeyup = ''; if (isset($mdata['maxlength']) && $mdata['maxlength'] > 0) { $onkeyup = 'onkeyup="bfCheckMaxlength(' . intval($mdata['dbId']) . ', ' . intval($mdata['maxlength']) . ', ' . (isset($mdata['showMaxlengthCounter']) && $mdata['showMaxlengthCounter'] ? 'true' : 'false') . ')" '; } /* translatables */ if (isset($mdata['placeholder_translation' . $this->language_tag]) && $mdata['placeholder_translation' . $this->language_tag] != '') { $mdata['placeholder'] = $mdata['placeholder_translation' . $this->language_tag]; } if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['placeholder_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } /* translatables end */ echo '<textarea ' . (isset($mdata['placeholder']) && $mdata['placeholder'] ? 'placeholder="' . htmlentities($mdata['placeholder'], ENT_QUOTES, 'UTF-8') . '" ' : '') . 'cols="20" rows="5" class="ff_elem" ' . $onkeyup . $size . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '">' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '</textarea>' . "\n"; break; case 'bfRadioGroup': /* translatables */ if (isset($mdata['group_translation' . $this->language_tag]) && $mdata['group_translation' . $this->language_tag] != '') { $mdata['group'] = $mdata['group_translation' . $this->language_tag]; } /* translatables end */ if ($mdata['group'] != '') { $mdata['group'] = str_replace("\r", '', $mdata['group']); $gEx = explode("\n", $mdata['group']); $lines = count($gEx); $wrapOpen = '<div data-role="fieldcontain">' . "\n" . '<fieldset ' . ($lines <= 3 ? 'data-type="horizontal" ' : '') . 'data-role="controlgroup">' . $legend . "\n"; $wrapClose = '</fieldset>' . "\n" . '</div>' . "\n"; echo $wrapOpen; for ($i = 0; $i < $lines; $i++) { $idExt = $i != 0 ? '_' . $i : ''; $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if ($iCnt == 3) { $lblRight = '<label class="bfGroupLabel" id="bfGroupLabel' . $mdata['dbId'] . $idExt . '" for="ff_elem' . $mdata['dbId'] . $idExt . '">' . trim($iEx[1]) . '</label>'; echo '<input ' . ($iEx[0] == 1 ? 'checked="checked" ' : '') . ' class="ff_elem" ' . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="radio" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . $idExt . '"/>' . $lblRight . "\n"; } } echo $wrapClose; } break; case 'bfCheckboxGroup': /* translatables */ if (isset($mdata['group_translation' . $this->language_tag]) && $mdata['group_translation' . $this->language_tag] != '') { $mdata['group'] = $mdata['group_translation' . $this->language_tag]; } /* translatables end */ if ($mdata['group'] != '') { $mdata['group'] = str_replace("\r", '', $mdata['group']); $gEx = explode("\n", $mdata['group']); $lines = count($gEx); $wrapOpen = '<div data-role="fieldcontain">' . "\n" . '<fieldset data-role="controlgroup">' . $legend . "\n"; $wrapClose = '</fieldset>' . "\n" . '</div>' . "\n"; echo $wrapOpen; for ($i = 0; $i < $lines; $i++) { $idExt = $i != 0 ? '_' . $i : ''; $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if ($iCnt == 3) { $lbl = '<label class="bfGroupLabel" id="bfGroupLabel' . $mdata['dbId'] . $idExt . '" for="ff_elem' . $mdata['dbId'] . $idExt . '">' . trim($iEx[1]) . '</label>'; echo '<input ' . ($iEx[0] == 1 ? 'checked="checked" ' : '') . ' class="ff_elem" ' . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="checkbox" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . $idExt . '"/>' . $lbl . "\n"; } } echo $wrapClose; } break; case 'bfCheckbox': echo '<input class="ff_elem" ' . ($mdata['checked'] ? 'checked="checked" ' : '') . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="checkbox" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; if ($mdata['mailbackAccept']) { echo '<input type="hidden" class="ff_elem" name="mailbackConnectWith[' . $mdata['mailbackConnectWith'] . ']" value="true_' . $mdata['bfName'] . '"/>' . "\n"; } break; case 'bfSelect': /* translatables */ if (isset($mdata['list_translation' . $this->language_tag]) && $mdata['list_translation' . $this->language_tag] != '') { $mdata['list'] = $mdata['list_translation' . $this->language_tag]; } /* translatables end */ if ($mdata['list'] != '') { $mdata['list'] = str_replace("\r", '', $mdata['list']); $gEx = explode("\n", $mdata['list']); $lines = count($gEx); // data-native-menu="false" echo '<select class="ff_elem" ' . ($mdata['multiple'] ? 'multiple="multiple" data-native-menu="false" ' : '') . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '">' . "\n"; for ($i = 0; $i < $lines; $i++) { $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if ($iCnt == 3) { echo '<option ' . ($iEx[0] == 1 ? 'selected="selected" ' : '') . 'value="' . htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8') . '">' . htmlentities(trim($iEx[1]), ENT_QUOTES, 'UTF-8') . '</option>' . "\n"; } } echo '</select>' . "\n"; } break; case 'bfFile': if (isset($mdata['flashUploader']) && $mdata['flashUploader'] || isset($mdata['html5']) && $mdata['html5']) { $base = explode('/', JURI::base()); if (isset($base[count($base) - 2]) && $base[count($base) - 2] == 'administrator') { unset($base[count($base) - 2]); $base = array_merge($base); } $base = implode('/', $base); echo '<input type="hidden" id="flashUpload' . $mdata['bfName'] . '" name="flashUpload' . $mdata['bfName'] . '" value="bfFlashFileQueue' . $mdata['dbId'] . '"/>' . "\n"; $this->hasFlashUpload = true; //allowedFileExtensions $allowedExts = explode(',', $mdata['allowedFileExtensions']); $allowedExtsCnt = count($allowedExts); for ($i = 0; $i < $allowedExtsCnt; $i++) { $allowedExts[$i] = $allowedExts[$i]; } $exts = ''; if ($allowedExtsCnt != 0) { $exts = implode(',', $allowedExts); } $bytes = isset($mdata['flashUploaderBytes']) && is_numeric($mdata['flashUploaderBytes']) && $mdata['flashUploaderBytes'] > 0 ? "max_file_size : '" . intval($mdata['flashUploaderBytes']) . "'," : ''; $flashUploader = "\n <span id=\"bfUploadContainer" . $mdata['dbId'] . "\">\n\t\t\t\t\t\t\t<img style=\"cursor: pointer;\" id=\"bfPickFiles" . $mdata['dbId'] . "\" src=\"" . $this->uploadImagePath . "\" border=\"0\" width=\"" . (isset($mdata['flashUploaderWidth']) && is_numeric($mdata['flashUploaderWidth']) && $mdata['flashUploaderWidth'] > 0 ? intval($mdata['flashUploaderWidth']) : '64') . "\" height=\"" . (isset($mdata['flashUploaderHeight']) && is_numeric($mdata['flashUploaderHeight']) && $mdata['flashUploaderHeight'] > 0 ? intval($mdata['flashUploaderHeight']) : '64') . "\"/>\n </span>\n <span id=\"bfUploader" . $mdata['bfName'] . "\"></span>\n <div class=\"bfFlashFileQueueClass\" id=\"bfFlashFileQueue" . $mdata['dbId'] . "\"></div>\n <script type=\"text/javascript\">\n <!--\n\t\t\t\t\t\t\tbfFlashUploaders.push('ff_elem" . $mdata['dbId'] . "');\n var bfFlashFileQueue" . $mdata['dbId'] . " = {};\n function bfUploadImageThumb(file) {\n var img;\n img = new o.Image;\n img.onload = function() {\n img.embed(JQuery('#' + file.id+'thumb').get(0), { \n width: 100, \n height: 60, \n crop: true,\n swf_url: mOxie.resolveUrl('" . $base . "components/com_breezingforms/libraries/jquery/plupload/Moxie.swf')\n });\n };\n\n img.onembedded = function() {\n img.destroy();\n };\n\n img.onerror = function() {\n \n };\n \n img.load(file.getSource());\n \n }\n JQuery(document).ready(\n function() {\n var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/i) ? true : false );\n var uploader = new plupload.Uploader({\n multi_selection: " . (isset($mdata['flashUploaderMulti']) && $mdata['flashUploaderMulti'] ? 'true' : 'false') . ",\n unique_names: iOS,\n chunk_size: '100kb',\n runtimes : '" . (isset($mdata['html5']) && $mdata['html5'] ? 'html5,' : '') . (isset($mdata['flashUploader']) && $mdata['flashUploader'] ? 'flash,' : '') . "html4',\n browse_button : 'bfPickFiles" . $mdata['dbId'] . "',\n container: 'bfUploadContainer" . $mdata['dbId'] . "',\n file_data_name: 'Filedata',\n multipart_params: { form: " . $this->p->form . ", itemName : '" . $mdata['bfName'] . "', bfFlashUploadTicket: '" . $this->flashUploadTicket . "', option: 'com_breezingforms', format: 'html', flashUpload: 'true', Itemid: 0 },\n " . $bytes . "\n url : '" . $base . (BFJoomlaConfig::get('config.sef') && !BFJoomlaConfig::get('config.sef_rewrite') ? 'index.php/' : '') . (JRequest::getCmd('lang', '') && BFJoomlaConfig::get('config.sef') ? JRequest::getCmd('lang', '') . (BFJoomlaConfig::get('config.sef_rewrite') ? 'index.php' : '') : 'index.php') . "',\n flash_swf_url : '" . $base . "components/com_breezingforms/libraries/jquery/plupload/Moxie.swf',\n filters : [\n {title : '" . addslashes(BFText::_('COM_BREEZINGFORMS_CHOOSE_FILE')) . "', extensions : '" . $exts . "'}\n ]\n });\n uploader.bind('FilesAdded', function(up, files) {\n for (var i in files) {\n if(typeof files[i].id != 'undefined' && files[i].id != null){\n var fsize = '';\n if(typeof files[i].size != 'undefined'){\n fsize = '(' + plupload.formatSize(files[i].size) + ') ';\n }\n JQuery('#bfFileQueue').append( '<div id=\"' + files[i].id + 'queue\">' + (iOS ? '' : files[i].name) + ' '+fsize+'<b></b></div>' );\n }\n }\n for (var i in files) {\n if(typeof files[i].id != 'undefined' && files[i].id != null){\n var error = false;\n var fsize = '';\n if(typeof files[i].size != 'undefined'){\n fsize = '(' + plupload.formatSize(files[i].size) + ') ';\n }\n JQuery('#bfFlashFileQueue" . $mdata['dbId'] . "').append('<div class=\"bfFileQueueItem\" id=\"' + files[i].id + 'queueitem\"><div id=\"' + files[i].id + 'thumb\"></div><div id=\"' + files[i].id + '\"><img id=\"' + files[i].id + 'cancel\" src=\"" . $this->cancelImagePath . "\" style=\"cursor: pointer; padding-right: 10px;\" border=\"0\"/>' + (iOS ? '' : files[i].name) + ' ' + fsize + '<b id=\"' + files[i].id + 'msg\" style=\"color:red;\"></b></div></div>');\n var file_ = files[i];\n var uploader_ = uploader;\n var bfUploaders_ = bfUploaders;\n JQuery('#' + files[i].id + 'cancel').click( \n function(){\n for( var i = 0; i < bfUploaders_.length; i++ ){\n bfUploaders_[i].stop();\n }\n var id_ = this.id.split('cancel');\n id_ = id_[0];\n uploader_.removeFileById(id_);\n JQuery('#'+id_+'queue').remove();\n JQuery('#'+id_+'queueitem').remove();\n bfFlashUploadersLength--;\n for( var i = 0; i < bfUploaders_.length; i++ ){\n bfUploaders_[i].start();\n }\n } \n );\n var thebytes = " . (isset($mdata['flashUploaderBytes']) && is_numeric($mdata['flashUploaderBytes']) && $mdata['flashUploaderBytes'] > 0 ? intval($mdata['flashUploaderBytes']) : '0') . ";\n if(thebytes > 0 && typeof files[i].size != 'undefined' && files[i].size > thebytes){\n alert(' " . addslashes(BFText::_('COM_BREEZINGFORMS_FLASH_UPLOADER_TOO_LARGE')) . "');\n error = true;\n }\n var ext = files[i].name.split('.').pop().toLowerCase();\n var exts = '" . strtolower($exts) . "'.split(',');\n var found = 0;\n for (var x in exts){\n if(exts[x] == ext){\n found++;\n }\n }\n if(found == 0){\n alert( ' " . addslashes(BFText::_('COM_BREEZINGFORMS_FILE_EXTENSION_NOT_ALLOWED')) . "' );\n error = true;\n }\n if(error){\n JQuery('#'+files[i].id+'queue').remove();\n JQuery('#'+files[i].id+'queueitem').remove();\n }else{\n bfFlashUploadersLength++;\n }\n bfUploadImageThumb(files[i]);\n }\n }\n });\n uploader.bind('UploadProgress', function(up, file) {\n if(typeof JQuery('#'+file.id+'queue').get(0) != 'undefined'){\n JQuery('#'+file.id+'queue').get(0).getElementsByTagName('b')[0].innerHTML = file.percent + '% <div style=\"height: 5px;width: ' + (file.percent*1.5) + 'px;background-color: #9de24f;\"></div>';\n }\n });\n uploader.bind('FileUploaded', function(up, file, response) {\n if(response.response!=''){\n if(response.response !== null){\n alert(response.response);\n }\n }\n JQuery('#'+file.id+'queue').remove();\n });\n uploader.init();\n bfUploaders.push(uploader);\n });\n\t\t\t\t\t\t\t//-->\n </script>\n\t\t\t\t\t\t\t"; // on mobiles, file uploads are forced not to be mandatory, since we cannot determin safely for all handsets if they are even allowed echo '<script type="text/javascript"><!--' . "\n" . 'var bfIsValidMobile = ( navigator.userAgent.match(/(iPad|iPhone|iPod|Android)/i) ? true : false )' . "\n" . 'if(!bfIsValidMobile){bfDeactivateField["ff_nm_' . $mdata['bfName'] . '[]"]=true;}' . "\n" . '//--></script>' . "\n"; echo '<input class="ff_elem" ' . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="hidden" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; } else { echo '<input class="ff_elem" ' . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="file" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; } if ($mdata['attachToAdminMail']) { echo '<input type="hidden" name="attachToAdminMail[' . $mdata['bfName'] . ']" value="true"/>' . "\n"; } if ($mdata['attachToUserMail']) { echo '<input type="hidden" name="attachToUserMail[' . $mdata['bfName'] . ']" value="true"/>' . "\n"; } break; // on mobiles, file uploads are forced not to be mandatory, since we cannot determin safely for all handsets if they are even allowed echo '<script type="text/javascript"><!--' . "\n" . 'bfDeactivateField["ff_nm_' . $mdata['bfName'] . '[]"]=true;' . "\n" . '//--></script>' . "\n"; break; case 'bfSubmitButton': /* translatables */ if (isset($mdata['src_translation' . $this->language_tag]) && $mdata['src_translation' . $this->language_tag] != '') { $mdata['src'] = $mdata['src_translation' . $this->language_tag]; } if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['value_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } /* translatables end */ $value = ''; $type = 'submit'; $src = ''; if ($mdata['src'] != '') { $type = 'image'; $src = 'src="' . $mdata['src'] . '" '; } if ($mdata['value'] != '') { $value = 'value="' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '" '; } if ($mdata['actionClick'] == 1) { $onclick = 'onclick="populateSummarizers();if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};' . $mdata['actionFunctionName'] . '(this,\'click\');return false;" '; } else { $onclick = 'onclick="populateSummarizers();if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};return false;" '; } if ($src == '') { echo '<button data-theme="e" class="ff_elem" ' . $value . $src . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"><span>' . $mdata['value'] . '</span></button>' . "\n"; } else { echo '<input class="ff_elem" ' . $value . $src . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '" value="' . $mdata['value'] . '"/>' . "\n"; } break; case 'bfHidden': echo '<input class="ff_elem" type="hidden" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; break; case 'bfSummarize': /* translatables */ if (isset($mdata['emptyMessage_translation' . $this->language_tag]) && $mdata['emptyMessage_translation' . $this->language_tag] != '') { $mdata['emptyMessage'] = $mdata['emptyMessage_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="ui-grid-a"> <div class="ui-block-a"><strong>' . $legend . '</strong></div> <div class="ui-block-b ff_elem bfSummarize" id="ff_elem' . $mdata['dbId'] . '"></div> </div>'; echo '<script type="text/javascript"><!--' . "\n" . 'bfRegisterSummarize("ff_elem' . $mdata['dbId'] . '", "' . $mdata['connectWith'] . '", "' . $mdata['connectType'] . '", "' . addslashes($mdata['emptyMessage']) . '", ' . ($mdata['hideIfEmpty'] ? 'true' : 'false') . ')' . "\n" . '//--></script>'; if (trim($mdata['fieldCalc']) != '') { echo '<script type="text/javascript"> <!-- function bfFieldCalcff_elem' . $mdata['dbId'] . '(value){ if(!isNaN(value)){ value = Number(value); } ' . $mdata['fieldCalc'] . ' return value; } //--> </script>'; } break; // recaptcha doesn't currently play well with jquery mobile // recaptcha doesn't currently play well with jquery mobile case 'bfReCaptcha': case 'bfCaptcha': echo '<input autocomplete="off" class="ff_elem" type="text" name="bfCaptchaEntry" id="bfCaptchaEntry" />' . "\n"; echo '<button data-role="button" data-icon="refresh" data-inline="true" data-iconpos="notext" data-theme="e" id="bfCaptchaReload" onclick="document.getElementById(\'bfCaptchaEntry\').value=\'\';document.getElementById(\'bfCaptchaEntry\').focus();document.getElementById(\'ff_capimgValue\').src = \'' . $captcha_url . '?bfMathRandom=\' + Math.random(); return false"><span>Reload Captcha</span></button>'; break; case 'bfCalendar': /* translatables */ if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['value_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } if (isset($mdata['format_translation' . $this->language_tag]) && $mdata['format_translation' . $this->language_tag] != '') { $mdata['format'] = $mdata['format_translation' . $this->language_tag]; } /* translatables end */ JHTML::_('behavior.calendar'); $exploded = explode('::', trim($mdata['value'])); $left = ''; $right = ''; if (count($exploded) == 2) { $left = trim($exploded[0]); $right = trim($exploded[1]); } else { $right = trim($exploded[0]); } echo '<input autocomplete="off" class="ff_elem" type="text" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '" value="' . htmlentities($left, ENT_QUOTES, 'UTF-8') . '"/>' . "\n"; echo '<label for="ff_elem' . $mdata['dbId'] . '_calendarButton"></label>'; echo '<button data-theme="e" id="ff_elem' . $mdata['dbId'] . '_calendarButton" type="submit" class="bfCalendar" value="' . htmlentities($right, ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities($right, ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; echo '<script type="text/javascript"> <!-- JQuery(document).bind("pageinit", function() { Calendar.setup({ inputField : "ff_elem' . $mdata['dbId'] . '", ifFormat : "' . $mdata['format'] . '", button : "ff_elem' . $mdata['dbId'] . '_calendarButton", align : "Bl", singleClick : true }); }); //--> </script>' . "\n"; break; case 'bfCalendarResponsive': /* translatables */ if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['value_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } if (isset($mdata['format_translation' . $this->language_tag]) && $mdata['format_translation' . $this->language_tag] != '') { $mdata['format'] = $mdata['format_translation' . $this->language_tag]; } /* translatables end */ $exploded = explode('::', trim($mdata['value'])); $left = ''; $right = ''; if (count($exploded) == 2) { $left = trim($exploded[0]); $right = trim($exploded[1]); } else { $right = trim($exploded[0]); } echo '<input autocomplete="off" class="ff_elem" type="text" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '" value="' . htmlentities($left, ENT_QUOTES, 'UTF-8') . '"/>' . "\n"; echo '<label for="ff_elem' . $mdata['dbId'] . '_calendarButton"></label>'; echo '<button data-theme="e" id="ff_elem' . $mdata['dbId'] . '_calendarButton" type="submit" class="bfCalendar" value="' . htmlentities($right, ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities($right, ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; echo '<script type="text/javascript"> <!-- JQuery(document).ready(function () { JQuery("#ff_elem' . $mdata['dbId'] . '_calendarButton").pickadate({ format: "' . $mdata['format'] . '", selectYears: true, selectMonths: true, editable: true, firstDay: 1, onSet: function() { JQuery("#ff_elem' . $mdata['dbId'] . '").val(this.get("value")); } }); }); //--> </script>' . "\n"; $this->hasResponsiveDatePicker = true; break; case 'bfPayPal': /* translatables */ if (isset($mdata['image_translation' . $this->language_tag]) && $mdata['image_translation' . $this->language_tag] != '') { $mdata['image'] = $mdata['image_translation' . $this->language_tag]; } /* translatables end */ $value = ''; $type = 'submit'; $src = ''; if ($mdata['image'] != '') { $type = 'image'; $src = 'src="' . $mdata['image'] . '" '; } else { $value = 'value="PayPal" '; } if ($mdata['actionClick'] == 1) { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'PayPal\';' . $mdata['actionFunctionName'] . '(this,\'click\');" '; } else { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'PayPal\';" '; } echo '<div align="center"><input data-role="none" class="ff_elem" ' . $value . $src . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"/></div>' . "\n"; break; case 'bfSofortueberweisung': /* translatables */ if (isset($mdata['image_translation' . $this->language_tag]) && $mdata['image_translation' . $this->language_tag] != '') { $mdata['image'] = $mdata['image_translation' . $this->language_tag]; } /* translatables end */ $value = ''; $type = 'submit'; $src = ''; if ($mdata['image'] != '') { $type = 'image'; $src = 'src="' . $mdata['image'] . '" '; } else { $value = 'value="Sofortueberweisung" '; } if ($mdata['actionClick'] == 1) { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'Sofortueberweisung\';' . $mdata['actionFunctionName'] . '(this,\'click\');" '; } else { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'Sofortueberweisung\';" '; } echo '<div align="center"><input data-role="none" class="ff_elem" ' . $value . $src . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"/></div>' . "\n"; break; } /* translatables */ if (isset($mdata['hint_translation' . $this->language_tag]) && $mdata['hint_translation' . $this->language_tag] != '') { $mdata['hint'] = $mdata['hint_translation' . $this->language_tag]; } /* translatables end */ if (trim($mdata['hint']) != '') { $labid = uniqid(); echo '<div><button data-theme="e" onclick="JQuery(\'.tooltip\').hide(\'fast\');JQuery(\'#' . $labid . '_tip\').show(\'fast\');" data-role="button" data-icon="info" data-inline="true" data-iconpos="notext" id="' . $labid . '">' . trim($mdata['hint']) . '</button><span id="' . $labid . '_tip" class="tooltip">' . trim($mdata['hint']) . '</span></div>'; } if (isset($mdata['bfName']) && isset($mdata['off']) && $mdata['off']) { echo '<script type="text/javascript"><!--' . "\n" . 'bfDeactivateField["ff_nm_' . $mdata['bfName'] . '[]"]=true;' . "\n" . '//--></script>' . "\n"; } if ($mdata['bfType'] == 'bfFile') { echo '<span id="ff_elem' . $mdata['dbId'] . '_files"></span>'; } echo $flashUploader; // if labels left if (true) { echo '</div>'; } //echo '</div>'; } } } } /** * Paging and wrapping of inline element containers */ if (isset($dataObject['children']) && count($dataObject['children']) != 0) { $childrenAmount = count($dataObject['children']); for ($i = 0; $i < $childrenAmount; $i++) { $this->process($dataObject['children'][$i], $mdata, $parentPage, $i, $childrenAmount); } } if (isset($dataObject['properties']) && $dataObject['properties']['type'] == 'section' && $dataObject['properties']['bfType'] == 'section') { echo '</div></div>' . "\n"; } else { if (isset($dataObject['properties']) && $dataObject['properties']['type'] == 'section' && $dataObject['properties']['bfType'] == 'normal') { if (isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != '') { echo '</div>' . "\n"; } } else { if (isset($dataObject['properties']) && $dataObject['properties']['type'] == 'page') { $isLastPage = false; if ($this->rootMdata['lastPageThankYou'] && $dataObject['properties']['pageNumber'] == count($this->dataObject['children']) && count($this->dataObject['children']) > 1) { $isLastPage = true; } if (!$isLastPage) { $last = 0; if ($this->rootMdata['lastPageThankYou']) { $last = 1; } if ($this->rootMdata['pagingInclude'] && $dataObject['properties']['pageNumber'] > 1) { /* translatables */ if (isset($this->rootMdata['pagingPrevLabel_translation' . $this->language_tag]) && $this->rootMdata['pagingPrevLabel_translation' . $this->language_tag] != '') { $this->rootMdata['pagingPrevLabel'] = $this->rootMdata['pagingPrevLabel_translation' . $this->language_tag]; } /* translatables end */ echo '<button data-theme="e" class="bfPrevButton" type="submit" onclick="ff_validate_prevpage(this, \'click\');populateSummarizers();if(typeof bfRefreshAll != \'undefined\'){bfRefreshAll();}" value="' . htmlentities(trim($this->rootMdata['pagingPrevLabel']), ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities(trim($this->rootMdata['pagingPrevLabel']), ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; } if ($this->rootMdata['pagingInclude'] && $dataObject['properties']['pageNumber'] < count($this->dataObject['children']) - $last) { /* translatables */ if (isset($this->rootMdata['pagingNextLabel_translation' . $this->language_tag]) && $this->rootMdata['pagingNextLabel_translation' . $this->language_tag] != '') { $this->rootMdata['pagingNextLabel'] = $this->rootMdata['pagingNextLabel_translation' . $this->language_tag]; } /* translatables end */ echo '<button data-theme="e" class="bfNextButton" type="submit" onclick="ff_validate_nextpage(this, \'click\');populateSummarizers();if(typeof bfRefreshAll != \'undefined\'){bfRefreshAll();}" value="' . htmlentities(trim($this->rootMdata['pagingNextLabel']), ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities(trim($this->rootMdata['pagingNextLabel']), ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; } if ($this->rootMdata['cancelInclude'] && $dataObject['properties']['pageNumber'] + 1 > count($this->dataObject['children']) - $last) { /* translatables */ if (isset($this->rootMdata['cancelLabel_translation' . $this->language_tag]) && $this->rootMdata['cancelLabel_translation' . $this->language_tag] != '') { $this->rootMdata['cancelLabel'] = $this->rootMdata['cancelLabel_translation' . $this->language_tag]; } /* translatables end */ echo '<button data-theme="e" class="bfCancelButton" type="submit" onclick="ff_resetForm(this, \'click\');" value="' . htmlentities(trim($this->rootMdata['cancelLabel']), ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities(trim($this->rootMdata['cancelLabel']), ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; } $callSubmit = 'ff_validate_submit(this, \'click\')'; if ($this->hasFlashUpload) { $callSubmit = 'if(typeof bfAjaxObject101 == \'undefined\' && typeof bfReCaptchaLoaded == \'undefined\'){bfDoFlashUpload()}else{ff_validate_submit(this, \'click\')}'; } if ($this->rootMdata['submitInclude'] && $dataObject['properties']['pageNumber'] + 1 > count($this->dataObject['children']) - $last) { /* translatables */ if (isset($this->rootMdata['submitLabel_translation' . $this->language_tag]) && $this->rootMdata['submitLabel_translation' . $this->language_tag] != '') { $this->rootMdata['submitLabel'] = $this->rootMdata['submitLabel_translation' . $this->language_tag]; } /* translatables end */ echo '<button data-theme="b" id="bfSubmitButton" class="bfSubmitButton" type="submit" onclick="if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};' . $callSubmit . ';" value="' . htmlentities(trim($this->rootMdata['submitLabel']), ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities(trim($this->rootMdata['submitLabel']), ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; } } } } } }
public function process(&$dataObject, $parent = null, $parentPage = null, $index = 0, $childrenLength = 0, $parentFull = null) { if (isset($dataObject['attributes']) && isset($dataObject['properties'])) { $options = array('type' => 'normal', 'displayType' => 'breaks'); if ($parent != null && $parent['type'] == 'section') { $options['type'] = $parent['bfType']; $options['displayType'] = $parent['displayType']; } $parentInline = false; $class = ' class="' . $this->fadingClass . '"'; if ($options['displayType'] == 'inline') { $class = ' class="' . $this->fadingClass . '"'; $parentInline = true; } //determine non-elements and reduce them from the children total to determine the right span sizes $reduce = 0; $parentFullChildrenLength = 0; if ($parentFull != null && isset($parentFull['children'])) { $parentFullChildrenLength = count($parentFull['children']); foreach ($parentFull['children'] as $child) { if (!isset($child['properties']) || isset($child['properties']) && isset($child['properties']['bfType']) && $child['properties']['bfType'] == 'bfHidden' || isset($child['properties']) && $child['properties']['type'] != 'element' && $child['properties']['type'] != 'section') { $reduce++; } //if(isset($child['properties']) && isset($child['properties']['off']) && $child['properties']['off'] && $child['properties']['type'] == 'section'){ // $reduce++; //} } } $span = ''; if ($parentFullChildrenLength - $reduce > 0 && $parentInline) { switch (12 / ($parentFullChildrenLength - $reduce)) { case 6: $span = ' span6'; break; case 4: $span = ' span4'; break; case 3: $span = ' span3'; break; case 2.4: $span = ' span2'; break; case 2: $span = ' span2'; break; } } $mdata = $dataObject['properties']; if ($mdata['type'] == 'page') { $parentPage = $mdata; if ($parentPage['pageNumber'] > 1) { echo '</div><!-- bfPage end -->' . "\n"; // closing previous pages } $display = ' style="display:none;"'; if (JRequest::getInt('ff_form_submitted', 0) == 0 && JRequest::getInt('ff_page', 1) == $parentPage['pageNumber']) { $display = ''; } else { if (JRequest::getInt('ff_form_submitted', 0) == 1 && $this->rootMdata['lastPageThankYou'] && $parentPage['pageNumber'] == count($this->dataObject['children'])) { $display = ''; } else { if (JRequest::getInt('ff_form_submitted', 0) == 1 && false == $this->rootMdata['lastPageThankYou'] && $parentPage['pageNumber'] == 1) { $display = ''; } } } echo '<div id="bfPage' . $parentPage['pageNumber'] . '" class="bfPage"' . $display . '>' . "\n"; // opening current page /* translatables */ if (isset($mdata['pageIntro_translation' . $this->language_tag]) && $mdata['pageIntro_translation' . $this->language_tag] != '') { $mdata['pageIntro'] = $mdata['pageIntro_translation' . $this->language_tag]; } /* translatables end */ if (trim($mdata['pageIntro']) != '') { echo '<div class="' . (isset($this->rootMdata['themebootstrapUseHeroUnit']) && $this->rootMdata['themebootstrapUseHeroUnit'] ? 'hero-unit' : '') . $this->fadingClass . '">' . "\n"; $regex = '/{loadposition\\s+(.*?)}/i'; $introtext = $mdata['pageIntro']; preg_match_all($regex, $introtext, $matches, PREG_SET_ORDER); jimport('joomla.version'); $version = new JVersion(); if ($matches && version_compare($version->getShortVersion(), '1.6', '>=')) { $document = JFactory::getDocument(); $renderer = $document->loadRenderer('modules'); $options = array('style' => 'xhtml'); foreach ($matches as $match) { $matcheslist = explode(',', $match[1]); $position = trim($matcheslist[0]); $output = $renderer->render($position, $options, null); $introtext = preg_replace("|{$match['0']}|", addcslashes($output, '\\'), $introtext, 1); } } echo $introtext . "\n"; echo '</div>' . "\n"; } if (!$this->useErrorAlerts) { echo '<div class="bfErrorMessage alert alert-error" style="display:none"></div>' . "\n"; } } else { if ($mdata['type'] == 'section') { if (isset($dataObject['properties']['name']) && isset($mdata['off']) && $mdata['off']) { echo '<script type="text/javascript"><!--' . "\n" . 'bfDeactivateSection.push("' . $dataObject['properties']['name'] . '");' . "\n" . '//--></script>' . "\n"; } /* translatables */ if (isset($mdata['title_translation' . $this->language_tag]) && $mdata['title_translation' . $this->language_tag] != '') { $mdata['title'] = $mdata['title_translation' . $this->language_tag]; } /* translatables end */ if ($mdata['bfType'] == 'section') { echo '<fieldset' . (isset($mdata['off']) && $mdata['off'] ? ' style="display:none" ' : '') . '' . (isset($mdata['off']) && $mdata['off'] ? '' : ' class="' . $span . ' ' . $this->fadingClass . '"') . (isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != "" ? ' id="' . $dataObject['properties']['name'] . '"' : '') . '>' . "\n"; if (trim($mdata['title']) != '') { echo '<legend>' . htmlentities(trim($mdata['title']), ENT_QUOTES, 'UTF-8') . '</legend>' . "\n"; } echo '<div class="row-fluid"><i style="display:none;"></i>'; } else { if ($mdata['bfType'] == 'normal') { if (isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != '') { echo '<section ' . (isset($mdata['off']) && $mdata['off'] ? 'style="display:none" ' : ' class="' . $span . ' ' . $this->fadingClass . '"') . (isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != "" ? ' id="' . $dataObject['properties']['name'] . '"' : '') . '>' . "\n"; echo '<div class="row-fluid"><i style="display:none;"></i>'; } } } /* translatables */ if (isset($mdata['description_translation' . $this->language_tag]) && $mdata['description_translation' . $this->language_tag] != '') { $mdata['description'] = $mdata['description_translation' . $this->language_tag]; } /* translatables end */ if (trim($mdata['description']) != '') { echo '<div class="bfSectionDescription' . (isset($this->rootMdata['themebootstrapUseWell']) && $this->rootMdata['themebootstrapUseWell'] ? ' well well-small' : '') . '">' . "\n"; $regex = '/{loadposition\\s+(.*?)}/i'; $introtext = $mdata['description']; preg_match_all($regex, $introtext, $matches, PREG_SET_ORDER); jimport('joomla.version'); $version = new JVersion(); if ($matches && version_compare($version->getShortVersion(), '1.6', '>=')) { $document = JFactory::getDocument(); $renderer = $document->loadRenderer('modules'); $options = array('style' => 'xhtml'); foreach ($matches as $match) { $matcheslist = explode(',', $match[1]); $position = trim($matcheslist[0]); $output = $renderer->render($position, $options, null); $introtext = preg_replace("|{$match['0']}|", addcslashes($output, '\\'), $introtext, 1); } } echo $introtext . "\n"; echo '</div>' . "\n"; } } else { if ($mdata['type'] == 'element') { $onclick = ''; if ($mdata['actionClick'] == 1) { $onclick = 'onclick="' . $mdata['actionFunctionName'] . '(this,\'click\');" '; } $onblur = ''; if ($mdata['actionBlur'] == 1) { $onblur = 'onblur="' . $mdata['actionFunctionName'] . '(this,\'blur\');" '; } $onchange = ''; if ($mdata['actionChange'] == 1) { $onchange = 'onchange="' . $mdata['actionFunctionName'] . '(this,\'change\');" '; } $onfocus = ''; if ($mdata['actionFocus'] == 1) { $onfocus = 'onfocus="' . $mdata['actionFunctionName'] . '(this,\'focus\');" '; } $onselect = ''; if (isset($mdata['actionSelect']) && $mdata['actionSelect'] == 1) { $onselect = 'onselect="' . $mdata['actionFunctionName'] . '(this,\'select\');" '; } if ($mdata['bfType'] != 'bfHidden') { echo '<div ' . (isset($mdata['off']) && $mdata['off'] ? 'style="display:none" ' : '') . 'class="bfElemWrap control-group' . $span . (isset($mdata['off']) && $mdata['off'] ? '' : $this->fadingClass) . '" id="bfElemWrap' . $mdata['dbId'] . '">' . "\n"; } $label = ''; if (!$mdata['hideLabel']) { $maxlengthCounter = ''; if ($mdata['bfType'] == 'bfTextarea' && isset($mdata['maxlength']) && $mdata['maxlength'] > 0 && isset($mdata['showMaxlengthCounter']) && $mdata['showMaxlengthCounter']) { $maxlengthCounter = ' <span class=***bfMaxLengthCounter*** id=***bfMaxLengthCounter' . $mdata['dbId'] . '***>(' . $mdata['maxlength'] . ' ' . BFText::_('COM_BREEZINGFORMS_CHARS_LEFT') . ')</span>'; } /* translatables */ if (isset($mdata['label_translation' . $this->language_tag]) && $mdata['label_translation' . $this->language_tag] != '') { $mdata['label'] = $mdata['label_translation' . $this->language_tag]; } if (isset($mdata['hint_translation' . $this->language_tag]) && $mdata['hint_translation' . $this->language_tag] != '') { $mdata['hint'] = $mdata['hint_translation' . $this->language_tag]; } /* translatables end */ $tipOpen = ''; $tipClose = ''; $labelText = trim($mdata['label']) . str_replace("***", "\"", $maxlengthCounter); if (trim($mdata['hint']) != '') { jimport('joomla.version'); $version = new JVersion(); if (version_compare($version->getShortVersion(), '3.0', '<') || version_compare($version->getShortVersion(), '3.0', '>=') && isset($this->rootMdata['joomlaHint']) && $this->rootMdata['joomlaHint']) { JHTML::_('behavior.tooltip'); $content = trim($mdata['hint']); $tipOpen = '<span title="' . addslashes(trim($mdata['label'])) . '::' . str_replace(array("\n", "\r"), array("", ""), htmlentities($content, ENT_QUOTES, 'UTF-8')) . '" class="editlinktip hasTip">'; $tipClose = '</span>'; } else { $content = trim($mdata['hint']); // compat $explodeHint = explode('<<<style', trim($mdata['hint'])); if (count($explodeHint) > 1 && trim($explodeHint[0]) != '') { $content = trim($explodeHint[1]); } $tipOpen = '<span class="hasTooltip" title="' . JHtml::tooltipText($content) . '">'; $tipClose = '</span>'; } } if ($tipOpen) { $tipOpen = $tipOpen . '<i class="icon-question-sign"> </i> '; } $for = ''; if ($mdata['bfType'] == 'bfTextfield' || $mdata['bfType'] == 'bfTextarea' || $mdata['bfType'] == 'bfCheckbox' || $mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfCalendar' || $mdata['bfType'] == 'bfCalendarResponsive' || $mdata['bfType'] == 'bfSelect' || $mdata['bfType'] == 'bfRadioGroup' || $mdata['bfType'] == 'bfFile' && (!isset($mdata['flashUploader']) && !isset($mdata['html5']) || isset($mdata['flashUploader']) && !$mdata['flashUploader'] && (isset($mdata['html5']) && !$mdata['html5']))) { $for = 'for="ff_elem' . $mdata['dbId'] . '"'; } if ($mdata['bfType'] == 'bfCaptcha') { $for = 'for="bfCaptchaEntry"'; } else { if ($mdata['bfType'] == 'bfReCaptcha') { $for = 'for="recaptcha_response_field"'; } } $required = ''; if ($mdata['required']) { $required = ' <i class="icon-asterisk"></i> ' . "\n"; } $label = '<label class="control-label' . (isset($this->rootMdata['themebootstrapLabelTop']) && $this->rootMdata['themebootstrapLabelTop'] ? ' bfLabelBlock' : '') . '" id="bfLabel' . $mdata['dbId'] . '" ' . $for . '>' . $tipOpen . str_replace("***", "\"", $labelText) . $tipClose . $required . '</label>' . "\n"; } $readonly = ''; if ($mdata['readonly']) { $readonly = 'readonly="readonly" '; } $tabIndex = ''; if ($mdata['tabIndex'] != -1 && is_numeric($mdata['tabIndex'])) { $tabIndex = 'tabindex="' . intval($mdata['tabIndex']) . '" '; } for ($i = 0; $i < $this->p->rowcount; $i++) { $row = $this->p->rows[$i]; if ($mdata['bfName'] == $row->name) { if ((isset($mdata['value']) || isset($mdata['list']) || isset($mdata['group'])) && ($mdata['bfType'] == 'bfTextfield' || $mdata['bfType'] == 'bfTextarea' || $mdata['bfType'] == 'bfCheckbox' || $mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfSubmitButton' || $mdata['bfType'] == 'bfHidden' || $mdata['bfType'] == 'bfCalendar' || $mdata['bfType'] == 'bfCalendarResponsive' || $mdata['bfType'] == 'bfSelect' || $mdata['bfType'] == 'bfRadioGroup')) { if ($mdata['bfType'] == 'bfSelect') { $mdata['list'] = $this->p->replaceCode($row->data2, "data2 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } else { if ($mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfRadioGroup') { $mdata['group'] = $this->p->replaceCode($row->data2, "data2 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } else { $mdata['value'] = $this->p->replaceCode($row->data1, "data1 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } } } if (isset($mdata['checked']) && $mdata['bfType'] == 'bfCheckbox') { $mdata['checked'] = $row->flag1 == 1 ? true : false; } break; } } switch ($mdata['bfType']) { case 'bfTextfield': $type = 'text'; if ($mdata['password']) { $type = 'password'; } $maxlength = ''; if (is_numeric($mdata['maxLength'])) { $maxlength = 'maxlength="' . intval($mdata['maxLength']) . '" '; } $size = ''; if ($mdata['size'] != '') { $size = 'style="width:' . htmlentities(strip_tags($mdata['size'])) . ' !important; min-width:' . htmlentities(strip_tags($mdata['size'])) . ' !important;" '; } /* translatables */ if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['value_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } if (isset($mdata['placeholder_translation' . $this->language_tag]) && $mdata['placeholder_translation' . $this->language_tag] != '') { $mdata['placeholder'] = $mdata['placeholder_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="controls form-inline">'; echo $label; echo '<input ' . (isset($mdata['placeholder']) && $mdata['placeholder'] ? 'placeholder="' . htmlentities($mdata['placeholder'], ENT_QUOTES, 'UTF-8') . '" ' : '') . 'class="ff_elem inputbox" ' . $size . $tabIndex . $maxlength . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; echo '</div>'; if ($mdata['mailbackAsSender']) { echo '<input type="hidden" name="mailbackSender[' . $mdata['bfName'] . ']" value="true"/>' . "\n"; } break; case 'bfTextarea': $width = ''; if ($mdata['width'] != '') { $width = 'width:' . htmlentities(strip_tags($mdata['width'])) . ' !important; min-width:' . htmlentities(strip_tags($mdata['width'])) . ' !important;'; } $height = ''; if ($mdata['height'] != '') { $height = 'height:' . htmlentities(strip_tags($mdata['height'])) . ';'; } $size = ''; if ($height != '' || $width != '') { $size = 'style="' . $width . $height . '" '; } $onkeyup = ''; if (isset($mdata['maxlength']) && $mdata['maxlength'] > 0) { $onkeyup = 'onkeyup="bfCheckMaxlength(' . intval($mdata['dbId']) . ', ' . intval($mdata['maxlength']) . ', ' . (isset($mdata['showMaxlengthCounter']) && $mdata['showMaxlengthCounter'] ? 'true' : 'false') . ')" '; } /* translatables */ if (isset($mdata['placeholder_translation' . $this->language_tag]) && $mdata['placeholder_translation' . $this->language_tag] != '') { $mdata['placeholder'] = $mdata['placeholder_translation' . $this->language_tag]; } if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['placeholder_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="controls form-inline">'; echo $label; if (isset($mdata['is_html']) && $mdata['is_html']) { echo '<div style="display: inline-block; vertical-align: top; width: ' . strip_tags($mdata['width']) . ';">'; JImport('joomla.html.editor'); $editor = JFactory::getEditor(); $this->htmltextareas[] = 'ff_nm_' . $mdata['bfName'] . '[]'; echo $editor->display('ff_nm_' . $mdata['bfName'] . '[]', htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8'), strip_tags($mdata['width']), strip_tags($mdata['height']), '75', '20'); echo '</div>'; echo '<style type="text/css">.toggle-editor{display: none;}</style>'; } else { echo '<textarea ' . (isset($mdata['placeholder']) && $mdata['placeholder'] ? 'placeholder="' . htmlentities($mdata['placeholder'], ENT_QUOTES, 'UTF-8') . '" ' : '') . 'cols="20" rows="5" class="ff_elem inputbox" ' . $onkeyup . $size . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '">' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '</textarea>' . "\n"; } echo '</div>'; break; case 'bfRadioGroup': /* translatables */ if (isset($mdata['group_translation' . $this->language_tag]) && $mdata['group_translation' . $this->language_tag] != '') { $mdata['group'] = $mdata['group_translation' . $this->language_tag]; } /* translatables end */ if ($mdata['group'] != '') { echo '<div class="controls form-inline">'; echo $label; if ($mdata['wrap']) { echo '<div style="display: inline-block; vertical-align: top;">'; } $mdata['group'] = str_replace("\r", '', $mdata['group']); $gEx = explode("\n", $mdata['group']); $lines = count($gEx); for ($i = 0; $i < $lines; $i++) { $idExt = $i != 0 ? '_' . $i : ''; $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if ($iCnt == 3) { echo '<label ' . ($mdata['wrap'] ? 'style="display: block;" ' : 'style="vertical-align: baseline;" ') . 'class="radio' . (!$mdata['wrap'] ? ' inline ' : '') . '" id="bfGroupLabel' . $mdata['dbId'] . $idExt . '" for="ff_elem' . $mdata['dbId'] . $idExt . '">'; echo '<input ' . ($iEx[0] == 1 ? 'checked="checked" ' : '') . ' class="ff_elem" ' . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . ($readonly ? ' disabled="disabled" ' : '') . 'type="radio" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . $idExt . '"/>' . "\n"; echo trim($iEx[1]) . '</label>' . ($i + 1 < $lines && $mdata['wrap'] ? '<div style="clear:both;"></div>' : ''); } } if ($mdata['wrap']) { echo '</div>'; } echo '</div>'; } break; case 'bfCheckboxGroup': /* translatables */ if (isset($mdata['group_translation' . $this->language_tag]) && $mdata['group_translation' . $this->language_tag] != '') { $mdata['group'] = $mdata['group_translation' . $this->language_tag]; } /* translatables end */ if ($mdata['group'] != '') { echo '<div class="controls form-inline">'; echo $label; if ($mdata['wrap']) { echo '<div style="display: inline-block; vertical-align: top;">'; } $mdata['group'] = str_replace("\r", '', $mdata['group']); $gEx = explode("\n", $mdata['group']); $lines = count($gEx); for ($i = 0; $i < $lines; $i++) { $idExt = $i != 0 ? '_' . $i : ''; $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if ($iCnt == 3) { echo '<label ' . ($mdata['wrap'] ? 'style="display: block;" ' : 'style="vertical-align: baseline;" ') . 'class="checkbox' . (!$mdata['wrap'] ? ' inline ' : '') . '" id="bfGroupLabel' . $mdata['dbId'] . $idExt . '">'; echo '<input ' . ($iEx[0] == 1 ? 'checked="checked" ' : '') . ' class="ff_elem" ' . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . ($readonly ? ' disabled="disabled" ' : '') . 'type="checkbox" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . $idExt . '"/>' . "\n"; echo trim($iEx[1]) . '</label>' . ($i + 1 < $lines && $mdata['wrap'] ? '<div style="clear:both;"></div>' : ''); } } if ($mdata['wrap']) { echo '</div>'; } echo '</div>'; } break; case 'bfCheckbox': echo '<div class="controls form-inline">'; echo $label; echo '<input style="vertical-align: baseline;" class="ff_elem" ' . ($mdata['checked'] ? 'checked="checked" ' : '') . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . ($readonly ? ' disabled="disabled" ' : '') . 'type="checkbox" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; echo '</div>'; if ($mdata['mailbackAccept']) { echo '<input type="hidden" class="ff_elem" name="mailbackConnectWith[' . $mdata['mailbackConnectWith'] . ']" value="true_' . $mdata['bfName'] . '"/>' . "\n"; } break; case 'bfSelect': /* translatables */ if (isset($mdata['list_translation' . $this->language_tag]) && $mdata['list_translation' . $this->language_tag] != '') { $mdata['list'] = $mdata['list_translation' . $this->language_tag]; } /* translatables end */ if ($mdata['list'] != '') { $width = ''; if (isset($mdata['width']) && $mdata['width'] != '') { $width = 'width:' . htmlentities(strip_tags($mdata['width'])) . ' !important; min-width:' . htmlentities(strip_tags($mdata['width'])) . ' !important;'; } $height = ''; if (isset($mdata['height']) && $mdata['height'] != '') { $height = 'height:' . htmlentities(strip_tags($mdata['height'])) . ';'; } $size = ''; if ($height != '' || $width != '') { $size = 'style="' . $width . $height . '" '; } $mdata['list'] = str_replace("\r", '', $mdata['list']); $gEx = explode("\n", $mdata['list']); $lines = count($gEx); echo '<div class="controls form-inline">'; echo $label; echo '<select class="ff_elem chzn-done" ' . $size . ($mdata['multiple'] ? 'multiple="multiple" ' : '') . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '">' . "\n"; for ($i = 0; $i < $lines; $i++) { $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if ($iCnt == 3) { echo '<option ' . ($iEx[0] == 1 ? 'selected="selected" ' : '') . 'value="' . htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8') . '">' . htmlentities(trim($iEx[1]), ENT_QUOTES, 'UTF-8') . '</option>' . "\n"; } } echo '</select>' . "\n"; echo '</div>'; } break; case 'bfFile': echo '<div class="controls form-inline">'; echo $label; if (isset($mdata['flashUploader']) && $mdata['flashUploader'] || isset($mdata['html5']) && $mdata['html5']) { $base = explode('/', JURI::base()); if (isset($base[count($base) - 2]) && $base[count($base) - 2] == 'administrator') { unset($base[count($base) - 2]); $base = array_merge($base); } $base = implode('/', $base); echo '<input type="hidden" id="flashUpload' . $mdata['bfName'] . '" name="flashUpload' . $mdata['bfName'] . '" value="bfFlashFileQueue' . $mdata['dbId'] . '"/>' . "\n"; $this->hasFlashUpload = true; //allowedFileExtensions $allowedExts = explode(',', $mdata['allowedFileExtensions']); $allowedExtsCnt = count($allowedExts); for ($i = 0; $i < $allowedExtsCnt; $i++) { $allowedExts[$i] = $allowedExts[$i]; } $exts = ''; if ($allowedExtsCnt != 0) { $exts = implode(',', $allowedExts); } $bytes = isset($mdata['flashUploaderBytes']) && is_numeric($mdata['flashUploaderBytes']) && $mdata['flashUploaderBytes'] > 0 ? "max_file_size : '" . intval($mdata['flashUploaderBytes']) . "'," : ''; echo "\n <span id=\"bfUploadContainer" . $mdata['dbId'] . "\">\n <button type=\"button\" class=\"btn bfUploadButton button\" id=\"bfPickFiles" . $mdata['dbId'] . "\"><i class=\"icon-upload\"></i></button>\n\t\t\t\t\t\t\t</span>\n <span id=\"bfUploader" . $mdata['bfName'] . "\"></span>\n <div class=\"bfFlashFileQueueClass\" id=\"bfFlashFileQueue" . $mdata['dbId'] . "\"></div>\n <script type=\"text/javascript\">\n <!--\n\t\t\t\t\t\t\tbfFlashUploaders.push('ff_elem" . $mdata['dbId'] . "');\n var bfFlashFileQueue" . $mdata['dbId'] . " = {};\n function bfUploadImageThumb(file) {\n var img;\n img = new o.Image;\n img.onload = function() {\n img.embed(JQuery('#' + file.id+'thumb').get(0), { \n width: 100, \n height: 60, \n crop: true,\n swf_url: mOxie.resolveUrl('" . $base . "components/com_breezingforms/libraries/jquery/plupload/Moxie.swf')\n });\n };\n\n img.onembedded = function() {\n img.destroy();\n };\n\n img.onerror = function() {\n \n };\n \n img.load(file.getSource());\n \n }\n JQuery(document).ready(\n function() {\n var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/i) ? true : false );\n var uploader = new plupload.Uploader({\n multi_selection: " . (isset($mdata['flashUploaderMulti']) && $mdata['flashUploaderMulti'] ? 'true' : 'false') . ",\n unique_names: iOS,\n chunk_size: '100kb',\n runtimes : '" . (isset($mdata['html5']) && $mdata['html5'] ? 'html5,' : '') . (isset($mdata['flashUploader']) && $mdata['flashUploader'] ? 'flash,' : '') . "html4',\n browse_button : 'bfPickFiles" . $mdata['dbId'] . "',\n container: 'bfUploadContainer" . $mdata['dbId'] . "',\n file_data_name: 'Filedata',\n multipart_params: { form: " . $this->p->form . ", itemName : '" . $mdata['bfName'] . "', bfFlashUploadTicket: '" . $this->flashUploadTicket . "', option: 'com_breezingforms', format: 'html', flashUpload: 'true', Itemid: 0 },\n " . $bytes . "\n url : '" . $base . (BFJoomlaConfig::get('config.sef') && !BFJoomlaConfig::get('config.sef_rewrite') ? 'index.php/' : '') . (JRequest::getCmd('lang', '') && BFJoomlaConfig::get('config.sef') ? JRequest::getCmd('lang', '') . (BFJoomlaConfig::get('config.sef_rewrite') ? 'index.php' : '') : 'index.php') . "',\n flash_swf_url : '" . $base . "components/com_breezingforms/libraries/jquery/plupload/Moxie.swf',\n filters : [\n {title : '" . addslashes(BFText::_('COM_BREEZINGFORMS_CHOOSE_FILE')) . "', extensions : '" . $exts . "'}\n ]\n });\n uploader.bind('FilesAdded', function(up, files) {\n for (var i in files) {\n if(typeof files[i].id != 'undefined' && files[i].id != null){\n var fsize = '';\n if(typeof files[i].size != 'undefined'){\n fsize = '(' + plupload.formatSize(files[i].size) + ') ';\n }\n JQuery('#bfFileQueue').append( '<div id=\"' + files[i].id + 'queue\">' + (iOS ? '' : files[i].name) + ' '+fsize+'<b></b></div>' );\n }\n }\n for (var i in files) {\n if(typeof files[i].id != 'undefined' && files[i].id != null){\n var error = false;\n var fsize = '';\n if(typeof files[i].size != 'undefined'){\n fsize = '(' + plupload.formatSize(files[i].size) + ') ';\n }\n JQuery('#bfFlashFileQueue" . $mdata['dbId'] . "').append('<div class=\"bfFileQueueItem\" id=\"' + files[i].id + 'queueitem\"><div id=\"' + files[i].id + 'thumb\"></div><div id=\"' + files[i].id + '\"><img id=\"' + files[i].id + 'cancel\" src=\"" . $this->cancelImagePath . "\" style=\"cursor: pointer; padding-right: 10px;\" />' + (iOS ? '' : files[i].name ? files[i].name.substring(0,12) : '') + ' ' + fsize + '<b id=\"' + files[i].id + 'msg\" style=\"color:red;\"></b></div></div>');\n var file_ = files[i];\n var uploader_ = uploader;\n var bfUploaders_ = bfUploaders;\n JQuery('#' + files[i].id + 'cancel').click( \n function(){\n for( var i = 0; i < bfUploaders_.length; i++ ){\n bfUploaders_[i].stop();\n }\n var id_ = this.id.split('cancel');\n id_ = id_[0];\n uploader_.removeFileById(id_);\n JQuery('#'+id_+'queue').remove();\n JQuery('#'+id_+'queueitem').remove();\n bfFlashUploadersLength--;\n for( var i = 0; i < bfUploaders_.length; i++ ){\n bfUploaders_[i].start();\n }\n } \n );\n var thebytes = " . (isset($mdata['flashUploaderBytes']) && is_numeric($mdata['flashUploaderBytes']) && $mdata['flashUploaderBytes'] > 0 ? intval($mdata['flashUploaderBytes']) : '0') . ";\n if(thebytes > 0 && typeof files[i].size != 'undefined' && files[i].size > thebytes){\n alert(' " . addslashes(BFText::_('COM_BREEZINGFORMS_FLASH_UPLOADER_TOO_LARGE')) . "');\n error = true;\n }\n var ext = files[i].name.split('.').pop().toLowerCase();\n var exts = '" . strtolower($exts) . "'.split(',');\n var found = 0;\n for (var x in exts){\n if(exts[x] == ext){\n found++;\n }\n }\n if(found == 0){\n alert( ' " . addslashes(BFText::_('COM_BREEZINGFORMS_FILE_EXTENSION_NOT_ALLOWED')) . "' );\n error = true;\n }\n if(error){\n JQuery('#'+files[i].id+'queue').remove();\n JQuery('#'+files[i].id+'queueitem').remove();\n }else{\n bfFlashUploadersLength++;\n }\n bfUploadImageThumb(files[i]);\n }\n }\n });\n uploader.bind('UploadProgress', function(up, file) {\n if(typeof JQuery('#'+file.id+'queue').get(0) != 'undefined'){\n JQuery('#'+file.id+'queue').get(0).getElementsByTagName('b')[0].innerHTML = file.percent + '% <div style=\"height: 5px;width: ' + (file.percent*1.5) + 'px;background-color: #9de24f;\"></div>';\n }\n });\n uploader.bind('FileUploaded', function(up, file, response) {\n if(response.response!=''){\n if(response.response !== null){\n alert(response.response);\n }\n }\n JQuery('#'+file.id+'queue').remove();\n });\n uploader.init();\n bfUploaders.push(uploader);\n });\n\t\t\t\t\t\t\t//-->\n </script>\n\t\t\t\t\t\t\t"; echo '<input class="ff_elem" ' . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="hidden" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; } else { echo '<input class="ff_elem" ' . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="file" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; } if ($mdata['attachToAdminMail']) { echo '<input type="hidden" name="attachToAdminMail[' . $mdata['bfName'] . ']" value="true"/>' . "\n"; } if ($mdata['attachToUserMail']) { echo '<input type="hidden" name="attachToUserMail[' . $mdata['bfName'] . ']" value="true"/>' . "\n"; } echo '</div>'; break; case 'bfSubmitButton': /* translatables */ if (isset($mdata['src_translation' . $this->language_tag]) && $mdata['src_translation' . $this->language_tag] != '') { $mdata['src'] = $mdata['src_translation' . $this->language_tag]; } if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['value_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="controls form-inline">'; echo $label; $value = ''; $type = 'submit'; $src = ''; if ($mdata['src'] != '') { $type = 'image'; $src = 'src="' . $mdata['src'] . '" '; } if ($mdata['value'] != '') { $value = 'value="' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '" '; } if ($mdata['actionClick'] == 1) { $onclick = 'onclick="if(typeof bf_htmltextareainit != \'undefined\'){ bf_htmltextareainit() }populateSummarizers();if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};' . $mdata['actionFunctionName'] . '(this,\'click\');return false;" '; } else { $onclick = 'onclick="if(typeof bf_htmltextareainit != \'undefined\'){ bf_htmltextareainit() }populateSummarizers();if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};return false;" '; } if ($src == '') { echo '<button type="button" class="ff_elem btn button" ' . $value . $src . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '">' . $mdata['value'] . '</button>' . "\n"; } else { echo '<input type="button" class="ff_elem" ' . $value . $src . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" alt="" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '" value="' . $mdata['value'] . '"/>' . "\n"; } echo '</div>'; break; case 'bfHidden': echo '<input class="ff_elem" type="hidden" name="ff_nm_' . $mdata['bfName'] . '[]" value="' . htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8') . '" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; break; case 'bfSummarize': /* translatables */ if (isset($mdata['emptyMessage_translation' . $this->language_tag]) && $mdata['emptyMessage_translation' . $this->language_tag] != '') { $mdata['emptyMessage'] = $mdata['emptyMessage_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="controls form-inline">'; echo $label; echo '<div style="display: inline-block; vertical-align: top;" class="ff_elem bfSummarize" id="ff_elem' . $mdata['dbId'] . '"></div>' . "\n"; echo '<script type="text/javascript"><!--' . "\n" . 'bfRegisterSummarize("ff_elem' . $mdata['dbId'] . '", "' . $mdata['connectWith'] . '", "' . $mdata['connectType'] . '", "' . addslashes($mdata['emptyMessage']) . '", ' . ($mdata['hideIfEmpty'] ? 'true' : 'false') . ')' . "\n" . '//--></script>'; if (trim($mdata['fieldCalc']) != '') { echo '<script type="text/javascript"> <!-- function bfFieldCalcff_elem' . $mdata['dbId'] . '(value){ if(!isNaN(value)){ value = Number(value); } ' . $mdata['fieldCalc'] . ' return value; } //--> </script>'; } echo '</div>'; break; case 'bfReCaptcha': echo '<div class="controls form-inline well well-small">'; echo $label; if (isset($mdata['pubkey']) && $mdata['pubkey'] != '') { $http = 'http'; if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') { $http .= 's'; } $lang = JRequest::getVar('lang', ''); if ($lang != '') { $lang = ',lang: "' . addslashes($lang) . '"'; } JFactory::getDocument()->addScript($http . '://www.google.com/recaptcha/api/js/recaptcha.js'); echo '<div class="bfReCaptchaDiv" id="recaptcha_widget" style="display: inline-block !important;"> <div class="control-group"> <div class="controls"> <span id="recaptcha_image" class="thumbnail"></span> </div> </div> <div class="control-group"> <div class="controls"> <input type="text" id="recaptcha_response_field" name="recaptcha_response_field" class="input-recaptcha" /> <button type="button" class="btn button" onclick="Recaptcha.reload()"><i class="icon-refresh"></i></button> <button type="button" class="btn recaptcha_only_if_image button" onclick="Recaptcha.switch_type(\'audio\')"><i title="Get an audio CAPTCHA" class="icon-play"></i></button> <button type="button" class="btn recaptcha_only_if_audio button" onclick="Recaptcha.switch_type(\'image\')"><i title="Get an image CAPTCHA" class="icon-picture"></i></button> <button type="button" class="btn button" onclick="Recaptcha.showhelp()"><i class="icon-question-sign"></i></button> </div> </div> </div> <script type="text/javascript"> <!-- Recaptcha.create("' . $mdata['pubkey'] . '", "bfReCaptchaDiv", { theme: "custom", custom_theme_widget: "recaptcha_widget" ' . $lang . ' } ); --> </script>' . "\n"; } else { echo '<span class="bfCaptcha">' . "\n"; echo 'WARNING: No public key given for ReCaptcha element!'; echo '</span>' . "\n"; } echo '</div>'; break; case 'bfCaptcha': echo '<div class="controls form-inline">'; echo $label; if (JFactory::getApplication()->isSite()) { $captcha_url = JURI::root(true) . '/components/com_breezingforms/images/captcha/securimage_show.php'; } else { $captcha_url = JURI::root(true) . '/administrator/components/com_breezingforms/images/captcha/securimage_show.php'; } echo '<div style="display: inline-block;">'; echo '<img alt="" ' . (isset($mdata['width']) && intval($mdata['width']) > 0 ? ' style="width: ' . intval($mdata['width']) . 'px !important;min-width: ' . intval($mdata['width']) . 'px !important;max-width: ' . intval($mdata['width']) . 'px !important;"' : 'style="width: 230px !important;min-width: 230px !important;max-width: 230px !important;"') . ' id="ff_capimgValue" class="ff_capimg img-polaroid" src="' . $captcha_url . '"/>' . "\n"; echo '<br/>'; echo '<br/>'; echo '<div class="input-append">'; echo '<input ' . (isset($mdata['width']) && intval($mdata['width']) > 0 ? ' style="width:' . (intval($mdata['width']) - 45) . 'px !important;min-width:' . (intval($mdata['width']) - 45) . 'px !important;max-width:' . (intval($mdata['width']) - 45) . 'px !important;"' : ' style="width: 185px !important;min-width: 185px !important;max-width: 185px !important;"') . ' autocomplete="off" class="ff_elem bfCaptchaField" type="text" name="bfCaptchaEntry" id="bfCaptchaEntry" />' . "\n"; echo '<button type="button" class="ff_elem btn button" onclick="document.getElementById(\'bfCaptchaEntry\').value=\'\';document.getElementById(\'bfCaptchaEntry\').focus();document.getElementById(\'ff_capimgValue\').src = \'' . $captcha_url . '?bfMathRandom=\' + Math.random(); return false"><i class="icon-refresh"></i></button>' . "\n"; echo '</div>'; echo '</div>'; echo '</div>'; break; case 'bfCalendar': /* translatables */ if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['value_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } if (isset($mdata['format_translation' . $this->language_tag]) && $mdata['format_translation' . $this->language_tag] != '') { $mdata['format'] = $mdata['format_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="controls form-inline">'; echo $label; JHTML::_('behavior.calendar'); $size = ''; if ($mdata['size'] != '') { $size = 'style="width:' . htmlentities(strip_tags($mdata['size'])) . '" '; } $exploded = explode('::', trim($mdata['value'])); $left = ''; $right = ''; if (count($exploded) == 2) { $left = trim($exploded[0]); $right = trim($exploded[1]); } else { $right = trim($exploded[0]); } echo '<div class="input-append">' . "\n"; echo '<input autocomplete="off" class="ff_elem" ' . $size . 'type="text" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '" value="' . htmlentities($left, ENT_QUOTES, 'UTF-8') . '"/>' . "\n"; echo '<button type="button" id="ff_elem' . $mdata['dbId'] . '_calendarButton" type="submit" class="bfCalendar btn button" value="' . htmlentities($right, ENT_QUOTES, 'UTF-8') . '"><span><i class="icon-calendar"></i>' . htmlentities($right == '...' ? '' : $right, ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; echo '</div>' . "\n"; echo '<script type="text/javascript"> <!-- Calendar.setup({ inputField : "ff_elem' . $mdata['dbId'] . '", ifFormat : "' . $mdata['format'] . '", button : "ff_elem' . $mdata['dbId'] . '_calendarButton", align : "Bl", singleClick : true }); //--> </script>' . "\n"; echo '</div>'; break; case 'bfCalendarResponsive': /* translatables */ if (isset($mdata['value_translation' . $this->language_tag]) && $mdata['value_translation' . $this->language_tag] != '') { $mdata['value'] = $mdata['value_translation' . $this->language_tag]; } if (isset($mdata['format_translation' . $this->language_tag]) && $mdata['format_translation' . $this->language_tag] != '') { $mdata['format'] = $mdata['format_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="controls form-inline">'; echo $label; $size = ''; if ($mdata['size'] != '') { $size = 'style="width:' . htmlentities(strip_tags($mdata['size'])) . '" '; } $exploded = explode('::', trim($mdata['value'])); $left = ''; $right = ''; if (count($exploded) == 2) { $left = trim($exploded[0]); $right = trim($exploded[1]); } else { $right = trim($exploded[0]); } echo '<div class="input-append">' . "\n"; echo '<input autocomplete="off" class="ff_elem" ' . $size . 'type="text" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '" value="' . htmlentities($left, ENT_QUOTES, 'UTF-8') . '"/>' . "\n"; echo '<button type="button" id="ff_elem' . $mdata['dbId'] . '_calendarButton" type="submit" class="bfCalendar btn button" value="' . htmlentities($right, ENT_QUOTES, 'UTF-8') . '"><span><i class="icon-calendar"></i>' . htmlentities($right == '...' ? '' : $right, ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; echo '</div>' . "\n"; $container = ''; if (!$this->hasResponsiveDatePicker) { $container = 'JQuery("body").append("<div class=\\"bfCalendarResponsiveContainer\\" style=\\"display:block;position:absolute;left:-9999px;\\"></div>");'; } echo '<script type="text/javascript"> <!-- JQuery(document).ready(function () { ' . $container . ' JQuery("#ff_elem' . $mdata['dbId'] . '_calendarButton").pickadate({ format: "' . $mdata['format'] . '", selectYears: true, selectMonths: true, editable: true, firstDay: 1, container: ".bfCalendarResponsiveContainer", onSet: function() { JQuery("#ff_elem' . $mdata['dbId'] . '").val(this.get("value")); } }); }); //--> </script>' . "\n"; $this->hasResponsiveDatePicker = true; echo '</div>'; break; case 'bfPayPal': /* translatables */ if (isset($mdata['image_translation' . $this->language_tag]) && $mdata['image_translation' . $this->language_tag] != '') { $mdata['image'] = $mdata['image_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="controls form-inline">'; echo $label; $value = ''; $type = 'submit'; $src = ''; if ($mdata['image'] != '') { $type = 'image'; $src = 'src="' . $mdata['image'] . '" alt="PayPal" '; } else { $value = 'value="PayPal" '; } if ($mdata['actionClick'] == 1) { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'PayPal\';' . $mdata['actionFunctionName'] . '(this,\'click\');" '; } else { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'PayPal\';" '; } echo '<input class="ff_elem" ' . $value . $src . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; echo '</div>'; break; case 'bfSofortueberweisung': /* translatables */ if (isset($mdata['image_translation' . $this->language_tag]) && $mdata['image_translation' . $this->language_tag] != '') { $mdata['image'] = $mdata['image_translation' . $this->language_tag]; } /* translatables end */ echo '<div class="controls form-inline">'; echo $label; $value = ''; $type = 'submit'; $src = ''; if ($mdata['image'] != '') { $type = 'image'; $src = 'src="' . $mdata['image'] . '" alt="Sofort.com" '; } else { $value = 'value="Sofortueberweisung" '; } if ($mdata['actionClick'] == 1) { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'Sofortueberweisung\';' . $mdata['actionFunctionName'] . '(this,\'click\');" '; } else { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'Sofortueberweisung\';" '; } echo '<input class="ff_elem" ' . $value . $src . $tabIndex . $onclick . $onblur . $onchange . $onfocus . $onselect . $readonly . 'type="' . $type . '" name="ff_nm_' . $mdata['bfName'] . '[]" id="ff_elem' . $mdata['dbId'] . '"/>' . "\n"; echo '</div>'; break; } if (isset($mdata['bfName']) && isset($mdata['off']) && $mdata['off']) { echo '<script type="text/javascript"><!--' . "\n" . 'bfDeactivateField["ff_nm_' . $mdata['bfName'] . '[]"]=true;' . "\n" . '//--></script>' . "\n"; } if ($mdata['bfType'] == 'bfFile') { echo '<span id="ff_elem' . $mdata['dbId'] . '_files"></span>'; } if ($mdata['bfType'] != 'bfHidden') { echo '</div>' . "\n"; } } } } } /** * Paging and wrapping of inline element containers */ if (isset($dataObject['properties']) && $dataObject['properties']['type'] == 'section' && $dataObject['properties']['displayType'] == 'inline') { echo '<div class="bfClearfix">' . "\n"; } if (isset($dataObject['children']) && count($dataObject['children']) != 0) { $childrenAmount = count($dataObject['children']); for ($i = 0; $i < $childrenAmount; $i++) { $this->process($dataObject['children'][$i], $mdata, $parentPage, $i, $childrenAmount, $dataObject); } } if (isset($dataObject['properties']) && $dataObject['properties']['type'] == 'section' && $dataObject['properties']['displayType'] == 'inline') { echo '</div>' . "\n"; } if (isset($dataObject['properties']) && $dataObject['properties']['type'] == 'section' && $dataObject['properties']['bfType'] == 'section') { echo '</div>'; // row-fluid echo '</fieldset>' . "\n"; } else { if (isset($dataObject['properties']) && $dataObject['properties']['type'] == 'section' && $dataObject['properties']['bfType'] == 'normal') { if (isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != '') { echo '</div>'; // row-fluid echo '</section>' . "\n"; } } else { if (isset($dataObject['properties']) && $dataObject['properties']['type'] == 'page') { $isLastPage = false; if ($this->rootMdata['lastPageThankYou'] && $dataObject['properties']['pageNumber'] == count($this->dataObject['children']) && count($this->dataObject['children']) > 1) { $isLastPage = true; } if (!$isLastPage) { $last = 0; if ($this->rootMdata['lastPageThankYou']) { $last = 1; } echo '<div class="bfClearfix"></div>'; echo '<div class="form-actions">'; if ($this->rootMdata['pagingInclude'] && $dataObject['properties']['pageNumber'] > 1) { /* translatables */ if (isset($this->rootMdata['pagingPrevLabel_translation' . $this->language_tag]) && $this->rootMdata['pagingPrevLabel_translation' . $this->language_tag] != '') { $this->rootMdata['pagingPrevLabel'] = $this->rootMdata['pagingPrevLabel_translation' . $this->language_tag]; } /* translatables end */ echo '<button type="button" class="bfPrevButton btn btn-primary pull-left button' . $this->fadingClass . '" type="submit" onclick="ff_validate_prevpage(this, \'click\');populateSummarizers();if(typeof bfRefreshAll != \'undefined\'){bfRefreshAll();}" value="' . htmlentities(trim($this->rootMdata['pagingPrevLabel']), ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities(trim($this->rootMdata['pagingPrevLabel']), ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; } if ($this->rootMdata['pagingInclude'] && $dataObject['properties']['pageNumber'] < count($this->dataObject['children']) - $last) { /* translatables */ if (isset($this->rootMdata['pagingNextLabel_translation' . $this->language_tag]) && $this->rootMdata['pagingNextLabel_translation' . $this->language_tag] != '') { $this->rootMdata['pagingNextLabel'] = $this->rootMdata['pagingNextLabel_translation' . $this->language_tag]; } /* translatables end */ echo '<button type="button" class="bfNextButton btn btn-primary pull-right button' . $this->fadingClass . '" type="submit" onclick="ff_validate_nextpage(this, \'click\');populateSummarizers();if(typeof bfRefreshAll != \'undefined\'){bfRefreshAll();}" value="' . htmlentities(trim($this->rootMdata['pagingNextLabel']), ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities(trim($this->rootMdata['pagingNextLabel']), ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; } if ($this->rootMdata['cancelInclude'] && $dataObject['properties']['pageNumber'] + 1 > count($this->dataObject['children']) - $last) { /* translatables */ if (isset($this->rootMdata['cancelLabel_translation' . $this->language_tag]) && $this->rootMdata['cancelLabel_translation' . $this->language_tag] != '') { $this->rootMdata['cancelLabel'] = $this->rootMdata['cancelLabel_translation' . $this->language_tag]; } /* translatables end */ echo '<button type="button" class="bfCancelButton btn btn-secondary pull-right button' . $this->fadingClass . '" type="submit" onclick="ff_resetForm(this, \'click\');" value="' . htmlentities(trim($this->rootMdata['cancelLabel']), ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities(trim($this->rootMdata['cancelLabel']), ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; } $callSubmit = 'ff_validate_submit(this, \'click\')'; if ($this->hasFlashUpload) { $callSubmit = 'if(typeof bfAjaxObject101 == \'undefined\' && typeof bfReCaptchaLoaded == \'undefined\'){bfDoFlashUpload()}else{ff_validate_submit(this, \'click\')}'; } if ($this->rootMdata['submitInclude'] && $dataObject['properties']['pageNumber'] + 1 > count($this->dataObject['children']) - $last) { /* translatables */ if (isset($this->rootMdata['submitLabel_translation' . $this->language_tag]) && $this->rootMdata['submitLabel_translation' . $this->language_tag] != '') { $this->rootMdata['submitLabel'] = $this->rootMdata['submitLabel_translation' . $this->language_tag]; } /* translatables end */ echo '<button type="button" id="bfSubmitButton" class="bfSubmitButton btn btn-primary pull-right button' . $this->fadingClass . '" type="submit" onclick="this.disabled=true;if(typeof bf_htmltextareainit != \'undefined\'){ bf_htmltextareainit() }if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};' . $callSubmit . ';" value="' . htmlentities(trim($this->rootMdata['submitLabel']), ENT_QUOTES, 'UTF-8') . '"><span>' . htmlentities(trim($this->rootMdata['submitLabel']), ENT_QUOTES, 'UTF-8') . '</span></button>' . "\n"; } echo '</div>'; } } } } }
public function process(&$dataObject, $parent = null, $parentPage = null, $index = 0, $childrenLength = 0){ if(isset($dataObject['attributes']) && isset($dataObject['properties']) ){ $options = array('type' => 'normal', 'displayType' => 'breaks'); if($parent != null && $parent['type'] == 'section'){ $options['type'] = $parent['bfType']; $options['displayType'] = $parent['displayType']; } $class = ' class="bfBlock'.$this->fadingClass.'"'; $wrapper = 'bfWrapperBlock'; if($options['displayType'] == 'inline'){ $class = ' class="bfInline'.$this->fadingClass.'"'; $wrapper = 'bfWrapperInline'; } $mdata = $dataObject['properties']; if($mdata['type'] == 'page'){ $parentPage = $mdata; if($parentPage['pageNumber'] > 1){ echo '</div><!-- bfPage end -->'."\n"; // closing previous pages } echo '<div id="bfPage'.$parentPage['pageNumber'].'" style="display:none">'."\n"; // opening current page if(trim($mdata['pageIntro'])!=''){ echo '<p class="bfPageIntro'.$this->fadingClass.'">'."\n"; echo $mdata['pageIntro']."\n"; echo '</p>'."\n"; } if(!$this->useErrorAlerts){ echo '<span class="bfErrorMessage" style="display:none"></span>'."\n"; } } else if($mdata['type'] == 'section'){ if(isset($dataObject['properties']['name']) && isset($mdata['off']) && $mdata['off']){ echo '<script type="text/javascript">bfDeactivateSection.push("'.$dataObject['properties']['name'].'");</script>'."\n"; } if($mdata['bfType'] == 'section'){ echo '<div class="bfFieldset-wrapper '.$wrapper.' bfClearfix"><div class="bfFieldset-tl"><div class="bfFieldset-tr"><div class="bfFieldset-t"></div></div></div><div class="bfFieldset-l"><div class="bfFieldset-r"><div class="bfFieldset-m bfClearfix"><fieldset'.(isset($mdata['off']) && $mdata['off'] ? ' style="display:none" ' : '').''.(isset($mdata['off']) && $mdata['off'] ? '' : $class).''.(isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != "" ? ' id="'.$dataObject['properties']['name'].'"' : '').'>'."\n"; if(trim($mdata['title']) != ''){ echo '<legend><span class="bfLegend-l"><span class="bfLegend-r"><span class="bfLegend-m">'.htmlentities(trim($mdata['title']), ENT_QUOTES, 'UTF-8').'</span></span></span></legend>'."\n"; } } else if( $mdata['bfType'] == 'normal' ) { if($dataObject['properties']['name'] != ''){ echo '<div '.(isset($mdata['off']) && $mdata['off'] ? 'style="display:none" ' : '').'class="bfNoSection"'.(isset($dataObject['properties']['name']) && $dataObject['properties']['name'] != "" ? ' id="'.$dataObject['properties']['name'].'"' : '').'>'."\n"; } } if(trim($mdata['description'])!=''){ echo '<p class="bfSectionDescription">'."\n"; echo $mdata['description']."\n"; echo '</p>'."\n"; } } else if($mdata['type'] == 'element'){ $onclick = ''; if($mdata['actionClick'] == 1){ $onclick = 'onclick="'.$mdata['actionFunctionName'] . '(this,\'click\');" '; } $onblur = ''; if($mdata['actionBlur'] == 1){ $onblur = 'onblur="'.$mdata['actionFunctionName'] . '(this,\'blur\');" '; } $onchange = ''; if($mdata['actionChange'] == 1){ $onchange = 'onchange="'.$mdata['actionFunctionName'] . '(this,\'change\');" '; } $onfocus = ''; if($mdata['actionFocus'] == 1){ $onfocus = 'onfocus="'.$mdata['actionFunctionName'] . '(this,\'focus\');" '; } $onselect = ''; if($mdata['actionSelect'] == 1){ $onselect = 'onselect="'.$mdata['actionFunctionName'] . '(this,\'select\');" '; } if($mdata['bfType'] != 'bfHidden'){ $labelPosition = ''; switch($mdata['labelPosition']){ case 'top': $labelPosition = ' bfLabelTop'; break; case 'right': $labelPosition = ' bfLabelRight'; break; case 'bottom': $labelPosition = ' bfLabelBottom'; break; default: $labelPosition = ' bfLabelLeft'; } if($options['displayType'] == 'breaks'){ echo '<p '.(isset($mdata['off']) && $mdata['off'] ? 'style="display:none" ' : '').'class="bfElemWrap'.$labelPosition.(isset($mdata['off']) && $mdata['off'] ? '' : $this->fadingClass).'" id="bfElemWrap'.$mdata['dbId'].'">'."\n"; } else { echo '<span '.(isset($mdata['off']) && $mdata['off'] ? 'style="display:none" ' : '').'class="bfElemWrap'.$labelPosition.(isset($mdata['off']) && $mdata['off'] ? '' : $this->fadingClass).'" id="bfElemWrap'.$mdata['dbId'].'">'."\n"; } } if(!$mdata['hideLabel']){ $maxlengthCounter = ''; if($mdata['bfType'] == 'bfTextarea' && isset($mdata['maxlength']) && $mdata['maxlength'] > 0 && isset($mdata['showMaxlengthCounter']) && $mdata['showMaxlengthCounter']){ $maxlengthCounter = ' <span class=***bfMaxLengthCounter*** id=***bfMaxLengthCounter'.$mdata['dbId'].'***>('.$mdata['maxlength'].' '.BFText::_('COM_BREEZINGFORMS_CHARS_LEFT').')</span>'; } $tipScript = ''; $tipOpen = ''; $tipClose = ''; $labelText = htmlentities(trim($mdata['label']), ENT_QUOTES, 'UTF-8') . str_replace("***","\"",$maxlengthCounter); if(trim($mdata['hint']) != ''){ $tipOpen = '<span id="bfTooltip'.$mdata['dbId'].'" class="bfTooltip">'; $tipClose = '</span>'; $style = ',style: {tip: !JQuery.browser.ie, background: "#ffc", color: "#000000", border : { color: "#C0C0C0", width: 1 }, name: "cream" }'; $content = trim($mdata['hint']); $explodeHint = explode('<<<style',trim($mdata['hint'])); if(count($explodeHint) > 1 && trim($explodeHint[0]) != ''){ $style = ',style: {tip: !JQuery.browser.ie,' . trim($explodeHint[0]) . '}'; // assuming style entry $content = trim($explodeHint[1]); } $tipScript = '<script type="text/javascript"><!--'."\n".'JQuery("#bfLabel'.$mdata['dbId'].'").qtip({ position: { adjust: { screen: true } }, content: "<b>'.addslashes(trim($mdata['label'])).'</b><br/>'.str_replace( array("\n","\r"), array("\\n",""), addslashes($content) ).'"'.$style.' });'."\n".'//--></script>'; } $for = 'for="ff_elem'.$mdata['dbId'].'"'; if($mdata['bfType'] == 'bfCaptcha'){ $for = 'for="bfCaptchaEntry"'; } else if($mdata['bfType'] == 'bfReCaptcha'){ $for = 'for="recaptcha_response_field"'; } echo '<label id="bfLabel'.$mdata['dbId'].'" '.$for.'>'.$tipOpen.str_replace("***","\"",$labelText).$tipClose.'</label>'.$tipScript."\n"; } $readonly = ''; if($mdata['readonly']){ $readonly = 'readonly="readonly" '; } $tabIndex = ''; if($mdata['tabIndex'] != -1 && is_numeric($mdata['tabIndex'])){ $tabIndex = 'tabindex="'.intval($mdata['tabIndex']).'" '; } for($i = 0; $i < $this->p->rowcount; $i++) { $row = $this->p->rows[$i]; if($mdata['bfName'] == $row->name){ if( ( isset($mdata['value']) || isset($mdata['list']) || isset($mdata['group'])) && ( $mdata['bfType'] == 'bfTextfield' || $mdata['bfType'] == 'bfTextarea' || $mdata['bfType'] == 'bfCheckbox' || $mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfSubmitButton' || $mdata['bfType'] == 'bfHidden' || $mdata['bfType'] == 'bfCalendar' || $mdata['bfType'] == 'bfSelect' || $mdata['bfType'] == 'bfRadioGroup' ) ){ if($mdata['bfType'] == 'bfSelect') { $mdata['list'] = $this->p->replaceCode($row->data2, "data2 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } else if($mdata['bfType'] == 'bfCheckboxGroup' || $mdata['bfType'] == 'bfRadioGroup') { $mdata['group'] = $this->p->replaceCode($row->data2, "data2 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } else { $mdata['value'] = $this->p->replaceCode($row->data1, "data1 of " . $mdata['bfName'], 'e', $mdata['dbId'], 0); } } if(isset($mdata['checked']) && $mdata['bfType'] == 'bfCheckbox'){ $mdata['checked'] = $row->flag1 == 1 ? true : false; } break; } } $flashUploader = ''; switch($mdata['bfType']){ case 'bfTextfield': $type = 'text'; if($mdata['password']){ $type = 'password'; } $maxlength = ''; if(is_numeric($mdata['maxLength'])){ $maxlength = 'maxlength="'.intval($mdata['maxLength']).'" '; } $size = ''; if($mdata['size']!=''){ $size = 'style="width:'.htmlentities(strip_tags($mdata['size'])).'" '; } echo '<input class="ff_elem" '.$size.$tabIndex.$maxlength.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="'.$type.'" name="ff_nm_'.$mdata['bfName'].'[]" value="'.htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8').'" id="ff_elem'.$mdata['dbId'].'"/>'."\n"; if($mdata['mailbackAsSender']){ echo '<input type="hidden" name="mailbackSender['.$mdata['bfName'].']" value="true"/>'."\n"; } break; case 'bfTextarea': $width = ''; if($mdata['width']!=''){ $width = 'width:'.htmlentities(strip_tags($mdata['width'])).';'; } $height = ''; if($mdata['height']!=''){ $height = 'height:'.htmlentities(strip_tags($mdata['height'])).';'; } $size = ''; if($height != '' || $width != ''){ $size = 'style="'.$width.$height.'" '; } $onkeyup = ''; if(isset($mdata['maxlength']) && $mdata['maxlength'] > 0){ $onkeyup = 'onkeyup="bfCheckMaxlength('.intval($mdata['dbId']).', '.intval($mdata['maxlength']).', '.(isset($mdata['showMaxlengthCounter']) && $mdata['showMaxlengthCounter'] ? 'true' : 'false').')" '; } echo '<textarea cols="20" rows="5" class="ff_elem" '.$onkeyup.$size.$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'name="ff_nm_'.$mdata['bfName'].'[]" id="ff_elem'.$mdata['dbId'].'">'.htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8').'</textarea>'."\n"; break; case 'bfRadioGroup': if($mdata['group'] != ''){ $wrapOpen = ''; $wrapClose = ''; if(!$mdata['wrap']){ $wrapOpen = '<span class="bfElementGroupNoWrap" id="bfElementGroupNoWrap'.$mdata['dbId'].'">'."\n"; $wrapClose = '</span>'."\n"; } else { $wrapOpen = '<span class="bfElementGroup" id="bfElementGroup'.$mdata['dbId'].'">'."\n"; $wrapClose = '</span>'."\n"; } $mdata['group'] = str_replace("\r", '', $mdata['group']); $gEx = explode("\n", $mdata['group']); $lines = count($gEx); echo $wrapOpen; for($i = 0; $i < $lines; $i++){ $idExt = $i != 0 ? '_'.$i : ''; $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if($iCnt == 3){ $lblRight = '<label for="ff_elem'.$mdata['dbId'].$idExt.'">'.htmlentities(trim($iEx[1]), ENT_QUOTES, 'UTF-8').'</label>'; $lblLeft = ''; if($mdata['labelPosition'] == 'right'){ $lblLeft = $lblRight; $lblRight = ''; } echo $lblLeft . '<input '.($iEx[0] == 1 ? 'checked="checked" ' : '').' class="ff_elem" '.$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="radio" name="ff_nm_'.$mdata['bfName'].'[]" value="'.htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8').'" id="ff_elem'.$mdata['dbId'].$idExt.'"/>'.$lblRight."\n"; if($mdata['wrap']){ echo '<br/>'."\n"; } } } echo $wrapClose; } break; case 'bfCheckboxGroup': if($mdata['group'] != ''){ $wrapOpen = ''; $wrapClose = ''; if(!$mdata['wrap']){ $wrapOpen = '<span class="bfElementGroupNoWrap" id="bfElementGroupNoWrap'.$mdata['dbId'].'">'."\n"; $wrapClose = '</span>'."\n"; } else { $wrapOpen = '<span class="bfElementGroup" id="bfElementGroup'.$mdata['dbId'].'">'."\n"; $wrapClose = '</span>'."\n"; } $mdata['group'] = str_replace("\r", '', $mdata['group']); $gEx = explode("\n", $mdata['group']); $lines = count($gEx); echo $wrapOpen; for($i = 0; $i < $lines; $i++){ $idExt = $i != 0 ? '_'.$i : ''; $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if($iCnt == 3){ $lblRight = '<label for="ff_elem'.$mdata['dbId'].$idExt.'">'.htmlentities(trim($iEx[1]), ENT_QUOTES, 'UTF-8').'</label>'; $lblLeft = ''; if($mdata['labelPosition'] == 'right'){ $lblLeft = $lblRight; $lblRight = ''; } echo $lblLeft . '<input '.($iEx[0] == 1 ? 'checked="checked" ' : '').' class="ff_elem" '.$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="checkbox" name="ff_nm_'.$mdata['bfName'].'[]" value="'.htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8').'" id="ff_elem'.$mdata['dbId'].$idExt.'"/>'.$lblRight."\n"; if($mdata['wrap']){ echo '<br/>'."\n"; } } } echo $wrapClose; } break; case 'bfCheckbox': echo '<input class="ff_elem" '.($mdata['checked'] ? 'checked="checked" ' : '').$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="checkbox" name="ff_nm_'.$mdata['bfName'].'[]" value="'.htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8').'" id="ff_elem'.$mdata['dbId'].'"/>'."\n"; if($mdata['mailbackAccept']){ echo '<input type="hidden" class="ff_elem" name="mailbackConnectWith['.$mdata['mailbackConnectWith'].']" value="true_'.$mdata['bfName'].'"/>'."\n"; } break; case 'bfSelect': if($mdata['list'] != ''){ $width = ''; if(isset($mdata['width']) && $mdata['width']!=''){ $width = 'width:'.htmlentities(strip_tags($mdata['width'])).';'; } $height = ''; if(isset($mdata['height']) && $mdata['height']!=''){ $height = 'height:'.htmlentities(strip_tags($mdata['height'])).';'; } $size = ''; if($height != '' || $width != ''){ $size = 'style="'.$width.$height.'" '; } $mdata['list'] = str_replace("\r", '', $mdata['list']); $gEx = explode("\n", $mdata['list']); $lines = count($gEx); echo '<select class="ff_elem" '.$size.($mdata['multiple'] ? 'multiple="multiple" ' : '').$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'name="ff_nm_'.$mdata['bfName'].'[]" id="ff_elem'.$mdata['dbId'].'">'."\n"; for($i = 0; $i < $lines; $i++){ $iEx = explode(";", $gEx[$i]); $iCnt = count($iEx); if($iCnt == 3){ echo '<option '.($iEx[0] == 1 ? 'selected="selected" ' : '').'value="'.htmlentities(trim($iEx[2]), ENT_QUOTES, 'UTF-8').'">'.htmlentities(trim($iEx[1]), ENT_QUOTES, 'UTF-8').'</option>'."\n"; } } echo '</select>'."\n"; } break; case 'bfFile': echo '<input class="ff_elem" '.$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="file" name="ff_nm_'.$mdata['bfName'].'[]" id="ff_elem'.$mdata['dbId'].'"/>'."\n"; if(isset( $mdata['flashUploader'] ) && $mdata['flashUploader']){ echo '<input type="hidden" id="flashUpload'.$mdata['bfName'].'" name="flashUpload'.$mdata['bfName'].'" value="bfFlashFileQueue'.$mdata['dbId'].'"/>'."\n"; $this->hasFlashUpload = true; //allowedFileExtensions $allowedExts = explode(',',$mdata['allowedFileExtensions']); $allowedExtsCnt = count($allowedExts); for($i = 0; $i < $allowedExtsCnt;$i++){ $allowedExts[$i] = '*.'.$allowedExts[$i]; } $exts = ''; if($allowedExtsCnt != 0){ $exts = ',fileExt: "'.implode(';',$allowedExts).'", fileDesc: "'.addslashes(str_replace(array("'",'"',"\n","\r"),'',BFText::_('COM_BREEZINGFORMS_CHOOSE_FILE'))).'"'; } $flashUploader = " <span class=\"bfFlashFileQueueClass\" id=\"bfFlashFileQueue".$mdata['dbId']."\"></span> <script type=\"text/javascript\"> <!-- bfFlashUploaders.push('ff_elem".$mdata['dbId']."'); var bfFlashFileQueue".$mdata['dbId']." = {}; var bfUploadified_ff_elem".$mdata['dbId']." = { 'scriptAccess' : 'always', 'buttonImg' : '".$this->uploadImagePath."', 'width' : ".(isset($mdata['flashUploaderWidth']) && is_numeric($mdata['flashUploaderWidth']) && $mdata['flashUploaderWidth'] > 0 ? intval($mdata['flashUploaderWidth']) : '64').", 'height' : ".(isset($mdata['flashUploaderHeight']) && is_numeric($mdata['flashUploaderHeight']) && $mdata['flashUploaderHeight'] > 0 ? intval($mdata['flashUploaderHeight']) : '64').", ". ( isset($mdata['flashUploaderTransparent']) && $mdata['flashUploaderTransparent'] ? "'wmode' : 'transparent'," : '' ) ." 'uploader' : '".JURI::root(true)."/components/com_breezingforms/libraries/jquery/uploadify.swf', 'script' : '".JURI::root(true)."/index.php', 'cancelImg' : '".$this->cancelImagePath."', 'queueID' : 'bfFileQueue', 'auto' : false, 'multi' : ".( isset($mdata['flashUploaderMulti']) && $mdata['flashUploaderMulti'] ? 'true' : 'false' ).", 'buttonText' : ' ', 'onSelect' : function(event, queueID, fileObj){ var tooLarge = ''; var thebytes = ".(isset($mdata['flashUploaderBytes']) && is_numeric($mdata['flashUploaderBytes']) && $mdata['flashUploaderBytes'] > 0 ? intval($mdata['flashUploaderBytes']) : '0')."; if(thebytes > 0 && fileObj.size > thebytes){ bfFlashUploadTooLarge[queueID] = '#ff_elem".$mdata['dbId']."'; tooLarge = ' (".addslashes(BFText::_('COM_BREEZINGFORMS_FLASH_UPLOADER_TOO_LARGE')).")'; } bfFlashUploadAll[queueID] = '#ff_elem".$mdata['dbId']."'; bfFlashFileQueue".$mdata['dbId']."[queueID] = {fname: fileObj.name, tooLarge: tooLarge}; JQuery('#bfFlashFileQueue".$mdata['dbId']."').html( JQuery('#bfFlashFileQueue".$mdata['dbId']."').html() + '<br/>' + '<a href=\"javascript:JQuery(\'#ff_elem".$mdata['dbId']."\').uploadifyCancel(\''+queueID+'\')\"><img src=\"".$this->cancelImagePath."\" border=\"0\"/></a> ' + fileObj.name + tooLarge); }, 'onCancel' : function(event, queueID, fileObj){ delete bfFlashFileQueue".$mdata['dbId']."[queueID]; delete bfFlashUploadTooLarge[queueID]; delete bfFlashUploadAll[queueID]; JQuery('#bfFlashFileQueue".$mdata['dbId']."').html(''); for(qID in bfFlashFileQueue".$mdata['dbId']."){ JQuery('#bfFlashFileQueue".$mdata['dbId']."').html( JQuery('#bfFlashFileQueue".$mdata['dbId']."').html() + '<br/>' + '<a href=\"javascript:JQuery(\'#ff_elem".$mdata['dbId']."\').uploadifyCancel(\''+qID+'\')\"><img src=\"".$this->cancelImagePath."\" border=\"0\"/></a> ' + bfFlashFileQueue".$mdata['dbId']."[qID].fname + bfFlashFileQueue".$mdata['dbId']."[qID].tooLarge ); } }, 'scriptData' : { form: ".$this->p->form.", itemName : '".$mdata['bfName']."', bfFlashUploadTicket: '".$this->flashUploadTicket."', option: 'com_breezingforms', format: 'raw', flashUpload: 'true', Itemid: '".JRequest::getInt('Itemid',0)."' }, //'onError' : function(e,q,f,err) {alert(err.info)}, 'onComplete' : function(event, queueID, fileObj, response, data){ if(response!='1')alert( response ) } ".$exts." }; JQuery('#ff_elem".$mdata['dbId']."').uploadify(bfUploadified_ff_elem".$mdata['dbId']."); //--> </script> "; } if($mdata['attachToAdminMail']){ echo '<input type="hidden" name="attachToAdminMail['.$mdata['bfName'].']" value="true"/>'."\n"; } if($mdata['attachToUserMail']){ echo '<input type="hidden" name="attachToUserMail['.$mdata['bfName'].']" value="true"/>'."\n"; } break; case 'bfSubmitButton': $value = ''; $type = 'submit'; $src = ''; if($mdata['src'] != ''){ $type = 'image'; $src = 'src="'.$mdata['src'].'" '; } if($mdata['value'] != ''){ $value = 'value="'.htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8').'" '; } if($mdata['actionClick'] == 1){ $onclick = 'onclick="populateSummarizers();if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};'.$mdata['actionFunctionName'] . '(this,\'click\');return false;" '; } else { $onclick = 'onclick="populateSummarizers();if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};return false;" '; } if($src == ''){ echo '<button class="ff_elem" '.$value.$src.$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="'.$type.'" name="ff_nm_'.$mdata['bfName'].'[]" id="ff_elem'.$mdata['dbId'].'"><span>'.$mdata['value'].'</span></button>'."\n"; }else{ echo '<input class="ff_elem" '.$value.$src.$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="'.$type.'" name="ff_nm_'.$mdata['bfName'].'[]" id="ff_elem'.$mdata['dbId'].'" value="'.$mdata['value'].'"/>'."\n"; } break; case 'bfHidden': echo '<input class="ff_elem" type="hidden" name="ff_nm_'.$mdata['bfName'].'[]" value="'.htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8').'" id="ff_elem'.$mdata['dbId'].'"/>'."\n"; break; case 'bfSummarize': echo '<span class="ff_elem bfSummarize" id="ff_elem'.$mdata['dbId'].'"></span>'."\n"; echo '<script type="text/javascript">bfRegisterSummarize("ff_elem'.$mdata['dbId'].'", "'.$mdata['connectWith'].'", "'.$mdata['connectType'].'", "'.addslashes($mdata['emptyMessage']).'", '.($mdata['hideIfEmpty'] ? 'true' : 'false').')</script>'; if(trim($mdata['fieldCalc']) != ''){ echo '<script type="text/javascript"> function bfFieldCalcff_elem'.$mdata['dbId'].'(value){ if(!isNaN(value)){ value = Number(value); } '.$mdata['fieldCalc'].' return value; } </script>'; } break; case 'bfReCaptcha': if(isset($mdata['pubkey']) && $mdata['pubkey'] != ''){ JFactory::getDocument()->addScript('http://api.recaptcha.net/js/recaptcha_ajax.js'); JFactory::getDocument()->addScriptDeclaration( ' JQuery(document).ready( function() { document.getElementById("bfReCaptchaWrap").style.display = ""; Recaptcha.create("'.$mdata['pubkey'].'", "bfReCaptchaDiv", { theme: "'.addslashes($mdata['theme']).'" } ); setTimeout("document.getElementById(\"bfReCaptchaSpan\").appendChild(document.getElementById(\"bfReCaptchaWrap\"))",100); } ); '); echo '<span id="bfReCaptchaSpan" class="bfCaptcha">'."\n"; echo '</span>'."\n"; } else { echo '<span class="bfCaptcha">'."\n"; echo 'WARNING: No public key given for ReCaptcha element!'; echo '</span>'."\n"; } break; case 'bfCaptcha': echo '<span class="bfCaptcha">'."\n"; echo '<img alt="" id="ff_capimgValue" class="ff_capimg" src="'.JURI::root(true) . '/index.php?raw=true&option=com_breezingforms&bfCaptcha=true&Itemid='.JRequest::getInt('Itemid',0).'"/>'."\n"; echo '<br/>'; echo '<input class="ff_elem" type="text" name="bfCaptchaEntry" id="bfCaptchaEntry" />'."\n"; echo '<a href="#" class="ff_elem" onclick="document.getElementById(\'bfCaptchaEntry\').value=\'\';document.getElementById(\'bfCaptchaEntry\').focus();document.getElementById(\'ff_capimgValue\').src = \''.JURI::root(true) . '/index.php?raw=true&option=com_breezingforms&bfCaptcha=true&Itemid='.JRequest::getInt('Itemid',0).'&bfMathRandom=\' + Math.random(); return false"><img alt="captcha" src="'.JURI::root(true) . '/components/com_breezingforms/images/captcha/refresh-captcha.png" border="0" /></a>'."\n"; echo '</span>'."\n"; break; case 'bfCalendar': $size = ''; if($mdata['size']!=''){ $size = 'style="width:'.htmlentities(strip_tags($mdata['size'])).'" '; } echo '<span class="bfElementGroupNoWrap" id="bfElementGroupNoWrap'.$mdata['dbId'].'">'."\n"; echo '<input class="ff_elem" '.$size.'type="text" name="ff_nm_'.$mdata['bfName'].'[]" id="ff_elem'.$mdata['dbId'].'" value=""/>'."\n"; echo '<button onclick="showCalendar(\'ff_elem'.$mdata['dbId'].'\', \''.$mdata['format'].'\');" type="submit" class="bfCalendar" value="'.htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8').'"><span>'.htmlentities(trim($mdata['value']), ENT_QUOTES, 'UTF-8').'</span></button>'."\n"; echo '</span>'."\n"; break; case 'bfPayPal': $value = ''; $type = 'submit'; $src = ''; if($mdata['image'] != ''){ $type = 'image'; $src = 'src="'.$mdata['image'].'" '; }else{ $value = 'value="PayPal" '; } if($mdata['actionClick'] == 1){ $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'PayPal\';'.$mdata['actionFunctionName'] . '(this,\'click\');" '; } else { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'PayPal\';" '; } echo '<input class="ff_elem" '.$value.$src.$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="'.$type.'" name="ff_nm_'.$mdata['bfName'].'[]" id="ff_elem'.$mdata['dbId'].'"/>'."\n"; break; case 'bfSofortueberweisung': $value = ''; $type = 'submit'; $src = ''; if($mdata['image'] != ''){ $type = 'image'; $src = 'src="'.$mdata['image'].'" '; }else{ $value = 'value="Sofortueberweisung" '; } if($mdata['actionClick'] == 1){ $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'Sofortueberweisung\';'.$mdata['actionFunctionName'] . '(this,\'click\');" '; } else { $onclick = 'onclick="document.getElementById(\'bfPaymentMethod\').value=\'Sofortueberweisung\';" '; } echo '<input class="ff_elem" '.$value.$src.$tabIndex.$onclick.$onblur.$onchange.$onfocus.$onselect.$readonly.'type="'.$type.'" name="ff_nm_'.$mdata['bfName'].'[]" id="ff_elem'.$mdata['dbId'].'"/>'."\n"; break; } if(isset($mdata['bfName']) && isset($mdata['off']) && $mdata['off']){ echo '<script type="text/javascript">bfDeactivateField["ff_nm_'.$mdata['bfName'].'[]"]=true;</script>'."\n"; } if($mdata['required']){ echo '<span class="bfRequired">*</span>'."\n"; } echo $flashUploader; if($mdata['bfType'] != 'bfHidden'){ if($options['displayType'] == 'breaks'){ echo '</p>'."\n"; } else { echo '</span>'."\n"; } } } } /** * Paging and wrapping of inline element containers */ if($dataObject['properties']['type'] == 'section' && $dataObject['properties']['displayType'] == 'inline'){ echo '<div class="bfClearfix">'."\n"; } if(isset($dataObject['children']) && count($dataObject['children']) != 0){ $childrenAmount = count($dataObject['children']); for($i = 0; $i < $childrenAmount; $i++){ $this->process( $dataObject['children'][$i], $mdata, $parentPage, $i, $childrenAmount ); } } if($dataObject['properties']['type'] == 'section' && $dataObject['properties']['displayType'] == 'inline'){ echo '</div>'."\n"; } if($dataObject['properties']['type'] == 'section' && $dataObject['properties']['bfType'] == 'section'){ echo '</fieldset></div></div></div><div class="bfFieldset-bl"><div class="bfFieldset-br"><div class="bfFieldset-b"></div></div></div></div><!-- bfFieldset-wrapper end -->'."\n"; } else if( $dataObject['properties']['type'] == 'section' && $dataObject['properties']['bfType'] == 'normal' ) { if($dataObject['properties']['name'] != ''){ echo '</div>'."\n"; } } else if($dataObject['properties']['type'] == 'page'){ $isLastPage = false; if($this->rootMdata['lastPageThankYou'] && $dataObject['properties']['pageNumber'] == count($this->dataObject['children']) && count($this->dataObject['children']) > 1){ $isLastPage = true; } if(!$isLastPage){ $last = 0; if($this->rootMdata['lastPageThankYou']){ $last = 1; } if($this->rootMdata['pagingInclude'] && $dataObject['properties']['pageNumber'] > 1){ echo '<button class="bfPrevButton'.$this->fadingClass.'" type="submit" onclick="ff_validate_prevpage(this, \'click\');populateSummarizers();" value="'.htmlentities(trim($this->rootMdata['pagingPrevLabel']), ENT_QUOTES, 'UTF-8').'"><span>'.htmlentities(trim($this->rootMdata['pagingPrevLabel']), ENT_QUOTES, 'UTF-8').'</span></button>'."\n"; } if($this->rootMdata['pagingInclude'] && $dataObject['properties']['pageNumber'] < count($this->dataObject['children']) - $last){ echo '<button class="bfNextButton'.$this->fadingClass.'" type="submit" onclick="ff_validate_nextpage(this, \'click\');populateSummarizers();" value="'.htmlentities(trim($this->rootMdata['pagingNextLabel']), ENT_QUOTES, 'UTF-8').'"><span>'.htmlentities(trim($this->rootMdata['pagingNextLabel']), ENT_QUOTES, 'UTF-8').'</span></button>'."\n"; } if($this->rootMdata['cancelInclude'] && $dataObject['properties']['pageNumber'] + 1 > count($this->dataObject['children']) - $last){ echo '<button class="bfCancelButton'.$this->fadingClass.'" type="submit" onclick="ff_resetForm(this, \'click\');" value="'.htmlentities(trim($this->rootMdata['cancelLabel']), ENT_QUOTES, 'UTF-8').'"><span>'.htmlentities(trim($this->rootMdata['cancelLabel']), ENT_QUOTES, 'UTF-8').'</span></button>'."\n"; } $callSubmit = 'ff_validate_submit(this, \'click\')'; if( $this->hasFlashUpload ){ $callSubmit = 'if(typeof bfAjaxObject101 == \'undefined\' && typeof bfReCaptchaLoaded == \'undefined\'){bfDoFlashUpload()}else{ff_validate_submit(this, \'click\')}'; } if($this->rootMdata['submitInclude'] && $dataObject['properties']['pageNumber'] + 1 > count($this->dataObject['children']) - $last){ echo '<button id="bfSubmitButton" class="bfSubmitButton'.$this->fadingClass.'" type="submit" onclick="if(document.getElementById(\'bfPaymentMethod\')){document.getElementById(\'bfPaymentMethod\').value=\'\';};'.$callSubmit.';" value="'.htmlentities(trim($this->rootMdata['submitLabel']), ENT_QUOTES, 'UTF-8').'"><span>'.htmlentities(trim($this->rootMdata['submitLabel']), ENT_QUOTES, 'UTF-8').'</span></button>'."\n"; } } } }