Ejemplo n.º 1
0
        $fid = $_POST['fid'];
    } else {
        $fid = 1;
    }
    if (isset($_POST['name']) && strlen(trim($_POST['name'])) > 0) {
        $name = trim($_POST['name']);
        if (mb_strlen($name) > 32) {
            $error_msg_array[] = sprintf(gettext("Folder name too long. Maximum length is %s characters"), 32);
            $valid = false;
        }
    } else {
        $error_msg_array[] = gettext("You must specify a name!");
        $valid = false;
    }
    if ($valid) {
        links_update_folder($fid, $_SESSION['UID'], $name);
        header_redirect("links.php?webtag={$webtag}&fid={$fid}");
    }
} else {
    if (isset($_GET['fid']) && is_numeric($_GET['fid'])) {
        $fid = $_GET['fid'];
        if (!in_array($fid, array_keys($folders))) {
            html_draw_error(gettext("You must specify a valid folder!"));
        }
    } else {
        html_draw_error(gettext("You must specify a folder!"));
    }
}
html_draw_top(array('title' => gettext("Links - Edit Folder"), 'class' => 'window_title'));
echo "<h1>", links_get_folder_path_links($fid, $folders, false), html_style_image('separator'), gettext("Edit Folder"), "</h1>\n";
echo "<br />\n";
Ejemplo n.º 2
0
        $fid = $_POST['fid'];
    } else {
        $fid = 1;
    }
    if (isset($_POST['name']) && strlen(trim($_POST['name'])) > 0) {
        $name = trim($_POST['name']);
        if (mb_strlen($name) > 32) {
            $error_msg_array[] = sprintf(gettext("Folder name too long. Maximum length is %s characters"), 32);
            $valid = false;
        }
    } else {
        $error_msg_array[] = gettext("You must specify a name!");
        $valid = false;
    }
    if ($valid) {
        links_update_folder($fid, $uid, $name);
        header_redirect("links.php?webtag={$webtag}&fid={$fid}");
    }
} else {
    if (isset($_GET['fid']) && is_numeric($_GET['fid'])) {
        $fid = $_GET['fid'];
        if (!in_array($fid, array_keys($folders))) {
            html_draw_error(gettext("You must specify a valid folder!"));
        }
    } else {
        html_draw_error(gettext("You must specify a folder!"));
    }
}
html_draw_top(sprintf('title=%s', gettext("Links - Edit Folder")), 'class=window_title');
echo "<h1>", links_get_folder_path_links($fid, $folders, false), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Edit Folder"), "</h1>\n";
echo "<br />\n";