1. Copy whole folder "News" into folder "Articles" in site directory tree. After this i must check ode of module and change all links to DB, friendly names, permissions' declarations etc.
2. Work with one module {News} and divide different entities(news and articles) between different categories. And i'll get some problems on that way:
- can not set permission to different categories: so anybody who can change news, will can change articles.
- templates and additional fields will be joined in one large heap. Working with this heap can be really hard.
- if module can not use hierarchical multilevel categories and i need dividing by categories in each section, i shall create categories like "news_in city" or "articles_health". and i shall cut this prefixes in templates.
As far as i understood second way is really worse.
But edit module each time as i work with other site is really stupid work.
So i suggest extend structure of CMSModule class with method get_alias.
And as get_db_prefix() return value of get_alias() will be used in module code.
For example. Old code:
Code: Select all
$sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_news", $flds, $taboptarray);
Code: Select all
$sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_news_".get_alias(), $flds, $taboptarray);
This architectural change make "aliasing" really easy: if we'll change return result of get_alias() we'll take new module automatically.