コード例 #1
0
function plugin_newpage_subdir_action()
{
    global $vars;
    if (Auth::check_role('readonly') || Auth::is_check_role(PKWK_CREATE_PAGE)) {
        return sprintf($_string['error_prohibit'], 'Readonly');
    }
    $roots = $retval = array();
    $page = empty($vars['page']) ? '' : $vars['page'];
    $dir = empty($vars['directory']) ? '' : strip_bracket($vars['directory']);
    if (empty($page)) {
        if (!empty($dir)) {
            $roots[] = substr($dir, -1) == '/' ? substr($dir, 0, -1) : $dir;
        }
        return array('msg' => sprintf(T_('Create new page to %s directory'), $dir), 'body' => print_form_string(build_directory_list($roots)));
    }
    Utility::redirect(Factory::Wiki($dir . $page)->uri('edit'));
}
コード例 #2
0
function plugin_newpage_subdir_action()
{
    global $script, $vars, $_msg_newpage;
    if (!$vars["page"]) {
        if ($vars["directory"]) {
            $directory = strip_bracket($vars["directory"]);
            $roots[] = substr($directory, 0, strlen($directory) - 1);
            $msg_prefix = $directory . "..に";
        }
        $action_messages["msg"] = $msg_prefix . $_msg_newpage;
        $action_messages["body"] = print_form_string(build_directory_list($roots));
        return $action_messages;
    }
    header("Location: {$script}?" . rawurlencode($vars['directory'] . $vars["page"]));
    die;
}
コード例 #3
0
function plugin_newpage_subdir_action()
{
    global $vars;
    if (auth::check_role('readonly')) {
        return '';
    }
    if (auth::is_check_role(PKWK_CREATE_PAGE)) {
        return '';
    }
    $roots = $retval = array();
    $page = empty($vars['page']) ? '' : $vars['page'];
    $dir = empty($vars['directory']) ? '' : strip_bracket($vars['directory']);
    if (empty($page)) {
        if (!empty($dir)) {
            $roots[] = substr($dir, -1) == '/' ? substr($dir, 0, -1) : $dir;
            // $msg_prefix = $directory."..に";
            $msg_prefix = _("To {$dir}.");
        }
        $retval['msg'] = htmlspecialchars($msg_prefix) . _('New page');
        $retval['body'] = print_form_string(build_directory_list($roots));
        return $retval;
    }
    header('Location: ' . get_page_location_uri($dir . $page));
    die;
}