Changeset 742d257 in iPeer


Ignore:
Timestamp:
2012-12-24T22:16:45-08:00 (5 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, hotfix, master, pagodabox, ticket463
Children:
d2317ba
Parents:
b6d44ab
git-author:
Compass <pan.luo@…> (12/24/2012 06:14:44 PM)
git-committer:
Compass <pan.luo@…> (12/24/2012 10:16:45 PM)
Message:

Add local vocabulary class for translation

Some time the displayed word may not fit the application. Added a local
vocabulary that allow user to set the word to what they want. e.g. at
UBC, the administration is not deep down to department level. So
changing department text to faculty and creating one to one
faculty-department is easier for administration.

Location:
app
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • app/app_controller.php

    rb6d44ab r742d257  
    2727        'userPersonalize', 'framework', 'Guard.Guard', 'Acl',
    2828        'AccessControl', 'TemplateEmail');
    29     public $helpers    = array('Session', 'Html', 'Js');
     29    public $helpers    = array('Session', 'Html', 'Js', 'Vocabulary');
    3030    public $access     = array ();
    3131    public $actionList = array ();
  • app/config/sql/delta_5.sql

    rb6d44ab r742d257  
    382382INSERT INTO `sys_parameters` VALUES (NULL, 'system.version', '3.0.0', 'S', 'System version', 'A', 1, NOW(), 1, NOW()),
    383383(NULL, 'display.login.header', '', 'S', 'Login Info Header', 'A', 0, NOW(), 0, NOW()),
    384 (NULL, 'display.login.footer', '', 'S', 'Login Info Footer', 'A', 0, NOW(), 0, NOW());
     384(NULL, 'display.login.footer', '', 'S', 'Login Info Footer', 'A', 0, NOW(), 0, NOW()),
     385(NULL, 'display.vocabulary.department', 'Department', 'S', 'Department vocabulary', 'A', 0, NOW(), 0, NOW());
    385386
    386387ALTER TABLE  `user_courses` CHANGE  `created`  `created` DATETIME NULL DEFAULT NULL, CHANGE  `modified`  `modified` DATETIME NULL DEFAULT NULL ;
  • app/config/sql/ipeer.sql

    rb6d44ab r742d257  
    14881488(25, 'display.contact_info', 'noreply@ipeer.ctlt.ubc.ca', 'S', 'Contact Info', 'A', 0, NOW(), 0, NOW()),
    14891489(26, 'display.login.header', '', 'S', 'Login Info Header', 'A', 0, NOW(), 0, NOW()),
    1490 (27, 'display.login.footer', '', 'S', 'Login Info Footer', 'A', 0, NOW(), 0, NOW());
     1490(27, 'display.login.footer', '', 'S', 'Login Info Footer', 'A', 0, NOW(), 0, NOW()),
     1491(28, 'display.vocabulary.department', 'Department', 'S', 'Department vocabulary', 'A', 0, NOW(), 0, NOW());
    14911492
    14921493-- --------------------------------------------------------
  • app/config/sql/ipeer_samples_data.sql

    rb6d44ab r742d257  
    19741974(25, 'display.contact_info', 'noreply@ipeer.ctlt.ubc.ca', 'S', 'Contact Info', 'A', 0, NOW(), 0, NOW()),
    19751975(26, 'display.login.header', '', 'S', 'Login Info Header', 'A', 0, NOW(), 0, NOW()),
    1976 (27, 'display.login.footer', '', 'S', 'Login Info Footer', 'A', 0, NOW(), 0, NOW());
     1976(27, 'display.login.footer', '', 'S', 'Login Info Footer', 'A', 0, NOW(), 0, NOW()),
     1977(28, 'display.vocabulary.department', 'Department', 'S', 'Department vocabulary', 'A', 0, NOW(), 0, NOW());
    19771978
    19781979-- --------------------------------------------------------
  • app/views/courses/add.ctp

    rb6d44ab r742d257  
    88    'record_status',
    99    array(
    10         'type' => 'select', 
     10        'type' => 'select',
    1111        'id' => 'status',
    1212        'label' => 'Status',
     
    1414    )
    1515);
    16 echo $this->Form->input('Department');
     16echo $this->Form->input('Department', array('label' => __($this->Vocabulary->translate('Department'), true)));
    1717echo $this->Form->input('homepage', array('after' => 'eg. http://mycoursehome.com'));
    1818echo $this->Form->submit('Save');
    1919echo $this->Form->end();
    20 
    21 ?>
  • app/views/courses/edit.ctp

    rb6d44ab r742d257  
    77echo $this->Form->input('Instructor');
    88echo $this->Form->input(
    9     'record_status', 
     9    'record_status',
    1010    array(
    11         'type' => 'select', 
    12         'label' => 'Status', 
     11        'type' => 'select',
     12        'label' => 'Status',
    1313        'id' => 'status',
    1414        'options' => $statusOptions,
    1515    )
    1616);
    17 echo $this->Form->input('Department');
    18 echo $this->Form->input('homepage', 
     17echo $this->Form->input('Department', array('label' => __($this->Vocabulary->translate('Department'), true)));
     18echo $this->Form->input('homepage',
    1919    array('after' => 'eg. http://mycoursehome.com'));
    2020echo $this->Form->submit('Save');
  • app/views/faculties/view.ctp

    rb6d44ab r742d257  
    11<h2><?php echo $faculty; ?></h2>
    22
    3 <h3><?php __('Departments');?></h3>
     3<h3><?php __($this->Vocabulary->translate('Department'));?></h3>
    44
    55<table id="departments">
     
    2525        echo "<td>";
    2626        echo $this->Html->link(
    27             $val, 
     27            $val,
    2828            array('action' => 'view', 'controller' => 'departments', $id)
    2929        );
     
    5959        echo "<td>";
    6060        echo $this->Html->link(
    61             $val, 
     61            $val,
    6262            array('action' => 'view', 'controller' => 'users', $id)
    6363        );
     
    7272jQuery(document).ready(function() {
    7373    jQuery('#departments').dataTable({
    74         "aoColumnDefs": [{ 
    75             "bSearchable": false, 
    76                 "bVisible": false, 
    77                 "bSortable":false, 
    78                 "aTargets": [ 0 ] 
     74        "aoColumnDefs": [{
     75            "bSearchable": false,
     76                "bVisible": false,
     77                "bSortable":false,
     78                "aTargets": [ 0 ]
    7979        }],
    8080        "aaSorting" : [[1, 'asc']]
    8181    });
    8282    jQuery('#userfaculty').dataTable({
    83         "aoColumnDefs": [{ 
    84             "bSearchable": false, 
    85                 "bVisible": false, 
    86                 "bSortable":false, 
    87                 "aTargets": [ 0 ] 
     83        "aoColumnDefs": [{
     84            "bSearchable": false,
     85                "bVisible": false,
     86                "bSortable":false,
     87                "aTargets": [ 0 ]
    8888        }],
    8989        "aaSorting" : [[1, 'asc']]
  • app/views/pages/admin.ctp

    rb6d44ab r742d257  
    1919    echo '<li>';
    2020    echo $this->Html->link(
    21         'Departments',
     21        __(Inflector::pluralize($this->Vocabulary->translate('Department')), true),
    2222        array('controller' => 'departments')
    2323    );
Note: See TracChangeset for help on using the changeset viewer.