Exemplo n.º 1
0
// Get the infos about the plugin from the plugin.info file
$info = parse_ini_file(dirname(__FILE__) . '/../plugin.info');
$plugin_full_name = $info['fullname'];
$plugin_name = $info['modulename'];
$plugin_id = $info['id'];
$plugin_ver = $info['version'];
// Check permissions
if (!module_webnpro_menu_editor::can_i('edit', 'webNpro Menu Editor Settings', 'Config') && module_security::get_loggedin_id() != '1') {
    redirect_browser(_BASE_HREF);
}
if (isset($_POST['cancel_edit'])) {
    header('Location: ' . $_SERVER['REQUEST_URI']);
} elseif (isset($_POST['reset_menu_items'])) {
    module_webnpro_menu_editor::reset_menu();
} elseif (isset($_POST['save_menu_items'])) {
    module_webnpro_menu_editor::save_menu($_POST);
}
// Header buttons
$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>';