|
From: <txm...@us...> - 2014-04-13 07:52:05
|
Revision: 12443
http://sourceforge.net/p/xoops/svn/12443
Author: txmodxoops
Date: 2014-04-13 07:51:58 +0000 (Sun, 13 Apr 2014)
Log Message:
-----------
Added custom themeform in subdirectory
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/themeform.php
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/index.html 2014-04-13 07:51:58 UTC (rev 12443)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/themeform.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/themeform.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/form/themeform.php 2014-04-13 07:51:58 UTC (rev 12443)
@@ -0,0 +1,65 @@
+<?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.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.5
+ * @author Txmod Xoops <su...@tx...>
+ * @version $Id: 1.59 themeform.php 11297 2013-03-24 10:58:10Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+xoops_load('XoopsFormLoader');
+
+/**
+ * Form that will output as a theme-enabled HTML table
+ *
+ * Also adds JavaScript to validate required fields
+ */
+class TDMCreateThemeForm extends XoopsForm
+{
+ /**
+ * create HTML to output the form as a theme-enabled table with validation.
+ *
+ * YOU SHOULD AVOID TO USE THE FOLLOWING Nocolspan METHOD, IT WILL BE REMOVED
+ *
+ * To use the noColspan simply use the following example:
+ *
+ * $colspan = new XoopsFormDhtmlTextArea( '', 'key', $value, '100%', '100%' );
+ * $colspan->setNocolspan();
+ * $form->addElement( $colspan );
+ *
+ * @return string
+ */
+ public function render()
+ {
+ $ele_name = $this->getName();
+ $ret = ($this->getTitle() ? '<div class=" center head ">' . $this->getTitle() . '</div>' : '');
+ $ret .= NWLINE . '<form name="' . $ele_name . '" id="' . $ele_name . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '" onsubmit="return xoopsFormValidate_' . $ele_name . '();"' . $this->getExtra() . '>' . NWLINE;
+ $hidden = '';
+ $class = 'even';
+ foreach ($this->getElements() as $ele) {
+ if (!is_object($ele)) {
+ $ret .= $ele;
+ } else if (!$ele->isHidden()) {
+ $ret .= $ele->render();
+ } else {
+ $hidden .= $ele->render();
+ }
+ }
+ $ret .= NWLINE . ' ' . $hidden . NWLINE . '</form>';
+ $ret .= $this->renderValidationJS(true);
+ return $ret;
+ }
+}
\ No newline at end of file
|