mirrored from git://git.moodle.org/moodle.git
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mchampan
committed
Jun 25, 2006
1 parent
1cd1252
commit 682d403
Showing
55 changed files
with
7,732 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,70 @@ | |||
<?php | |||
|
|||
/* This is the global search shortcut block - a single query can be entered, and | |||
the user will be redirected to the query page where they can enter more | |||
advanced queries, and view the results of their search. When searching from | |||
this block, the broadest possible selection of documents is searched. | |||
Author: Michael Champanis (mchampan) | |||
Date: 2006 06 23 | |||
Todo: make strings -> get_string() | |||
*/ | |||
|
|||
class block_search extends block_base { | |||
|
|||
function init() { | |||
$this->title = "Global Search"; //get_string() | |||
$this->version = 20060625; | |||
} //init | |||
|
|||
// only one instance of this block is required | |||
function instance_allow_multiple() { | |||
return false; | |||
} //instance_allow_multiple | |||
|
|||
// label and button values can be set in admin | |||
function has_config() { | |||
return true; | |||
} //has_config | |||
|
|||
function get_content() { | |||
global $CFG; | |||
|
|||
//cache block contents | |||
if ($this->content !== NULL) { | |||
return $this->content; | |||
} //if | |||
|
|||
$this->content = new stdClass; | |||
|
|||
//lazy check for the moment | |||
if (check_php_version("5.0.0")) { | |||
//fetch values if defined in admin, otherwise use defaults | |||
$label = (isset($CFG->block_search_text)) ? $CFG->block_search_text : "Search Moodle"; | |||
$button = (isset($CFG->block_search_button)) ? $CFG->block_search_button : "Go"; | |||
|
|||
//basic search form | |||
$this->content->text = | |||
'<form name="query" method="post" action="search/query.php">' | |||
. "<label for=''>$label</label>" | |||
. '<input type="text" name="query_string" length="50" value=""/>' | |||
. '<input type="submit" value="'.$button.'"/>' | |||
. '</form>'; | |||
} else { | |||
$this->content->text = "Sorry folks, PHP 5 is needed for the new search module."; | |||
} //else | |||
|
|||
//no footer, thanks | |||
$this->content->footer = ''; | |||
|
|||
return $this->content; | |||
} //get_content | |||
|
|||
function specialisation() { | |||
//empty! | |||
} //specialisation | |||
|
|||
} //block_search | |||
|
|||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
<div style="text-align:center;"> | |||
<label for="block_search_text">Search label</label> | |||
<input type="text" name="block_search_text" value="<?php | |||
if(isset($CFG->block_search_text)) { | |||
p($CFG->block_search_text); | |||
} else { | |||
p("Search Moodle"); | |||
} ?>"/><br> | |||
|
|||
<label for="block_search_button">Button label</label> | |||
<input type="text" name="block_search_button" value="<?php | |||
if(isset($CFG->block_search_button)) { | |||
p($CFG->block_search_button); | |||
} else { | |||
p("Go"); | |||
} ?>"/><br><br> | |||
|
|||
<input type="submit" value="<?php print_string('savechanges'); ?>" /> | |||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
This is the initial release (prototype) of Moodle's new search module - | |||
so basically watch out for sharp edges. | |||
|
|||
The structure has not been finalised, but this is what is working at the | |||
moment, when I start looking at other content to index, it will most likely | |||
change. I don't recommend trying to make your own content modules indexable, | |||
at least not until the whole flow is finalised. I will be implementing the | |||
functions needed to index all of the default content modules on Moodle, so | |||
expect that around mid-August. | |||
|
|||
Wiki pages were my goal for this release, they can be indexed and searched, | |||
but not updated or deleted at this stage (was waiting for ZF 0.14 actually). | |||
|
|||
I need to check the PostgreSQL sql file, I don't have a PG7 install lying | |||
around to test on, so the script is untested. | |||
|
|||
To index for the first time, login as an admin user and browse to /search/index.php | |||
or /search/stats.php - there will be a message and a link telling you to go index. | |||
|
|||
-- Michael Champanis (mchampan) | |||
cynnical@gmail.com | |||
Summer of Code 2006 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
<?php | |||
/** | |||
* Zend Framework | |||
* | |||
* LICENSE | |||
* | |||
* This source file is subject to the new BSD license that is bundled | |||
* with this package in the file LICENSE.txt. | |||
* It is also available through the world-wide-web at this URL: | |||
* http://framework.zend.com/license/new-bsd | |||
* If you did not receive a copy of the license and are unable to | |||
* obtain it through the world-wide-web, please send an email | |||
* to license@zend.com so we can send you a copy immediately. | |||
* | |||
* @category Zend | |||
* @package Zend | |||
* @copyright Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com) | |||
* @license http://framework.zend.com/license/new-bsd New BSD License | |||
*/ | |||
|
|||
|
|||
/** | |||
* @category Zend | |||
* @package Zend | |||
* @copyright Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com) | |||
* @license http://framework.zend.com/license/new-bsd New BSD License | |||
*/ | |||
class Zend_Exception extends Exception | |||
{} | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
We are running cutting-edge (i.e. HEAD) Zend Framework: | |||
URL: http://framework.zend.com/svn/framework/trunk | |||
Revision: 696 | |||
Last Changed Rev: 696 | |||
Last Changed Date: 2006-06-23 02:14:54 +0200 (Fri, 23 Jun 2006) | |||
|
|||
This Zend Framework present in this directory only contains the minimum | |||
to run Zend_Search_Lucene - I don't foresee any problems, since the license | |||
is new BSD... | |||
|
|||
To obtain a full Zend Framework package, please visit: | |||
http://framework.zend.com/ | |||
|
|||
Or alternatively check it out from SVN: | |||
svn checkout http://framework.zend.com/svn/framework/trunk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
Copyright (c) 2006, Zend Technologies USA, Inc. | |||
All rights reserved. | |||
|
|||
Redistribution and use in source and binary forms, with or without modification, | |||
are permitted provided that the following conditions are met: | |||
|
|||
* Redistributions of source code must retain the above copyright notice, | |||
this list of conditions and the following disclaimer. | |||
|
|||
* Redistributions in binary form must reproduce the above copyright notice, | |||
this list of conditions and the following disclaimer in the documentation | |||
and/or other materials provided with the distribution. | |||
|
|||
* Neither the name of Zend Technologies USA, Inc. nor the names of its | |||
contributors may be used to endorse or promote products derived from this | |||
software without specific prior written permission. | |||
|
|||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | |||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | |||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,36 @@ | |||
<?php | |||
/** | |||
* Zend Framework | |||
* | |||
* LICENSE | |||
* | |||
* This source file is subject to the new BSD license that is bundled | |||
* with this package in the file LICENSE.txt. | |||
* It is also available through the world-wide-web at this URL: | |||
* http://framework.zend.com/license/new-bsd | |||
* If you did not receive a copy of the license and are unable to | |||
* obtain it through the world-wide-web, please send an email | |||
* to license@zend.com so we can send you a copy immediately. | |||
* | |||
* @category Zend | |||
* @package Zend_Search | |||
* @copyright Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com) | |||
* @license http://framework.zend.com/license/new-bsd New BSD License | |||
*/ | |||
|
|||
|
|||
/** | |||
* Framework base exception | |||
*/ | |||
require_once 'Zend/Exception.php'; | |||
|
|||
|
|||
/** | |||
* @category Zend | |||
* @package Zend_Search | |||
* @copyright Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com) | |||
* @license http://framework.zend.com/license/new-bsd New BSD License | |||
*/ | |||
class Zend_Search_Exception extends Zend_Exception | |||
{} | |||
|
Oops, something went wrong.