예제 #1
0
    // текстовое поле
    ?>
<div class="b-form b-form_padleft_90">
    <div id="wysiwyg-error" class="<?php 
    echo !empty($alert['msgtext']) ? 'b-combo__input_error' : '';
    ?>
">
        <textarea id="msg_source" name="msgtext_source" style="display:none;height:200px;"><?php 
    echo htmlspecialchars($msgtext, ENT_COMPAT, 'cp1251');
    ?>
</textarea>
        <textarea class="<?php 
    echo commune::IS_NEW_WYSIWYG ? "ckeditor" : "wysiwyg";
    ?>
" conf="insertcode" style="height:200px; width:100%;" onfocus="if($(this) && $('msgtext_error')) $('msgtext_error').style.display = 'none';" id="msg" name="msgtext" rows="5" cols="10"><?php 
    echo commune::IS_NEW_WYSIWYG ? htmlspecialchars(html2wysiwyg($msgtext), ENT_COMPAT, 'cp1251') : htmlspecialchars($msgtext, ENT_COMPAT, 'cp1251');
    ?>
</textarea>
    </div>
</div>
<?php 
    // загрузка файлов
    ?>
<div class="b-form b-form_padleft_90 b-file">
    <div class="b-fon">
        <div id="attachedfiles" class="b-fon__body_pad_10 b-icon-layout i-button">
            <table id="attachedfiles_table" class="b-icon-layout__table" cellpadding="0" cellspacing="0" border="0">
                <tr id="attachedfiles_template" style="display:none" class="b-icon-layout__tr">
                    <td class="b-icon-layout__icon"><i class="b-icon"></i></td>
                    <td class="b-icon-layout__files"><a href="javascript:void(0)" class="b-icon-layout__link">&nbsp;</a>&nbsp;</td>
                    <td class="b-icon-layout__operate b-icon-layout__operate_padleft_10"><a href="javascript:void(0)" class="b-button b-button_m_delete"></a></td>
예제 #2
0
function GetComment($sname, $item)
{
    session_start();
    $objResponse = new xajaxResponse();
    $uid = get_uid(false);
    if (!$uid) {
        return $objResponse;
    }
    switch (strtolower($sname)) {
        case 'commune':
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsCommune.php';
            $comments = new CommentsCommune($item, date('Y-m-d H:i:s'));
            break;
        case 'articles':
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsArticles.php';
            $comments = new CommentsArticles($item, date('Y-m-d H:i:s'));
            break;
        case 'adminlog':
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/comments/CommentsAdminLog.php';
            $comments = new CommentsAdminLog($item, date('Y-m-d H:i:s'));
            break;
        default:
            return $objResponse;
    }
    $result = $comments->getData($item);
    $attach = $result['attach'];
    unset($result['attach']);
    $msg = $result;
    if ($comments->enableWysiwyg) {
        $msg['msgtext'] = str_replace('  ', '&nbsp;&nbsp;', $msg['msgtext']);
    } else {
        $msg['msgtext'] = str_replace(array('&#039;'), array('\''), $msg['msgtext']);
        $msg['msgtext'] = htmlspecialchars_decode($msg['msgtext']);
    }
    //    $msg['msgtext'] = preg_replace_callback("/<([^\s>]+)[^>](.*?)*>/si",
    //            create_function('$matches', 'return str_replace("&nbsp;", " ", $matches[0]);'),
    //        $msg['msgtext']);
    if ($comments->enableNewWysiwyg) {
        $msg['msgtext'] = html2wysiwyg($msg['msgtext']);
    }
    $objResponse->call('commentEditCallback', $msg, $attach);
    return $objResponse;
}