first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+82
View File
@@ -0,0 +1,82 @@
// Wikipedia JavaScript support functions
// if this is true, the toolbar will no longer overwrite the infobox when you move the mouse over individual items
var noOverwrite=false;
var alertText;
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var is_gecko = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1)
&& (clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1));
var is_safari = ((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1));
var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ));
if (clientPC.indexOf('opera')!=-1) {
var is_opera = true;
var is_opera_preseven = (window.opera && !document.childNodes);
var is_opera_seven = (window.opera && document.childNodes);
}
// apply tagOpen/tagClose to selection in textarea,
// use sampleText instead of selection if there is none
// copied and adapted from phpBB
function insertTags(tagOpen, tagClose, sampleText) {
tagOpen = unescape(tagOpen);
tagClose = unescape(tagClose);
var txtarea = document.forms['mform1'].newcontent;
// IE
if(document.selection && !is_gecko) {
var theSelection = document.selection.createRange().text;
if(!theSelection) { theSelection=sampleText;}
txtarea.focus();
if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any
theSelection = theSelection.substring(0, theSelection.length - 1);
document.selection.createRange().text = tagOpen + theSelection + tagClose + " ";
} else {
document.selection.createRange().text = tagOpen + theSelection + tagClose;
}
// Mozilla
} else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
var startPos = txtarea.selectionStart;
var endPos = txtarea.selectionEnd;
var scrollTop=txtarea.scrollTop;
var myText = (txtarea.value).substring(startPos, endPos);
if(!myText) { myText=sampleText;}
if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any
subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " ";
} else {
subst = tagOpen + myText + tagClose;
}
txtarea.value = txtarea.value.substring(0, startPos) + subst +
txtarea.value.substring(endPos, txtarea.value.length);
txtarea.focus();
var cPos=startPos+(tagOpen.length+myText.length+tagClose.length);
txtarea.selectionStart=cPos;
txtarea.selectionEnd=cPos;
txtarea.scrollTop=scrollTop;
// All others
} else {
var copy_alertText=alertText;
var re1=new RegExp("\\$1","g");
var re2=new RegExp("\\$2","g");
copy_alertText=copy_alertText.replace(re1,sampleText);
copy_alertText=copy_alertText.replace(re2,tagOpen+sampleText+tagClose);
var text;
if (sampleText) {
text=prompt(copy_alertText);
} else {
text="";
}
if(!text) { text=sampleText;}
text=tagOpen+text+tagClose;
document.infoform.infobox.value=text;
// in Safari this causes scrolling
if(!is_safari) {
txtarea.focus();
}
noOverwrite=true;
}
// reposition cursor if possible
if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate();
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

