×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: prohibit the users select a particular category

prohibit the users select a particular category 11 years 9 months ago #19298

  • Viktor Prade
  • Viktor Prade's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
HI
is there any possibility in the "submit a location / NewHotspot- Site",
that users can select only certain categories when creating new hotspots
something to hide one or more categories for users ?
thanks a lot
GREAT TOOL
BR
Viktor

prohibit the users select a particular category 11 years 9 months ago #19310

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Victor,
unfortunately this is not currently possible. If you really need this you'll need to hack:
administrator/components/com_hotspots/models/fields/hotspotscategory.php

You'll need to remove the categories that you don't need from the $options array.
Regards,
Daniel

prohibit the users select a particular category 11 years 9 months ago #19311

  • Viktor Prade
  • Viktor Prade's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
ok, thanks,
unfortunately I do not have sufficient knowledge about php :(

prohibit the users select a particular category 11 years 9 months ago #19338

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Viktor,
So, I found some time to experiment with that. Here is the code after line 65
$options = $db->loadObjectList();

add the following code:
		$application = JFactory::getApplication();
		if(!$application->isAdmin()) {
			foreach ($options as $key => $value) {
				if($value->value == 1) {
					unset($options[$key]);
				}
			}
		}

where "1" is the category id. So if you have several categories to exclude you'll need to add more lines like
				if($value->value == 2) {
					unset($options[$key]);
				}

you get the idea.

Regards,
Daniel

prohibit the users select a particular category 11 years 9 months ago #19528

  • Viktor Prade
  • Viktor Prade's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Ok,
Thanks a lot for your help!!
  • Page:
  • 1
Time to create page: 0.105 seconds