Commit 9d2c0a113cd7505c8555c1a9a3e23974ebcd58d4
1 parent
20920011
KTS-3459
"Make length of document and folder display names configurable." Fixed. Added a new config setting to set the length. Committed by: Megan Watson Reviewed by: Conrad Vermeulen git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@9234 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
15 additions
and
5 deletions
plugins/ktcore/KTColumns.inc.php
| ... | ... | @@ -81,9 +81,12 @@ class AdvancedTitleColumn extends AdvancedColumn { |
| 81 | 81 | function renderFolderLink($aDataRow) { |
| 82 | 82 | /* this check has to be done so that any titles longer than 40 characters is not displayed incorrectly. |
| 83 | 83 | as mozilla cannot wrap text without white spaces */ |
| 84 | - if (mb_strlen($aDataRow["folder"]->getName(), 'UTF-8') > 40) { | |
| 84 | + global $default; | |
| 85 | + $charLength = (isset($default->titleCharLength)) ? $default->titleCharLength : 40; | |
| 86 | + | |
| 87 | + if (mb_strlen($aDataRow["folder"]->getName(), 'UTF-8') > $charLength) { | |
| 85 | 88 | mb_internal_encoding("UTF-8"); |
| 86 | - $outStr = htmlentities(mb_substr($aDataRow["folder"]->getName(), 0, 40, 'UTF-8')."...", ENT_NOQUOTES, 'UTF-8'); | |
| 89 | + $outStr = htmlentities(mb_substr($aDataRow["folder"]->getName(), 0, $charLength, 'UTF-8')."...", ENT_NOQUOTES, 'UTF-8'); | |
| 87 | 90 | }else{ |
| 88 | 91 | $outStr = htmlentities($aDataRow["folder"]->getName(), ENT_NOQUOTES, 'UTF-8'); |
| 89 | 92 | } |
| ... | ... | @@ -97,9 +100,12 @@ class AdvancedTitleColumn extends AdvancedColumn { |
| 97 | 100 | function renderDocumentLink($aDataRow) { |
| 98 | 101 | /* this check has to be done so that any titles longer than 40 characters is not displayed incorrectly. |
| 99 | 102 | as mozilla cannot wrap text without white spaces */ |
| 100 | - if (mb_strlen($aDataRow["document"]->getName(), 'UTF-8') > 40) { | |
| 103 | + global $default; | |
| 104 | + $charLength = (isset($default->titleCharLength)) ? $default->titleCharLength : 40; | |
| 105 | + | |
| 106 | + if (mb_strlen($aDataRow["document"]->getName(), 'UTF-8') > $charLength) { | |
| 101 | 107 | mb_internal_encoding("UTF-8"); |
| 102 | - $outStr = htmlentities(mb_substr($aDataRow["document"]->getName(), 0, 40, 'UTF-8')."...", ENT_NOQUOTES, 'UTF-8'); | |
| 108 | + $outStr = htmlentities(mb_substr($aDataRow["document"]->getName(), 0, $charLength, 'UTF-8')."...", ENT_NOQUOTES, 'UTF-8'); | |
| 103 | 109 | }else{ |
| 104 | 110 | $outStr = htmlentities($aDataRow["document"]->getName(), ENT_NOQUOTES, 'UTF-8'); |
| 105 | 111 | } | ... | ... |
sql/mysql/install/data.sql
| ... | ... | @@ -269,7 +269,8 @@ INSERT INTO `config_settings` VALUES |
| 269 | 269 | (95, 'KnowledgeTree', 'Redirect To Browse View', 'Defines whether to redirect to the Browse view (Browse Documemts) on login, instead of the Dashboard.<br>Default is \'False\'. ', 'redirectToBrowse', 'default', 'false', 'boolean', NULL, 1), |
| 270 | 270 | (96, 'KnowledgeTree', 'Redirect To Browse View: Exceptions', 'Specifies that, when \'Redirect To Browse\' is set to \'True\' all users, except for the users listed in the text field below are redirected to the Browse view on log in. The users listed for this setting are directed to the KnowledgeTree Dashboard. To define exceptions, add user names in the text field as follows, e.g. admin, joebloggs, etc.', 'redirectToBrowseExceptions', '', '', '', NULL, 1), |
| 271 | 271 | (97, 'session', 'Allow Automatic Sign In', 'Defines whether to automatically create a user account on first login for any user who does not yet exist in the system. Default is \'False\'.', 'allowAutoSignup', 'default', 'false', 'boolean', '', 1), |
| 272 | -(98, 'ldapAuthentication', 'Create Groups Automatically', 'Defines whether to allow LDAP groups to be created automatically. Default is \'False\'.', 'autoGroupCreation', 'default', 'false', 'boolean', '', 1); | |
| 272 | +(98, 'ldapAuthentication', 'Create Groups Automatically', 'Defines whether to allow LDAP groups to be created automatically. Default is \'False\'.', 'autoGroupCreation', 'default', 'false', 'boolean', '', 1), | |
| 273 | +(99, 'browse', 'Truncate Document and Folder Titles in Browse View', 'Defines the length of the document or folder title displayed in the browse view.', 'titleCharLength', 'default', '40', 'numeric_string', '', 1); | |
| 273 | 274 | /*!40000 ALTER TABLE `config_settings` ENABLE KEYS */; |
| 274 | 275 | UNLOCK TABLES; |
| 275 | 276 | ... | ... |
sql/mysql/upgrade/3.5.3/length_config_setting.sql
0 → 100644
| 1 | +INSERT INTO `config_settings` (group_name, display_name, description, item, value, default_value, type, options, can_edit) VALUES | |
| 2 | +('browse', 'Truncate Document and Folder Titles in Browse View', 'Defines the length of the document or folder title displayed in the | |
| 3 | +browse view.', 'titleCharLength', 'default', '40', 'numeric_string', '', 1); | |
| 0 | 4 | \ No newline at end of file | ... | ... |