Index: block_search.php =================================================================== RCS file: /cvsroot/moodle/moodle/blocks/search/block_search.php,v retrieving revision 1.11.2.2 diff -r1.11.2.2 block_search.php 39c39 < return ''; --- > return get_string('disabledsearch', 'search'); Index: config_global.html =================================================================== RCS file: /cvsroot/moodle/moodle/blocks/search/config_global.html,v retrieving revision 1.4.2.1 diff -r1.4.2.1 config_global.html 0a1,10 > > /** > * Requires and includes > */ > include_once $CFG->dirroot."/search/lib.php"; > > $defaultfiletypes = "PDF,TXT,HTML,PPT,XML,DOC,HTM"; > > ?> 2c12 < --- >
51,55c61,66 < if(isset($CFG->block_search_filetypes)) { < p($CFG->block_search_filetypes); < } else { < p("PDF,TXT,HTML,PPT,XML,DOC,HTM"); < } ?>"/>

--- > if(!isset($CFG->block_search_filetypes)) { > $CFG->block_search_filetypes = $defaultfiletypes; > } > p($CFG->block_search_filetypes); > ?>" /> >

73a85,102 > : > > > >
>

>
> >
> > > >
90a120,125 >
>
> >
> > 126a162,176 >
>
> > $types = split(',', $CFG->block_search_filetypes); > if (!empty($types)){ > foreach($types as $type) { > $utype = strtoupper($type); > $type = strtolower($type); > $type = trim($type); > if (preg_match("/\\b$type\\b/i", $defaultfiletypes)) continue; > ?> >
> > 129c179 < : --- > : 132,137c182,200 <

--- > if(isset($CFG->$propname)) { > p($CFG->$propname); > } > ?>"/> >

> > > > >
> : > > if(isset($CFG->$propname)) { > echo stripslashes($CFG->$propname); > } ?>"/>

139a203,295 >
>
> } > } > ?> > >
> > > > > >
>
>                          $searchnames = search_collect_searchables(true);
>             $searchable_list = implode("','", $searchnames);
>             ?>
>             
>
>
> >
> > > > > >
> $i = 0; > $found_searchable_modules = 0; > if ($modules = get_records_select('modules', " name IN ('{$searchable_list}') ", 'name', 'id,name')){ > foreach($modules as $module){ > $i++; > $keyname = "search_in_{$module->name}"; > $checkedup = (!isset($CFG->$keyname) || $CFG->$keyname) ? 'checked="checked"' : '' ; > $checkeddown = !(!isset($CFG->$keyname) || $CFG->$keyname) ? 'checked="checked"' : '' ; > echo "name}\" value=\"0\" {$checkeddown} /> " . get_string('no'); > echo " - name}\" value=\"1\" {$checkedup} /> " . get_string('yes'); > echo " - ".get_string('modulename', $module->name).'
'; > if ($i % 20 == 0){ > echo "
"; > } > $found_searchable_modules = 1; > } > } > if (!$found_searchable_modules) { > print_string('nosearchablemodules', 'block_search'); > } > ?> > >
>
> >
> > > > > >
> $i = 0; > $found_searchable_blocks = 0; > if ($blocks = get_records_select('block', " name IN ('{$searchable_list}') ", 'name', 'id,name')){ > foreach($blocks as $block){ > $i++; > $keyname = "search_in_{$block->name}"; > $checked = (!isset($CFG->$keyname) || $CFG->$keyname) ? 'checked="checked"' : '' ; > echo "name}\" value=\"1\" {$checked} />"; > > // multiple fallback strategy to get the name of the block > $blocklabel = get_string('blockname', 'block_'.$block->name); > if ($blocklabel == '[[blockname]]') $blocklabel = get_string($block->name, 'block_'.$block->name); > if ($blocklabel == "[[{$block->name}]]") $blocklabel = "$block->name"; > echo " - ".$blocklabel.'
'; > if ($i % 20 == 0){ > echo "
"; > } > $found_searchable_blocks = 1; > } > } > if (!$found_searchable_blocks) { > print_string('nosearchableblocks', 'block_search'); > } > ?> > >
>
> > cvs diff: Diffing db Index: db/install.xml =================================================================== RCS file: /cvsroot/moodle/moodle/blocks/search/db/install.xml,v retrieving revision 1.4.2.2 diff -r1.4.2.2 install.xml 15,16c15,16 < < --- > > Index: db/upgrade.php =================================================================== RCS file: /cvsroot/moodle/moodle/blocks/search/db/upgrade.php,v retrieving revision 1.4.2.2 diff -r1.4.2.2 upgrade.php 1c1 < prefix}block_search_documents", true); < < /// Changing type of field docdate on table block_search_documents to int < $table = new XMLDBTable('block_search_documents'); < $field = new XMLDBField('docdate'); < $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'url'); < < /// Launch change of type for field docdate < $result = $result && change_field_type($table, $field); < < /// Changing type of field updated on table block_search_documents to int < $table = new XMLDBTable('block_search_documents'); < $field = new XMLDBField('updated'); < $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'docdate'); < < /// Launch change of type for field updated < $result = $result && change_field_type($table, $field); < */ < < < /// MDL-12352, postgres can not cope with change_field_type(), so dropping the fields and adding again < < /// Define field docdate to be dropped from block_search_documents < $table = new XMLDBTable('block_search_documents'); < $field = new XMLDBField('docdate'); < < /// Launch drop field docdate < $result = $result && drop_field($table, $field); < < /// Define field updated to be dropped from block_search_documents < $field = new XMLDBField('updated'); < < /// Launch drop field updated < $result = $result && drop_field($table, $field); < < /// Define field docdate to be added to block_search_documents < $field = new XMLDBField('docdate'); < $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'url'); < < /// Launch add field docdate < $result = $result && add_field($table, $field); < < /// Define field updated to be added to block_search_documents < $field = new XMLDBField('updated'); < $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'docdate'); < < /// Launch add field updated < $result = $result && add_field($table, $field); < } < 167c113 < ?> \ No newline at end of file --- > ?>