Remove AddWidget


#1

How can I remove the AddWidget?

I want that only the admin of the statistics can see the AddWidget

I try like this:

{if $userLogin==“admin”}

<div class="ui-confirm" id="confirm">
    <h2>{'Dashboard_DeleteWidgetConfirm'|translate}</h2>
	<input id="yes" type="button" value="{'General_Yes'|translate}" />
	<input id="no" type="button" value="{'General_No'|translate}" />
</div> 

<div id="addWidget">
	<div class="widget_button">{'Dashboard_AddWidget'|translate} <img height="16" width="16" class="arr" src="themes/default/images/sortdesc.png"></div>

	<div class="menu" id="widgetChooser">	
		<div class="subMenu" id="sub1"></div>
		<div class="subMenu" id="sub2"></div>
		<div class="subMenu" id="sub3"></div>
		<div class="menuClear"> </div>
	</div>	
</div>

<div class="clear"></div>

<div id="dashboardWidgetsArea">
	<div class="col" id="1"></div>
	<div class="col" id="2"></div>
	<div class="col" id="3"></div>
	<div class="clear"></div>
</div>
{/if}

(Matthieu Aubry) #2

You can use the variable $isSuperUser in the template .tpl files


#3

{if $isSuperUser == 1}


{‘Dashboard_AddWidget’|translate}
	<div class="menu" id="widgetChooser">	
		<div class="subMenu" id="sub1"></div>
		<div class="subMenu" id="sub2"></div>
		<div class="subMenu" id="sub3"></div>
		<div class="menuClear"> </div>
	</div>	
</div>
[b]{/if}[/b]

Thank you


#4

where can I find the template.tl files??
Under my piwik files,there is no template.tpl file.


#5

Here you can find it
/plugins/Dashboard/templates/index.tpl


#6

Thank you ,I find it.
But after I copy it what you have written, when the anonymous visited,the dashboard is empty. Why it happened.


#7

The rest of the file remains.
What I wrote it is only a part of the file.

You must add only these 2 lines
{if $isSuperUser == 1}

{/if}


#8

welcome

{if $isSuperUser == 1}


{‘Dashboard_AddWidget’|translate}
	<div class="menu" id="widgetChooser">	
		<div class="subMenu" id="sub1"></div>
		<div class="subMenu" id="sub2"></div>
		<div class="subMenu" id="sub3"></div>
		<div class="menuClear"> </div>
	</div>	
</div>
[b]{/if}[/b]