From: <tr...@us...> - 2012-12-26 18:44:07
|
Revision: 10563 http://sourceforge.net/p/xoops/svn/10563 Author: trabis Date: 2012-12-26 18:43:49 +0000 (Wed, 26 Dec 2012) Log Message: ----------- Adding a simple block form to use in blocks forms. Needs some extra work. Help is appreciated. Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/blockform.php Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/blockform.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/blockform.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/blockform.php 2012-12-26 18:43:49 UTC (rev 10563) @@ -0,0 +1,56 @@ +<?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. +*/ + +/** + * XOOPS Block Form + * + * @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 class + * @subpackage xoopsform + * @since 2.6.0 + * @author trabis <lus...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die('Restricted access'); + + +/** + * Form that will output formatted as a HTML table + * + * No styles and no JavaScript to check for required fields. + */ +class XoopsBlockForm extends XoopsForm +{ + public function __construct() + { + parent::__construct('', '', ''); + } + + /** + * @return string + */ + public function render() + { + $ret = ''; + /* @var $ele XoopsFormElement */ + foreach ($this->getElements() as $ele) { + if (!$ele->isHidden()) { + $ret .= "<strong>" . $ele->getCaption()."</strong>"; + $ret .= " " . $ele->render() . ""; + $ret .= " <i>" . $ele->getDescription() . "</i><br /><br />"; + } + } + $ret .= ''; + return $ret; + } +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsform/blockform.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-26 18:41:43 UTC (rev 10562) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/class/xoopsload.php 2012-12-26 18:43:49 UTC (rev 10563) @@ -240,6 +240,7 @@ 'xoopsavataruserlink' => XOOPS_ROOT_PATH . '/kernel/avataruserlink.php', 'xoopsavataruserlinkhandler' => XOOPS_ROOT_PATH . '/kernel/avataruserlink.php', 'xoopsblock' => XOOPS_ROOT_PATH . '/kernel/block.php', + 'xoopsblockform' => XOOPS_ROOT_PATH . '/class/xoopsform/blockform.php', 'xoopsblockhandler' => XOOPS_ROOT_PATH . '/kernel/block.php', 'xoopsblockmodulelink' => XOOPS_ROOT_PATH . '/kernel/blockmodulelink.php', 'xoopsblockmodulelinkhandler' => XOOPS_ROOT_PATH . '/kernel/blockmodulelink.php', |