From: <be...@us...> - 2012-06-25 16:34:26
|
Revision: 9717 http://xoops.svn.sourceforge.net/xoops/?rev=9717&view=rev Author: beckmi Date: 2012-06-25 16:34:13 +0000 (Mon, 25 Jun 2012) Log Message: ----------- Updating Trunk to 1.21 Final Modified Paths: -------------- XoopsModules/xforms/trunk/xforms/admin/about.php XoopsModules/xforms/trunk/xforms/admin/admin_header.php XoopsModules/xforms/trunk/xforms/admin/editelement.php XoopsModules/xforms/trunk/xforms/admin/ele_text.php XoopsModules/xforms/trunk/xforms/admin/ele_upload.php XoopsModules/xforms/trunk/xforms/admin/ele_uploadimg.php XoopsModules/xforms/trunk/xforms/admin/elements.php XoopsModules/xforms/trunk/xforms/admin/index.php XoopsModules/xforms/trunk/xforms/admin/menu.php XoopsModules/xforms/trunk/xforms/class/elementrenderer.php XoopsModules/xforms/trunk/xforms/class/elements.php XoopsModules/xforms/trunk/xforms/class/forms.php XoopsModules/xforms/trunk/xforms/include/form_execute.php XoopsModules/xforms/trunk/xforms/language/english/admin.php XoopsModules/xforms/trunk/xforms/language/english/modinfo.php XoopsModules/xforms/trunk/xforms/xoops_version.php Added Paths: ----------- XoopsModules/xforms/trunk/xforms/admin/admin_footer.php XoopsModules/xforms/trunk/xforms/admin/main.php XoopsModules/xforms/trunk/xforms/docs/ XoopsModules/xforms/trunk/xforms/docs/changelog.txt XoopsModules/xforms/trunk/xforms/docs/credits.txt XoopsModules/xforms/trunk/xforms/docs/index.html XoopsModules/xforms/trunk/xforms/docs/install.txt XoopsModules/xforms/trunk/xforms/docs/lang_diff.txt XoopsModules/xforms/trunk/xforms/docs/licence.txt XoopsModules/xforms/trunk/xforms/docs/readme.txt XoopsModules/xforms/trunk/xforms/language/english/help/ XoopsModules/xforms/trunk/xforms/language/english/help/help.html XoopsModules/xforms/trunk/xforms/language/english/help/index.html Removed Paths: ------------- XoopsModules/xforms/trunk/xforms/admin/footer.php XoopsModules/xforms/trunk/xforms/license.txt Modified: XoopsModules/xforms/trunk/xforms/admin/about.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/about.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/about.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -1,36 +1,29 @@ <?php -############################################################################### -## See license.txt ## -############################################################################### -include 'admin_header.php'; -adminHtmlHeader(); -?> -<img src="../images/xforms.png" alt="xforms" style="float: left; margin: 0 10px 5px 0;" /> -<h4 style="margin: 0;">xForms</h4> -<p style="margin-top: 0;"> -Version <?=number_format($xoopsModule->getVar('version')/100, 2);?><br /> -Presented by <a href="http://www.dylian.melgert.net/software" target="_blank">FliX Software</a> <br /> -Copyright © 2009 Dylian Melgert -<br clear="all" /> -</p> +/** + * xForms module + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * +* @copyright The XOOPS Project (http://www.xoops.org) + * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package xforms + * @since 2.5.0 + * @author Mage, Mamba + * @version $Id $ + **/ -<h4 style="margin: 0;">License</h4> -<p style="margin-top: 0;"> -This software is licensed under the CC-GNU GPL.<br /> -<a href="http://creativecommons.org/licenses/GPL/2.0/" target="_blank">Commons Deed</a> | -<a href="http://www.gnu.org/copyleft/gpl.html" target="_blank">Legal Code</a> -</p> +include_once dirname(__FILE__) . '/admin_header.php'; -<h4 style="margin: 0;">Who to Contact</h4> -<p style="margin-top: 0;"> -Whe have not yet created a support page. -</p> +xoops_cp_header(); -<h4 style="margin: 0;">Special thanks to</h4> -<p style="margin: 0;"> -<a href="http://www.brandycoke.com/" target="_blank">Brandycoke Productions</a> for creating liaise, the module xforms is based on. -</p> +$aboutAdmin = new ModuleAdmin(); -<?php -xoops_cp_footer(); -?> \ No newline at end of file +echo $aboutAdmin->addNavigation('about.php'); +echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); + +include 'admin_footer.php'; \ No newline at end of file Added: XoopsModules/xforms/trunk/xforms/admin/admin_footer.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/admin_footer.php (rev 0) +++ XoopsModules/xforms/trunk/xforms/admin/admin_footer.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -0,0 +1,28 @@ +<?php +/** + * xForms module + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright:: The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package:: xDirectory + * @subpackage:: admin + * @since: 2.5.0 + * @author:: XOOPS Development Team + * @version:: $Id $ +**/ + +echo "<div class='adminfooter'>\n" + ." <div style='text-align: center;'>\n" + ." <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" + ." </div>\n" + ." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" + ."</div>"; + +xoops_cp_footer(); \ No newline at end of file Modified: XoopsModules/xforms/trunk/xforms/admin/admin_header.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/admin_header.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/admin_header.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -1,31 +1,51 @@ <?php -############################################################################### -## See license.txt ## -############################################################################### -include '../../../include/cp_header.php'; +/** + * XoopsPartners module + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright:: The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license:: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} + * @package:: XoopsPartners + * @subpackage:: admin + * @since:: 2.5.0 + * @author:: XOOPS Team + * @version:: $Id $ +**/ + + +$path = dirname(dirname(dirname(dirname(__FILE__)))); +include_once $path . '/mainfile.php'; +include_once $path . '/include/cp_functions.php'; +require_once $path . '/include/cp_header.php'; + include '../include/common.php'; -define('xforms_ADMIN_URL', xforms_URL.'admin/index.php'); +define('xforms_ADMIN_URL', xforms_URL.'admin/main.php'); include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; -function adminHtmlHeader(){ - global $xoopsModule, $xoopsConfig; - $langf = xforms_ROOT_PATH.'language/'.$xoopsConfig['language'].'/modinfo.php'; - if( file_exists($langf) ){ - include $langf; - }else{ - include xforms_ROOT_PATH.'language/english/modinfo.php'; - } - include 'menu.php'; - for( $i=0; $i<4; $i++ ){ - $links[$i] = array(0 => xforms_URL.$adminmenu[$i]['link'], 1 => $adminmenu[$i]['title']); - } - $links[] = array(0 => XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$xoopsModule->getVar('mid'), 1 => _PREFERENCES); - $links[] = array(0=> xforms_URL.'admin/about.php', 1=> 'About'); - $admin_links = '<table class="outer" width="100%" cellspacing="1"><tr>'; - for( $i=0; $i<count($links); $i++ ){ - $admin_links .= '<td class="even" style="width: 20%; text-align: center;"><a href="'.$links[$i][0].'" accesskey="'.($i+1).'">'.$links[$i][1].'</a></td>'; - } - $admin_links .= "</tr></table><br clear='all' />\n"; - xoops_cp_header(); - echo $admin_links; -} -?> \ No newline at end of file + +global $xoopsModule; + +$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); + +//if functions.php file exist +require_once dirname(dirname(__FILE__)) . '/include/functions.php'; + +// Load language files +xoops_loadLanguage('admin', $thisModuleDir); +xoops_loadLanguage('modinfo', $thisModuleDir); +xoops_loadLanguage('main', $thisModuleDir); + +$pathIcon16 = '../'.$xoopsModule->getInfo('icons16'); +$pathIcon32 = '../'.$xoopsModule->getInfo('icons32'); +$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin'); + +if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){ + include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); + }else{ + redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false); + } \ No newline at end of file Modified: XoopsModules/xforms/trunk/xforms/admin/editelement.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/editelement.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/editelement.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -30,7 +30,8 @@ switch($op){ case 'edit': - adminHtmlHeader(); + //adminHtmlHeader(); + xoops_cp_header(); if( !empty($ele_id) ){ $element = $xforms_ele_mgr->get($ele_id); $ele_type = $element->getVar('ele_type'); @@ -136,7 +137,8 @@ redirect_header(xforms_ADMIN_URL, 0, _AM_NOTHING_SELECTED); } if( empty($_POST['ok']) ){ - adminHtmlHeader(); + //adminHtmlHeader(); + xoops_cp_header(); xoops_confirm(array('op' => 'delete', 'ele_id' => $ele_id, 'form_id' => $form_id, 'ok' => 1), _THIS_PAGE, _AM_ELE_CONFIRM_DELETE); }else{ $element = $xforms_ele_mgr->get($ele_id); @@ -249,14 +251,17 @@ } $element->setVar('ele_value', $value); if( !$xforms_ele_mgr->insert($element) ){ - adminHtmlHeader(); + //adminHtmlHeader(); + xoops_cp_header(); echo $element->getHtmlErrors(); }else{ redirect_header(xforms_URL.'admin/elements.php?form_id='.$form_id, 0, _AM_DBUPDATED); } break; default: - adminHtmlHeader(); + xoops_cp_header(); + $indexAdmin = new ModuleAdmin(); + echo $indexAdmin->addNavigation('editelement.php') ; echo "<h4>"._AM_ELE_CREATE."</h4> <ul> <li><a href='"._THIS_PAGE."?op=edit&ele_type=text'>"._AM_ELE_TEXT."</a></li> @@ -272,7 +277,7 @@ ; break; } -include 'footer.php'; +include 'admin_footer.php'; xoops_cp_footer(); Modified: XoopsModules/xforms/trunk/xforms/admin/ele_text.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/ele_text.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/ele_text.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -8,7 +8,9 @@ $max = !empty($value[1]) ? intval($value[1]) : $xoopsModuleConfig['t_max']; $size = new XoopsFormText(_AM_ELE_SIZE, 'ele_value[0]', 3, 3, $size); $max = new XoopsFormText(_AM_ELE_MAX_LENGTH, 'ele_value[1]', 3, 3, $max); -$default = new XoopsFormText(_AM_ELE_DEFAULT, 'ele_value[2]', 50, 255, $myts->htmlspecialchars($myts->stripSlashesGPC($value[2]))); + +//$default = new XoopsFormText(_AM_ELE_DEFAULT, 'ele_value[2]', 50, 255, $myts->htmlspecialchars($myts->stripSlashesGPC($value[2]))); +$default = new XoopsFormText(_AM_ELE_DEFAULT, 'ele_value[2]', 50, 255, isset($value[2]) ? $myts->htmlspecialchars($myts->stripSlashesGPC($value[2])) : ''); $default->setDescription(_AM_ELE_TEXT_DESC); $output->addElement($size, 1); $output->addElement($max, 1); Modified: XoopsModules/xforms/trunk/xforms/admin/ele_upload.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/ele_upload.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/ele_upload.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -5,7 +5,12 @@ if( !defined('xforms_ROOT_PATH') ){ exit(); } $size = !empty($value[0]) ? intval($value[0]) : 0; -$saveas = $value[3] != 1 ? 0 : 1; +//$saveas = $value[3] != 1 ? 0 : 1; +if (isset($value[3]) && $value[3] == 1) { + $saveas = $value[3]; +} else { + $saveas = 0; +} $size = new XoopsFormText(_AM_ELE_UPLOAD_MAXSIZE, 'ele_value[0]', 10, 20, $size); $size->setDescription(_AM_ELE_UPLOAD_MAXSIZE_DESC.'<br />'._AM_ELE_UPLOAD_DESC_SIZE_NOLIMIT); Modified: XoopsModules/xforms/trunk/xforms/admin/ele_uploadimg.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/ele_uploadimg.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/ele_uploadimg.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -7,7 +7,12 @@ $size = !empty($value[0]) ? intval($value[0]) : 0; $ext = empty($ele_id) ? 'jpg|jpeg|gif|png|tif|tiff' : $value[1]; $mime = empty($ele_id) ? 'image/jpeg|image/pjpeg|image/png|image/x-png|image/gif|image/tiff' : $value[2]; -$saveas = $value[3] != 1 ? 0 : 1; +//$saveas = $value[3] != 1 ? 0 : 1; +if (isset($value[3]) && $value[3] == 1) { + $saveas = $value[3]; +} else { + $saveas = 0; +} $width = !empty($value[4]) ? intval($value[4]) : 0; $height = !empty($value[5]) ? intval($value[5]) : 0; Modified: XoopsModules/xforms/trunk/xforms/admin/elements.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/elements.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/elements.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -5,6 +5,8 @@ include 'admin_header.php'; $xforms_ele_mgr = xoops_getmodulehandler('elements'); include_once xforms_ROOT_PATH.'class/elementrenderer.php'; +global $indexAdmin; +$indexAdmin = new ModuleAdmin(); define('_THIS_PAGE', xforms_URL.'admin/elements.php'); if( !isset($_POST['op']) || $_POST['op'] != 'save' ){ $form_id = isset($_GET['form_id']) ? intval($_GET['form_id']) : 0; @@ -12,7 +14,10 @@ redirect_header(xforms_ADMIN_URL, 0, _AM_NOTHING_SELECTED); } $form = $xforms_form_mgr->get($form_id); - adminHtmlHeader(); + + //adminHtmlHeader(); + xoops_cp_header(); + echo $indexAdmin->addNavigation('elements.php') ; $jump = array(); $jump[0] = new XoopsFormSelect('', 'ele_type'); $jump[0]->addOptionArray(array('text' => _AM_ELE_TEXT, @@ -72,10 +77,10 @@ echo '<td class="even" rowspan="2" align="center">'.$check_req->render()."</td>\n"; echo '<td class="even" rowspan="2" align="center">'.$text_order->render()."</td>\n"; echo '<td class="even" rowspan="2" align="center">'.$check_display->render().$hidden_id->render()."</td>\n"; - echo '<td class="even" nowrap="nowrap" rowspan="2"> - <ul><li><a href="editelement.php?op=edit&ele_id='.$id.'&form_id='.$form_id.'">'._EDIT.'</a></li> - <li><a href="editelement.php?op=edit&ele_id='.$id.'&form_id='.$form_id.'&clone=1">'._CLONE.'</a></li> - <li><a href="editelement.php?op=delete&ele_id='.$id.'&form_id='.$form_id.'">'._DELETE.'</a></li></ul></td>'; + echo '<td class="even" align="center" nowrap="nowrap" rowspan="2"> + <a href="editelement.php?op=edit&ele_id='.$id.'&form_id='.$form_id.'"><img src='.$pathIcon16.'/edit.png title='._EDIT.'></a> + <a href="editelement.php?op=edit&ele_id='.$id.'&form_id='.$form_id.'&clone=1"><img src='.$pathIcon16.'/editcopy.png title='._CLONE.'></a> + <a href="editelement.php?op=delete&ele_id='.$id.'&form_id='.$form_id.'"><img src='.$pathIcon16.'/delete.png title='._DELETE.'></a></td>'; echo '</tr>'; echo '<tr><td class="even" colspan="2">'.$ele_value->render()."</td>\n</tr>"; } @@ -228,10 +233,12 @@ redirect_header(_THIS_PAGE.'?form_id='.$form_id, 0, _AM_DBUPDATED); } }else{ - adminHtmlHeader(); + //adminHtmlHeader(); + xoops_cp_header(); + echo $indexAdmin->addNavigation('elements.php') ; echo $error; } } -include 'footer.php'; -xoops_cp_footer(); -?> \ No newline at end of file +include 'admin_footer.php'; +//xoops_cp_footer(); +//?> \ No newline at end of file Deleted: XoopsModules/xforms/trunk/xforms/admin/footer.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/footer.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/footer.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -1,16 +0,0 @@ -<?php -############################################################################### -## See license.txt ## -############################################################################### -$version = number_format($xoopsModule->getVar('version')/100, 2); -$version = !substr($version, -1, 1) ? substr($version, 0, 3) : $version; - -$credits = "<div style='text-align: right; font-size: x-small; margin-top: 15px;'>Powered by <a href='about.php'>xForms ".$version."</a>"; -echo $credits; - -if(version_compare(XOOPS_VERSION, '2.3.0', '>=')){ - echo '<br /><span style="color: #F00;"><b>'._AM_XOOPS_VERSION_WRONG.'</b></span>'; -} - -echo '</div>'; -?> \ No newline at end of file Modified: XoopsModules/xforms/trunk/xforms/admin/index.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/index.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/index.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -1,278 +1,43 @@ -<?php -############################################################################### -## See license.txt ## -############################################################################### -include 'admin_header.php'; -$myts = MyTextSanitizer::getInstance(); -$op = isset($_GET['op']) ? trim($_GET['op']) : 'list'; -$op = isset($_POST['op']) ? trim($_POST['op']) : $op; - -switch($op){ - case 'list': - default: - adminHtmlHeader(); - $criteria = new Criteria(1, 1); - $criteria->setSort('form_order'); - $criteria->setOrder('ASC'); - if( $forms = $xforms_form_mgr->getObjects($criteria, 'admin_list') ){ - echo '<form action="'.xforms_ADMIN_URL.'" method="post"> - <table class="outer" cellspacing="1" width="100%"> - <tr><th colspan="5">'._AM_FORM_LISTING.'</th></tr> - <tr> - <td class="head" align="center">'._AM_ID.'</td> - <td class="head" align="center">'._AM_FORM_ORDER.'<br />'._AM_FORM_ORDER_DESC.'</td> - <td class="head" align="center">'._AM_FORM_TITLE.'</td> - <td class="head" align="center">'._AM_FORM_SENDTO.'</td> - <td class="head" align="center">'._AM_ACTION.'</td> - </tr>'; - foreach( $forms as $f ){ - $id = $f->getVar('form_id'); - $order = new XoopsFormText('', 'order['.$id.']', 3, 2, $f->getVar('form_order')); - $group_mgr = xoops_gethandler('group'); - $sendto = $f->getVar('form_send_to_group'); - if( false != $sendto && $group = $group_mgr->get($sendto) ){ - $sendto = $group->getVar('name'); - }else{ - $sendto = _AM_FORM_SENDTO_ADMIN; - } - $ids = new XoopsFormHidden('ids[]', $id); - echo ' - <tr> - <td class="odd" align="center">'.$id.'</td> - <td class="even" align="center">'.$order->render().'</td> - <td class="odd"><a target="_blank" href="'.xforms_URL.'?form_id='.$id.'">'.$f->getVar('form_title').'</a></td> - <td class="odd" align="center">'.$sendto.'</td> - <td class="odd"><ul> - <li><a href="'.xforms_ADMIN_URL.'?op=edit&form_id='.$id.'">' - ._AM_FORM_ACTION_EDITFORM.'</a></li> - <li><a href="elements.php?form_id='.$id.'">' - ._AM_FORM_ACTION_EDITELEMENT.'</a></li> - <li><a href="'.xforms_ADMIN_URL.'?op=edit&clone=1&form_id='.$id.'">' - ._AM_FORM_ACTION_CLONE.'</a></li> - <li><a href="'.xforms_ADMIN_URL.'?op=delete&form_id='.$id.'">' - ._DELETE.'</a></li> - </ul>'.$ids->render().'</td> - </tr>'; - } - $submit = new XoopsFormButton('', 'submit', _AM_RESET_ORDER, 'submit'); - echo ' - <tr> - <td class="foot"> </td> - <td class="foot" align="center">'.$submit->render().'</td> - <td class="foot" colspan="3"> </td> - </tr> - </table>'; - $hidden = new XoopsFormHidden('op', 'saveorder'); - echo $hidden->render()."\n</form>\n"; - } - break; - - case 'edit': - $clone = isset($_GET['clone']) ? intval($_GET['clone']) : false; - $form_id = isset($_GET['form_id']) ? intval($_GET['form_id']) : 0; - adminHtmlHeader(); - if( !empty($form_id) ){ - $form = $xforms_form_mgr->get($form_id); - }else{ - $form = $xforms_form_mgr->create(); - } - - $text_form_title = new XoopsFormText(_AM_FORM_TITLE, 'form_title', 50, 255, $form->getVar('form_title', 'e')); - - $group_ids = $moduleperm_handler->getGroupIds($xforms_form_mgr->perm_name, $form_id, $xoopsModule->getVar('mid')); - $select_form_group_perm = new XoopsFormSelectGroup(_AM_FORM_PERM, 'form_group_perm', true, $group_ids, 5, true); - - $select_form_send_method = new XoopsFormSelect(_AM_FORM_SEND_METHOD, 'form_send_method', $form->getVar('form_send_method')); - $select_form_send_method->addOption('e', _AM_FORM_SEND_METHOD_MAIL); - $select_form_send_method->addOption('p', _AM_FORM_SEND_METHOD_PM); - $select_form_send_method->setDescription(_AM_FORM_SEND_METHOD_DESC); - - $select_form_send_to_group = new XoopsFormSelectGroup(_AM_FORM_SENDTO, 'form_send_to_group', false, $form->getVar('form_send_to_group')); - $select_form_send_to_group->addOption('0', _AM_FORM_SENDTO_ADMIN); - - $select_form_delimiter = new XoopsFormSelect(_AM_FORM_DELIMETER, 'form_delimiter', $form->getVar('form_delimiter')); - $select_form_delimiter->addOption('s', _AM_FORM_DELIMETER_SPACE); - $select_form_delimiter->addOption('b', _AM_FORM_DELIMETER_BR); - - $text_form_order = new XoopsFormText(_AM_FORM_ORDER, 'form_order', 3, 2, $form->getVar('form_order')); - $text_form_order->setDescription(_AM_FORM_ORDER_DESC); - - $submit_text = $form->getVar('form_submit_text'); - $text_form_submit_text = new XoopsFormText(_AM_FORM_SUBMIT_TEXT, 'form_submit_text', 50, 50, empty($submit_text) ? _SUBMIT : $submit_text); - - $tarea_form_desc = new XoopsFormDhtmlTextArea(_AM_FORM_DESC, 'form_desc', $form->getVar('form_desc', 'e'), 5); - $tarea_form_desc->setDescription(_AM_FORM_DESC_DESC); - - $tarea_form_intro = new XoopsFormDhtmlTextArea(_AM_FORM_INTRO, 'form_intro', $form->getVar('form_intro', 'e'), 10); - $tarea_form_intro->setDescription(_AM_FORM_INTRO_DESC); - - $text_form_whereto = new XoopsFormText(_AM_FORM_WHERETO, 'form_whereto', 50, 255, $form->getVar('form_whereto')); - $text_form_whereto->setDescription(_AM_FORM_WHERETO_DESC); - - $hidden_op = new XoopsFormHidden('op', 'saveform'); - $submit = new XoopsFormButton('', 'submit', _AM_SAVE, 'submit'); - $submit1 = new XoopsFormButton('', 'submit', _AM_SAVE_THEN_ELEMENTS, 'submit'); - $tray = new XoopsFormElementTray(''); - $tray->addElement($submit); - $tray->addElement($submit1); - - if( empty($form_id) ){ - $caption = _AM_FORM_NEW; - }else{ - if( $clone ){ - $caption = sprintf(_AM_COPIED, $form->getVar('form_title')); - $clone_form_id = new XoopsFormHidden('clone_form_id', $form_id); - $text_form_title = new XoopsFormText(_AM_FORM_TITLE, 'form_title', 50, 255, sprintf(_AM_COPIED, $form->getVar('form_title', 'e'))); - }else{ - $caption = sprintf(_AM_FORM_EDIT, $form->getVar('form_title')); - $hidden_form_id = new XoopsFormHidden('form_id', $form_id); - } - } - $output = new XoopsThemeForm($caption, 'editform', xforms_ADMIN_URL); - $output->addElement($text_form_title, true); - $output->addElement($select_form_group_perm); - $output->addElement($select_form_send_method); - $output->addElement($select_form_send_to_group); - $output->addElement($select_form_delimiter); - $output->addElement($text_form_order); - $output->addElement($text_form_submit_text, true); - $output->addElement($tarea_form_desc); - $output->addElement($tarea_form_intro); - $output->addElement($text_form_whereto); - $output->addElement($hidden_op); - if( isset($hidden_form_id) && is_object($hidden_form_id) ){ - $output->addElement($hidden_form_id); - } - if( isset($clone_form_id) && is_object($clone_form_id) ){ - $output->addElement($clone_form_id); - } - $output->addElement($tray); - $output->display(); - break; - - case 'delete': - if( empty($_POST['ok']) ){ - adminHtmlHeader(); - xoops_confirm(array('op' => 'delete', 'form_id' => $_GET['form_id'], 'ok' => 1), xforms_ADMIN_URL, _AM_FORM_CONFIRM_DELETE); - }else{ - $form_id = intval($_POST['form_id']); - if( empty($form_id) ){ - redirect_header(xforms_ADMIN_URL, 0, _AM_NOTHING_SELECTED); - } - $form = $xforms_form_mgr->get($form_id); - $xforms_form_mgr->delete($form); - $xforms_ele_mgr = xoops_getmodulehandler('elements'); - $criteria = new Criteria('form_id', $form_id); - $xforms_ele_mgr->deleteAll($criteria); - $xforms_form_mgr->deleteFormPermissions($form_id); - redirect_header(xforms_ADMIN_URL, 0, _AM_DBUPDATED); - } - break; - - case 'saveorder': - if( !isset($_POST['ids']) || count($_POST['ids']) < 1 ){ - redirect_header(xforms_ADMIN_URL, 0, _AM_NOTHING_SELECTED); - } - extract($_POST); - foreach( $ids as $id ){ - $form = $xforms_form_mgr->get($id); - $form->setVar('form_order', $order[$id]); - $xforms_form_mgr->insert($form); - } - redirect_header(xforms_ADMIN_URL, 0, _AM_DBUPDATED); - break; - - case 'saveform': - if( !isset($_POST['submit']) ){ - redirect_header(xforms_ADMIN_URL, 0, _AM_NOTHING_SELECTED); - } - $error = ''; - extract($_POST); - if( !empty($form_id) ){ - $form = $xforms_form_mgr->get($form_id); - }else{ - $form = $xforms_form_mgr->create(); - } - $form->setVar('form_send_method', $form_send_method); - $form->setVar('form_send_to_group', $form_send_to_group); - $form->setVar('form_order', $form_order); - $form->setVar('form_delimiter', $form_delimiter); - $form->setVar('form_title', $form_title); - $form->setVar('form_submit_text', $form_submit_text); - $form->setVar('form_desc', $form_desc); - $form->setVar('form_intro', $form_intro); - $form->setVar('form_whereto', $form_whereto); - if( !$ret = $xforms_form_mgr->insert($form) ){ - $error = $form->getHtmlErrors(); - }else{ - $xforms_form_mgr->deleteFormPermissions($ret); - if( count($form_group_perm) > 0 ){ - $xforms_form_mgr->insertFormPermissions($ret, $form_group_perm); - } - if( !empty($clone_form_id) ){ - $xforms_ele_mgr = xoops_getmodulehandler('elements'); - $criteria = new Criteria('form_id', $clone_form_id); - $count = $xforms_ele_mgr->getCount($criteria); - if( $count > 0 ){ - $elements = $xforms_ele_mgr->getObjects($criteria); - foreach( $elements as $e ){ - $cloned = $e->xoopsClone(); - $cloned->setVar('form_id', $ret); - if( !$xforms_ele_mgr->insert($cloned) ){ - $error .= $cloned->getHtmlErrors(); - } - } - } - }elseif( empty($form_id) ){ - $xforms_ele_mgr = xoops_getmodulehandler('elements'); - $error = $xforms_ele_mgr->insertDefaults($ret); - } - } - if( !empty($error) ){ - adminHtmlHeader(); - echo $error; - }else{ - if( $_POST['submit'] == _AM_SAVE_THEN_ELEMENTS ){ - redirect_header(xforms_URL.'admin/elements.php?form_id='.$ret, 0, _AM_DBUPDATED); - }else{ - redirect_header(xforms_ADMIN_URL.'?op=edit&form_id='.$ret, 0, _AM_DBUPDATED); - } - } - break; - - case 'liaise_import': - adminHtmlHeader(); - //include(XOOPS_ROOT_PATH."/modules/xforms/admin/liaise_import.php"); - if(file_exists(XOOPS_ROOT_PATH."/modules/liaise/xoops_version.php")){ - $sql = array(); - $sql[0] = "DROP TABLE `".$xoopsDB -> prefix( 'xforms_formelements' )."`;"; - $sql[1] = "CREATE TABLE ".$xoopsDB -> prefix( 'xforms_formelements' )." LIKE ".$xoopsDB -> prefix( 'liaise_formelements' ).";"; - $sql[2] = "INSERT ".$xoopsDB -> prefix( 'xforms_formelements' )." SELECT * FROM ".$xoopsDB -> prefix( 'liaise_formelements' ).";"; - $sql[3] = "DROP TABLE `".$xoopsDB -> prefix( 'xforms_forms' )."`;"; - $sql[4] = "CREATE TABLE ".$xoopsDB -> prefix( 'xforms_forms' )." LIKE ".$xoopsDB -> prefix( 'liaise_forms' ).";"; - $sql[5] = "INSERT ".$xoopsDB -> prefix( 'xforms_forms' )." SELECT * FROM ".$xoopsDB -> prefix( 'liaise_forms' ).";"; - - $number = count($sql); - for( $i=0; $i<count($sql); $i++ ){ - if(false == $xoopsDB->queryF($sql[$i])) { - echo 'ERROR: '.$xoopsDB->error().' ('.$xoopsDB->errno().')<br />'; - $number--; - /*}else{ - echo 'The query "'.$sql[$i].'" is executed...<br />';*/ - } - } - - If ($number == count($sql)) { - echo '<br /><strong>'._AM_IMPORT_SUCCES.'</strong>'; - }else{ - echo '<br /><strong>'._AM_IMPORT_FAILED.'</strong>'; - } - }else{ - echo _AM_IMPORT_NFND; - } - break; -} - -include 'footer.php'; -xoops_cp_footer(); -?> \ No newline at end of file +<?php +// $Id$ +// ------------------------------------------------------------------------ // +// XOOPS - PHP Content Management System // +// Copyright (c) 2000 XOOPS.org // +// <http://www.xoops.org/> // +// ------------------------------------------------------------------------ // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// You may not change or alter any portion of this comment or credits // +// of supporting developers from this source code or any supporting // +// source code which is considered copyrighted (c) material of the // +// original comment or credit authors. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// ------------------------------------------------------------------------ // +// Hacks provided by: Adam Frick // +// e-mail: afr...@ya... // +// Purpose: Create a yellow-page like business directory for xoops using // +// the mylinks module as the foundation. // +// ------------------------------------------------------------------------- // + +require_once '../../../include/cp_header.php'; +include_once 'admin_header.php'; + +xoops_cp_header(); + + $index_admin = new ModuleAdmin(); + echo $index_admin->addNavigation('index.php') ; + echo $index_admin->renderIndex(); + + +include "admin_footer.php"; \ No newline at end of file Added: XoopsModules/xforms/trunk/xforms/admin/main.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/main.php (rev 0) +++ XoopsModules/xforms/trunk/xforms/admin/main.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -0,0 +1,284 @@ +<?php +############################################################################### +## See license.txt ## +############################################################################### +include 'admin_header.php'; +$myts = MyTextSanitizer::getInstance(); +$op = isset($_GET['op']) ? trim($_GET['op']) : 'list'; +$op = isset($_POST['op']) ? trim($_POST['op']) : $op; + +switch($op){ + case 'list': + default: + xoops_cp_header(); + $indexAdmin = new ModuleAdmin(); + echo $indexAdmin->addNavigation('main.php') ; + $criteria = new Criteria(1, 1); + $criteria->setSort('form_order'); + $criteria->setOrder('ASC'); + if( $forms = $xforms_form_mgr->getObjects($criteria, 'admin_list') ){ + echo '<form action="'.xforms_ADMIN_URL.'" method="post"> + <table class="outer" cellspacing="1" width="100%"> + <tr><th colspan="5">'._AM_FORM_LISTING.'</th></tr> + <tr> + <td class="head" align="center">'._AM_ID.'</td> + <td class="head" align="center">'._AM_FORM_ORDER.'<br />'._AM_FORM_ORDER_DESC.'</td> + <td class="head" align="center">'._AM_FORM_TITLE.'</td> + <td class="head" align="center">'._AM_FORM_SENDTO.'</td> + <td class="head" align="center">'._AM_ACTION.'</td> + </tr>'; + foreach( $forms as $f ){ + $id = $f->getVar('form_id'); + $order = new XoopsFormText('', 'order['.$id.']', 3, 2, $f->getVar('form_order')); + $group_mgr = xoops_gethandler('group'); + $sendto = $f->getVar('form_send_to_group'); + if( false != $sendto && $group = $group_mgr->get($sendto) ){ + $sendto = $group->getVar('name'); + }else{ + $sendto = _AM_FORM_SENDTO_ADMIN; + } + $ids = new XoopsFormHidden('ids[]', $id); + echo ' + <tr> + <td class="odd" align="center">'.$id.'</td> + <td class="even" align="center">'.$order->render().'</td> + <td class="odd"><a target="_blank" href="'.xforms_URL.'?form_id='.$id.'">'.$f->getVar('form_title').'</a></td> + <td class="odd" align="center">'.$sendto.'</td> + <td class="odd" align="center"> + <a href="'.xforms_ADMIN_URL.'?op=edit&form_id='.$id.'"><img src='.$pathIcon16.'/edit.png title='._AM_FORM_ACTION_EDITFORM.'alt='._AM_FORM_ACTION_EDITFORM.'></a> + <a href="'.'elements.php?form_id='.$id.'"><img src='.$pathIcon16.'/1day.png title='._AM_FORM_ACTION_EDITELEMENT.'alt='._AM_FORM_ACTION_EDITELEMENT.'></a> + <a href="'.xforms_ADMIN_URL.'?op=edit&clone=1&form_id='.$id.'"><img src='.$pathIcon16.'/editcopy.png title='._AM_FORM_ACTION_CLONE.'alt='._AM_FORM_ACTION_CLONE.'></a> + + <a href="'.xforms_ADMIN_URL.'?op=delete&form_id='.$id.'"><img src='.$pathIcon16.'/delete.png title='._DELETE.' alt='._DELETE.'></a>'.$ids->render() + .'</td> + </tr>'; + } + $submit = new XoopsFormButton('', 'submit', _AM_RESET_ORDER, 'submit'); + echo ' + <tr> + <td class="foot"> </td> + <td class="foot" align="center">'.$submit->render().'</td> + <td class="foot" colspan="3"> </td> + </tr> + </table>'; + $hidden = new XoopsFormHidden('op', 'saveorder'); + echo $hidden->render()."\n</form>\n"; + } + break; + + case 'edit': + $clone = isset($_GET['clone']) ? intval($_GET['clone']) : false; + $form_id = isset($_GET['form_id']) ? intval($_GET['form_id']) : 0; + xoops_cp_header(); + $indexAdmin = new ModuleAdmin(); + echo $indexAdmin->addNavigation('main.php?op=edit') ; + if( !empty($form_id) ){ + $form = $xforms_form_mgr->get($form_id); + }else{ + $form = $xforms_form_mgr->create(); + } + + $text_form_title = new XoopsFormText(_AM_FORM_TITLE, 'form_title', 50, 255, $form->getVar('form_title', 'e')); + + $group_ids = $moduleperm_handler->getGroupIds($xforms_form_mgr->perm_name, $form_id, $xoopsModule->getVar('mid')); + $select_form_group_perm = new XoopsFormSelectGroup(_AM_FORM_PERM, 'form_group_perm', true, $group_ids, 5, true); + + $select_form_send_method = new XoopsFormSelect(_AM_FORM_SEND_METHOD, 'form_send_method', $form->getVar('form_send_method')); + $select_form_send_method->addOption('e', _AM_FORM_SEND_METHOD_MAIL); + $select_form_send_method->addOption('p', _AM_FORM_SEND_METHOD_PM); + $select_form_send_method->setDescription(_AM_FORM_SEND_METHOD_DESC); + + $select_form_send_to_group = new XoopsFormSelectGroup(_AM_FORM_SENDTO, 'form_send_to_group', false, $form->getVar('form_send_to_group')); + $select_form_send_to_group->addOption('0', _AM_FORM_SENDTO_ADMIN); + + $select_form_delimiter = new XoopsFormSelect(_AM_FORM_DELIMETER, 'form_delimiter', $form->getVar('form_delimiter')); + $select_form_delimiter->addOption('s', _AM_FORM_DELIMETER_SPACE); + $select_form_delimiter->addOption('b', _AM_FORM_DELIMETER_BR); + + $text_form_order = new XoopsFormText(_AM_FORM_ORDER, 'form_order', 3, 2, $form->getVar('form_order')); + $text_form_order->setDescription(_AM_FORM_ORDER_DESC); + + $submit_text = $form->getVar('form_submit_text'); + $text_form_submit_text = new XoopsFormText(_AM_FORM_SUBMIT_TEXT, 'form_submit_text', 50, 50, empty($submit_text) ? _SUBMIT : $submit_text); + + $tarea_form_desc = new XoopsFormDhtmlTextArea(_AM_FORM_DESC, 'form_desc', $form->getVar('form_desc', 'e'), 5); + $tarea_form_desc->setDescription(_AM_FORM_DESC_DESC); + + $tarea_form_intro = new XoopsFormDhtmlTextArea(_AM_FORM_INTRO, 'form_intro', $form->getVar('form_intro', 'e'), 10); + $tarea_form_intro->setDescription(_AM_FORM_INTRO_DESC); + + $text_form_whereto = new XoopsFormText(_AM_FORM_WHERETO, 'form_whereto', 50, 255, $form->getVar('form_whereto')); + $text_form_whereto->setDescription(_AM_FORM_WHERETO_DESC); + + $hidden_op = new XoopsFormHidden('op', 'saveform'); + $submit = new XoopsFormButton('', 'submit', _AM_SAVE, 'submit'); + $submit1 = new XoopsFormButton('', 'submit', _AM_SAVE_THEN_ELEMENTS, 'submit'); + $tray = new XoopsFormElementTray(''); + $tray->addElement($submit); + $tray->addElement($submit1); + + if( empty($form_id) ){ + $caption = _AM_FORM_NEW; + }else{ + if( $clone ){ + $caption = sprintf(_AM_COPIED, $form->getVar('form_title')); + $clone_form_id = new XoopsFormHidden('clone_form_id', $form_id); + $text_form_title = new XoopsFormText(_AM_FORM_TITLE, 'form_title', 50, 255, sprintf(_AM_COPIED, $form->getVar('form_title', 'e'))); + }else{ + $caption = sprintf(_AM_FORM_EDIT, $form->getVar('form_title')); + $hidden_form_id = new XoopsFormHidden('form_id', $form_id); + } + } + $output = new XoopsThemeForm($caption, 'editform', xforms_ADMIN_URL); + $output->addElement($text_form_title, true); + $output->addElement($select_form_group_perm); + $output->addElement($select_form_send_method); + $output->addElement($select_form_send_to_group); + $output->addElement($select_form_delimiter); + $output->addElement($text_form_order); + $output->addElement($text_form_submit_text, true); + $output->addElement($tarea_form_desc); + $output->addElement($tarea_form_intro); + $output->addElement($text_form_whereto); + $output->addElement($hidden_op); + if( isset($hidden_form_id) && is_object($hidden_form_id) ){ + $output->addElement($hidden_form_id); + } + if( isset($clone_form_id) && is_object($clone_form_id) ){ + $output->addElement($clone_form_id); + } + $output->addElement($tray); + $output->display(); + break; + + case 'delete': + if( empty($_POST['ok']) ){ + //adminHtmlHeader(); + xoops_cp_header(); + xoops_confirm(array('op' => 'delete', 'form_id' => $_GET['form_id'], 'ok' => 1), xforms_ADMIN_URL, _AM_FORM_CONFIRM_DELETE); + }else{ + $form_id = intval($_POST['form_id']); + if( empty($form_id) ){ + redirect_header(xforms_ADMIN_URL, 0, _AM_NOTHING_SELECTED); + } + $form = $xforms_form_mgr->get($form_id); + $xforms_form_mgr->delete($form); + $xforms_ele_mgr = xoops_getmodulehandler('elements'); + $criteria = new Criteria('form_id', $form_id); + $xforms_ele_mgr->deleteAll($criteria); + $xforms_form_mgr->deleteFormPermissions($form_id); + redirect_header(xforms_ADMIN_URL, 0, _AM_DBUPDATED); + } + break; + + case 'saveorder': + if( !isset($_POST['ids']) || count($_POST['ids']) < 1 ){ + redirect_header(xforms_ADMIN_URL, 0, _AM_NOTHING_SELECTED); + } + extract($_POST); + foreach( $ids as $id ){ + $form = $xforms_form_mgr->get($id); + $form->setVar('form_order', $order[$id]); + $xforms_form_mgr->insert($form); + } + redirect_header(xforms_ADMIN_URL, 0, _AM_DBUPDATED); + break; + + case 'saveform': + if( !isset($_POST['submit']) ){ + redirect_header(xforms_ADMIN_URL, 0, _AM_NOTHING_SELECTED); + } + $error = ''; + extract($_POST); + if( !empty($form_id) ){ + $form = $xforms_form_mgr->get($form_id); + }else{ + $form = $xforms_form_mgr->create(); + } + $form->setVar('form_send_method', $form_send_method); + $form->setVar('form_send_to_group', $form_send_to_group); + $form->setVar('form_order', $form_order); + $form->setVar('form_delimiter', $form_delimiter); + $form->setVar('form_title', $form_title); + $form->setVar('form_submit_text', $form_submit_text); + $form->setVar('form_desc', $form_desc); + $form->setVar('form_intro', $form_intro); + $form->setVar('form_whereto', $form_whereto); + if( !$ret = $xforms_form_mgr->insert($form) ){ + $error = $form->getHtmlErrors(); + }else{ + $xforms_form_mgr->deleteFormPermissions($ret); + if( count($form_group_perm) > 0 ){ + $xforms_form_mgr->insertFormPermissions($ret, $form_group_perm); + } + if( !empty($clone_form_id) ){ + $xforms_ele_mgr = xoops_getmodulehandler('elements'); + $criteria = new Criteria('form_id', $clone_form_id); + $count = $xforms_ele_mgr->getCount($criteria); + if( $count > 0 ){ + $elements = $xforms_ele_mgr->getObjects($criteria); + foreach( $elements as $e ){ + $cloned = $e->xoopsClone(); + $cloned->setVar('form_id', $ret); + if( !$xforms_ele_mgr->insert($cloned) ){ + $error .= $cloned->getHtmlErrors(); + } + } + } + }elseif( empty($form_id) ){ + $xforms_ele_mgr = xoops_getmodulehandler('elements'); + $error = $xforms_ele_mgr->insertDefaults($ret); + } + } + if( !empty($error) ){ + //adminHtmlHeader(); + xoops_cp_header(); + echo $error; + }else{ + if( $_POST['submit'] == _AM_SAVE_THEN_ELEMENTS ){ + redirect_header(xforms_URL.'admin/elements.php?form_id='.$ret, 0, _AM_DBUPDATED); + }else{ + redirect_header(xforms_ADMIN_URL.'?op=edit&form_id='.$ret, 0, _AM_DBUPDATED); + } + } + break; + + case 'liaise_import': + xoops_cp_header(); + $indexAdmin = new ModuleAdmin(); + echo $indexAdmin->addNavigation('main.php?op=liaise_import'); + + //include(XOOPS_ROOT_PATH."/modules/xforms/admin/liaise_import.php"); + if(file_exists(XOOPS_ROOT_PATH."/modules/liaise/xoops_version.php")){ + $sql = array(); + $sql[0] = "DROP TABLE `".$xoopsDB -> prefix( 'xforms_formelements' )."`;"; + $sql[1] = "CREATE TABLE ".$xoopsDB -> prefix( 'xforms_formelements' )." LIKE ".$xoopsDB -> prefix( 'liaise_formelements' ).";"; + $sql[2] = "INSERT ".$xoopsDB -> prefix( 'xforms_formelements' )." SELECT * FROM ".$xoopsDB -> prefix( 'liaise_formelements' ).";"; + $sql[3] = "DROP TABLE `".$xoopsDB -> prefix( 'xforms_forms' )."`;"; + $sql[4] = "CREATE TABLE ".$xoopsDB -> prefix( 'xforms_forms' )." LIKE ".$xoopsDB -> prefix( 'liaise_forms' ).";"; + $sql[5] = "INSERT ".$xoopsDB -> prefix( 'xforms_forms' )." SELECT * FROM ".$xoopsDB -> prefix( 'liaise_forms' ).";"; + + $number = count($sql); + for( $i=0; $i<count($sql); $i++ ){ + if(false == $xoopsDB->queryF($sql[$i])) { + echo 'ERROR: '.$xoopsDB->error().' ('.$xoopsDB->errno().')<br />'; + $number--; + /*}else{ + echo 'The query "'.$sql[$i].'" is executed...<br />';*/ + } + } + + If ($number == count($sql)) { + echo '<br /><strong>'._AM_IMPORT_SUCCES.'</strong>'; + }else{ + echo '<br /><strong>'._AM_IMPORT_FAILED.'</strong>'; + } + }else{ + echo _AM_IMPORT_NFND; + } + break; +} + +include 'admin_footer.php'; +xoops_cp_footer(); +?> \ No newline at end of file Modified: XoopsModules/xforms/trunk/xforms/admin/menu.php =================================================================== --- XoopsModules/xforms/trunk/xforms/admin/menu.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/admin/menu.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -27,12 +27,34 @@ ## along with this program; if not, write to the Free Software ## ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## ############################################################################### -$adminmenu[0]['title'] = _MI_xforms_ADMENU1; -$adminmenu[0]['link'] = "admin/index.php"; -$adminmenu[1]['title'] = _MI_xforms_ADMENU2; -$adminmenu[1]['link'] = "admin/index.php?op=edit"; -$adminmenu[2]['title'] = _MI_xforms_ADMENU3; -$adminmenu[2]['link'] = "admin/editelement.php"; -$adminmenu[3]['title'] = _MI_xforms_ADMENU4; -$adminmenu[3]['link'] = "admin/index.php?op=liaise_import"; -?> \ No newline at end of file +$module_handler =& xoops_gethandler('module'); +$xoopsModule =& XoopsModule::getByDirname('xforms'); +$moduleInfo =& $module_handler->get($xoopsModule->getVar('mid')); +$pathIcon32 = $moduleInfo->getInfo('icons32'); + +$adminmenu = array(); + +$i = 1; +$adminmenu[$i]['title'] = _MI_xforms_ADMENU0 ; +$adminmenu[$i]['link'] = 'admin/index.php' ; +$adminmenu[$i]['icon'] = $pathIcon32.'/home.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_xforms_ADMENU1 ; +$adminmenu[$i]['link'] = 'admin/main.php' ; +$adminmenu[$i]['icon'] = $pathIcon32.'/manage.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_xforms_ADMENU2 ; +$adminmenu[$i]['link'] = 'admin/main.php?op=edit'; +$adminmenu[$i]['icon'] = $pathIcon32.'/add.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_xforms_ADMENU3 ; +$adminmenu[$i]['link'] = 'admin/editelement.php' ; +$adminmenu[$i]['icon'] = $pathIcon32.'/insert_table_row.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_xforms_ADMENU4 ; +$adminmenu[$i]['link'] = 'admin/main.php?op=liaise_import' ; +$adminmenu[$i]['icon'] = $pathIcon32.'/compfile.png' ; +$i++; +$adminmenu[$i]['title'] = _MI_xforms_ADMENU5; +$adminmenu[$i]['link'] = "admin/about.php"; +$adminmenu[$i]['icon'] = $pathIcon32.'/about.png'; \ No newline at end of file Modified: XoopsModules/xforms/trunk/xforms/class/elementrenderer.php =================================================================== --- XoopsModules/xforms/trunk/xforms/class/elementrenderer.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/class/elementrenderer.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -103,7 +103,7 @@ $form_ele = new XoopsFormElementTray($ele_caption, $delimiter == 'b' ? '<br />' : ' '); while( $o = each($options) ){ - $t =& new XoopsFormCheckBox( + $t = new XoopsFormCheckBox( '', $form_ele_id.'[]', $selected @@ -141,7 +141,7 @@ case 'b': $form_ele = new XoopsFormElementTray($ele_caption, '<br />'); while( $o = each($options) ){ - $t =& new XoopsFormRadio( + $t = new XoopsFormRadio( '', $form_ele_id, $selected Modified: XoopsModules/xforms/trunk/xforms/class/elements.php =================================================================== --- XoopsModules/xforms/trunk/xforms/class/elements.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/class/elements.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -19,12 +19,12 @@ } } -class xformsElementsHandler { +class xformsElementsHandler extends XoopsPersistableObjectHandler{ var $db; var $db_table; var $obj_class = 'xformsElements'; - function xformsElementsHandler($db) { + function __construct($db) { $this->db = $db; $this->db_table = $this->db->prefix('xforms_formelements'); } @@ -157,9 +157,9 @@ $elements = new $this->obj_class(); $elements->assignVars($myrow); if( !$id_as_key ){ - $ret[] = &$elements; + $ret[] =& $elements; }else{ - $ret[$myrow['ele_id']] = &$elements; + $ret[$myrow['ele_id']] =& $elements; } unset($elements); } Modified: XoopsModules/xforms/trunk/xforms/class/forms.php =================================================================== --- XoopsModules/xforms/trunk/xforms/class/forms.php 2012-06-25 16:26:38 UTC (rev 9716) +++ XoopsModules/xforms/trunk/xforms/class/forms.php 2012-06-25 16:34:13 UTC (rev 9717) @@ -22,13 +22,13 @@ } } -class xformsFormsHandler extends XoopsObjectHandler { +class xformsFormsHandler extends XoopsPersistableObjectHandler { var $db; var $db_table; var $perm_name = 'xforms_form_access'; var $obj_class = 'xformsForms'; - function xformsFormsHandler(&$db){ + function __construct(&$db){ $this->db = $db; $this->db_table = $this->db->prefix('xforms_forms'); } Added: XoopsModules/xforms/trunk/xforms/docs/changelog.txt =================================================================== --- XoopsModules/xforms/trunk/xforms/docs/changelog.txt (rev 0) +++ XoopsModules/xforms/trunk/xforms/docs/changelog.txt 2012-06-25 16:34:13 UTC (rev 9717) @@ -0,0 +1,13 @@ +1.21 Mamba (2011-07-18) +================================= +- fixing some bugs: (black_beard) +- updated to the XOOPS 2.5.x Admin GUI (mamba) + +1.20 Dylian (2010-6-30 +================================= +slight improvements + +1.00 Dylian (2009-6-29 +================================= +- Original release of the clone of Liaiss + Added: XoopsModules/xforms/trunk/xforms/docs/credits.txt =================================================================== --- XoopsModules/xforms/trunk/xforms/docs/credits.txt (rev 0) +++ XoopsModules/xforms/trunk/xforms/docs/credits.txt 2012-06-25 16:34:13 UTC (rev 9717) @@ -0,0 +1,5 @@ +Credits +=============== +Developed by Dylian Melgert (http://www.dylian.eu/) and based on Liaise module by Brandycoke Productions (http://www.brandycoke.com) + +Updated to XOOPS 2.5.0 Standard GUI by Michael Beck (Mamba), with contributios by Gregory Mage (Mage) Added: XoopsModules/xforms/trunk/xforms/docs/index.html =================================================================== --- XoopsModules/xforms/trunk/xforms/docs/index.html (rev 0) +++ XoopsModules/xforms/trunk/xforms/docs/index.html 2012-06-25 16:34:13 UTC (rev 9717) @@ -0,0 +1 @@ +<script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/xforms/trunk/xforms/docs/install.txt =================================================================== --- XoopsModules/xforms/trunk/xforms/docs/install.txt (rev 0) +++ XoopsModules/xforms/trunk/xforms/docs/install.txt 2012-06-25 16:34:13 UTC (rev 9717) @@ -0,0 +1,6 @@ +INSTALL/UNISTALL +================= + +No special measures necessary, follow the standard installation process \x96 extract the /xforms folder into the ../modules directory. Install the module through Admin -> System Module -> Modules. + +Detailed instructions on installing modules are available in the XOOPS Operations Manual (http://goo.gl/adT2i) \ No newline at end of file Added: XoopsModules/xforms/trunk/xforms/docs/lang_diff.txt =================================================================== --- XoopsModules/xforms/trunk/xforms/docs/lang_diff.txt (rev 0) +++ XoopsModules/xforms/trunk/xforms/docs/lang_diff.txt 2012-06-25 16:34:13 UTC (rev 9717) @@ -0,0 +1,56 @@ +LANGUAGE DIFFERENCES +===================== + +Below are language differences from a version to next version. + +Version 1.11 +---------------- +admin.php +---------- +Changed prefixes for defines from '_AM_' to _AM_XPARTNERS_' + +// About.php +define("_AM_XPARTNERS_ABOUT_RELEASEDATE", "Released: "); +define("_AM_XPARTNERS_ABOUT_UPDATEDATE", "Updated: "); +define("_AM_XPARTNERS_ABOUT_AUTHOR", "Author: "); +define("_AM_XPARTNERS_ABOUT_CREDITS", "Credits: "); +define("_AM_XPARTNERS_ABOUT_LICENSE", "License: "); +define("_AM_XPARTNERS_ABOUT_MODULE_STATUS", "Status: "); +define("_AM_XPARTNERS_ABOUT_WEBSITE", "Website: "); +define("_AM_XPARTNERS_ABOUT_AUTHOR_NAME", "Author name: "); +define("_AM_XPARTNERS_ABOUT_CHANGELOG", "Change Log"); +define("_AM_XPARTNERS_ABOUT_MODULE_INFO", "Module Infos"); +define("_AM_XPARTNERS_ABOUT_AUTHOR_INFO", "Author Infos"); +define("_AM_XPARTNERS_ABOUT_DESCRIPTION", "Description: "); +define("_AM_XPARTNERS_EMPTYDATABASE", "There is nothing to sort. Please add some Partners first!"); + +define("_AM_XPARTNERS_ACTIONS", "Actions"); +define("_AM_XPARTNERS_INVALIDID", "No partner exists with this ID"); + +Removed: +_AM_EDIT +_AM_DELETE + +blocks.php +----------- +Changed prefix of all defines from '_MB_' to '_MB_XPARTNERS_' + +help.php +----------- +New file with defines + +main.php +----------- +//file /admin/index.php +define("_MD_XPARTNERS_DASHBOARD","Xoops Partner Dashboard"); +define("_MD_XPARTNERS_TOTALPARTNERS","Total Partners: <strong>%s</strong> "); +define("_MD_XPARTNERS_TOTALACTIVE","Active Partners: <strong>%s</strong> "); +define("_MD_XPARTNERS_TOTALNONACTIVE","Non-Active Partners: <strong>%s</strong> "); +//define("_MD_XPARTNERS_TOTALPARTNERS","There are <strong>%s</strong> Active Partners in our Database"); + +modinfo.php +------------- +// index.php +define("_MI_XPARTNERS_MENU_01", "Home"); +define("_PARTNERS_ADMIN_ABOUT", "About"); +define("_PARTNERS_ADMIN_HELP", "Help"); \ No newline at end of file Added: XoopsModules/xforms/trunk/xforms/docs/licence.txt =================================================================== --- XoopsModules/xforms/trunk/xforms/docs/licence.txt (rev 0) +++ XoopsModules/xforms/trunk/xforms/docs/licence.txt 2012-06-25 16:34:13 UTC (rev 9717) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + doe... [truncated message content] |