How It Works
This mod makes two very simple changes. The first change is to check through all the module files for the line:
Code: Select all
$this->data['vqmod_mls'] = false;
Code: Select all
$this->data['vqmod_mls'] = true;
Code: Select all
$module['layout_id'] == $layout_id
Code: Select all
((isset($module['layout_id']) && $module['layout_id'] == $layout_id) || (isset($module['layouts']) && in_array($layout_id, $module['layouts'])))
Developer's Guide To Use This Modification
To enable multiple layout selection in your module, follow the steps below:
1. Download the attached file package and add the VQMod file to your extension download package.
2. In your extension admin controller file (admin/controller/module/yourextension):
Find:
Code: Select all
$this->template
Code: Select all
$this->data['vqmod_mls'] = false;
$this->data['text_select_all'] = $this->language->get('text_select_all');
$this->data['text_unselect_all'] = $this->language->get('text_unselect_all');
Find:
Code: Select all
<select name="yourextension_module[<?php echo $module_row; ?>][layout_id]">
Code: Select all
<?php if ($vqmod_mls) { ?>
<div class="scrollbox">
<?php $class = 'even'; ?>
<?php foreach ($layouts as $layout) { ?>
<?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
<div class="<?php echo $class; ?>">
<?php if (!empty($data['layouts']) && in_array($layout['layout_id'], $data['layouts'])) { ?>
<input type="checkbox" name="yourextension_module[<?php echo $module_row; ?>][layouts][]" value="<?php echo $layout['layout_id']; ?>" checked="checked" />
<?php echo $layout['name']; ?>
<?php } else { ?>
<input type="checkbox" name="yourextension_module[<?php echo $module_row; ?>][layouts][]" value="<?php echo $layout['layout_id']; ?>" />
<?php echo $layout['name']; ?>
<?php } ?>
</div>
<?php } ?>
</div>
<a onclick="$(this).parent().find(':checkbox').attr('checked', true);"><?php echo $text_select_all; ?></a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);"><?php echo $text_unselect_all; ?></a>
<?php } ?>
Code: Select all
<select name="yourextension_module[<?php echo $module_row; ?>][layout_id]">
Code: Select all
<select name="yourextension_module[<?php echo $module_row; ?>][layout_id]"<?php if ($vqmod_mls) { ?> style="display: none;"<?php } ?>>
Code: Select all
html += '<select name="yourextension_module[' + module_row + '][layout_id]">';
Code: Select all
<?php if ($vqmod_mls) { ?>
html += '<div class="scrollbox">';
<?php $class = 'even'; ?>
<?php foreach ($layouts as $layout) { ?>
<?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
html += '<div class="<?php echo $class; ?>"><input type="checkbox" name="yourextension_module[' + module_row + '][layouts][]" value="<?php echo $layout['layout_id']; ?>" checked="checked" /><?php echo $layout['name']; ?></div>';
<?php } ?>
html += '</div>';
html += '<a onclick="$(this).parent().find(\':checkbox\').attr(\'checked\', true);"><?php echo $text_select_all; ?></a> / <a onclick="$(this).parent().find(\':checkbox\').attr(\'checked\', false);"><?php echo $text_unselect_all; ?></a>';
<?php } ?>
Code: Select all
html += '<select name="yourextension_module[' + module_row + '][layout_id]">';
Code: Select all
html += '<select name="yourextension_module[' + module_row + '][layout_id]"<?php if ($vqmod_mls) { ?> style="display: none;"<?php } ?>>';
Note: The example above is generic and will need to be revised to suit your module.
Examples Of The Multiple Layout Selection Feature
<Images coming soon>
Support Request
If you're having difficulty implementing the required changes into your system, please feel free to reply to this topic and I'll do my best to walk you through the system and help you integrate this mod.
Cheers,
Joel.