function do_pre_htEdit() { global $wgOut, $wgUser; $this->loadEditText(); $MvOverlay = new MV_Overlay(); // strip semantic tags which are managed by the interface: $semantic_data = $MvOverlay->get_and_strip_semantic_tags($this->stripped_edit_text); $out = $js_eval = ''; // add a div for previews: $wgOut->addHTML('<div id="wikiPreview_' . $this->mvd_id . '"></div>'); // set the default action so save page: $wgOut->addHTML($this->getAjaxForm()); // add in adjust html if present: $wgOut->addHTML($this->adj_html); // structure layout via tables (@@todo switch to class based css layout) $wgOut->addHTML('<table style="background: transparent;" width="100%"><tr><td valign="top" width="90">'); // output the person selector: if (!isset($semantic_data['spoken_by'])) { $semantic_data['spoken_by'] = ''; } $img = mv_get_person_img($semantic_data['spoken_by']); $wgOut->addHTML('<img id="mv_edit_im_' . htmlspecialchars($this->mvd_id) . '" style="display: block;margin-left: auto;margin-right: auto;" src="' . htmlspecialchars($img->getURL()) . '" width="44">'); $wgOut->addHTML('<input style="font-size:x-small" value="' . htmlspecialchars($semantic_data['spoken_by']) . '" name="smw_Spoken_By" onClick="this.value=\'\';" type="text" id="auto_comp_' . htmlspecialchars($this->mvd_id) . '" size="12" maxlength="125" autocomplete="off"/>'); // only add one auto_comp_choices_ per object/request pass if (!isset($this->auto_comp_choices)) { $this->auto_comp_choices = true; $wgOut->addHTML('<div id="auto_comp_choices_' . htmlspecialchars($this->mvd_id) . '" class="autocomplete"></div>'); } // add container formatting for MV_Overlay $wgOut->addHTML('</td>' . '<td>'); }
function takes() { global $mvgIP; require_once $mvgIP . '/includes/MV_Index.php'; require_once $mvgIP . '/includes/MV_MetavidInterface/MV_Overlay.php'; $s = MV_Stream::newStreamByName($this->name); if (!$s->db_load_stream()) { return "An error occured please notify Administrator"; } $dbr =& wfGetDB(DB_SLAVE); $result =& MV_Index::getMVDInRange($s->getStreamId(), 0, $s->getDuration(), $this->mvd_tracks); if ($dbr->numRows($result) == 0) { return "No takes have been generated " . $this->name . ' - ' . $s->getStreamId() . ' - ' . $s->getDuration(); } else { $i = 0; $temp = array(); while ($row = $dbr->fetchObject($result)) { $mvdTitle = new MV_Title($row->wiki_title); $curRevision = Revision::newFromTitle($mvdTitle); $wikitext = $curRevision->getText(); $smw_attr = MV_Overlay::get_and_strip_semantic_tags($wikitext); $temp[$i]['start_time'] = $row->start_time; $temp[$i]['end_time'] = $row->end_time; $temp[$i]['Reported by'] = '' . $smw_attr['Reported By']; $temp[$i]['Read by'] = '' . $smw_attr['Read By']; $temp[$i]['Edited by'] = '' . $smw_attr['Edited By']; $i++; } $html = '<table><tr><th>Time</th><th>Editors</th><th>Readers</th><th>Reporters</th></tr><tr><td><ul id="ul-takes" class="draglist">'; for ($j = 0; $j < $i; $j++) { $html .= '<li class="li-takes">' . $temp[$j]['start_time'] . ' -> ' . $temp[$j]['end_time'] . '</li>'; } $html .= '</ul></td>'; $html .= '<td><ul id="ul1" class="draglist">'; for ($j = 0; $j < $i; $j++) { $html .= '<li class="list1">' . $temp[$j]['Edited by'] . '</li>'; } $html .= '</ul></td>'; $html .= '<td><ul id="ul2" class="draglist">'; for ($j = 0; $j < $i; $j++) { $html .= '<li class="list2">' . $temp[$j]['Read by'] . '</li>'; } $html .= '</ul></td>'; $html .= '<td> <ul id="ul3" class="draglist">'; for ($j = 0; $j < $i; $j++) { $html .= '<li class="list3">' . $temp[$j]['Reported by'] . '</li>'; } $html .= '</ul></td></tr></table>'; return $html; } }
function getMetaData($normalized_prop_name = true) { global $wgUser, $wgParser; $article = new Article($this); $retAry = array(); $text = $article->getContent(); // @@todo should use semanticMediaWiki api here $tmpProp = MV_Overlay::get_and_strip_semantic_tags($text); // strip categories $retAry['striped_text'] = preg_replace('/\\[\\[[^:]+:[^\\]]+\\]\\]/', '', $text); if ($normalized_prop_name) { foreach ($tmpProp as $pkey => $pval) { $retAry['prop'][str_replace(' ', '_', $pkey)] = $pval; } } else { $retAry['prop'] = $tmpProp; } $sk =& $wgUser->getSkin(); // run via parser to add in Category info: $parserOptions = ParserOptions::newFromUser($wgUser); $parserOutput = $wgParser->parse($text, $this, $parserOptions); $retAry['categories'] = $parserOutput->getCategories(); return $retAry; }