T
T
TheHorse2012-11-07 16:07:53
CodeIgniter
TheHorse, 2012-11-07 16:07:53

Replacing string constants from the administration panel. Underwater rocks?

Context :
There is a site, php under CodeIgniter. The site includes a configuration file with hundreds of string constants and many .html files with thousands of string constants.
Task :
Implement functionality in the admin panel to change the internals of string constants.
Solutions:
1. Transfer all string constants to a database/file, cache.
+ easy to build the desired functionality in the admin panel; admin speed; the possibility of simple external editing. It will be relatively easy to make the site multilingual.
- the template engine will work slowly (many substitutions have a bad effect on it); it is difficult to transfer everything to the database (invent keys, monitor collisions).
2. Implement something like search/replace. The administrator enters the text that he saw on the site and wants to replace. The function searches for all occurrences, returns a list of files with the corresponding text and a delta neighborhood. And accordingly proposes to change.
+ easy to implement; does not require structural changes; more convenient for point changes.
-???
Questions:
1. What could be the disadvantages for the second solution?
2. Other options?
Add. question:
Is it possible to select and paste text from the browser, taking into account layout / markup. If the user copies a bа<b>б</b> , you need exactly " " and not " " in the clipboard аб.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
egorinsk, 2012-11-07
@TheHorse

> Is it possible to select and paste text from the browser, taking into account layout / markup. If the user copies ab, it is necessary that exactly “a b ” and not “ab” appear on the clipboard .
There are everywhere except the Opera. In Opera (I suspect) you can make a crutch in the form of turning a piece of the page into contentEditable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question