Index: blocks/admin_tree/block_admin_tree.php =================================================================== RCS file: /cvsroot/moodle/moodle/blocks/admin_tree/block_admin_tree.php,v retrieving revision 1.35 diff -u -r1.35 block_admin_tree.php --- blocks/admin_tree/block_admin_tree.php 27 Jun 2008 13:12:21 -0000 1.35 +++ blocks/admin_tree/block_admin_tree.php 7 Jul 2008 23:33:55 -0000 @@ -49,10 +49,10 @@ $this->tempcontent .= "\n"; } - function create_item($visiblename,$link,$icon,$class) { + function create_item($shortvisiblename,$link,$icon,$class) { global $CFG; $this->tempcontent .= '
'. - $visiblename.'
'."\n"; + $shortvisiblename.''."\n"; } function build_tree (&$content) { @@ -64,7 +64,7 @@ if ($content->is_hidden()) { $class .= ' hidden'; } - $this->create_item($content->visiblename, $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section='.$content->name,$CFG->pixpath.'/i/item.gif', $class); + $this->create_item($content->shortvisiblename, $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section='.$content->name,$CFG->pixpath.'/i/item.gif', $class); } } else if (is_a($content, 'admin_externalpage')) { // show hidden pages in tree if hidden page active @@ -73,7 +73,7 @@ if ($content->is_hidden()) { $class .= ' hidden'; } - $this->create_item($content->visiblename, $content->url, $CFG->pixpath.'/i/item.gif', $class); + $this->create_item($content->shortvisiblename, $content->url, $CFG->pixpath.'/i/item.gif', $class); } } else if (is_a($content, 'admin_category')) { if ($content->check_access() and !$content->is_hidden()) { @@ -85,7 +85,7 @@ array_pop($this->pathtosection); } - $this->open_folder($content->visiblename); + $this->open_folder($content->shortvisiblename); $entries = array_keys($content->children); @@ -99,7 +99,6 @@ } function get_content() { - global $CFG; if ($this->content !== NULL) { @@ -114,7 +113,6 @@ require_once($CFG->libdir.'/adminlib.php'); $adminroot =& admin_get_root(false, false); // settings not required - only pages - if ($current = $adminroot->locate($this->section, true)) { $this->pathtosection = $current->path; array_pop($this->pathtosection); Index: lang/en_utf8/admin.php =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/admin.php,v retrieving revision 1.196 diff -u -r1.196 admin.php --- lang/en_utf8/admin.php 9 Jun 2008 08:44:02 -0000 1.196 +++ lang/en_utf8/admin.php 7 Jul 2008 23:33:55 -0000 @@ -357,14 +357,14 @@ $string['forceloginforprofiles'] = 'Force users to login for profiles'; $string['forcetimezone'] = 'Force default timezone'; $string['framename'] = 'Frame name'; -$string['frontpage'] = 'Front Page'; -$string['frontpagebackup'] = 'Front Page backup'; +$string['frontpage'] = 'Front page'; +$string['frontpagebackup'] = 'Front page backup'; $string['frontpagedefaultrole'] = 'Default frontpage role'; $string['frontpageloggedin'] = 'Front page items when logged in'; -$string['frontpagequestions'] = 'Front Page questions'; -$string['frontpagerestore'] = 'Front Page restore'; -$string['frontpageroles'] = 'Front Page roles'; -$string['frontpagesettings'] = 'Front Page settings'; +$string['frontpagequestions'] = 'Front page questions'; +$string['frontpagerestore'] = 'Front page restore'; +$string['frontpageroles'] = 'Front page roles'; +$string['frontpagesettings'] = 'Front page settings'; $string['fullnamedisplay'] = 'Full Name Format'; $string['gdversion'] = 'GD version'; $string['generalsettings'] = 'General settings'; Index: lib/adminlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/adminlib.php,v retrieving revision 1.223 diff -u -r1.223 adminlib.php --- lib/adminlib.php 22 Jun 2008 23:35:52 -0000 1.223 +++ lib/adminlib.php 7 Jul 2008 23:33:55 -0000 @@ -1166,6 +1166,11 @@ var $visiblename; /** + * @var string The short version of the visible name (used for the menu) + */ + var $shortvisiblename; + + /** * @var bool Should this category be hidden in admin tree block? */ var $hidden; @@ -1182,11 +1187,13 @@ * @param string $name The internal name for this category. Must be unique amongst ALL part_of_admin_tree objects * @param string $visiblename The displayed named for this category. Usually obtained through get_string() * @param bool $hidden hide category in admin tree block + * @param string $shortvisiblename The short displayed named for this category */ - function admin_category($name, $visiblename, $hidden=false) { + function admin_category($name, $visiblename, $hidden=false, $shortvisiblename="") { $this->children = array(); $this->name = $name; $this->visiblename = $visiblename; + $this->shortvisiblename = empty($shortvisiblename) ? $visiblename : $shortvisiblename; $this->hidden = $hidden; } @@ -1363,6 +1370,11 @@ var $visiblename; /** + * @var string The short version of the visible name (used for the menu) + */ + var $shortvisiblename; + + /** * @var string The external URL that we should link to when someone requests this external page. */ var $url; @@ -1395,10 +1407,13 @@ * @param string $visiblename The displayed name for this external page. Usually obtained through get_string(). * @param string $url The external URL that we should link to when someone requests this external page. * @param mixed $req_capability The role capability/permission a user must have to access this external page. Defaults to 'moodle/site:config'. + * @param string $shortvisiblename The short displayed named for this category. */ - function admin_externalpage($name, $visiblename, $url, $req_capability='moodle/site:config', $hidden=false, $context=NULL) { + function admin_externalpage($name, $visiblename, $url, $req_capability='moodle/site:config', $hidden=false, $context=NULL, + $shortvisiblename="") { $this->name = $name; $this->visiblename = $visiblename; + $this->shortvisiblename = empty($shortvisiblename) ? $visiblename : $shortvisiblename; $this->url = $url; if (is_array($req_capability)) { $this->req_capability = $req_capability; @@ -1501,6 +1516,12 @@ * @var string The displayed name for this external page. Usually obtained through get_string(). */ var $visiblename; + + /** + * @var string The short version of the visible name (used for the menu) + */ + var $shortvisiblename; + /** * @var mixed An array of admin_setting objects that are part of this setting page. */ @@ -1528,10 +1549,11 @@ var $visiblepath; // see admin_externalpage - function admin_settingpage($name, $visiblename, $req_capability='moodle/site:config', $hidden=false, $context=NULL) { + function admin_settingpage($name, $visiblename, $req_capability='moodle/site:config', $hidden=false, $context=NULL, $shortvisiblename="") { $this->settings = new object(); $this->name = $name; $this->visiblename = $visiblename; + $this->shortvisiblename = empty($shortvisiblename) ? $visiblename : $shortvisiblename; if (is_array($req_capability)) { $this->req_capability = $req_capability; } else { @@ -1837,7 +1859,7 @@ function output_html($data, $query='') { $return = ''; if ($this->visiblename != '') { - $return .= print_heading(''.highlightfast($query, $this->visiblename).'', '', 3, 'main', true); + $return .= print_heading(''.highlightfast($query, $this->visiblename . "felicidad").'', '', 3, 'main', true); } if ($this->description != '') { $return .= print_box(highlight($query, $this->description), 'generalbox formsettingheading', '', true); Index: lib/moodlelib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/moodlelib.php,v retrieving revision 1.1063 diff -u -r1.1063 moodlelib.php --- lib/moodlelib.php 23 Jun 2008 21:23:28 -0000 1.1063 +++ lib/moodlelib.php 7 Jul 2008 23:33:56 -0000 @@ -5051,6 +5051,20 @@ * @return string The localized string. */ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) { + $descsuffix = "_desc"; + if (substr_compare($identifier, $descsuffix, -strlen($descsuffix)) == 0) { + $ret = get_normal_string($identifier, $module, $a, $extralocations); + if ($ret <> "[[$identifier]]") { + // We assume the string can't be of this form, so the identifier has + // been found + return $ret; + } + } + // If the abbreviated version does not exist, we just return the usual result. + return get_normal_string($identifier, $module, $a, $extralocations); +} + +function get_normal_string($identifier, $module='', $a=NULL, $extralocations=NULL) { global $CFG; /// originally these special strings were stored in moodle.php now we are only in langconfig.php