Best practice forum (Archived)

تمت إزالة منتدى المناقشة هذا

 
لقد تمت إزالة مشاركة المنتدى هذه
Saturday, 23 July 2011, 4:41 AM
تمت إزالة محتوى هذه المشاركة في المنتدى ولم يعد من الممكن الوصول إليها
Craig Eves
Re: Adding custom item to Header navigation Menu
بواسطة Tuesday, 26 July 2011, 2:50 PM - Craig Eves (Totara Support)
مجموعة Totara

Hi Salem

The file for creating menus is located at local/totara_menu.php

This file can be edited to create and link menu items

For example to create a help link for item 7 of the menu you could use this code.

line 53:

 //added in help link
    'help' => array()

lines 80:

//added in help link
    'help' => '/course/view.php?id=19'

lines 261:

 <!--added in help link-->
     <li class="last<?php echo $selected['help']; ?> menu7">
        <div>
        <a href="<?php echo $CFG->wwwroot.'/course/view.php?id=19' ?>"><?php echo get_string('Help', 'local') ?></a>
        </div>
    </li

When you add text in Totara, you also need to add it to the language pack, so that it can be translated into multiple languages. In your code you added:

get_string('Help', 'local')

which means you need to add this line into lang/en_utf8/local.php:

$string['Help'] = 'Help';

Try and edit the file totara_menu.php to see the effect of your changes. There are comments in the file to help, if you have any questions one of the developers will be answer to respond.

regards

Craig

لقد تمت إزالة مشاركة المنتدى هذه
Wednesday, 27 July 2011, 12:25 AM
تمت إزالة محتوى هذه المشاركة في المنتدى ولم يعد من الممكن الوصول إليها