1
brianhay
Usability - hiding unavailable functions and empty blocks
  • 2003/8/1 0:00

  • brianhay

  • Just popping in

  • Posts: 7

  • Since: 2003/7/19


From a usability point of view it erks me that restricted menu functions in XOOPS are displayed to users who don't have access rights to them. For example, the "submit news" function is displayed even if you're an unregistered guest. It makes people think they CAN submit news when in fact they can't, without first registering and logging in.

Likewise, displaying blocks that are empty. For example, news articles that have NO comments still display the comments block with sorting fields and table headers. This is redundant and just doesn't make sense to me.

Is there any way to deactivate restricted and unused items?

If not, I think this feature would be important for webmasters who want to use XOOPS for corporate websites/intranets (rather than just community portal sites), that is, they want to display a clean, uncluttered corporate interface to casual visitors (potential customers) yet expose selected staff to the necessary admin functions.

Regards,
Brian Hay.

2
Lance95
Re: Usability - hiding unavailable functions and empty blocks
  • 2003/8/1 2:02

  • Lance95

  • Just popping in

  • Posts: 14

  • Since: 2003/5/9 2


Well, yes there are.
There is such feature called groups in the admin panel.
Just untick whatever you dont want unregistered users to NOT see.

You can even separate your users into different group experiencing different blocks access .

As for the submit news sublink , you have to edit the templates to get what you want .(remove the link for unregistered) .

Since today is a good day as any , here is how to do it .

Go to your admin panel , system--> templates .. Clone your default templates giving it a name ( because you cannot edit default templates ).

After that go to system --> blocks

See the main menu on the list ? click on the edit on the right side.

After this ,, there is a edit template on the right block .Click on that

An editor came out .

find these

Quote:
<{foreach item=sublink from=$module.sublinks}>
|-- <{$sublink.name}>
<{/foreach}>


and changed to

Quote:
<{if ($xoops_isuser==1)}>
<{foreach item=sublink from=$module.sublinks}>
|-- <{$sublink.name}>
<{/foreach}>
<{/if}>


then goto ... system-->preferences-->general settings-->


find "Default template set" , and change the default to the new template name that you have cloned.And you're done.


3
brianhay
Re: Usability - hiding unavailable functions and empty blocks
  • 2003/8/1 2:35

  • brianhay

  • Just popping in

  • Posts: 7

  • Since: 2003/7/19


Quote:

Lance95 wrote:
Well, yes there are.
There is such feature called groups in the admin panel.
Just untick whatever you dont want unregistered users to NOT see.


You're a legend!! Thank you very much.

I should have known that the XOOPS developers would have thought of this.

Regards,
Brian Hay.

4
JackJ
Re: Usability - hiding unavailable functions and empty blocks
  • 2004/4/27 18:29

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


Also, another way to go is by editing xoops_version.php in the News module root, Look for the "Menu" code and change it like this:

// Menu
$modversion['hasMain'] = 1;
global $xoopsUser;
if(!empty($xoopsUser)) {
$group = $xoopsUser->getGroups();

if (in_array(2, $group)) { //or other group-IDs
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";
}
}
$modversion['sub'][2]['name'] = _MI_NEWS_SMNAME2;
$modversion['sub'][2]['url'] = "archive.php";


Each $group has an ID, in this example only registered users and webmasters will see the submit.

Group: 1 is webmasters (webmasters will see all anyway)
Groups 2 registered users
Group 3 anon
Group 4 your created group

you can add more than one groups to the array i.e

if (in_array(2,4, $group)) { //or other group-IDs

5
Mithrandir
Re: Usability - hiding unavailable functions and empty blocks

For News module, next version (currently early beta) will NOT show the "submit news" link for users without submit permissions.

Login

Who's Online

392 user(s) are online (259 user(s) are browsing Support Forums)


Members: 0


Guests: 392


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits