Browse Source

Implemented font resize feature for accessibility (implements #2237)

ywarnier 14 years ago
parent
commit
16d843f378

+ 2 - 1
documentation/changelog.html

@@ -59,7 +59,8 @@
    <li>Support for Hindi language has been added (Feature #2746)</li>
    <li>Added sessions, promotions and careers cloning features (Feature BT#1916)</li>
    <li>Integration of Pixlr image editing services and photo retouching (Feature #2712)</li>
-   <li>Added experimental MySQLi driver. Requires manual replacement of database.lib.php to enable.</li> 
+   <li>Added experimental MySQLi driver. Requires manual replacement of database.lib.php to enable it</li>
+   <li>Added font resize capabilities for accessibility (Feature #2237)</li>
 </ul>
 <h3>Debugging</h3>
 <ul>

+ 5 - 0
main/inc/banner.inc.php

@@ -178,6 +178,11 @@ if (api_is_allowed_to_edit()) {
 		echo "</li>";		
 	}
 }
+if (api_get_setting('accessibility_font_resize') == 'true') {
+	echo '<li class="resize_font">';
+    echo '<span class="decrease_font" title="'.get_lang('DecreaseFontSize').'">A</span> <span class="reset_font" title="'.get_lang('ResetFontSize').'">A</span> <span class="increase_font" title="'.get_lang('IncreaseFontSize').'">A</span>';
+    echo '</li>';
+}
 ?>
 		</ul>
 	</div>

+ 4 - 1
main/inc/header.inc.php

@@ -159,8 +159,11 @@ if ( ( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.
 </script>
 
 
-
 <?php
+if (api_get_setting('accessibility_font_resize') == 'true') {
+    echo '<script src= "'.api_get_path(WEB_LIBRARY_PATH).'javascript/fontresize.js" type="text/javascript"></script>';
+}
+
 if (isset($htmlHeadXtra) && $htmlHeadXtra) {
     foreach ($htmlHeadXtra as & $this_html_head) {
         echo $this_html_head;

+ 23 - 0
main/inc/lib/javascript/fontresize.js

@@ -0,0 +1,23 @@
+$(document).ready(function(){
+ // Reset Font Size
+ var originalFontSize = $('body').css('font-size');
+ $(".reset_font").click(function(){
+  $('body').css('font-size', originalFontSize);
+ });
+ // Increase Font Size
+ $(".increase_font").click(function(){
+  var currentFontSize = $('body').css('font-size');
+  var currentFontSizeNum = parseFloat(currentFontSize, 10);
+  var newFontSize = currentFontSizeNum*1.2;
+  $('body').css('font-size', newFontSize);
+  return false;
+ });
+ // Decrease Font Size
+ $(".decrease_font").click(function(){
+  var currentFontSize = $('body').css('font-size');
+  var currentFontSizeNum = parseFloat(currentFontSize, 10);
+  var newFontSize = currentFontSizeNum*0.8;
+  $('body').css('font-size', newFontSize);
+  return false;
+ });
+});

+ 5 - 3
main/install/db_main.sql

@@ -818,8 +818,8 @@ VALUES
 ('course_hide_tools','course_setting','checkbox','Tools','false','CourseHideToolsTitle','CourseHideToolsComment',NULL,'CourseSettings',1),
 ('enabled_support_pixlr',NULL,'radio','Tools','false','EnabledPixlrTitle','EnabledPixlrComment',NULL,NULL, 0),
 ('show_groups_to_users',NULL,'radio','Platform','true','ShowGroupsToUsersTitle','ShowGroupsToUsersComment',NULL,NULL, 0),
-('chamilo_database_version',NULL,'textfield',NULL, '1.8.8.13673','DokeosDatabaseVersion','', NULL, NULL, 0);
-
+('accessibility_font_resize',NULL,'radio','Platform','false','EnableAccessibilityFontResizeTitle','EnableAccessibilityFontResizeComment',NULL,NULL, 1),
+('chamilo_database_version',NULL,'textfield',NULL, '1.8.8.13709','DokeosDatabaseVersion','', NULL, NULL, 0);
 
 UNLOCK TABLES;
 /*!40000 ALTER TABLE settings_current ENABLE KEYS */;
@@ -1076,7 +1076,9 @@ VALUES
 ('enabled_support_pixlr','true','Yes'),
 ('enabled_support_pixlr','false','No'),
 ('show_groups_to_users','true','Yes'),
-('show_groups_to_users','false','No');
+('show_groups_to_users','false','No'),
+('accessibility_font_resize', 'true', 'Yes'),
+('accessibility_font_resize', 'false', 'No');
 
 UNLOCK TABLES;
 

+ 6 - 2
main/install/migrate-db-1.8.7-1.8.8-pre.sql

@@ -150,8 +150,6 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value,
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_groups_to_users', 'true', 'Yes');
 INSERT INTO settings_options (variable, value, display_text) VALUES ('show_groups_to_users', 'false', 'No');
 
-UPDATE settings_current SET selected_value = '1.8.8.13673' WHERE variable = 'chamilo_database_version';
-
 INSERT INTO language (original_name, english_name, isocode, dokeos_folder, available) VALUES ('&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;', 'hindi', 'hi', 'hindi', 0);
 
 ALTER TABLE session ADD promotion_id INT NOT NULL;
@@ -164,6 +162,12 @@ CREATE TABLE usergroup_rel_user    ( usergroup_id INT NOT NULL, user_id 	INT NOT
 CREATE TABLE usergroup_rel_course  ( usergroup_id INT NOT NULL, course_id 	INT NOT NULL );
 CREATE TABLE usergroup_rel_session ( usergroup_id INT NOT NULL, session_id  INT NOT NULL );
 
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('accessibility_font_resize',NULL,'radio','Platform','false','EnableAccessibilityFontResizeTitle','EnableAccessibilityFontResizeComment',NULL,NULL, 1);
+INSERT INTO settings_options (variable, value, display_text) VALUES ('accessibility_font_resize', 'true', 'Yes');
+INSERT INTO settings_options (variable, value, display_text) VALUES ('accessibility_font_resize', 'false', 'No');
+
+UPDATE settings_current SET selected_value = '1.8.8.13709' WHERE variable = 'chamilo_database_version';
+
 -- xxSTATSxx
 ALTER TABLE track_e_exercices ADD COLUMN orig_lp_item_view_id INT NOT NULL DEFAULT 0;
 -- xxUSERxx