示例#1
0
文件: trans.php 项目: stof/pearweb
<?php

auth_require('pear.dev');
require_once 'notes/ManualNotes.class.php';
$manualNotes = new Manual_Notes();
$action = '';
if (isset($_REQUEST['action'])) {
    $action = strtolower($_REQUEST['action']);
}
switch ($action) {
    case 'makedocbug':
        if (isset($_GET['noteId'])) {
            $noteId = (int) $_GET['noteId'];
            $note = $manualNotes->getSingleCommentById($noteId);
            $registered = 1;
            $package = getPackageNameForId($note['page_url']);
            $package_name = is_null($package) ? 'Documentation' : $package;
            $bug_type = 'Documentation Problem';
            $email = $auth_user->email;
            $handle = $auth_user->handle;
            $sdesc = 'User note that is a documentation problem';
            $ldesc = 'Manual page: ' . $note['page_url'] . "\n" . 'Note submitter:' . "\n";
            if (!empty($note['user_handle'])) {
                $ldesc .= user_link($note['user_handle'], true);
            } else {
                include_once 'bugs/pear-bugs-utils.php';
                $ldesc .= PEAR_Bugs_Utils::spamProtect($note['user_name'], 'text');
            }
            $ldesc .= "\n\n" . str_replace('<br />', '', $dbh->escapeSimple(html_entity_decode($note['note_text'])));
            $package_version = null;
            $php_version = 'Irrelevant';
示例#2
0
文件: index.php 项目: stof/pearweb
<?php

auth_require('pear.dev');
// Manual notes class
require_once 'notes/ManualNotes.class.php';
$manualNotes = new Manual_Notes();
$status = 'pending';
$action = 'approveMass';
$title = 'Approve Pending User Notes';
$button = 'Approve';
$caption = 'Approve Notes';
$name = 'approve';
if (isset($_GET['status']) && $_GET['status'] == 'approved') {
    $status = 'yes';
    $action = 'updateApproved';
    $title = 'Move Approved Notes to Pending';
    $button = 'Make Pending';
    $caption = 'Pending';
    $name = 'pending';
}
/**
elseif (isset($_GET['status']) && $_GET['status'] == 'deleted') {
    $status  = 'no';
    $action  = 'approveMass';
    $title   = 'Deleted notes';
    $button  = 'Un-Delete comments';
    $caption = 'Deleted';
    $name    = 'undelete';
}
*/
if (isset($_GET['url']) && !empty($_GET['url'])) {
示例#3
0
<?php

auth_require('pear.dev');
$status = isset($_GET['status']) && $_GET['status'] == 'yes' ? 'approved' : false;
$ajax = isset($_GET['ajax']) && $_GET['ajax'] == 'yes' ? true : false;
$id = isset($_GET['noteId']) ? (int) $_GET['noteId'] : '';
if (!$id) {
    response_footer();
    exit;
}
require_once 'notes/ManualNotes.class.php';
$manualNotes = new Manual_Notes();
$noteContent = $manualNotes->getSingleCommentById($id);
include PEARWEB_TEMPLATEDIR . '/notes/view-full-note.tpl.php';
示例#4
0
/**
 * Generates and returns the notes comments HTML.
 *
 * @param string $uri Manual page id
 *
 * @return string HTML
 */
function getComments($uri)
{
    $output = '';
    require_once 'notes/ManualNotes.class.php';
    $manualNotes = new Manual_Notes();
    $comments = $manualNotes->getPageComments($uri, auth_check('pear.dev'));
    if (empty($comments)) {
        $output .= 'There are no user contributed notes for this page.';
    }
    foreach ($comments as $comment) {
        $manualNotes->display($comment);
    }
    return $output;
}
示例#5
0
文件: add-note.php 项目: stof/pearweb
     * @todo Check akismet here aswell ?
     */
}
/**
 * Check if the keys are set, if not
 * then set an error..
 */
foreach ($keys as $key => $message) {
    if (!isset($post[$key]) || empty($post[$key])) {
        $errors[] = 'Error occured, missing: ' . $message;
    }
}
$redirect = $post['redirect'];
if (empty($errors)) {
    require_once 'notes/ManualNotes.class.php';
    $manualNote = new Manual_Notes();
    $added = $manualNote->addComment($post['noteUrl'], $post['user'], $post['note']);
    if (PEAR::isError($added)) {
        if (isset($post['noteUrl'])) {
            /**
             * If someone tries to access this page
             * without a noteUrl then it's his problem
             * to get the comment template without
             * a noteUrl.. this is recursivly not
             * going to be working however this check
             * should not have to be done because
             * in order to get to this point.. you need
             * to have.
             */
            $noteUrl = strip_tags($post['noteUrl']);
        }