humhub / translation

Internal translation tool
https://translate.humhub.org
Apache License 2.0
17 stars 15 forks source link

Add option to allow only access by admin #4

Closed luke- closed 9 years ago

timvango commented 9 years ago

I would love this too! Now everyone can mess with the translations...

Edit: Found a way to do this: Open the file TranslationModule.php in /home/protected/modules/translation.

At the bottom you see this: public static function onTopMenuInit($event) { $event->sender->addItem(array( 'label' => Yii::t('TranslationModule.base', 'Translations'), 'url' => Yii::app()->createUrl('//translation/translate', array('uguid' => Yii::app()->user->guid)), 'icon' => '', 'isActive' => (Yii::app()->controller->module && Yii::app()->controller->module->id == 'translation'), 'sortOrder' => 700, )); }

Remove $event->sender->addItem(array( 'label' => Yii::t('TranslationModule.base', 'Translations'), 'url' => Yii::app()->createUrl('//translation/translate', array('uguid' => Yii::app()->user->guid)), 'icon' => '', 'isActive' => (Yii::app()->controller->module && Yii::app()->controller->module->id == 'translation'), 'sortOrder' => 700, ));

So only public static function onTopMenuInit($event) {

}

stays intact.

Now the menu button is gone!