Example #1
0
#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('LinkID', 'Text');
/******************************************************************************/
/******************************************************************************/
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Links =& Links();
#-------------------------------------------------------------------------------
$Object =& $Links[$LinkID];
#-------------------------------------------------------------------------------
$Object->AddAttribs(array('onmouseover' => SPrintF("PromptShow(event,'%s',this);", AddcSlashes(Str_Replace("\n", '<BR />', $Text), "\n\r\\\\'"))));
#-------------------------------------------------------------------------------
if (!Comp_IsLoaded('Form/Prompt')) {
    #-----------------------------------------------------------------------------
    $DOM =& $Links['DOM'];
    #-----------------------------------------------------------------------------
    $Script = new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Prompt.js}'));
    #-----------------------------------------------------------------------------
    $DOM->AddChild('Head', $Script);
    #-----------------------------------------------------------------------------
    $Comp = Comp_Load('Css', array('Prompt'));
    if (Is_Error($Comp)) {
        return ERROR | @Trigger_Error(500);
    }
    #-----------------------------------------------------------------------------
    foreach ($Comp as $Css) {
Example #2
0
        #-------------------------------------------------------------------------------
        switch (ValueOf($LastMessage)) {
            case 'error':
                return ERROR | @Trigger_Error(500);
            case 'exception':
                return ERROR | @Trigger_Error(400);
            case 'array':
                # No more...
                break;
            default:
                return ERROR | @Trigger_Error(101);
        }
        #-------------------------------------------------------------------------------
        # это последнее сообщение, и создано оно менее суток назад
        if ($LastMessage['ID'] == $MessageID && $LastMessage['CreateDate'] > Time() - 24 * 3600) {
            $Params['Delete'] = SPrintF('<a href="JavaScript:EdeskMessageEdit(%u,\'%s\');">[редактировать]</a>', $MessageID, AddcSlashes(HtmlSpecialChars($Content), "\n\r\\\\'"));
        }
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ((int) $FileLength) {
    #-------------------------------------------------------------------------------
    $Delete = $__USER['IsAdmin'] ? SPrintF('<a href="JavaScript:ShowConfirm(\'Вы подтверждаете удаление файла?\',\'AjaxCall(\\\'/Administrator/API/FileDelete\\\',{Table:\\\'EdesksMessages\\\',ID:%u},\\\'Удаление файла\\\',\\\'GetURL(document.location);\\\');\');" onmouseover="PromptShow(event,\'Удалить это вложение\',this);">[удалить]</a>', $MessageID) : ' ';
    #-------------------------------------------------------------------------------
    $Params2 = array('Delete' => $Delete, 'FileName' => $FileName, 'FileSize' => SPrintF('%01.2f', $FileLength / 1024), 'MessageID' => $MessageID);
    #-------------------------------------------------------------------------------
    #$Table->AddHTML(TemplateReplace('Edesks.Message.Uploaded',$Params));
    $Params['File'] = TemplateReplace('Edesks.Message.Uploaded', $Params2);