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 ?>