Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 11:10:20 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155556 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Prevent adding specific modules twice !!!  (Read 180 times)
Bug

Offline Offline

Posts: 188


« on: November 08, 2011, 11:03:06 PM »

Adding a newsmodule, a form or bakery twice on a page fkz the page up,
I am
Curious if it is possible to discard those modules from the add section dropdown if they are already added.
Logged
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #1 on: November 08, 2011, 11:10:37 PM »

It is the module developer who decides if a module can be added multiple times (or just fails to make that work).

It will take a bit extra programming effort to make a module usable more than once, but for some modules (expecially the ones called) it will be very unlikely someone will ever try to do that.

The WB framework will not make that decision just because it just has no way of knowing what a module does, and if it can or should be used more than once.
Logged

Professional WebsiteBaker Solutions
Bug

Offline Offline

Posts: 188


« Reply #2 on: November 09, 2011, 08:51:30 AM »

in the sections.php
Code:
<select name="module" style="width: 100%;" class="inputveldje">
<?php
// Insert module list
$result $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'page' AND directory != 'menu_link' order by name");
if($result->numRows() > 0) {
while($module $result->fetchRow()) {
// Check if user is allowed to use this module
if(!is_numeric(array_search($module['directory'], $module_permissions))) {
?>

<option value="<?php echo $module['directory']; ?>"<?php if($module['directory'] == 'wysiwyg') { echo 'selected'; } ?>><?php echo $module['name']; ?></option>
<?php
}
}
}
?>

</select>

I hoped there was a way to check wheter a certain module is already added to the list for that specific page and then exclude it from the list...
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!