Tiki img directory consolidation.
Goal
- Stage 1: to have a clean, organized structure to find things where they are expected - DONE
- Stage 2: delete unnecessary, unused files - partly DONE, still many unused files left
Timeline
- lets agree first on how it should be, than figure out how to do
- March 2nd - 4th: make it happen for Tiki9 (trunk now)
- Document the changes made: Update docs for Tiki 9 -> Tiki9
Number of references in all the files
Some grepping stats (revision 39998 after clearing Tiki cache):
luci@w7-vbox-ubuntu:/var/www/tikitrunk$ grep -Ro --exclude-dir=\.svn 'img\/' * | wc -l 1029 luci@w7-vbox-ubuntu:/var/www/tikitrunk$ grep -Ro --exclude-dir=\.svn 'images\/' * | wc -l 1448 luci@w7-vbox-ubuntu:/var/www/tikitrunk$ grep -Ro --exclude-dir=\.svn 'pics\/' * | wc -l 4574
Revamped img dir structure proposal
- img/
- img/avatars/
- img/flags/
- img/icons/
- img/icons/large/
- img/icons/mime/
- img/icons/sprite/
- img/icons/svg/ (for future use of http://raphaeljs.com/icons )
- img/smiles/
- img/tiki/
- img/trackers/
- img/webmail/
- img/wiki/
- img/wiki_up/
Issues / Questions / Concerns
- things might get temporarily broken in trunk but on the long run we should get through this
- afraid if the "icon themes" override functionality will be preserved (see for example Strasa theme) — luci
- what happens if there is wiki page created named "images" and rewrite rules are on via .htaccess - it is very possible case. Will the images be still readable or broken ? would not it be better to use the img dir or pics dir instead ? — luci
- OK. Just tried and it reveals, that if one creates page named "Images", he/she cannot access the created page after save using the SEFURL, because Tiki thinks it is the images/ dir and there is the index.php redirect to Tiki index page. — luci
- luci: Only one problem remains with the images dir - now when it is gone i would expect that my test wiki page named "images" will be working but i get error instead redirecting me from http://localhost/tikitrunk/images to http://localhost/tikitrunk/images/ and the error is: "Page not found images/" and the theme is completely broken
- gezza: on my localhost with SefURL on "tikitrunk/images" is being displayed fine
- luci: Only one problem remains with the images dir - now when it is gone i would expect that my test wiki page named "images" will be working but i get error instead redirecting me from http://localhost/tikitrunk/images to http://localhost/tikitrunk/images/ and the error is: "Page not found images/" and the theme is completely broken
- OK. Just tried and it reveals, that if one creates page named "Images", he/she cannot access the created page after save using the SEFURL, because Tiki thinks it is the images/ dir and there is the index.php redirect to Tiki index page. — luci
- just spotted it: what about lib/images/icons/ ? — luci
- known issue - Xavi reported his custom icons use old paths to pics/ and he gets PHP error now - will need php upgrade script created in installer/schema/ to replace the paths in tiki_preferences tool_icon
Things to Check
- Now we have just some things to check remaining:
- rewrite rules in .htaccess
- is there any Tiki 9 specific profile using the old paths on http://profiles.tiki.org?
- is there any Theme on themes.tiki.org using the old paths?
- are there any possible use cases causing trouble after upgrade?
- custom toolbar icons created at /tiki-admin_toolbars.php get broken after update if they point to the legacy pics/icons folder. Related data is stored in tiki_preferences table with pref name tool_icons.
- does fresh install work fine?
Overview
Current path | Current number of pics | Proposal | Done in trunk |
EXISTING DIRECTORIES | |||
/images | 87 | move to /img | Yes |
/img | 26 | leave as it is | Yes |
/img/avatars | 0 | leave as it is | Yes |
/img/flags | 252 | leave as it is | Yes |
/img/graph | 4 | move files to /img and DELETE | Yes |
/img/icn | 34 | DELETE | Yes |
/img/icons | 310 | leave as it is | Yes |
/img/icons2 | 164 | move files to /img/icons and DELETE | Yes |
/img/mytiki | 16 | move files to /img/icons/large/ and DELETE | Yes |
/img/smiles | 24 | leave as it is | Yes |
/img/tiki | 7 | leave as it is | Yes |
/img/trackers | 0 | leave as it is | Yes |
/img/webmail | 14 | leave as it is | Yes |
/img/wiki | 0 | leave as it is | Yes |
/img/wiki_up | 0 | leave as it is | Yes |
/pics | 6 | move to /img/ and DELETE | Yes |
/pics/icons | 212 | move to /img/icons | Yes |
/pics/icons/mime | 39 | move to /img/icons/mime and DELETE | Yes |
/pics/large | 111 | move to /img/icons/large and DELETE | Yes |
/pics/sprite | 2 | move to /img/icons/sprite and DELETE | Yes |
Important files to check
./lib/init/smarty.php:26: 'styles/strasa/pics/icons/', ./lib/init/smarty.php:27: 'styles/coelesce/pics/icons/', ./lib/init/smarty.php:28: 'styles/darkroom/pics/icons/', ./lib/init/smarty.php:29: 'styles/thenews/pics/icons/', ./lib/init/smarty.php:30: 'styles/tikinewt/pics/icons/', ./lib/init/smarty.php:31: 'styles/twist/pics/icons/', ./lib/init/smarty.php:38: 'pics/', ./lib/init/smarty.php:39: 'pics/icons', ./lib/init/smarty.php:40: 'pics/icons/mime', ./lib/init/smarty.php:41: 'pics/large',
./lib/prefs/menus.php:20: 'default' => 'pics/large',
./lib/smarty_tiki/function.icon.php:58: $basedirs = array('pics/icons', 'images', 'img/icons', 'pics/icons/mime'); ./lib/smarty_tiki/function.icon.php:71: if ( isset($params['_defaultdir']) && $params['_defaultdir'] == 'pics/large' ) { ./lib/smarty_tiki/function.icon.php:79: if ( $params['_defaultdir'] == 'pics/large' ) { ./lib/smarty_tiki/modifier.iconify.php 29: $icon = file_exists("pics/icons/mime/$ext.png") ? $ext : 'default'; 33: '_id' => 'pics/icons/mime/'.$icon.'.png',
Change description
File system changes
r39999 - r40040
DB changes
No change