|
From: <be...@us...> - 2012-11-22 19:38:40
|
Revision: 10267
http://sourceforge.net/p/xoops/svn/10267
Author: beckmi
Date: 2012-11-22 19:38:36 +0000 (Thu, 22 Nov 2012)
Log Message:
-----------
Add Country and Date selection (Mariane)
Modified Paths:
--------------
XoopsModules/xforms/branches/mamba/xforms/admin/editelement.php
XoopsModules/xforms/branches/mamba/xforms/admin/elements.php
XoopsModules/xforms/branches/mamba/xforms/class/elementrenderer.php
XoopsModules/xforms/branches/mamba/xforms/docs/changelog.txt
XoopsModules/xforms/branches/mamba/xforms/docs/lang_diff.txt
XoopsModules/xforms/branches/mamba/xforms/include/form_execute.php
XoopsModules/xforms/branches/mamba/xforms/language/english/admin.php
XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php
XoopsModules/xforms/branches/mamba/xforms/xoops_version.php
Added Paths:
-----------
XoopsModules/xforms/branches/mamba/xforms/admin/ele_date.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_select_ctry.php
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/editelement.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/editelement.php 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/editelement.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -79,6 +79,12 @@
case 'select':
include 'ele_select.php';
break;
+ case 'select2':
+ include 'ele_select_ctry.php';
+ break;
+ case 'date':
+ include 'ele_date.php';
+ break;
case 'checkbox':
include 'ele_check.php';
break;
@@ -204,6 +210,36 @@
}
$value[2] = $v2;
break;
+ case 'select2':
+ $value[0] = $ele_value[0]>1 ? intval($ele_value[0]) : 1;
+ $value[1] = !empty($ele_value[1]) ? 1 : 0;
+ $value[2] = !empty($ele_value[2]) ? $ele_value[2] : 'LB';
+ /*
+ $v2 = array();
+ $multi_flag = 1;
+ while( $v = each($ele_value[2]) ){
+ if( !empty($v['value']) ){
+ if( $value[1] == 1 || $multi_flag ){
+ if( $checked[$v['key']] == 1 ){
+ $check = 1;
+ $multi_flag = 0;
+ }else{
+ $check = 0;
+ }
+ }else{
+ $check = 0;
+ }
+ $v2[$v['value']] = $check;
+ }
+ }
+ $value[2] = $v2;
+ */
+ break;
+ case 'date':
+ $value = array();
+ $value[] = $ele_value;
+
+ break;
case 'checkbox':
while( $v = each($ele_value) ){
if( !empty($v['value']) ){
@@ -267,6 +303,8 @@
<li><a href='"._THIS_PAGE."?op=edit&ele_type=text'>"._AM_ELE_TEXT."</a></li>
<li><a href='"._THIS_PAGE."?op=edit&ele_type=textarea'>"._AM_ELE_TAREA."</a></li>
<li><a href='"._THIS_PAGE."?op=edit&ele_type=select'>"._AM_ELE_SELECT."</a></li>
+ <li><a href='"._THIS_PAGE."?op=edit&ele_type=select2'>"._AM_ELE_SELECT_CTRY."</a></li>
+ <li><a href='"._THIS_PAGE."?op=edit&ele_type=date'>"._AM_ELE_DATE."</a></li>
<li><a href='"._THIS_PAGE."?op=edit&ele_type=checkbox'>"._AM_ELE_CHECK."</a></li>
<li><a href='"._THIS_PAGE."?op=edit&ele_type=radio'>"._AM_ELE_RADIO."</a></li>
<li><a href='"._THIS_PAGE."?op=edit&ele_type=yn'>"._AM_ELE_YN."</a></li>
Added: XoopsModules/xforms/branches/mamba/xforms/admin/ele_date.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/ele_date.php (rev 0)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/ele_date.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -0,0 +1,16 @@
+<?php
+###############################################################################
+## See license.txt ##
+###############################################################################
+
+if( !defined('xforms_ROOT_PATH') ){ exit(); }
+
+ if($value[0] != "Y-m-d" AND $value[0] != "") {
+ $date_value = strtotime($value[0]);
+ } else {
+ $date_value = "";
+ }
+ $date = new XoopsFormTextDateSelect (_AM_ELE_DATE, 'ele_value', $size = 15, $date_value);
+ $output->addElement($date);
+
+?>
Added: XoopsModules/xforms/branches/mamba/xforms/admin/ele_select_ctry.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/ele_select_ctry.php (rev 0)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/ele_select_ctry.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -0,0 +1,25 @@
+<?php
+###############################################################################
+## See license.txt ##
+###############################################################################
+if (!defined('xforms_ROOT_PATH')) {
+ exit();
+}
+
+if (empty($addopt) && !empty($ele_id)) {
+ $ele_value = $element->getVar('ele_value');
+}
+$ele_size = !empty($ele_value[0]) ? $ele_value[0] : 1;
+$size = new XoopsFormText(_AM_ELE_SIZE, 'ele_value[0]', 3, 2, $ele_size);
+$allow_multi = empty($ele_value[1]) ? 0 : 1;
+$multiple = new XoopsFormRadioYN(_AM_ELE_MULTIPLE, 'ele_value[1]', $allow_multi);
+$country = xoops_getModuleOption('mycountry', 'xforms');
+$countries = !empty($ele_value[2]) ? $ele_value[2] : $country;
+$reg_form = new XoopsFormSelectCountry(_AM_ELE_SELECT_CTRY, 'ele_value[2]', $countries);
+//
+$output->addElement($size, 1);
+$output->addElement($multiple);
+//$output->addElement($opt_tray);
+$output->addElement($reg_form);
+
+?>
\ No newline at end of file
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/elements.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/elements.php 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/elements.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -23,6 +23,8 @@
$jump[0]->addOptionArray(array('text' => _AM_ELE_TEXT,
'textarea' => _AM_ELE_TAREA,
'select' => _AM_ELE_SELECT,
+ 'select2' => _AM_ELE_SELECT_CTRY,
+ 'date' => _AM_ELE_DATE,
'checkbox' => _AM_ELE_CHECK,
'radio' => _AM_ELE_RADIO,
'yn' => _AM_ELE_YN,
@@ -127,6 +129,13 @@
case 'html':
$value[0] = $ele_value[$id];
break;
+ case 'date':
+ $value = array();
+ $value[] = $ele_value[$id];
+ break;
+ case 'select2':
+ $value[2] = !empty($ele_value[$id]) ? $ele_value[$id] : 'LB';
+ break;
case 'select':
$new_vars = array();
$opt_count = 1;
Modified: XoopsModules/xforms/branches/mamba/xforms/class/elementrenderer.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/class/elementrenderer.php 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/class/elementrenderer.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -64,7 +64,31 @@
$check_req->setExtra('disabled="disabled"');
}
break;
-
+ case 'date':
+ if ($post_val) {
+ $ele_value = $post_val;
+ }
+ $form_ele = new XoopsFormTextDateSelect(
+ $ele_caption,
+ $form_ele_id,
+ 15,
+ strtotime($ele_value[0])
+ );
+
+
+
+ break;
+
+ case 'select2':
+ if ($post_val) {
+ $ele_value = $post_val;
+ }
+ $form_ele = new XoopsFormSelectCountry(
+ $ele_caption,
+ $form_ele_id,
+ $myts->htmlspecialchars($myts->stripSlashesGPC($ele_value[2])) // default value
+ );
+ break;
case 'select':
$selected = array();
$options = array();
Modified: XoopsModules/xforms/branches/mamba/xforms/docs/changelog.txt
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/docs/changelog.txt 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/docs/changelog.txt 2012-11-22 19:38:36 UTC (rev 10267)
@@ -1,3 +1,7 @@
+1.22 Mariane (2012-11-20)
+=================================
+- add Country and Date selection (Mariane)
+
1.21 Mamba (2012-06-26)
=================================
- fixing some bugs: (black_beard)
Modified: XoopsModules/xforms/branches/mamba/xforms/docs/lang_diff.txt
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/docs/lang_diff.txt 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/docs/lang_diff.txt 2012-11-22 19:38:36 UTC (rev 10267)
@@ -53,4 +53,13 @@
// index.php
define("_MI_XPARTNERS_MENU_01", "Home");
define("_PARTNERS_ADMIN_ABOUT", "About");
-define("_PARTNERS_ADMIN_HELP", "Help");
\ No newline at end of file
+define("_PARTNERS_ADMIN_HELP", "Help");
+
+Version 1.11
+----------------
+
+admin.php
+-----------
+define("_AM_ELE_DATE","Date Selection");
+define("_AM_ELE_SELECT_CTRY","Country Selection");
+define("_AM_ELE_SELECT_CTRY_DEFAULT","Select Default Country");
\ No newline at end of file
Modified: XoopsModules/xforms/branches/mamba/xforms/include/form_execute.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/include/form_execute.php 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/include/form_execute.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -45,6 +45,8 @@
if( $ele_caption != '' ){
$msg[$ele_id] = "\n".$myts->stripSlashesGPC($ele_caption)."\n";
}
+ include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
+ $countries = XoopsLists::getCountryList();
switch($ele_type){
case 'upload':
case 'uploadimg':
@@ -106,6 +108,37 @@
$opt_count++;
}
break;
+ case 'select2':
+ $ele[$ele_id] = trim($ele[$ele_id]);
+ if( preg_match('/\{EMAIL\}/', $ele_value[2]) ){
+ if( !checkEmail($ele[$ele_id]) ){
+ $err[] = _LIAISE_ERR_INVALIDMAIL;
+ }else{
+ $reply_mail = $ele[$ele_id];
+ }
+ }
+ if( preg_match('/\{UNAME\}/', $ele_value[2]) ){
+ $reply_name = $ele[$ele_id];
+ }
+ // $msg[$ele_id] .= $myts->stripSlashesGPC($ele[$ele_id]);
+
+ $msg[$ele_id] .= $countries[$myts->stripSlashesGPC($ele[$ele_id])];
+
+ break;
+ case 'date':
+ $ele[$ele_id] = trim($ele[$ele_id]);
+ if( preg_match('/\{EMAIL\}/', $ele_value) ){
+ if( !checkEmail($ele[$ele_id]) ){
+ $err[] = _LIAISE_ERR_INVALIDMAIL;
+ }else{
+ $reply_mail = $ele[$ele_id];
+ }
+ }
+ if( preg_match('/\{UNAME\}/', $ele_value) ){
+ $reply_name = $ele[$ele_id];
+ }
+ $msg[$ele_id] .= $myts->stripSlashesGPC($ele[$ele_id]);
+ break;
case 'yn':
$v = ($ele[$ele_id]==2) ? _NO : _YES;
$msg[$ele_id] .= $myts->stripSlashesGPC($v);
Modified: XoopsModules/xforms/branches/mamba/xforms/language/english/admin.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/language/english/admin.php 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/language/english/admin.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -116,3 +116,8 @@
define("_AM_ELE_YOUR_NAME",'Your Name');
define("_AM_ELE_YOUR_EMAIL",'Email address');
define("_AM_ELE_YOUR_COMMENTS",'Your comments');
+
+//1.22
+
+define("_AM_ELE_DATE","Date Selection");
+define("_AM_ELE_SELECT_CTRY","Country Selection");
\ No newline at end of file
Modified: XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -63,4 +63,6 @@
define("_MI_xforms_NOFORM_DEFAULT","Sorry, there are currently no forms (visible for you).");
define("_MI_xforms_ADMENU0","Home");
-?>
\ No newline at end of file
+
+//1.22
+define("_MI_ELE_SELECT_CTRY_DEFAULT","Select Default Country");
\ No newline at end of file
Modified: XoopsModules/xforms/branches/mamba/xforms/xoops_version.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/xoops_version.php 2012-11-21 05:34:42 UTC (rev 10266)
+++ XoopsModules/xforms/branches/mamba/xforms/xoops_version.php 2012-11-22 19:38:36 UTC (rev 10267)
@@ -4,7 +4,7 @@
###################################
$modversion['name'] = _MI_xforms_NAME;
-$modversion['version'] = '1.21';
+$modversion['version'] = '1.22';
$modversion['description'] = _MI_xforms_DESC;
$modversion['author'] = "XD Soft";
$modversion['credits'] = "Creator of xforms Dylian Melgert and special thanks to Brandycoke Productions (http://www.brandycoke.com/) for creating liaise (The base of this module)";
@@ -19,10 +19,10 @@
$modversion['icons32'] = '../../Frameworks/moduleclasses/icons/32';
//about
-$modversion['release_date'] = '2012/06/25';
+$modversion['release_date'] = '2012/11/20';
$modversion["module_website_url"] = "www.xoops.org/";
$modversion["module_website_name"] = "XOOPS";
-$modversion["module_status"] = "Final";
+$modversion["module_status"] = "Beta 1";
$modversion['min_php']='5.2';
$modversion['min_xoops']="2.5";
$modversion['min_admin']='1.1';
@@ -101,6 +101,17 @@
$modversion['config'][$i]['default'] = array('user', 'ip', 'agent');
$modversion['config'][$i]['options'] = array(_MI_xforms_MOREINFO_USER => 'user', _MI_xforms_MOREINFO_IP => 'ip', _MI_xforms_MOREINFO_AGENT => 'agent', _MI_xforms_MOREINFO_FORM => 'form');
$i++;
+
+// Select Default Country
+$modversion['config'][$i]['name'] = "mycountry";
+$modversion['config'][$i]['title'] = '_MI_ELE_SELECT_CTRY_DEFAULT';
+$modversion['config'][$i]['description'] = '';
+$modversion['config'][$i]['formtype'] = 'select';
+$modversion['config'][$i]['valuetype'] = 'text';
+$modversion['config'][$i]['default'] = '-----';
+xoops_load('XoopsLists');
+$modversion['config'][$i]['options'] = array_flip(XoopsLists::getCountryList());
+$i++;
// $xoopsModuleConfig['mail_charset']
$modversion['config'][$i]['name'] = 'mail_charset';
$modversion['config'][$i]['title'] = '_MI_xforms_MAIL_CHARSET';
|
|
From: <be...@us...> - 2014-10-08 14:58:25
|
Revision: 12813
http://sourceforge.net/p/xoops/svn/12813
Author: beckmi
Date: 2014-10-08 14:58:09 +0000 (Wed, 08 Oct 2014)
Log Message:
-----------
Merging eForms into xForms 2.0 Alpha 1
Modified Paths:
--------------
XoopsModules/xforms/branches/mamba/xforms/admin/about.php
XoopsModules/xforms/branches/mamba/xforms/admin/admin_footer.php
XoopsModules/xforms/branches/mamba/xforms/admin/admin_header.php
XoopsModules/xforms/branches/mamba/xforms/admin/default_elements.php
XoopsModules/xforms/branches/mamba/xforms/admin/editelement.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_check.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_html.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_radio.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_select.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_tarea.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_text.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_upload.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_uploadimg.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_yn.php
XoopsModules/xforms/branches/mamba/xforms/admin/elements.php
XoopsModules/xforms/branches/mamba/xforms/admin/index.php
XoopsModules/xforms/branches/mamba/xforms/admin/main.php
XoopsModules/xforms/branches/mamba/xforms/admin/menu.php
XoopsModules/xforms/branches/mamba/xforms/class/elementrenderer.php
XoopsModules/xforms/branches/mamba/xforms/class/elements.php
XoopsModules/xforms/branches/mamba/xforms/class/forms.php
XoopsModules/xforms/branches/mamba/xforms/class/index.html
XoopsModules/xforms/branches/mamba/xforms/class/uploader.php
XoopsModules/xforms/branches/mamba/xforms/docs/changelog.txt
XoopsModules/xforms/branches/mamba/xforms/docs/credits.txt
XoopsModules/xforms/branches/mamba/xforms/docs/install.txt
XoopsModules/xforms/branches/mamba/xforms/docs/lang_diff.txt
XoopsModules/xforms/branches/mamba/xforms/docs/licence.txt
XoopsModules/xforms/branches/mamba/xforms/docs/readme.txt
XoopsModules/xforms/branches/mamba/xforms/header.php
XoopsModules/xforms/branches/mamba/xforms/include/common.php
XoopsModules/xforms/branches/mamba/xforms/include/form_execute.php
XoopsModules/xforms/branches/mamba/xforms/include/form_render.php
XoopsModules/xforms/branches/mamba/xforms/include/functions.php
XoopsModules/xforms/branches/mamba/xforms/include/index.html
XoopsModules/xforms/branches/mamba/xforms/index.php
XoopsModules/xforms/branches/mamba/xforms/language/english/admin.php
XoopsModules/xforms/branches/mamba/xforms/language/english/help/help.html
XoopsModules/xforms/branches/mamba/xforms/language/english/index.html
XoopsModules/xforms/branches/mamba/xforms/language/english/mail_template/index.html
XoopsModules/xforms/branches/mamba/xforms/language/english/mail_template/xforms.tpl
XoopsModules/xforms/branches/mamba/xforms/language/english/main.php
XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php
XoopsModules/xforms/branches/mamba/xforms/language/index.html
XoopsModules/xforms/branches/mamba/xforms/sql/mysql.sql
XoopsModules/xforms/branches/mamba/xforms/templates/index.html
XoopsModules/xforms/branches/mamba/xforms/xoops_version.php
Added Paths:
-----------
XoopsModules/xforms/branches/mamba/xforms/admin/report.php
XoopsModules/xforms/branches/mamba/xforms/assets/
XoopsModules/xforms/branches/mamba/xforms/assets/images/
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/1day.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/active.gif
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/content.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/delete.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/edit.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/editcopy.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/expired.gif
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/inactive.gif
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/index.html
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/mail_generic.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/rpthor.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/rpthor0.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/rptsee.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/rptvert.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/rptvert0.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/16/search.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/32/
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/32/about.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/32/add.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/32/content.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/32/home.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/32/index.html
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/32/insert_table_row.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/32/manage.png
XoopsModules/xforms/branches/mamba/xforms/assets/images/icons/index.html
XoopsModules/xforms/branches/mamba/xforms/assets/images/index.html
XoopsModules/xforms/branches/mamba/xforms/assets/images/xforms.png
XoopsModules/xforms/branches/mamba/xforms/assets/index.html
XoopsModules/xforms/branches/mamba/xforms/class/constants.php
XoopsModules/xforms/branches/mamba/xforms/class/dbupdater.php
XoopsModules/xforms/branches/mamba/xforms/class/helper.php
XoopsModules/xforms/branches/mamba/xforms/class/session.php
XoopsModules/xforms/branches/mamba/xforms/class/userdata.php
XoopsModules/xforms/branches/mamba/xforms/class/xforms.php
XoopsModules/xforms/branches/mamba/xforms/file.php
XoopsModules/xforms/branches/mamba/xforms/include/directorychecker.php
XoopsModules/xforms/branches/mamba/xforms/include/filechecker.php
XoopsModules/xforms/branches/mamba/xforms/include/module.php
XoopsModules/xforms/branches/mamba/xforms/include/oninstall.php
XoopsModules/xforms/branches/mamba/xforms/include/onuninstall.php
XoopsModules/xforms/branches/mamba/xforms/include/onupdate.php
XoopsModules/xforms/branches/mamba/xforms/templates/xforms_error.tpl
XoopsModules/xforms/branches/mamba/xforms/templates/xforms_form.tpl
XoopsModules/xforms/branches/mamba/xforms/templates/xforms_form_poll.tpl
XoopsModules/xforms/branches/mamba/xforms/templates/xforms_index.tpl
Removed Paths:
-------------
XoopsModules/xforms/branches/mamba/xforms/images/
XoopsModules/xforms/branches/mamba/xforms/templates/xforms_error.html
XoopsModules/xforms/branches/mamba/xforms/templates/xforms_form.html
XoopsModules/xforms/branches/mamba/xforms/templates/xforms_index.html
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/about.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/about.php 2014-10-06 19:43:10 UTC (rev 12812)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/about.php 2014-10-08 14:58:09 UTC (rev 12813)
@@ -1,29 +1,30 @@
<?php
+/*
+ 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.
+ */
/**
* 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 $
- **/
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
-include_once dirname(__FILE__) . '/admin_header.php';
+include_once __DIR__ . '/admin_header.php';
xoops_cp_header();
$aboutAdmin = new ModuleAdmin();
echo $aboutAdmin->addNavigation('about.php');
-echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);
+echo $aboutAdmin->renderAbout('', true);
-include 'admin_footer.php';
\ No newline at end of file
+include __DIR__ . '/admin_footer.php';
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/admin_footer.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/admin_footer.php 2014-10-06 19:43:10 UTC (rev 12812)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/admin_footer.php 2014-10-08 14:58:09 UTC (rev 12813)
@@ -1,23 +1,26 @@
<?php
+/*
+ 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.
+ */
/**
* 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 $
-**/
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
+global $xoopsModule;
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+
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"
@@ -25,4 +28,4 @@
." " . _AM_MODULEADMIN_ADMIN_FOOTER . "\n"
."</div>";
-xoops_cp_footer();
\ No newline at end of file
+xoops_cp_footer();
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/admin_header.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/admin_header.php 2014-10-06 19:43:10 UTC (rev 12812)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/admin_header.php 2014-10-08 14:58:09 UTC (rev 12813)
@@ -1,51 +1,48 @@
<?php
+/*
+ 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.
+ */
/**
- * XoopsPartners module
+ * 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:: XoopsPartners
- * @subpackage:: admin
- * @since:: 2.5.0
- * @author:: XOOPS Team
- * @version:: $Id $
-**/
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
+include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
+include_once XOOPS_ROOT_PATH . '/include/cp_functions.php';
+require_once XOOPS_ROOT_PATH . '/include/cp_header.php';
-$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 dirname(__DIR__) .'/include/common.php';
+define('XFORMS_ADMIN_URL', XFORMS_URL . '/admin/main.php');
+include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
-include '../include/common.php';
-define('xforms_ADMIN_URL', xforms_URL.'admin/main.php');
-include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
-
global $xoopsModule;
-$thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname');
+$thisModuleDir = XFORMS_DIRNAME;
//if functions.php file exist
-require_once dirname(dirname(__FILE__)) . '/include/functions.php';
+require_once dirname(__DIR__) . '/include/functions.php';
// Load language files
-xoops_loadLanguage('admin', $thisModuleDir);
-xoops_loadLanguage('modinfo', $thisModuleDir);
-xoops_loadLanguage('main', $thisModuleDir);
+xoops_loadLanguage('admin', XFORMS_DIRNAME);
+xoops_loadLanguage('modinfo', XFORMS_DIRNAME);
+xoops_loadLanguage('main', XFORMS_DIRNAME);
-$pathIcon16 = '../'.$xoopsModule->getInfo('icons16');
-$pathIcon32 = '../'.$xoopsModule->getInfo('icons32');
+$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
+$mypathIcon16 = XOOPS_URL . '/modules/' . $thisModuleDir . '/assets/images/icons/16';
+//$pathIcon32 = '../'.$xoopsModule->getInfo('icons32');
+
+include_once $GLOBALS['xoops']->path($pathModuleAdmin . '/moduleadmin.php');
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/default_elements.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/default_elements.php 2014-10-06 19:43:10 UTC (rev 12812)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/default_elements.php 2014-10-08 14:58:09 UTC (rev 12813)
@@ -1,41 +1,60 @@
<?php
-###############################################################################
-## See license.txt ##
-###############################################################################
-if( !defined('xforms_ROOT_PATH') ){ exit(); }
+/*
+ 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.
-$defaults = array();
-$defaults[0]['caption'] = _AM_ELE_YOUR_NAME;
-$defaults[0]['req'] = true;
-$defaults[0]['order'] = 1;
-$defaults[0]['display'] = 1;
-$defaults[0]['type'] = 'text';
-$defaults[0]['value'] = array(
- 0 => $xoopsModuleConfig['t_width'],
- 1 => $xoopsModuleConfig['t_max'],
- 2 => '{UNAME}'
- );
+ 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.
+ */
+/**
+ * xForms module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
-$defaults[1]['caption'] = _AM_ELE_YOUR_EMAIL;
-$defaults[1]['req'] = true;
-$defaults[1]['order'] = 2;
-$defaults[1]['display'] = 1;
-$defaults[1]['type'] = 'text';
-$defaults[1]['value'] = array(
- 0 => $xoopsModuleConfig['t_width'],
- 1 => $xoopsModuleConfig['t_max'],
- 2 => '{EMAIL}'
- );
+if (!defined('XFORMS_ROOT_PATH')) {
+ exit();
+}
-$defaults[2]['caption'] = _AM_ELE_YOUR_COMMENTS;
-$defaults[2]['req'] = true;
-$defaults[2]['order'] = 3;
-$defaults[2]['display'] = 1;
-$defaults[2]['type'] = 'textarea';
-$defaults[2]['value'] = array(
- 0 => '',
- 1 => $xoopsModuleConfig['ta_rows'],
- 2 => $xoopsModuleConfig['ta_cols']
- );
+$defaults = array();
+$defaults[0]['caption'] = _AM_XFORMS_DEFAULT_ELE_YOURNAME;
+$defaults[0]['req'] = true;
+$defaults[0]['ele_display_row'] = 1;
+$defaults[0]['order'] = 1;
+$defaults[0]['display'] = 1;
+$defaults[0]['type'] = 'text';
+$defaults[0]['value'] = array(
+ 0 => $xoopsModuleConfig['t_width'],
+ 1 => $xoopsModuleConfig['t_max'],
+ 2 => '{U_uname}'
+);
-?>
\ No newline at end of file
+$defaults[1]['caption'] = _AM_XFORMS_DEFAULT_ELE_YOUREMAIL;
+$defaults[1]['req'] = true;
+$defaults[1]['ele_display_row'] = 1;
+$defaults[1]['order'] = 2;
+$defaults[1]['display'] = 1;
+$defaults[1]['type'] = 'text';
+$defaults[1]['value'] = array(
+ 0 => $xoopsModuleConfig['t_width'],
+ 1 => $xoopsModuleConfig['t_max'],
+ 2 => '{U_email}'
+);
+
+$defaults[2]['caption'] = _AM_XFORMS_DEFAULT_ELE_COMMENTS;
+$defaults[2]['req'] = true;
+$defaults[2]['ele_display_row'] = 1;
+$defaults[2]['order'] = 3;
+$defaults[2]['display'] = 1;
+$defaults[2]['type'] = 'textarea';
+$defaults[2]['value'] = array(
+ 0 => '',
+ 1 => $xoopsModuleConfig['ta_rows'],
+ 2 => $xoopsModuleConfig['ta_cols']
+);
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/editelement.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/editelement.php 2014-10-06 19:43:10 UTC (rev 12812)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/editelement.php 2014-10-08 14:58:09 UTC (rev 12813)
@@ -1,218 +1,283 @@
<?php
-###############################################################################
-## See license.txt ##
-###############################################################################
-include("admin_header.php");
+/*
+ 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.
+ */
+/**
+ * xForms module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
+
+include __DIR__ . '/admin_header.php';
$xforms_ele_mgr = xoops_getmodulehandler('elements');
-include_once xforms_ROOT_PATH.'class/elementrenderer.php';
-define('_THIS_PAGE', xforms_URL.'admin/editelement.php');
+include_once XFORMS_ROOT_PATH . '/class/elementrenderer.php';
+define('_THIS_PAGE', XFORMS_URL . '/admin/editelement.php');
$myts = MyTextSanitizer::getInstance();
-if( $xforms_form_mgr->getCount() < 1 ){
- redirect_header(xforms_ADMIN_URL, 0, _AM_GO_CREATE_FORM);
+if ($xforms_form_mgr->getCount() < 1) {
+ redirect_header(XFORMS_ADMIN_URL, 0, _AM_XFORMS_GO_CREATE_FORM);
}
-if( count($_POST) > 0 ){
- extract($_POST);
-}else{
- extract($_GET);
+if (count($_POST) > 0) {
+ extract($_POST);
+} else {
+ extract($_GET);
}
-$op = isset($_GET['op']) ? trim($_GET['op']) : '';
-$op = isset($_POST['op']) ? trim($_POST['op']) : $op;
-$clone = isset($_GET['clone']) ? intval($_GET['clone']) : 0;
-$clone = isset($_POST['clone']) ? trim($_POST['clone']) : $clone;
-$form_id = isset($_GET['form_id']) ? intval($_GET['form_id']) : 0;
+$op = isset($_GET['op']) ? trim($_GET['op']) : '';
+$op = isset($_POST['op']) ? trim($_POST['op']) : $op;
+$clone = isset($_GET['clone']) ? intval($_GET['clone'], 10) : 0;
+$clone = isset($_POST['clone']) ? trim($_POST['clone']) : $clone;
+$form_id = isset($_GET['form_id']) ? intval($_GET['form_id'], 10) : 0;
$form_id = isset($_POST['form_id']) ? trim($_POST['form_id']) : $form_id;
-if( isset($_POST['submit']) && $_POST['submit'] == _AM_ELE_ADD_OPT_SUBMIT && intval($_POST['addopt']) > 0 ){
- $op = 'edit';
+if (isset($_POST['submit']) && $_POST['submit'] == _AM_XFORMS_ELE_ADD_OPT_SUBMIT && intval($_POST['addopt'], 10) > 0) {
+ $op = 'edit';
}
-switch($op){
- case 'edit':
- //adminHtmlHeader();
- xoops_cp_header();
- if( !empty($ele_id) ){
- $element = $xforms_ele_mgr->get($ele_id);
- $ele_type = $element->getVar('ele_type');
- $output_title = $clone ? _AM_ELE_CREATE : sprintf(_AM_ELE_EDIT, $element->getVar('ele_caption'));
- }else{
- $element = $xforms_ele_mgr->create();
- $output_title = _AM_ELE_CREATE;
- }
- $output = new XoopsThemeForm($output_title, 'form_ele', _THIS_PAGE);
- if( empty($addopt) ){
- $ele_caption = $clone ? sprintf(_AM_COPIED, $element->getVar('ele_caption', 'f')) : $element->getVar('ele_caption', 'f');
- $text_ele_caption = new XoopsFormText(_AM_ELE_CAPTION, 'ele_caption', 50, 255, $ele_caption);
- $value = $element->getVar('ele_value', 'f');
- $req = $element->getVar('ele_req');
- $display = $element->getVar('ele_display');
- $order = $element->getVar('ele_order');
- }else{
- $ele_caption = $myts->makeTboxData4PreviewInForm($ele_caption);
- $text_ele_caption = new XoopsFormText(_AM_ELE_CAPTION, 'ele_caption', 50, 255, $ele_caption);
- $req = isset($_POST['ele_req']) ? 1 : 0;
- $display = isset($_POST['ele_display']) ? 1 : 0;
- $order = isset($_POST['ele_order']) ? intval($_POST['ele_order']) : 0;
- }
- $output->addElement($text_ele_caption);
+switch ($op) {
+ case 'edit':
+ xoops_cp_header();
- $check_ele_req = new XoopsFormCheckBox(_AM_ELE_REQ, 'ele_req', $req);
- $check_ele_req->addOption(1, ' ');
- $output->addElement($check_ele_req);
-
- $check_ele_display = new XoopsFormCheckBox(_AM_ELE_DISPLAY, 'ele_display', $display);
- $check_ele_display->addOption(1, ' ');
- $output->addElement($check_ele_display);
-
- $text_ele_order = new XoopsFormText(_AM_ELE_ORDER, 'ele_order', 3, 2, $order);
- $output->addElement($text_ele_order);
-
- switch($ele_type){
- case 'text':
- default:
- include 'ele_text.php';
- break;
- case 'textarea':
- include 'ele_tarea.php';
- break;
- case 'select':
- include 'ele_select.php';
- break;
+ if (!empty($ele_id)) {
+ $element = $xforms_ele_mgr->get($ele_id);
+ $ele_type = $element->getVar('ele_type');
+ $output_title = $clone ? _AM_XFORMS_ELE_CREATE : sprintf(_AM_XFORMS_ELE_EDIT, $element->getVar('ele_caption'));
+ } else {
+ $element = $xforms_ele_mgr->create();
+ $output_title = _AM_XFORMS_ELE_CREATE;
+ }
+ $output = new XoopsThemeForm($output_title, 'form_ele', _THIS_PAGE);
+ if (empty($addopt)) {
+ $ele_caption = $clone ? sprintf(_AM_XFORMS_COPIED, $element->getVar('ele_caption', 'e')) : $element->getVar('ele_caption', 'e');
+ $text_ele_caption = new XoopsFormDhtmlTextArea(_AM_XFORMS_ELE_CAPTION, 'ele_caption', $myts->htmlspecialchars($myts->stripSlashesGPC($ele_caption)), 5, 90);
+ $text_ele_caption->skipPreview = true;
+ $value = $element->getVar('ele_value', 'f');
+ $req = $element->getVar('ele_req');
+ $display_row = $element->getVar('ele_display_row');
+ $display = $element->getVar('ele_display');
+ $order = $element->getVar('ele_order');
+ } else {
+ $text_ele_caption = new XoopsFormDhtmlTextArea(_AM_XFORMS_ELE_CAPTION, 'ele_caption', $myts->htmlspecialchars($myts->stripSlashesGPC($ele_caption)), 5, 90);
+ $text_ele_caption->skipPreview = true;
+ $req = isset($_POST['ele_req']) ? 1 : 0;
+ $display_row = isset($_POST['ele_display_row']) ? 2 : 1;
+ $display = isset($_POST['ele_display']) ? 1 : 0;
+ $order = isset($_POST['ele_order']) ? intval($_POST['ele_order'], 10) : 0;
+ }
+
+ if ($ele_type != 'html') {
+ $output->addElement($text_ele_caption);
+
+ $check_ele_req = new XoopsFormCheckBox(_AM_XFORMS_ELE_REQ, 'ele_req', $req);
+ $check_ele_req->addOption(1, ' ');
+ $output->addElement($check_ele_req);
+
+ $check_ele_display_row = new XoopsFormCheckBox(_AM_XFORMS_ELE_DISPLAY_ROW, 'ele_display_row', $display_row);
+ $check_ele_display_row->setDescription(_AM_XFORMS_ELE_DISPLAY_ROW_DESC);
+ $check_ele_display_row->addOption(2, ' ');
+ $output->addElement($check_ele_display_row);
+ }
+
+ $check_ele_display = new XoopsFormCheckBox(_AM_XFORMS_ELE_DISPLAY, 'ele_display', $display);
+ $check_ele_display->addOption(1, ' ');
+ $output->addElement($check_ele_display);
+
+ $text_ele_order = new XoopsFormText(_AM_XFORMS_ELE_ORDER, 'ele_order', 3, 2, $order);
+ $output->addElement($text_ele_order);
+
+ $elementName = "";
+ switch ($ele_type) {
+ case 'text':
+ default:
+ $elementName = _AM_XFORMS_ELE_TEXT;
+ include 'ele_text.php';
+ break;
+
+ case 'textarea':
+ $elementName = _AM_XFORMS_ELE_TAREA;
+ include 'ele_tarea.php';
+ break;
+
+ case 'select':
+ $elementName = _AM_XFORMS_ELE_SELECT;
+ include 'ele_select.php';
+ break;
case 'select2':
+ $elementName = _AM_XFORMS_ELE_COUNTRY;
include 'ele_select_ctry.php';
break;
case 'date':
+ $elementName = _AM_XFORMS_ELE_DATE;
include 'ele_date.php';
break;
- case 'checkbox':
- include 'ele_check.php';
- break;
- case 'radio':
- include 'ele_radio.php';
- break;
- case 'yn':
- include 'ele_yn.php';
- break;
- case 'html':
- $check_ele_req->setExtra('disabled="disabled"');
- include 'ele_html.php';
- break;
- case 'uploadimg':
- include 'ele_uploadimg.php';
- break;
- case 'upload':
- include 'ele_upload.php';
- break;
- }
+ case 'checkbox':
+ $elementName = _AM_XFORMS_ELE_CHECK;
+ include 'ele_check.php';
+ break;
- $hidden_op = new XoopsFormHidden('op', 'save');
- $hidden_type = new XoopsFormHidden('ele_type', $ele_type);
- $output->addElement($hidden_op);
- $output->addElement($hidden_type);
-
- if( $clone == true || empty($form_id) ){
- $select_apply_form = new XoopsFormSelect(_AM_ELE_APPLY_TO_FORM, 'form_id', $form_id);
- $forms = $xforms_form_mgr->getObjects(null, 'form_id, form_title');
- foreach( $forms as $f ){
- $select_apply_form->addOption($f->getVar('form_id'), $f->getVar('form_title'));
- }
- $output->addElement($select_apply_form);
- $hidden_clone = new XoopsFormHidden('clone', 1);
- $output->addElement($hidden_clone);
- }else{
- $hidden_form_id = new XoopsFormHidden('form_id', $form_id);
- $output->addElement($hidden_form_id);
- }
-
- if( !empty($ele_id) && !$clone ){
- $hidden_id = new XoopsFormHidden('ele_id', $ele_id);
- $output->addElement($hidden_id);
- }
- $submit = new XoopsFormButton('', 'submit', _AM_SAVE, 'submit');
- $cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button');
- $cancel->setExtra('onclick="javascript:history.go(-1);"');
- $tray = new XoopsFormElementTray('');
- $tray->addElement($submit);
- $tray->addElement($cancel);
- $output->addElement($tray);
- $output->display();
- break;
- case 'delete':
- if( empty($ele_id) ){
- redirect_header(xforms_ADMIN_URL, 0, _AM_...
[truncated message content] |
|
From: <be...@us...> - 2014-10-08 15:01:24
|
Revision: 12814
http://sourceforge.net/p/xoops/svn/12814
Author: beckmi
Date: 2014-10-08 15:01:21 +0000 (Wed, 08 Oct 2014)
Log Message:
-----------
code clean-up for consistency
Modified Paths:
--------------
XoopsModules/xforms/branches/mamba/xforms/admin/ele_date.php
XoopsModules/xforms/branches/mamba/xforms/admin/ele_select_ctry.php
XoopsModules/xforms/branches/mamba/xforms/admin/file.php
XoopsModules/xforms/branches/mamba/xforms/admin/upgrade.php
XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php
XoopsModules/xforms/branches/mamba/xforms/xoops_version.php
Added Paths:
-----------
XoopsModules/xforms/branches/mamba/xforms/assets/images/logo.png
XoopsModules/xforms/branches/mamba/xforms/language/english/mail_template/xforms_copy.tpl
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/ele_date.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/ele_date.php 2014-10-08 14:58:09 UTC (rev 12813)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/ele_date.php 2014-10-08 15:01:21 UTC (rev 12814)
@@ -1,16 +1,29 @@
-<?php
-###############################################################################
-## See license.txt ##
-###############################################################################
-
-if( !defined('xforms_ROOT_PATH') ){ exit(); }
-
- if($value[0] != "Y-m-d" AND $value[0] != "") {
- $date_value = strtotime($value[0]);
- } else {
- $date_value = "";
- }
- $date = new XoopsFormTextDateSelect (_AM_ELE_DATE, 'ele_value', $size = 15, $date_value);
- $output->addElement($date);
-
-?>
+<?php
+/*
+ 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.
+ */
+/**
+ * xForms module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
+
+if ( !defined('xforms_ROOT_PATH') ) { exit(); }
+
+ if ($value[0] != "Y-m-d" and $value[0] != "") {
+ $date_value = strtotime($value[0]);
+ } else {
+ $date_value = "";
+ }
+ $date = new XoopsFormTextDateSelect (_AM_XFORMS_ELE_DATE, 'ele_value', $size = 15, $date_value);
+ $output->addElement($date);
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/ele_select_ctry.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/ele_select_ctry.php 2014-10-08 14:58:09 UTC (rev 12813)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/ele_select_ctry.php 2014-10-08 15:01:21 UTC (rev 12814)
@@ -1,25 +1,39 @@
-<?php
-###############################################################################
-## See license.txt ##
-###############################################################################
-if (!defined('xforms_ROOT_PATH')) {
- exit();
-}
-
-if (empty($addopt) && !empty($ele_id)) {
- $ele_value = $element->getVar('ele_value');
-}
-$ele_size = !empty($ele_value[0]) ? $ele_value[0] : 1;
-$size = new XoopsFormText(_AM_ELE_SIZE, 'ele_value[0]', 3, 2, $ele_size);
-$allow_multi = empty($ele_value[1]) ? 0 : 1;
-$multiple = new XoopsFormRadioYN(_AM_ELE_MULTIPLE, 'ele_value[1]', $allow_multi);
-$country = xoops_getModuleOption('mycountry', 'xforms');
-$countries = !empty($ele_value[2]) ? $ele_value[2] : $country;
-$reg_form = new XoopsFormSelectCountry(_AM_ELE_SELECT_CTRY, 'ele_value[2]', $countries);
-//
-$output->addElement($size, 1);
-$output->addElement($multiple);
-//$output->addElement($opt_tray);
-$output->addElement($reg_form);
-
-?>
\ No newline at end of file
+<?php
+/*
+ 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.
+ */
+/**
+ * xForms module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
+
+if (!defined('xforms_ROOT_PATH')) {
+ exit();
+}
+
+if (empty($addopt) && !empty($ele_id)) {
+ $ele_value = $element->getVar('ele_value');
+}
+$ele_size = !empty($ele_value[0]) ? $ele_value[0] : 1;
+$size = new XoopsFormText(_AM_XFORMS_ELE_SIZE, 'ele_value[0]', 3, 2, $ele_size);
+$allow_multi = empty($ele_value[1]) ? 0 : 1;
+$multiple = new XoopsFormRadioYN(_AM_XFORMS_ELE_MULTIPLE, 'ele_value[1]', $allow_multi);
+$country = xoops_getModuleOption('mycountry', 'xforms');
+$countries = !empty($ele_value[2]) ? $ele_value[2] : $country;
+$reg_form = new XoopsFormSelectCountry(_AM_XFORMS_ELE_SELECT_CTRY, 'ele_value[2]', $countries);
+//
+$output->addElement($size, 1);
+$output->addElement($multiple);
+//$output->addElement($opt_tray);
+$output->addElement($reg_form);
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/file.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/file.php 2014-10-08 14:58:09 UTC (rev 12813)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/file.php 2014-10-08 15:01:21 UTC (rev 12814)
@@ -1,12 +1,28 @@
<?php
-###############################################################################
-## See license.txt ##
-###############################################################################
+/*
+ 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.
+ */
+/**
+ * xForms module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
+
include 'admin_header.php';
$file = isset($_GET['f']) ? trim($_GET['f']) : '';
-$path = xforms_UPLOAD_PATH.$file;
-if( !$file || !preg_match('/^[0-9]+_{1}[0-9a-z]+\.[0-9a-z]+$/', $file) || !file_exists($path) ){
- redirect_header(XOOPS_URL, 0, _AM_NOTHING_SELECTED);
+$path = XFORMS_UPLOAD_PATH.$file;
+if ( !$file || !preg_match('/^[0-9]+_{1}[0-9a-z]+\.[0-9a-z]+$/', $file) || !file_exists($path) ) {
+ redirect_header(XOOPS_URL, 0, _AM_XFORMS_NOTHING_SELECTED);
}
header("Content-Type: application/octet-stream");
@@ -17,4 +33,3 @@
header("Content-Length: ".filesize($path));
readfile($path);
-?>
\ No newline at end of file
Modified: XoopsModules/xforms/branches/mamba/xforms/admin/upgrade.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/admin/upgrade.php 2014-10-08 14:58:09 UTC (rev 12813)
+++ XoopsModules/xforms/branches/mamba/xforms/admin/upgrade.php 2014-10-08 15:01:21 UTC (rev 12814)
@@ -1,33 +1,49 @@
<?php
-###############################################################################
-## See license.txt ##
-###############################################################################
+/*
+ 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.
+ */
+/**
+ * xForms module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
+ * @package xforms
+ * @since 1.30
+ * @author Xoops Development Team
+ */
+
include 'admin_header.php';
$version = number_format($xoopsModule->getVar('version')/100, 2);
$count = $xforms_form_mgr->getCount();
-if( $version >= 1.2 || $count > 0 ){
- xoops_cp_header();
- echo 'I guess this module has been upgraded already. Why don\'t you delete this file?';
-}elseif( $_POST['goupgrade'] == 1){
- $sql = $msgs = $ret = array();
- $error = false;
-
- $msgs[] = 'Rename form elements table...';
- $sql[] = 'ALTER TABLE `'.$xoopsDB->prefix('xforms').'` RENAME `'.$xoopsDB->prefix('xforms_formelements').'`';
-
- $msgs[] = 'Add form_id to elements table...';
- $sql[] = 'ALTER TABLE `'.$xoopsDB->prefix('xforms_formelements')."` ADD `form_id` SMALLINT( 5 ) DEFAULT '1' NOT NULL AFTER `ele_id`";
-
- $msgs[] = 'Change default value of form_id in elements table...';
- $sql[] = 'ALTER TABLE `'.$xoopsDB->prefix('xforms_formelements')."` CHANGE `form_id` `form_id` SMALLINT( 5 ) DEFAULT '0' NOT NULL";
-
- $method = $xoopsModuleConfig['method'];
- $method = $xoopsModuleConfig['method'] == 'pm' ? 'p' : 'e';
- $sendto = !empty($xoopsModuleConfig['admin_only']) ? 0 : $xoopsModuleConfig['group'];
- $delimiter = $xoopsModuleConfig['delimeter'] == 'br' ? 'b' : 's';
- $msgs[] = 'Create forms table...';
- $sql[] =
- "CREATE TABLE `".$xoopsDB->prefix('xforms_forms')."` (
+if ($version >= 1.2 || $count > 0) {
+ xoops_cp_header();
+ echo 'I guess this module has been upgraded already. Why don\'t you delete this file?';
+} elseif ($_POST['goupgrade'] == 1) {
+ $sql = $msgs = $ret = array();
+ $error = false;
+
+ $msgs[] = 'Rename form elements table...';
+ $sql[] = 'ALTER TABLE `'.$xoopsDB->prefix('xforms').'` RENAME `'.$xoopsDB->prefix('xforms_formelements').'`';
+
+ $msgs[] = 'Add form_id to elements table...';
+ $sql[] = 'ALTER TABLE `'.$xoopsDB->prefix('xforms_formelements')."` ADD `form_id` SMALLINT( 5 ) DEFAULT '1' NOT NULL AFTER `ele_id`";
+
+ $msgs[] = 'Change default value of form_id in elements table...';
+ $sql[] = 'ALTER TABLE `'.$xoopsDB->prefix('xforms_formelements')."` CHANGE `form_id` `form_id` SMALLINT( 5 ) DEFAULT '0' NOT NULL";
+
+ $method = $xoopsModuleConfig['method'];
+ $method = $xoopsModuleConfig['method'] == 'pm' ? 'p' : 'e';
+ $sendto = !empty($xoopsModuleConfig['admin_only']) ? 0 : $xoopsModuleConfig['group'];
+ $delimiter = $xoopsModuleConfig['delimeter'] == 'br' ? 'b' : 's';
+ $msgs[] = 'Create forms table...';
+ $sql[] =
+ "CREATE TABLE `".$xoopsDB->prefix('xforms_forms')."` (
`form_id` smallint(5) NOT NULL auto_increment,
`form_send_method` char(1) NOT NULL default 'e',
`form_send_to_group` smallint(3) NOT NULL default '0',
@@ -41,55 +57,54 @@
PRIMARY KEY (`form_id`),
KEY `form_order` (`form_order`)
) ENGINE=MyISAM;";
-
- $msgs[] = 'Insert default data into forms table...';
- $sql[] =
- "INSERT INTO `".$xoopsDB->prefix('xforms_forms')."` VALUES (1, '".$method."', ".intval($sendto).", 1, '".$delimiter."', 'Contact Us', '"._SUBMIT."', 'Tell us about your comments for this site.', 'Contact us by filling out this form.', '');";
-
- for( $i=0; $i<count($sql); $i++ ){
- if( false != $xoopsDB->query($sql[$i]) ){
- $ret[] = $msgs[$i].'done.';
- }else{
- $ret[] = $msgs[$i].'failed.';
- $ret[] = ' '.$xoopsDB->error().' ('.$xoopsDB->errno().')';
- $error = true;
- }
- }
-
- if( $error == false ){
- $ret[] = 'Setting up default permissions...';
- $m = ' Grant permission of form id 1 to group id %u...%s';
- for( $i=1; $i<4; $i++ ){
- $perm = $moduleperm_handler->create();
- $perm->setVar('gperm_name', $xforms_form_mgr->perm_name);
- $perm->setVar('gperm_itemid', 1);
- $perm->setVar('gperm_groupid', $i);
- $perm->setVar('gperm_modid', $xoopsModule->getVar('mid'));
- if( !$moduleperm_handler->insert($perm) ){
- $ret[] = sprintf($m, $i, 'failed.');
- $error = true;
- }else{
- $ret[] = sprintf($m, $i, 'done.');
- }
- }
- }
-
- xoops_cp_header();
- $output = '';
- foreach( $ret as $r ){
- $output .= $r.'<br />';
- }
- echo '<pre><code>'.$output.'</code></pre>';
-
- if( false != $error ){
- echo '<b>Oh No! Upgrade seems failed... I honestly hope that you have a backup...</b>';
- }else{
- echo 'Upgrade successed. Now go <a href="'.XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&op=update&module=xforms">update this module</a>.';
- }
-}else{
- xoops_cp_header();
- xoops_confirm(array('goupgrade' => 1), xforms_URL.'admin/upgrade.php', 'Make sure you have your files and database backuped. Are you really ready to upgrade the module now?', 'Cut the crap and do it');
+
+ $msgs[] = 'Insert default data into forms table...';
+ $sql[] =
+ "INSERT INTO `".$xoopsDB->prefix('xforms_forms')."` VALUES (1, '".$method."', ".intval($sendto).", 1, '".$delimiter."', 'Contact Us', '"._SUBMIT."', 'Tell us about your comments for this site.', 'Contact us by filling out this form.', '');";
+
+ for ( $i=0; $i<count($sql); $i++ ) {
+ if ( false != $xoopsDB->query($sql[$i]) ) {
+ $ret[] = $msgs[$i].'done.';
+ } else {
+ $ret[] = $msgs[$i].'failed.';
+ $ret[] = ' '.$xoopsDB->error().' ('.$xoopsDB->errno().')';
+ $error = true;
+ }
+ }
+
+ if ($error == false) {
+ $ret[] = 'Setting up default permissions...';
+ $m = ' Grant permission of form id 1 to group id %u...%s';
+ for ($i=1; $i<4; $i++) {
+ $perm = $moduleperm_handler->create();
+ $perm->setVar('gperm_name', $xforms_form_mgr->perm_name);
+ $perm->setVar('gperm_itemid', 1);
+ $perm->setVar('gperm_groupid', $i);
+ $perm->setVar('gperm_modid', $xoopsModule->getVar('mid'));
+ if ( !$moduleperm_handler->insert($perm) ) {
+ $ret[] = sprintf($m, $i, 'failed.');
+ $error = true;
+ } else {
+ $ret[] = sprintf($m, $i, 'done.');
+ }
+ }
+ }
+
+ xoops_cp_header();
+ $output = '';
+ foreach ($ret as $r) {
+ $output .= $r.'<br />';
+ }
+ echo '<pre><code>'.$output.'</code></pre>';
+
+ if (false != $error) {
+ echo '<b>Oh No! Upgrade seems failed... I honestly hope that you have a backup...</b>';
+ } else {
+ echo 'Upgrade successed. Now go <a href="'.XOOPS_URL.'/modules/system/admin.php?fct=modulesadmin&op=update&module=xforms">update this module</a>.';
+ }
+} else {
+ xoops_cp_header();
+ xoops_confirm(array('goupgrade' => 1), XFORMS_URL.'admin/upgrade.php', 'Make sure you have your files and database backuped. Are you really ready to upgrade the module now?', 'Cut the crap and do it');
}
xoops_cp_footer();
-?>
\ No newline at end of file
Added: XoopsModules/xforms/branches/mamba/xforms/assets/images/logo.png
===================================================================
(Binary files differ)
Index: XoopsModules/xforms/branches/mamba/xforms/assets/images/logo.png
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/assets/images/logo.png 2014-10-08 14:58:09 UTC (rev 12813)
+++ XoopsModules/xforms/branches/mamba/xforms/assets/images/logo.png 2014-10-08 15:01:21 UTC (rev 12814)
Property changes on: XoopsModules/xforms/branches/mamba/xforms/assets/images/logo.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: XoopsModules/xforms/branches/mamba/xforms/language/english/mail_template/xforms_copy.tpl
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/language/english/mail_template/xforms_copy.tpl (rev 0)
+++ XoopsModules/xforms/branches/mamba/xforms/language/english/mail_template/xforms_copy.tpl 2014-10-08 15:01:21 UTC (rev 12814)
@@ -0,0 +1,5 @@
+{EHEADER}<br/>
+
+{MSG}<br/><br/>
+
+{EFOOTER}<br/>
Modified: XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php 2014-10-08 14:58:09 UTC (rev 12813)
+++ XoopsModules/xforms/branches/mamba/xforms/language/english/modinfo.php 2014-10-08 15:01:21 UTC (rev 12814)
@@ -51,4 +51,4 @@
define("_MI_xforms_ADMENU0","Home");
//1.22
-define("_MI_XFORMS_ELE_SELECT_CTRY_DEFAULT","Select Default Country");
\ No newline at end of file
+define("_MI_XFORMS_ELE_SELECT_CTRY_DEFAULT","Select Default Country");
Modified: XoopsModules/xforms/branches/mamba/xforms/xoops_version.php
===================================================================
--- XoopsModules/xforms/branches/mamba/xforms/xoops_version.php 2014-10-08 14:58:09 UTC (rev 12813)
+++ XoopsModules/xforms/branches/mamba/xforms/xoops_version.php 2014-10-08 15:01:21 UTC (rev 12814)
@@ -27,7 +27,7 @@
$modversion['license'] = 'GNU GPL 2.0 or later';
$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html";
$modversion['official'] = 0;
-$modversion['image'] = "assets/images/xforms2.png";
+$modversion['image'] = "assets/images/logo.png";
$modversion['dirname'] = $myDirName;
$modversion['dirmoduleadmin'] = '/Frameworks/moduleclasses/moduleadmin';
$modversion['icons16'] = '../../Frameworks/moduleclasses/icons/16';
|