clean html

clean html

by Daniele Cordella -
Number of replies: 4
Picture of Core developers Picture of Plugin developers
I updated the theme I manage for my institution elearning.
I removed some classes from my css and now I would like to find a way to:
-> remove from wherever they appear the attribute class="myDeletedClass" (mainly labels)
-> change <p class="oneMoreDeletedClass"> to <h2>
in all the courses I manage.
Any idea about the way to do this?
TIA
Average of ratings: -
In reply to Daniele Cordella

Re: clean html

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Daniele,
you need a multi-file search and replace program
  1. DreamWeaver would do what you want using the "Find" function on all the files in the Moodle directory
  2. I use InfoRapid Search and Replace, because it is free and works well for me
  3. WinGrep does what you want for $30
  4. The is also a OpenSource version of "grep" ported to Windows as part of the GnuWin32 project
cheers
Gordon
In reply to Gordon Bateson

Re: clean html

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
Thank you Gordon.
I do believe my texts (labels) are into mySQL !!!!!!!!
If I make a backup and then I change files into the backup... the backup is no longer valid. I already tried.
Do I have to operate into tables directly with phpMyAdmin?
In reply to Daniele Cordella

Re: clean html

by Mauno Korpelainen -

How about (after login)

moodle/admin/replace.php

One possible way is to open backup file (sql) with notepad - find - replace all -save and restore...

...class="myDeletedClass" is easy to replace with empty but changing <p class="oneMoreDeletedClass"> to <h2> is not so simple because you need to change end tags too (not all </p> to </h2> however).