From: <du...@us...> - 2012-12-17 18:32:53
|
Revision: 10430 http://sourceforge.net/p/xoops/svn/10430 Author: dugris Date: 2012-12-17 18:32:50 +0000 (Mon, 17 Dec 2012) Log Message: ----------- Add search block to module search Remove search block from module system Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/language/english/modinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/xoops_version.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/language/english/modinfo.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php Added Paths: ----------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/index.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/search_blocks.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/block_search.html XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/index.html Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/index.html 2012-12-17 18:32:50 UTC (rev 10430) @@ -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/search/blocks/search_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/search_blocks.php (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/search_blocks.php 2012-12-17 18:32:50 UTC (rev 10430) @@ -0,0 +1,40 @@ +<?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. +*/ + +/** + * Blocks functions + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) + * @author Laurent JEN (aka DuGris) + * @package system + * @version $Id$ + */ + +function b_search_show() +{ + $search = Search::getInstance(); + $search->loadLanguage('main', 'search'); + + $form = new XoopsSimpleForm('', 'search', $search->url('index.php'), 'get', false, 'inline'); + + // create form elements + $form->addElement(new XoopsFormText('', 'query', 2, 100, '', _MD_SEARCH_KEYWORDS), true); + $form->addElement(new XoopsFormHidden('action', 'results')); + $form->addElement(new XoopsFormHiddenToken('id')); + + $button = new XoopsFormButton('', 'submit', _MD_SEARCH, 'submit'); + $button->setClass('btn btn-primary'); + $form->addElement($button); + + $block['form'] = $form->render(); + return $block; +} \ No newline at end of file Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/blocks/search_blocks.php ___________________________________________________________________ Added: svn:executable + * Added: svn:keywords + Author Date Id Revision URL Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/language/english/modinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/language/english/modinfo.php 2012-12-17 16:14:34 UTC (rev 10429) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/language/english/modinfo.php 2012-12-17 18:32:50 UTC (rev 10430) @@ -26,3 +26,4 @@ define("_MI_SEARCH_MINSEARCH", "Minimum keyword length"); define("_MI_SEARCH_MINSEARCHDSC", "Enter the minimum keyword length that users are required to enter to perform search"); +define("_MI_SEARCH_BNAME1","Search"); Property changes on: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks ___________________________________________________________________ Added: tsvn:autoprops + *.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/block_search.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/block_search.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/block_search.html 2012-12-17 18:32:50 UTC (rev 10430) @@ -0,0 +1 @@ +<{$block.form}> \ No newline at end of file Added: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/index.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/index.html (rev 0) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/templates/blocks/index.html 2012-12-17 18:32:50 UTC (rev 10430) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/xoops_version.php 2012-12-17 16:14:34 UTC (rev 10429) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/search/xoops_version.php 2012-12-17 18:32:50 UTC (rev 10430) @@ -70,6 +70,11 @@ Blocks */ $modversion['blocks'] = array(); +$modversion['blocks'][1]['file'] = 'search_blocks.php'; +$modversion['blocks'][1]['name'] = _MI_SEARCH_BNAME1; +$modversion['blocks'][1]['description'] = 'Shows search form block'; +$modversion['blocks'][1]['show_func'] = 'b_search_show'; +$modversion['blocks'][1]['template'] = 'block_search.html'; // Preferences $i = 0; Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2012-12-17 16:14:34 UTC (rev 10429) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/blocks/system_blocks.php 2012-12-17 18:32:50 UTC (rev 10430) @@ -161,14 +161,6 @@ return $xoops->tpl()->fetch('admin:system|system_modules_menu.html'); } -function b_system_search_show() -{ - $block = array(); - $block['lang_search'] = _MB_SYSTEM_SEARCH; - $block['lang_advsearch'] = _MB_SYSTEM_ADVS; - return $block; -} - function b_system_user_show() { $xoops = Xoops::getInstance(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/language/english/modinfo.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/language/english/modinfo.php 2012-12-17 16:14:34 UTC (rev 10429) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/language/english/modinfo.php 2012-12-17 18:32:50 UTC (rev 10430) @@ -15,7 +15,6 @@ // Names of blocks for this module (Not all module has blocks) define("_MI_SYSTEM_BNAME2","User Menu"); define("_MI_SYSTEM_BNAME3","Login"); -define("_MI_SYSTEM_BNAME4","Search"); define("_MI_SYSTEM_BNAME5","Waiting Contents"); define("_MI_SYSTEM_BNAME6","Main Menu"); define("_MI_SYSTEM_BNAME7","Site Info"); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php 2012-12-17 16:14:34 UTC (rev 10429) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/xoops_version.php 2012-12-17 18:32:50 UTC (rev 10430) @@ -114,12 +114,6 @@ $modversion['blocks'][2]['show_func'] = 'b_system_login_show'; $modversion['blocks'][2]['template'] = 'system_block_login.html'; -$modversion['blocks'][3]['file'] = 'system_blocks.php'; -$modversion['blocks'][3]['name'] = _MI_SYSTEM_BNAME4; -$modversion['blocks'][3]['description'] = 'Shows search form block'; -$modversion['blocks'][3]['show_func'] = 'b_system_search_show'; -$modversion['blocks'][3]['template'] = 'system_block_search.html'; - $modversion['blocks'][4]['file'] = 'system_blocks.php'; $modversion['blocks'][4]['name'] = _MI_SYSTEM_BNAME5; $modversion['blocks'][4]['description'] = 'Shows contents waiting for approval'; |