Beispiel #1
0
function attach_showform()
{
    global $vars, $_attach_messages;
    $page = isset($vars['page']) ? $vars['page'] : '';
    $vars['refer'] = $page;
    $body = attach_form($page);
    return array('msg' => $_attach_messages['msg_upload'], 'body' => $body);
}
function attach_showform()
{
    global $vars, $_attach_messages;
    if (auth::check_role('safemode')) {
        die_message(_('PKWK_SAFE_MODE prohibits this'));
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_editable($page, true, true);
    $vars['refer'] = $page;
    $body = attach_form($page, TRUE);
    return array('msg' => $_attach_messages['msg_upload'], 'body' => $body);
}
Beispiel #3
0
function attach_showform()
{
    global $vars, $_attach_messages, $_string;
    if (Auth::check_role('safemode')) {
        die_message($_string['prohibit']);
    }
    $page = isset($vars['page']) ? $vars['page'] : null;
    if (empty($page)) {
        Utility::dieMessage('Page name is not defined');
    }
    $isEditable = Factory::Wiki($page)->isEditable();
    $vars['refer'] = $page;
    $html = array();
    if (!IS_AJAX) {
        $attach_list = attach_list($page);
        $html[] = '<p><small>[<a href="' . Router::get_cmd_uri('attach', null, null, array('pcmd' => 'list')) . '">' . $_attach_messages['msg_listall'] . '</a>]</small></p>';
        if ($isEditable) {
            $html[] = '<h2>' . str_replace('$1', $page, $_attach_messages['msg_upload']) . '</h2>' . "\n";
            $html[] = attach_form($page);
        }
        $html[] = '<h2>' . str_replace('$1', $page, $_attach_messages['msg_listpage']) . '</h2>' . "\n";
        $html[] = $attach_list['body'];
    } else {
        $html[] = '<div class="tabs" role="application">';
        $html[] = '<ul role="tablist">';
        if ($isEditable) {
            $html[] = '<li role="tab"><a href="' . Router::get_cmd_uri('attach', null, null, array('pcmd' => 'form', 'refer' => $page)) . '">' . str_replace('$1', $_attach_messages['msg_thispage'], $_attach_messages['msg_upload']) . '</a></li>';
        }
        $html[] = '<li role="tab"><a href="' . Router::get_cmd_uri('attach', null, null, array('pcmd' => 'list', 'refer' => $page)) . '">' . str_replace('$1', $_attach_messages['msg_thispage'], $_attach_messages['msg_listpage']) . '</a></li>';
        $html[] = '</ul>';
        $html[] = '</div>';
    }
    return array('msg' => $_attach_messages['msg_upload'], 'body' => join("\n", $html));
}
Beispiel #4
0
function attach_showform()
{
    global $vars;
    $qm = get_qm();
    $page = isset($vars['page']) ? $vars['page'] : '';
    $vars['refer'] = $page;
    $body = attach_form($page);
    return array('msg' => $qm->m['plg_attach']['upload'], 'body' => $body);
}