From: <du...@us...> - 2012-10-25 13:35:11
|
Revision: 10233 http://sourceforge.net/p/xoops/svn/10233 Author: dugris Date: 2012-10-25 13:35:09 +0000 (Thu, 25 Oct 2012) Log Message: ----------- FIX form xcaptcha 1.00 alpha (Xoops CAPTCHA configuration) System extensions for xoops 2.6.x Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php 2012-10-25 13:05:30 UTC (rev 10232) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php 2012-10-25 13:35:09 UTC (rev 10233) @@ -119,8 +119,8 @@ $button_tray = new XoopsFormElementTray('', ''); $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); - $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); $captcha_form->addElement($button_tray); ob_start(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php 2012-10-25 13:05:30 UTC (rev 10232) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php 2012-10-25 13:35:09 UTC (rev 10233) @@ -85,8 +85,11 @@ $button_tray = new XoopsFormElementTray('', ''); $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); - $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); + $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); + $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); + $button_tray->addElement($cancel_send); $captcha_form->addElement($button_tray); ob_start(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php 2012-10-25 13:05:30 UTC (rev 10232) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php 2012-10-25 13:35:09 UTC (rev 10233) @@ -55,8 +55,11 @@ $button_tray = new XoopsFormElementTray('', ''); $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); - $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); + $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); + $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); + $button_tray->addElement($cancel_send); $captcha_form->addElement($button_tray); ob_start(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php 2012-10-25 13:05:30 UTC (rev 10232) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php 2012-10-25 13:35:09 UTC (rev 10233) @@ -46,8 +46,11 @@ $button_tray = new XoopsFormElementTray('', ''); $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_tray->addElement(new XoopsFormButton('', '', _SUBMIT, 'submit')); - $button_tray->addElement(new XoopsFormButton('', '', _CANCEL, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); + $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); + $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); + $button_tray->addElement($cancel_send); $captcha_form->addElement($button_tray); ob_start(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php 2012-10-25 13:05:30 UTC (rev 10232) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php 2012-10-25 13:35:09 UTC (rev 10233) @@ -30,7 +30,6 @@ $modversion['image'] = 'images/xcaptcha_logo.png'; $modversion['dirname'] = 'xcaptcha'; - //about $modversion['release_date'] = '2012/10/01'; $modversion['module_website_url'] = 'labs.xoofoo.org/modules/news/'; |
From: <du...@us...> - 2012-11-07 16:17:58
|
Revision: 10248 http://sourceforge.net/p/xoops/svn/10248 Author: dugris Date: 2012-11-07 16:17:53 +0000 (Wed, 07 Nov 2012) Log Message: ----------- Fix : help Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/help.html Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/help.css XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help.php Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/help.css =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/help.css (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/css/help.css 2012-11-07 16:17:53 UTC (rev 10248) @@ -0,0 +1,45 @@ +code { + display: block; + width: 90%; + max-height: 400px; + overflow: auto; + padding: 2em; + font-weight: bold; + font-size: 1em; +} +.system-help { + min-height: 650px; +} +.help { + height: 100px; + display: block; +} +.help-item { + margin-bottom: 20px; + display: blockj; +} +.help-title { + width: 80%; + margin-bottom: 10px; + font-size: 1.2em; + font-weight: bold; +} +.help-paypal { + vertical-align: top; + margin: 0; + padding: 0; +} + +.help-submenu { + margin: 10px; + padding: 10px; + background-color: #F7F7F9; + width: 250px; + position: absolute; + right: 50px; +} + +.help-description { + width: 100%; + +} \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/help.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/help.html 2012-11-07 15:31:24 UTC (rev 10247) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help/help.html 2012-11-07 16:17:53 UTC (rev 10248) @@ -0,0 +1,93 @@ +<link rel="stylesheet" type="text/css" media="screen" href="<{xoAppUrl modules/xcaptcha/css/help.css}>" /> + +<div class="help txtcenter"> + <div class="help-submenu floatright txtleft"> + <ul> + <li><a href="#description" title=""><{$smarty.const._HELP_DESCRIPTION_TITLE}></a></li> + <li><a href="#developer" title=""><{$smarty.const._HELP_DEVELOPER_TITLE}></a></li> + <li><a href="#install" title=""><{$smarty.const._HELP_INSTALL_TITLE}></a></li> +<!-- + <li><a href="#uninstall" title=""><{$smarty.const._HELP_UNINSTALL_TITLE}></a></li> +--> + <li><a href="#tutorial" title=""><{$smarty.const._HELP_TUTORIAL_TITLE}></a></li> + </ul> + </div> + + <div class="floatleft"> + <img src="<{$xoops_url}>/modules/<{$module->getVar('dirname')}>/<{$module->getInfo('image')}>" alt="<{$module->getVar('name')}>" title="<{$module->getVar('name')}>" /> + </div> + + <div class="help-title floaleft"> + <h2><{$module->getVar('name')}></h2> + <{if $module->getInfo('paypal')}> + <form class="help-paypal" id="paypal-form" name="_xclick" action="https://www.paypal.com/fr/cgi-bin/webscr" method="post"> + <input type="hidden" name="cmd" value="_xclick"> + <{foreachq from=$module->getInfo('paypal') item=value key=key}> + <{if is_numeric($value)}> + <input type="hidden" name="<{$key}>" value=<{$value}>> + <{else}> + <input type="hidden" name="<{$key}>" value="<{$value}>"> + <{/if}> + <{/foreach}> + <img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" onclick="$('#paypal-form').submit()" alt="PayPal - The safer, easier way to pay online!" /> + </form> + <{/if}> + </div> +</div> +<div class="clear"></div> + +<a name="description"></a> +<div class="help-item"> + <div class="help-title"> + <{$smarty.const._HELP_DESCRIPTION_TITLE}> + </div> + <div> + <{$module->getInfo('description')}> + <br /> + Version : <{$module->getInfo('version')}> <{$module->getInfo('module_status')}> (<{$module->getInfo('release_date')}>)</div> + </div> +</div> + +<a name="Developer"></a> +<div class="help-item"> + <div class="help-title"> + <{$smarty.const._HELP_DEVELOPER_TITLE}> + </div> + <{if $module->getInfo('module_website_url')}> + <div class="spacer marg5"> + <a href="http://<{$module->getInfo('module_website_url')}>" rel="external"><{$module->getInfo('module_website_name')}></a> + </div> + <{/if}> +</div> + +<a name="install"></a> +<div class="help-item"> + <div class="help-title"> + <{$smarty.const._HELP_INSTALL_TITLE}> + </div> + <div> + <{$smarty.const._HELP_INSTALL_CONTENT}> + </div> +</div> + +<!-- +<a name="uninstall"></a> +<div class="help-item"> + <div class="help-title"> + <{$smarty.const._HELP_UNINSTALL_TITLE}> + </div> + <div> + <{$smarty.const._HELP_UNINSTALL_CONTENT}> + </div> +</div> +--> + +<a name="tutorial"></a> +<div class="help-item"> + <div class="help-title"> + <{$smarty.const._HELP_TUTORIAL_TITLE}> + </div> + <div> + <{$smarty.const._HELP_TUTORIAL_CONTENT}> + </div> +</div> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help.php 2012-11-07 16:17:53 UTC (rev 10248) @@ -0,0 +1,39 @@ +<?php +/** + * Xoocontact 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package xoocontact + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +define("_HELP_DESCRIPTION_TITLE", "Description"); +define("_HELP_DEVELOPER_TITLE", "Developer"); + +define("_HELP_INSTALL_TITLE", "Install"); +define("_HELP_INSTALL_CONTENT", " +Extra, or non-core, modules are usually downloadable as compressed files (zip, tar). Always check if a text file with upload instructions is included in the downloaded package. + <ol> + <li> Unzip files in local computer.</li> + <li>FTP/upload all files to appropriate folders in your website directory. This is usually the /modules folder under the Xoops root directory, where all the other modules are found. However, some modules have extra files that need to be uploaded to other folders such as the /include and the /class folders.</li> + <li>After upload, go to your Modules Administration Page and check if the new module is included in the uninstalled modules table.</li> + <li>Follow the steps described above for installing core modules from the Modules Administration page.</li> + </ol> +"); + +define("_HELP_UNINSTALL_TITLE", "Uninstall"); +define("_HELP_UNINSTALL_CONTENT", ""); + +define("_HELP_TUTORIAL_TITLE", "Tutorial"); +define("_HELP_TUTORIAL_CONTENT", "Coming soon"); +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/language/english/help.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL |
From: <du...@us...> - 2012-11-18 22:32:52
|
Revision: 10256 http://sourceforge.net/p/xoops/svn/10256 Author: dugris Date: 2012-11-18 22:32:49 +0000 (Sun, 18 Nov 2012) Log Message: ----------- Fiw form Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/captcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/image.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/recaptcha.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/text.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php 2012-11-18 22:30:39 UTC (rev 10255) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/admin/index.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -48,12 +48,14 @@ if ( $type == 'config' ) { $admin_page->renderNavigation('index.php?type=config'); $admin_page->addInfoBox(_AM_XCAPTCHA_FORM); - $admin_page->addInfoBoxLine($xcaptcha_handler->getForm()); + $form = $xoops->getModuleForm($xcaptcha_handler, 'captcha', 'xcaptcha'); + $admin_page->addInfoBoxLine( $form->render() ); } else { - if ($xcaptcha_handler->loadPluginHandler( $type )) { + if ( $plugin = $xcaptcha_handler->loadPluginHandler( $type )) { $title = constant('_XCAPTCHA_FORM_' . strtoupper($type) ); + $form = $xoops->getModuleForm($plugin, $type, 'xcaptcha'); $admin_page->addInfoBox( $title ); - $admin_page->addInfoBoxLine($xcaptcha_handler->Pluginhandler->getForm()); + $admin_page->addInfoBoxLine( $form->render() ); } else { $xoops->redirect('index.php', 5, _AM_XCAPTCHA_ERROR); } Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/captcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/captcha.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/captcha.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -0,0 +1,84 @@ +<?php +/** + * Xcaptcha 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package Xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class XcaptchaCaptchaForm extends XoopsThemeForm +{ + /** + * @param null $obj + */ + public function __construct($object = null) + { + $this->object = $object; + $this->config = $object->config; + } + + /** + * Maintenance Form + * @return void + */ + public function CaptchaForm() + { + $xoops = Xoops::getInstance(); + + parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal'); + + $activate = new XoopsFormRadio(_AM_XCAPTCHA_ACTIVATE, 'disabled', $this->config['disabled'] ); + $activate->addOption(1, _AM_XCAPTCHA_ENABLE); + $activate->addOption(0, _AM_XCAPTCHA_DISABLE); + $this->addElement($activate, false); + + $plugin_List = new XoopsFormSelect(_AM_XCAPTCHA_PLUGINS, 'mode', $this->config['mode'] ); + $plugin_List->addOptionArray( $this->object->plugin_List ); + $this->addElement($plugin_List, false); + + $this->addElement(new XoopsFormText(_AM_XCAPTCHA_NAME, 'name', 50, 50, $this->config['name'] ), true); + + $skipmember = new XoopsFormRadio(_AM_XCAPTCHA_SKIPMEMBER, 'skipmember', $this->config['skipmember'] ); + $skipmember->addOption(1, _AM_XCAPTCHA_ENABLE); + $skipmember->addOption(0, _AM_XCAPTCHA_DISABLE); + $this->addElement($skipmember, false); + + $this->addElement(new XoopsFormText(_AM_XCAPTCHA_MAXATTEMPTS, 'maxattempts', 2, 2, $this->config['maxattempts'] ), true); + + $this->addElement(new XoopsFormHidden('type', 'config' )); + + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); + $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); + $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); + $button_tray->addElement($cancel_send); + + $this->addElement($button_tray); + } + + public function render() + { + $this->CaptchaForm(); + ob_start(); + parent::render(); + $ret = ob_get_contents(); + ob_end_clean(); + return $ret; + } +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/captcha.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/image.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/image.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -0,0 +1,107 @@ +<?php +/** + * Xcaptcha 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package Xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class XcaptchaImageForm extends XoopsThemeForm +{ + /** + * @param null $obj + */ + public function __construct($object = null) + { + $this->object = $object; + $this->config = $object->config; + } + + /** + * Maintenance Form + * @return void + */ + public function ImageForm() + { + $xoops = Xoops::getInstance(); + + parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal'); + + $this->addElement(new XoopsFormText(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars'] ), true); + + $this->addElement(new XoopsFormRadioYN(_XCAPTCHA_CASESENSITIVE, 'casesensitive', $this->config['casesensitive'], _YES, _NO)); + + $fontmin_form = new XoopsFormSelect(_XCAPTCHA_FONTSIZE_MIN, 'fontsize_min', $this->config['fontsize_min']); + for ($i = 10; $i <= 30; $i++) { + $fontmin_form->addOption($i, $i); + } + $this->addElement($fontmin_form, false); + + $fontmax_form = new XoopsFormSelect(_XCAPTCHA_FONTSIZE_MAX, 'fontsize_max', $this->config['fontsize_max']); + for ($i = 10; $i <= 30; $i++) { + $fontmax_form->addOption($i, $i); + } + $this->addElement($fontmax_form, false); + + $backtype_form = new XoopsFormSelect(_XCAPTCHA_BACKGROUND_TYPE, 'background_type', $this->config['background_type'], $size = 7); + $backtype_form->addOption(0, _XCAPTCHA_BACKGROUND_BAR); + $backtype_form->addOption(1, _XCAPTCHA_BACKGROUND_CIRCLE); + $backtype_form->addOption(2, _XCAPTCHA_BACKGROUND_LINE); + $backtype_form->addOption(3, _XCAPTCHA_BACKGROUND_RECTANGLE); + $backtype_form->addOption(4, _XCAPTCHA_BACKGROUND_ELLIPSE); + $backtype_form->addOption(5, _XCAPTCHA_BACKGROUND_POLYGONE); + $backtype_form->addOption(100, _XCAPTCHA_BACKGROUND_IMAGE); + $this->addElement($backtype_form, false); + + $backnum_form = new XoopsFormSelect(_XCAPTCHA_BACKGROUND_NUM, 'background_num', $this->config['background_num']); + for ($i = 10; $i <= 100; $i = $i+10) { + $backnum_form->addOption($i, $i); + } + $this->addElement($backnum_form, false); + + $polygon_point = new XoopsFormSelect(_XCAPTCHA_POLYGON_POINT, 'polygon_point', $this->config['polygon_point']); + for ($i = 3; $i <= 20; $i++) { + $polygon_point->addOption($i, $i); + } + $this->addElement($polygon_point, false); + + $value = implode('|', $this->config['skip_characters']); + $this->addElement(new XoopsFormTextarea(_XCAPTCHA_SKIP_CHARACTERS, 'skip_characters', $value, 5, 50 ), true); + + $this->addElement(new XoopsFormHidden('type', 'image' )); + + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); + $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); + $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); + $button_tray->addElement($cancel_send); + + $this->addElement($button_tray); + } + + public function render() + { + $this->ImageForm(); + ob_start(); + parent::render(); + $ret = ob_get_contents(); + ob_end_clean(); + return $ret; + } +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/image.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/index.html 2012-11-18 22:32:49 UTC (rev 10256) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/recaptcha.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/recaptcha.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -0,0 +1,77 @@ +<?php +/** + * Xcaptcha 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package Xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class XcaptchaRecaptchaForm extends XoopsThemeForm +{ + /** + * @param null $obj + */ + public function __construct($object = null) + { + $this->object = $object; + $this->config = $object->config; + } + + /** + * Maintenance Form + * @return void + */ + public function RecaptchaForm() + { + $xoops = Xoops::getInstance(); + + parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal'); + + $this->addElement(new XoopsFormTextarea(_XCAPTCHA_PRIVATE_KEY, 'private_key', $this->config['private_key'], 5, 50 ), true); + $this->addElement(new XoopsFormTextarea(_XCAPTCHA_PUBLIC_KEY, 'public_key', $this->config['public_key'], 5, 50 ), true); + + $theme_form = new XoopsFormSelect(_XCAPTCHA_THEME, 'theme', $this->config['theme'], $size = 4); + $theme_form->addOptionArray($this->object->getThemes() ); + $this->addElement($theme_form, false); + + $lang_form = new XoopsFormSelect(_XCAPTCHA_LANG, 'lang', $this->config['lang'], $size = 4); + $lang_form->addOptionArray($this->object->getLanguages() ); + $this->addElement($lang_form, false); + + $this->addElement(new XoopsFormHidden('type', 'recaptcha' )); + + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); + $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); + $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); + $button_tray->addElement($cancel_send); + + $this->addElement($button_tray); + } + + public function render() + { + $this->RecaptchaForm(); + ob_start(); + parent::render(); + $ret = ob_get_contents(); + ob_end_clean(); + return $ret; + } +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/recaptcha.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/text.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/text.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -0,0 +1,68 @@ +<?php +/** + * Xcaptcha 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 GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @package Xcaptcha + * @since 2.6.0 + * @author Laurent JEN (Aka DuGris) + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + +class XcaptchaTextForm extends XoopsThemeForm +{ + /** + * @param null $obj + */ + public function __construct($object = null) + { + $this->object = $object; + $this->config = $object->config; + } + + /** + * Maintenance Form + * @return void + */ + public function TextForm() + { + $xoops = Xoops::getInstance(); + + parent::__construct('', 'xcaptchaform', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal'); + + $this->addElement(new XoopsFormText(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars'] ), true); + + $this->addElement(new XoopsFormHidden('type', 'text' )); + + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); + $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); + $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); + $button_tray->addElement($cancel_send); + + $this->addElement($button_tray); + } + + public function render() + { + $this->TextForm(); + ob_start(); + parent::render(); + $ret = ob_get_contents(); + ob_end_clean(); + return $ret; + } +} +?> \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/form/text.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Rev URL Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php 2012-11-18 22:30:39 UTC (rev 10255) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/class/xcaptcha.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -92,45 +92,6 @@ return $config; } - public function getForm() - { - $captcha_form = new XoopsThemeForm('', 'xcaptchaform', 'index.php', 'post', true); - - $activate = new XoopsFormRadio(_AM_XCAPTCHA_ACTIVATE, 'disabled', $this->config['disabled'] ); - $activate->addOption(1, _AM_XCAPTCHA_ENABLE); - $activate->addOption(0, _AM_XCAPTCHA_DISABLE); - $captcha_form->addElement($activate, false); - - $plugin_List = new XoopsFormSelect(_AM_XCAPTCHA_PLUGINS, 'mode', $this->config['mode'] ); - $plugin_List->addOptionArray( $this->plugin_List ); - $captcha_form->addElement($plugin_List, false); - - $captcha_form->addElement(new XoopsFormText(_AM_XCAPTCHA_NAME, 'name', 50, 50, $this->config['name'] ), true); - - $skipmember = new XoopsFormRadio(_AM_XCAPTCHA_SKIPMEMBER, 'skipmember', $this->config['skipmember'] ); - $skipmember->addOption(1, _AM_XCAPTCHA_ENABLE); - $skipmember->addOption(0, _AM_XCAPTCHA_DISABLE); - $captcha_form->addElement($skipmember, false); - - $captcha_form->addElement(new XoopsFormText(_AM_XCAPTCHA_MAXATTEMPTS, 'maxattempts', 2, 2, $this->config['maxattempts'] ), true); - - - $captcha_form->addElement(new XoopsFormHidden('type', 'config' )); - - $button_tray = new XoopsFormElementTray('', ''); - $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); - $captcha_form->addElement($button_tray); - - ob_start(); - $captcha_form->render(); - $ret = ob_get_contents(); - ob_end_clean(); - - return $ret; - } - public function VerifyData() { global $system; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php 2012-11-18 22:30:39 UTC (rev 10255) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/image.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -36,70 +36,6 @@ $this->__construct(); } - public function getForm() - { - $captcha_form = new XoopsThemeForm('', 'xcaptchaform', 'index.php', 'post', true); - - $captcha_form->addElement(new XoopsFormText(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars'] ), true); - - $captcha_form->addElement(new XoopsFormRadioYN(_XCAPTCHA_CASESENSITIVE, 'casesensitive', $this->config['casesensitive'], _YES, _NO)); - - $fontmin_form = new XoopsFormSelect(_XCAPTCHA_FONTSIZE_MIN, 'fontsize_min', $this->config['fontsize_min']); - for ($i = 10; $i <= 30; $i++) { - $fontmin_form->addOption($i, $i); - } - $captcha_form->addElement($fontmin_form, false); - - $fontmax_form = new XoopsFormSelect(_XCAPTCHA_FONTSIZE_MAX, 'fontsize_max', $this->config['fontsize_max']); - for ($i = 10; $i <= 30; $i++) { - $fontmax_form->addOption($i, $i); - } - $captcha_form->addElement($fontmax_form, false); - - $backtype_form = new XoopsFormSelect(_XCAPTCHA_BACKGROUND_TYPE, 'background_type', $this->config['background_type'], $size = 7); - $backtype_form->addOption(0, _XCAPTCHA_BACKGROUND_BAR); - $backtype_form->addOption(1, _XCAPTCHA_BACKGROUND_CIRCLE); - $backtype_form->addOption(2, _XCAPTCHA_BACKGROUND_LINE); - $backtype_form->addOption(3, _XCAPTCHA_BACKGROUND_RECTANGLE); - $backtype_form->addOption(4, _XCAPTCHA_BACKGROUND_ELLIPSE); - $backtype_form->addOption(5, _XCAPTCHA_BACKGROUND_POLYGONE); - $backtype_form->addOption(100, _XCAPTCHA_BACKGROUND_IMAGE); - $captcha_form->addElement($backtype_form, false); - - $backnum_form = new XoopsFormSelect(_XCAPTCHA_BACKGROUND_NUM, 'background_num', $this->config['background_num']); - for ($i = 10; $i <= 100; $i = $i+10) { - $backnum_form->addOption($i, $i); - } - $captcha_form->addElement($backnum_form, false); - - $polygon_point = new XoopsFormSelect(_XCAPTCHA_POLYGON_POINT, 'polygon_point', $this->config['polygon_point']); - for ($i = 3; $i <= 20; $i++) { - $polygon_point->addOption($i, $i); - } - $captcha_form->addElement($polygon_point, false); - - $value = implode('|', $this->config['skip_characters']); - $captcha_form->addElement(new XoopsFormTextarea(_XCAPTCHA_SKIP_CHARACTERS, 'skip_characters', $value, 5, 50 ), true); - - $captcha_form->addElement(new XoopsFormHidden('type', 'image' )); - - $button_tray = new XoopsFormElementTray('', ''); - $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); - $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); - $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); - $button_tray->addElement($cancel_send); - $captcha_form->addElement($button_tray); - - ob_start(); - $captcha_form->render(); - $ret = ob_get_contents(); - ob_end_clean(); - - return $ret; - } - public function VerifyData() { global $system; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php 2012-11-18 22:30:39 UTC (rev 10255) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/recaptcha.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -36,40 +36,6 @@ $this->__construct(); } - function getForm() - { - $captcha_form = new XoopsThemeForm('', 'xcaptchaform', 'index.php', 'post', true); - - $captcha_form->addElement(new XoopsFormTextarea(_XCAPTCHA_PRIVATE_KEY, 'private_key', $this->config['private_key'], 5, 50 ), true); - $captcha_form->addElement(new XoopsFormTextarea(_XCAPTCHA_PUBLIC_KEY, 'public_key', $this->config['public_key'], 5, 50 ), true); - - $theme_form = new XoopsFormSelect(_XCAPTCHA_THEME, 'theme', $this->config['theme'], $size = 4); - $theme_form->addOptionArray($this->getThemes() ); - $captcha_form->addElement($theme_form, false); - - $lang_form = new XoopsFormSelect(_XCAPTCHA_LANG, 'lang', $this->config['lang'], $size = 4); - $lang_form->addOptionArray($this->getLanguages() ); - $captcha_form->addElement($lang_form, false); - - $captcha_form->addElement(new XoopsFormHidden('type', 'recaptcha' )); - - $button_tray = new XoopsFormElementTray('', ''); - $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); - $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); - $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); - $button_tray->addElement($cancel_send); - $captcha_form->addElement($button_tray); - - ob_start(); - $captcha_form->render(); - $ret = ob_get_contents(); - ob_end_clean(); - - return $ret; - } - function VerifyData() { global $xoopsConfig; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php 2012-11-18 22:30:39 UTC (rev 10255) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/plugins/text.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -36,31 +36,6 @@ $this->__construct(); } - function getForm() - { - $captcha_form = new XoopsThemeForm('', 'xcaptchaform', 'index.php', 'post', true); - - $captcha_form->addElement(new XoopsFormText(_XCAPTCHA_NUM_CHARS, 'num_chars', 2, 2, $this->config['num_chars'] ), true); - - $captcha_form->addElement(new XoopsFormHidden('type', 'text' )); - - $button_tray = new XoopsFormElementTray('', ''); - $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $button_tray->addElement(new XoopsFormButton('', 'reset', _RESET, 'reset')); - $cancel_send = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); - $cancel_send->setExtra("onclick='javascript:history.go(-1);'"); - $button_tray->addElement($cancel_send); - $captcha_form->addElement($button_tray); - - ob_start(); - $captcha_form->render(); - $ret = ob_get_contents(); - ob_end_clean(); - - return $ret; - } - function VerifyData() { global $system; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php 2012-11-18 22:30:39 UTC (rev 10255) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/xcaptcha/xoops_version.php 2012-11-18 22:32:49 UTC (rev 10256) @@ -30,6 +30,7 @@ $modversion['image'] = 'images/xcaptcha_logo.png'; $modversion['dirname'] = 'xcaptcha'; + //about $modversion['release_date'] = '2012/10/01'; $modversion['module_website_url'] = 'dugris.xoofoo.org'; |