+106
View File
@@ -0,0 +1,106 @@
<?php
/**
* This file defines a simple editor
*
* @author Jordi Piguillem
* @author Kenneth Riba
*
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package mod_wiki
*
*/
/**
* Printing wiki editor.
* Depending on where it is called , action will go to different destinations.
* If it is called from comments section, the return will be in comments section
* in any other case it will be in edit view section.
* @param $pageid. Current pageid
* @param $content. Content to be edited.
* @param $section. Current section, default null
* @param $comesfrom. Information about where the function call is made
* @param commentid. id comment of comment that will be edited.
*/
function wiki_print_editor_wiki($pageid, $content, $editor, $version = -1, $section = null, $upload = false, $deleteuploads = array(), $comesfrom = 'editorview', $commentid = 0) {
global $CFG, $OUTPUT, $PAGE;
if ($comesfrom == 'editcomments') {
$action = $CFG->wwwroot . '/mod/wiki/instancecomments.php?pageid=' . $pageid . '&id=' . $commentid . '&action=edit';
} else if ($comesfrom == 'addcomments') {
$action = $CFG->wwwroot . '/mod/wiki/instancecomments.php?pageid=' . $pageid . '&id=' . $commentid . '&action=add';
} else {
$action = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $pageid;
}
if (!empty($section)) {
$action .= "&amp;section=" . urlencode($section);
}
///Get tags for every element we are displaying
$tag = getTokens($editor, 'bold');
$wiki_editor['bold'] = array('ed_bold.gif', get_string('wikiboldtext', 'wiki'), $tag[0], $tag[1], get_string('wikiboldtext', 'wiki'));
$tag = getTokens($editor, 'italic');
$wiki_editor['italic'] = array('ed_italic.gif', get_string('wikiitalictext', 'wiki'), $tag[0], $tag[1], get_string('wikiitalictext', 'wiki'));
$tag = getTokens($editor, 'link');
$wiki_editor['internal'] = array('ed_internal.gif', get_string('wikiinternalurl', 'wiki'), $tag[0], $tag[1], get_string('wikiinternalurl', 'wiki'));
$tag = getTokens($editor, 'url');
$wiki_editor['external'] = array('ed_external.gif', get_string('wikiexternalurl', 'wiki'), $tag[0], $tag[1], get_string('wikiexternalurl', 'wiki'));
$tag = getTokens($editor, 'list');
$wiki_editor['u_list'] = array('ed_ul.gif', get_string('wikiunorderedlist', 'wiki'), '\\n' . $tag[0], '', '');
$wiki_editor['o_list'] = array('ed_ol.gif', get_string('wikiorderedlist', 'wiki'), '\\n' . $tag[1], '', '');
$tag = getTokens($editor, 'image');
$wiki_editor['image'] = array('ed_img.gif', get_string('wikiimage', 'wiki'), $tag[0], $tag[1], get_string('wikiimage', 'wiki'));
$tag = getTokens($editor, 'header');
$wiki_editor['h1'] = array('ed_h1.gif', get_string('wikiheader', 'wiki', 1), '\\n' . $tag . ' ', ' ' . $tag . '\\n', get_string('wikiheader', 'wiki', 1));
$wiki_editor['h2'] = array('ed_h2.gif', get_string('wikiheader', 'wiki', 2), '\\n' . $tag . $tag . ' ', ' ' . $tag . $tag . '\\n', get_string('wikiheader', 'wiki', 2));
$wiki_editor['h3'] = array('ed_h3.gif', get_string('wikiheader', 'wiki', 3), '\\n' . $tag . $tag . $tag . ' ', ' ' . $tag . $tag . $tag . '\\n', get_string('wikiheader', 'wiki', 3));
$tag = getTokens($editor, 'line_break');
$wiki_editor['hr'] = array('ed_hr.gif', get_string('wikihr', 'wiki'), '\\n' . $tag . '\\n', '', '');
$tag = getTokens($editor, 'nowiki');
$wiki_editor['nowiki'] = array('ed_nowiki.gif', get_string('wikinowikitext', 'wiki'), $tag[0], $tag[1], get_string('wikinowikitext', 'wiki'));
$OUTPUT->heading(strtoupper(get_string('format' . $editor, 'wiki')), 3);
$PAGE->requires->js('/mod/wiki/editors/wiki/buttons.js');
echo $OUTPUT->container_start();
foreach ($wiki_editor as $button) {
echo "<a href=\"javascript:insertTags";
echo "('" . $button[2] . "','" . $button[3] . "','" . $button[4] . "');\">";
echo "<img width=\"23\" height=\"22\" src=\"$CFG->wwwroot/mod/wiki/editors/wiki/images/$button[0]\" alt=\"" . $button[1] . "\" title=\"" . $button[1] . "\" />";
echo "</a>";
}
echo $OUTPUT->container_end();
echo $OUTPUT->container_start();
echo '<form method="post" id="mform1" action="' . $action . '">';
$textarea = $OUTPUT->print_textarea('newcontent', 'edit-newcontent', $content, 20, 60);
echo $OUTPUT->container($textarea, false, 'wiki_editor');
echo $OUTPUT->container_start();
wiki_print_edit_form_default_fields($editor, $pageid, $version, $upload, $deleteuploads);
echo $OUTPUT->container_end();
echo '</form>';
echo $OUTPUT->container_end();
}
/**
* Returns escaped token used by a wiki language to represent a given tag or "object" (bold -> **)
*
* @param string $format format of page
* @param array|string $token format tokens which needs to be escaped
* @return array|string
*/
function getTokens($format, $token) {
$tokens = wiki_parser_get_token($format, $token);
if (is_array($tokens)) {
foreach ($tokens as $key => $value) {
$tokens[$key] = urlencode(str_replace("'", "\'", $value));
}
} else {
urlencode(str_replace("'", "\'", $token));
}
return $tokens;
}
+198
View File
@@ -0,0 +1,198 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains all necessary code to define a wiki editor
*
* @package mod_wiki
* @copyright 2009 Marc Alier, Jordi Piguillem marc.alier@upc.edu
* @copyright 2009 Universitat Politecnica de Catalunya http://www.upc.edu
*
* @author Josep Arus
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot.'/lib/formslib.php');
require_once($CFG->dirroot.'/lib/form/textarea.php');
require_once($CFG->dirroot.'/lib/form/templatable_form_element.php');
class MoodleQuickForm_wikieditor extends MoodleQuickForm_textarea {
use templatable_form_element {
export_for_template as export_for_template_base;
}
private $files;
/** @var string */
protected $wikiformat;
/**
* Constructor
*
* @param string $elementName (optional) name of the text field
* @param string $elementLabel (optional) text field label
* @param string $attributes (optional) Either a typical HTML attribute string or an associative array
*/
function __construct($elementName = null, $elementLabel = null, $attributes = null) {
if (isset($attributes['wiki_format'])) {
$this->wikiformat = $attributes['wiki_format'];
unset($attributes['wiki_format']);
}
if (isset($attributes['files'])) {
$this->files = $attributes['files'];
unset($attributes['files']);
}
parent::__construct($elementName, $elementLabel, $attributes);
$this->_type = 'wikieditor';
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function MoodleQuickForm_wikieditor($elementName = null, $elementLabel = null, $attributes = null) {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct($elementName, $elementLabel, $attributes);
}
function setWikiFormat($wikiformat) {
$this->wikiformat = $wikiformat;
}
function toHtml() {
$textarea = parent::toHtml();
return $this->{
$this->wikiformat."Editor"}
($textarea);
}
function creoleEditor($textarea) {
return $this->printWikiEditor($textarea);
}
function nwikiEditor($textarea) {
return $this->printWikiEditor($textarea);
}
private function printWikiEditor($textarea) {
global $OUTPUT;
$textarea = $OUTPUT->container_start().$textarea.$OUTPUT->container_end();
$buttons = $this->getButtons();
return $buttons.$textarea;
}
private function getButtons() {
global $PAGE, $OUTPUT, $CFG;
$editor = $this->wikiformat;
$tag = $this->getTokens($editor, 'bold');
$wiki_editor['bold'] = array('ed_bold.gif', get_string('wikiboldtext', 'wiki'), $tag[0], $tag[1], get_string('wikiboldtext', 'wiki'));
$tag = $this->getTokens($editor, 'italic');
$wiki_editor['italic'] = array('ed_italic.gif', get_string('wikiitalictext', 'wiki'), $tag[0], $tag[1], get_string('wikiitalictext', 'wiki'));
$imagetag = $this->getTokens($editor, 'image');
$wiki_editor['image'] = array('ed_img.gif', get_string('wikiimage', 'wiki'), $imagetag[0], $imagetag[1], get_string('wikiimage', 'wiki'));
$tag = $this->getTokens($editor, 'link');
$wiki_editor['internal'] = array('ed_internal.gif', get_string('wikiinternalurl', 'wiki'), $tag[0], $tag[1], get_string('wikiinternalurl', 'wiki'));
$tag = $this->getTokens($editor, 'url');
$wiki_editor['external'] = array('ed_external.gif', get_string('wikiexternalurl', 'wiki'), $tag, "", get_string('wikiexternalurl', 'wiki'));
$tag = $this->getTokens($editor, 'list');
$wiki_editor['u_list'] = array('ed_ul.gif', get_string('wikiunorderedlist', 'wiki'), '\\n'.$tag[0], '', '');
$wiki_editor['o_list'] = array('ed_ol.gif', get_string('wikiorderedlist', 'wiki'), '\\n'.$tag[1], '', '');
$tag = $this->getTokens($editor, 'header');
$wiki_editor['h1'] = array('ed_h1.gif', get_string('wikiheader', 'wiki', 1), '\\n'.$tag.' ', ' '.$tag.'\\n', get_string('wikiheader', 'wiki', 1));
$wiki_editor['h2'] = array('ed_h2.gif', get_string('wikiheader', 'wiki', 2), '\\n'.$tag.$tag.' ', ' '.$tag.$tag.'\\n', get_string('wikiheader', 'wiki', 2));
$wiki_editor['h3'] = array('ed_h3.gif', get_string('wikiheader', 'wiki', 3), '\\n'.$tag.$tag.$tag.' ', ' '.$tag.$tag.$tag.'\\n', get_string('wikiheader', 'wiki', 3));
$tag = $this->getTokens($editor, 'line_break');
$wiki_editor['hr'] = array('ed_hr.gif', get_string('wikihr', 'wiki'), '\\n'.$tag.'\\n', '', '');
$tag = $this->getTokens($editor, 'nowiki');
$wiki_editor['nowiki'] = array('ed_nowiki.gif', get_string('wikinowikitext', 'wiki'), $tag[0], $tag[1], get_string('wikinowikitext', 'wiki'));
$PAGE->requires->js('/mod/wiki/editors/wiki/buttons.js');
$html = '<div class="wikieditor-toolbar">';
foreach ($wiki_editor as $button) {
$html .= "<a href=\"javascript:insertTags";
$html .= "('".$button[2]."','".$button[3]."','".$button[4]."');\">";
$html .= html_writer::empty_tag('img', array('alt' => $button[1], 'src' => $CFG->wwwroot . '/mod/wiki/editors/wiki/images/' . $button[0]));
$html .= "</a>";
}
$html .= "<label class='accesshide' for='addtags'>" . get_string('insertimage', 'wiki') . "</label>";
$html .= "<select id='addtags' class='custom-select mx-1' " .
"onchange=\"insertTags('{$imagetag[0]}', '{$imagetag[1]}', this.value)\">";
$html .= "<option value='" . s(get_string('wikiimage', 'wiki')) . "'>" . get_string('insertimage', 'wiki') . '</option>';
foreach ($this->files as $filename) {
$html .= "<option value='".s($filename)."'>";
$html .= $filename;
$html .= '</option>';
}
$html .= '</select>';
$html .= $OUTPUT->help_icon('insertimage', 'wiki');
$html .= '</div>';
return $html;
}
private function getTokens($format, $token) {
$tokens = wiki_parser_get_token($format, $token);
if (is_array($tokens)) {
foreach ($tokens as & $t) {
$this->escapeToken($t);
}
} else {
$this->escapeToken($tokens);
}
return $tokens;
}
private function escapeToken(&$token) {
$token = urlencode(str_replace("'", "\'", $token));
}
public function export_for_template(renderer_base $output) {
$context = $this->export_for_template_base($output);
// We do want the form-control class on the output from toHTML - but we dont' want it when calling export_for_template.
// This is because in this type of form element the export_for_template calls toHTML to get the html for the context.
// If we did both we would be duplicating the form-control which messes up the styles.
$saved = $this->getAttribute('class');
$this->updateAttributes(['class' => $saved . ' form-control']);
$context['html'] = $this->toHtml();
$this->updateAttributes(['class' => $saved]);
return $context;
}
}
//register wikieditor
MoodleQuickForm::registerElementType('wikieditor', $CFG->dirroot."/mod/wiki/editors/wikieditor.php", 'MoodleQuickForm_wikieditor');
+150
View File
@@ -0,0 +1,150 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle 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. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains all necessary code to define a wiki file table form element
*
* @package mod_wiki
* @copyright 2009 Marc Alier, Jordi Piguillem marc.alier@upc.edu
* @copyright 2009 Universitat Politecnica de Catalunya http://www.upc.edu
*
* @author Josep Arus
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once('HTML/QuickForm/element.php');
require_once($CFG->dirroot.'/lib/filelib.php');
class MoodleQuickForm_wikifiletable extends HTML_QuickForm_element {
private $_contextid;
private $_filearea;
private $_fileareaitemid;
private $_fileinfo;
private $_value = array();
/** @var string */
protected $_format;
public function __construct($elementName = null, $elementLabel = null, $attributes = null, $fileinfo = null, $format = null) {
parent::__construct($elementName, $elementLabel, $attributes);
$this->_fileinfo = $fileinfo;
$this->_format = $format;
}
/**
* Old syntax of class constructor. Deprecated in PHP7.
*
* @deprecated since Moodle 3.1
*/
public function MoodleQuickForm_wikifiletable($elementName = null, $elementLabel = null, $attributes = null, $fileinfo = null, $format = null) {
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
self::__construct($elementName, $elementLabel, $attributes, $fileinfo, $format);
}
function onQuickFormEvent($event, $arg, &$caller) {
global $OUTPUT;
switch ($event) {
case 'addElement':
$this->_contextid = $arg[3]['contextid'];
$this->_filearea = $arg[3]['filearea'];
$this->_fileareaitemid = $arg[3]['itemid'];
$this->_format = $arg[4];
break;
}
return parent::onQuickFormEvent($event, $arg, $caller);
}
function setName($name) {
$this->updateAttributes(array('name' => $name));
}
function getName() {
return $this->getAttribute('name');
}
function setValue($value) {
$this->_value = $value;
}
function getValue() {
return $this->_value;
}
function toHtml() {
global $CFG, $OUTPUT;
$htmltable = new html_table();
$htmltable->head = array(get_string('deleteupload', 'wiki'), get_string('uploadname', 'wiki'), get_string('uploadactions', 'wiki'));
$fs = get_file_storage();
$files = $fs->get_area_files($this->_fileinfo['contextid'], 'mod_wiki', 'attachments', $this->_fileinfo['itemid']); //TODO: verify where this is coming from, all params must be validated (skodak)
if (count($files) < 2) {
return get_string('noattachments', 'wiki');
}
//get tags
foreach (array('image', 'attach', 'link') as $tag) {
$tags[$tag] = wiki_parser_get_token($this->_format, $tag);
}
foreach ($files as $file) {
if (!$file->is_directory()) {
$checkbox = '<input type="checkbox" name="'.$this->_attributes['name'].'[]" value="'.$file->get_pathnamehash().'"';
if (in_array($file->get_pathnamehash(), $this->_value)) {
$checkbox .= ' checked="checked"';
}
$checkbox .= " />";
//actions
$icon = file_file_icon($file);
$file_url = file_encode_url($CFG->wwwroot.'/pluginfile.php', "/{$this->_contextid}/mod_wiki/attachments/{$this->_fileareaitemid}/".$file->get_filename());
$action_icons = "";
if(!empty($tags['attach'])) {
$action_icons .= "<a href=\"javascript:void(0)\" class=\"wiki-attachment-attach\" ".$this->printInsertTags($tags['attach'], $file->get_filename())." title=\"".get_string('attachmentattach', 'wiki')."\">".$OUTPUT->pix_icon($icon, "Attach")."</a>"; //TODO: localize
}
$action_icons .= "&nbsp;&nbsp;<a href=\"javascript:void(0)\" class=\"wiki-attachment-link\" ".$this->printInsertTags($tags['link'], $file_url)." title=\"".get_string('attachmentlink', 'wiki')."\">".$OUTPUT->pix_icon($icon, "Link")."</a>";
if (file_mimetype_in_typegroup($file->get_mimetype(), 'web_image')) {
$action_icons .= "&nbsp;&nbsp;<a href=\"javascript:void(0)\" class=\"wiki-attachment-image\" ".$this->printInsertTags($tags['image'], $file->get_filename())." title=\"".get_string('attachmentimage', 'wiki')."\">".$OUTPUT->pix_icon($icon, "Image")."</a>"; //TODO: localize
}
$htmltable->data[] = array($checkbox, '<a href="'.$file_url.'">'.$file->get_filename().'</a>', $action_icons);
}
}
return html_writer::table($htmltable);
}
private function printInsertTags($tags, $value) {
return "onclick=\"javascript:insertTags('{$tags[0]}', '{$tags[1]}', '$value');\"";
}
}
//register wikieditor
MoodleQuickForm::registerElementType('wikifiletable', $CFG->dirroot."/mod/wiki/editors/wikifiletable.php", 'MoodleQuickForm_wikifiletable');