loadStrings(array( 'confirmcheckindexes' => 'xmldb', 'ok' => '', 'missing' => 'xmldb', 'table' => 'xmldb', 'key' => 'xmldb', 'index' => 'xmldb', 'searchresults' => 'xmldb', 'missingindexes' => 'xmldb', 'completelogbelow' => 'xmldb', 'nomissingindexesfound' => 'xmldb', 'yesmissingindexesfound' => 'xmldb', 'yes' => '', 'no' => '', 'back' => 'xmldb' )); } /** * Invoke method, every class will have its own * returns true/false on completion, setting both * errormsg and output as necessary */ function invoke() { parent::invoke(); $result = true; /// Set own core attributes $this->does_generate = ACTION_GENERATE_HTML; /// These are always here global $CFG, $XMLDB; /// And we nedd some ddl suff require_once ($CFG->libdir . '/ddllib.php'); /// Here we'll acummulate all the missing indexes found $missing_indexes = array(); /// Do the job, setting $result as needed /// Get the confirmed to decide what to do $confirmed = optional_param('confirmed', false, PARAM_BOOL); /// If not confirmed, show confirmation box if (!$confirmed) { $o = '
';
$o.= ' ' . $this->str['confirmcheckindexes'] . ' '; $o.= '
|
';
$r.= ' ' . $this->str['searchresults'] . ''; $r.= '' . $this->str['missingindexes'] . ': ' . count($missing_indexes) . ' '; $r.= ' |
';
/// If we have found missing indexes inform about them
if (count($missing_indexes)) {
$r.= ' ' . $this->str['yesmissingindexesfound'] . ' '; $r.= '
' . str_replace("\n", ' '; } $r.= ' ' . $s; } else { $r.= ' ' . $this->str['nomissingindexesfound'] . ' '; } $r.= ' |
';
/// Add the complete log message
$r.= ' ' . $this->str['completelogbelow'] . ' '; $r.= ' |