Merge pull request #605 from Captain-FLAM/patch-10

[*] BO : Proposition : IMPROVEMENT Admin Modules Positions
This commit is contained in:
Gregory Roussac
2013-07-30 09:48:11 -07:00
2 changed files with 65 additions and 40 deletions
@@ -393,21 +393,35 @@ class AdminModulesPositionsControllerCore extends AdminController
if (!is_array($file_list))
$file_list = ($file_list) ? array($file_list) : array();
$content = '<input type="text" name="exceptions['.$shop_id.']" size="40" value="'.implode(', ', $file_list).'" id="em_text_'.$shop_id.'">';
$content = '<input type="text" name="exceptions['.$shop_id.']" size="40" value="'.implode(', ', $file_list).'" id="em_text_'.$shop_id.'" />';
if ($shop_id)
{
$shop = new Shop($shop_id);
$content .= ' ('.$shop->name.')';
}
$content .= '<br /><select id="em_list_'.$shop_id.'">';
$content .= '
<br />
<select id="em_list_'.$shop_id.'" size="45" multiple style="width:237px">
<option disabled="disabled">'.$this->l('___________ CUSTOM ___________').'</option>';
// @todo do something better with controllers
$controllers = Dispatcher::getControllers(_PS_FRONT_CONTROLLER_DIR_);
ksort($controllers);
foreach ($file_list as $k => $v)
if ( ! array_key_exists ($v, $controllers))
$content .= '
<option value="'.$v.'">'.$v.'</option>';
$content .= '
<option disabled="disabled">'.$this->l('____________ CORE ____________').'</option>';
foreach ($controllers as $k => $v)
$content .= '<option value="'.$k.'">'.$k.'</option>';
$content .= '</select> <input type="button" class="button" value="'.$this->l('Add').'" onclick="position_exception_add('.$shop_id.')" />
<input type="button" class="button" value="'.$this->l('Remove').'" onclick="position_exception_remove('.$shop_id.')" /><br /><br />';
$content .= '
<option value="'.$k.'">'.$k.'</option>';
$content .= '
</select>
';
return $content;
}