Hi,
As trying to read through the Syntax Highlighting Feature for Moodle 2.0 thread opened by Jeremy W is getting a bit confusing, I'm opening a new thread just to summarize the files used and the steps followed (everything based on what Jeremy indicated) to have the Geshi plugin working in my Moodle 2.5.1 installation.
** For quickstarters
- Go to the moodle/lib/editor/tinymce/ directory and backup the following three files:
- lib.php (tinymce/)
- editor_tinymce.php (tinymce/lang/en/)
- content.css (tinymce/tiny_mce/3.5.8/themes/advanced/skins/default/)
- Download the one-file-install, bk_tinymce_m251-04_rjic_final.7z (sha1: E8E462ADAA5033A6382D0CE3CC3A397435F0F2F7).
- Move the file to moodle/lib/editor/ and unpack it; this will overwrite the lib.php, editor_tinymce.php and content.css files, and it will add the rj_insertcode plugin directory (under tinymce/tiny_mce/3.5.8/plugins/).
- Go to your Moodle installation and purge all caches (Administration > Development > Purge all caches ).
- The Insert/Edit Code button in the HTML editor toolbar will now be available.
I uploaded a course backup (bk-mdl2-c03-geshi101-130930-1608-nu.mbz, sha1: 75604C105C3DD0443758683F9492C223BD93292C) that has only two Page resources to show how the highlighted html and php sample codes look.
** Background
For those who might want to know, here's how everything went.
- Made a backup of directory tinymce (moodle/lib/editor/).
- Downloaded:
- the RJ_InsertCode-1.2.0.zip file (http://www.ryanjuckett.com/downloads/category/8-rj_insertcode/)
- the geshihacks.zip file, by Jeremy W. (https://moodle.org/pluginfile.php/143/mod_forum/attachment/1011562/geshihacks.zip)
- Unpacked rj_insertcode under moodle/lib/editor/tinymce/tiny_mce/3.5.8/plugins/
- Unpacked geshihacks in a temporary folder, and after a bit of searching I only moved four of the five files included, into the corresponding directories:
- lib.php -- tinymce/
- editor_tinymce.php -- tinymce/lang/en/
- content.css -- tinymce/tiny_mce/3.5.8/themes/advanced/skins/default/
- rj_get_highlighted_code.php -- tinymce/tiny_mce/3.5.8/plugins/rj_insertcode/tinymce/php/
- Note. I skipped file rj_common.php because it is exactly the same as the one in the RJ_InsertCode-1.2.0.zip file.
- I moved the latest lib.php file provided by Jeremy (https://moodle.org/pluginfile.php/143/mod_forum/attachment/1034629/lib.php) into the tinymce directory, overriding the one included in the geshihacks.zip (they are actually the same, only the comment line changes).
- I removed the ampersand character at line 58 ("$geshi =& new GeSHi...") of file rj_get_highlighted_code.php.
- Went into my Moodle installation and purged all caches (Administration > Development > Purge all caches ).
- Created a new course.
- Added a page resource, and there it was, the Insert/Edit Code button in the HTML editor toolbar
After confirming that the plugin was working, I then created a package only with the required files (the rj_insertcode and the three extra ones).
The uploaded file, geshi_files-originals.7z (sha1: 413B5F5162989A695830C03D49F7745CDF4B752F) has all the original files I used to create the "one file install" bk_tinymce_m251-04_rjic_final.7z file.
Hope this helps everyone.
All the files were packed with 7zip so they would not exceed the 500 KB file size attachment limit.
** Disclaimer
As I initially said, here I'm just summarizing the recommended steps and gathering the files developed by Jeremy W (see the original thread).