예제 #1
0
$header_buttons[] = array('url' => _BASE_HREF . '?m[0]=' . $plugin_name . '&p[0]=documentation', 'title' => _l('Read Documentation'));
// Print the heading with the header buttons
print_heading(array('type' => 'h2', 'main' => true, 'title' => _l($plugin_full_name) . ' v' . $plugin_ver, 'button' => $header_buttons));
$new_menu_row = '<tr class="tbl_row">';
$new_menu_row .= '<td><input type="hidden" name="menu_position[]" placeholder="menu position"></td>';
$new_menu_row .= '<td><span class="fa fa-arrows">&nbsp;</span><span class="fa fa-unlock">&nbsp;</span></td>';
$new_menu_row .= '<td><input  class="form-control" type="text" name="menu_name[]" placeholder="menu name"></td>';
//$new_menu_row .= '<td><input type="text" name="menu_icon[]" placeholder="menu icon"></td>';
$new_menu_row .= '<td><select class="form-control" name="menu_icon[]">' . module_webnpro_menu_editor::get_select_FontAwesomeIcons() . '</select></td>';
$new_menu_row .= '<td><input  class="form-control" type="text" name="menu_url[]" placeholder="menu url"></td>';
$new_menu_row .= '<td><input  class="form-control" type="hidden" name="menu_module[]" placeholder="menu module"></td>';
$new_menu_row .= '<td><input  class="form-control" type="hidden" name="menu_page[]" placeholder="menu page"></td>';
$new_menu_row .= '<td>&nbsp;<a href="#" class="btn btn-success add_field">+</a></td>';
$new_menu_row .= '<td><a href="#" class="btn btn-danger remove_field">-</a></td>';
$new_menu_row .= '</tr>';
$menu_items = module_webnpro_menu_editor::get_menu_items();
echo '<form action="" method="POST">';
echo '<table id="menu_items" class="input_fields_wrap">';
echo '<tbody>';
echo '<tr style="text-align: center; font-weight: bold; border-bottom: 1px #ccc solid; margin-bottom: 5px;"><td></td><td></td><td>Menu text</td><td>Icon</td><td>URL</td><td>Module</td><td>Module Page</td><td></td><td></td></tr>';
if (count($menu_items)) {
    foreach ($menu_items as $menu_item) {
        $readonly = $menu_item['p'] != '' || $menu_item['m'] == 'dashboard' ? 'readonly' : '';
        echo '<tr class="tbl_row">';
        echo '<td><input type="hidden" name="menu_position[]" placeholder="menu position" value="' . $menu_item['order'] . '"></td>';
        echo '<td><span class="fa fa-arrows">&nbsp;</span><span class="fa fa-' . ($readonly != '' ? 'lock' : 'unlock') . '">&nbsp;</span></td>';
        echo '<td><input ' . $readonly . '  class="form-control" type="text" name="menu_name[]" placeholder="menu name" value="' . preg_replace("/ <span.*/", "", $menu_item['name']) . '"></td>';
        //echo '<td><input ' . $readonly . '  class="form-control" type="text" name="menu_icon[]" placeholder="menu icon" value="' . $menu_item['icon_name'] . '"></td>';
        if ($readonly != '') {
            echo '<td><select disabled class="form-control" name="menu_icon[]">' . module_webnpro_menu_editor::get_select_FontAwesomeIcons($menu_item['icon_name']) . '</select>' . '<input type="hidden" name="menu_icon[]" value="' . $menu_item['icon_name'] . '"></td>';
        } else {