Trace phrase usage before removal
Right now user can delete a phrase, that is used on a website.
In-Portal internally stores phrase IDs, that are used on each website page (both Admin Console and Front-End), that was visited at least once since phrase was placed on it. This information is used to load all phrases used on a template with single database query.
And we can use that information to determine pages, where phrase is used. Then we can:
- show total number of pages, where phrase is used (in phrase list);
- show exact pages, where phrase is used (on phrase editing).
Since phrase usage is updated only when page is visited, then there is a possibility, that phrase is no longer user on a page, but nobody actually visited that page to update usage information.
Because of it we can't prevent phrase deletion just based on it's usage, but we can ask additional confirmation from user if he plans to delete phrase, that is in use.