当前位置: 首页>>代码示例>>PHP>>正文


PHP xajaxResponse::insertAfter方法代码示例

本文整理汇总了PHP中xajaxResponse::insertAfter方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::insertAfter方法的具体用法?PHP xajaxResponse::insertAfter怎么用?PHP xajaxResponse::insertAfter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xajaxResponse的用法示例。


在下文中一共展示了xajaxResponse::insertAfter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: newUploadForm

function newUploadForm($i)
{
    global $smarty, $arquivo;
    $objResponse = new xajaxResponse();
    $smarty->assign('i', $i);
    $smarty->assign('arquivoId', $arquivo->id);
    $objResponse->script("uploadI++");
    $objResponse->insertAfter("uploadFormCont" . ($i - 1), "span", "uploadFormCont" . $i);
    $objResponse->assign("uploadFormCont" . $i, 'innerHTML', $smarty->fetch("el-gallery_upload_form.tpl"));
    return $objResponse;
}
开发者ID:rodrigoprimo,项目名称:estudiolivre,代码行数:11,代码来源:el-gallery_upload_ajax.php

示例2: Lenta_EditFav

function Lenta_EditFav($msg_id, $priority = 0, $title = "", $action = "edit", $pfx = "CM")
{
    global $session, $stars;
    session_start();
    $user_id = $_SESSION['uid'];
    $objResponse = new xajaxResponse();
    $msg_id = intval($msg_id);
    $GLOBALS['xajax']->setCharEncoding("windows-1251");
    $action = trim($action);
    switch ($action) {
        case "update":
            //$title     = pg_escape_string(substr($title, 0, 128));
            $title = substr($title, 0, 128);
            switch ($pfx) {
                case 'CM':
                    $updatefav = lenta::AddFav($user_id, $msg_id, 0, 0, 0, $priority, $title);
                    $fav_href = "/commune/?id={$editfav['commune_id']}&site=Topic&post={$msg_id}";
                    break;
                case 'PF':
                    $updatefav = lenta::AddFav($user_id, 0, $msg_id, 0, 0, $priority, $title);
                    $fav_href = "/users/{$editfav['login']}/viewproj.php?prjid={$msg_id}";
                    break;
                case 'BL':
                    $updatefav = lenta::AddFav($user_id, 0, 0, $msg_id, 0, $priority, $title);
                    $fav_href = "/blogs/view.php?tr={$msg_id}";
                    break;
            }
            $editfav = lenta::GetFav($user_id, $msg_id, $pfx);
            $key = $msg_id;
            //		    $fav_href =  ( $pfx=='CM' ? "/commune/?id={$editfav['commune_id']}&site=Topic&post={$msg_id}" : "/users/{$editfav['login']}/viewproj.php?prjid={$msg_id}");
            $outHTML = __lentaPrntFavContent($editfav, $key, $user_id, $pfx, $fav_href);
            $objResponse->assign("fav" . $pfx . $msg_id, "innerHTML", $outHTML);
            //		    $objResponse->assign('favstar'.$pfx.$msg_id, "src", "/images/ico_star_{$priority}.gif");
            $objResponse->assign('favstar' . $pfx . $msg_id, "src", "/images/bookmarks/" . $stars[$priority]);
            break;
        case "edit":
            $editfav = lenta::GetFav($user_id, $msg_id, $pfx);
            $editfav['title'] = str_replace("<br/>", "\r\n", reformat2($editfav['title'], 20, 0, 1));
            $outHTML = "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\"><tbody><tr valign=\"top\"><td style=\"padding-left: 3px;\">";
            $outHTML .= "<ul class=\"post-f-fav-sel\">";
            $outHTML .= "<li><IMG alt=\"\" border=\"0\" id='favpic" . $pfx . $msg_id . "-0' width=\"15\" height=\"15\" src=\"/images/ico_star_0" . ($editfav['priority'] != 0 ? "_empty" : "") . ".gif\" hspace=\"1\" vspace=\"1\" onclick=\"FavPriorityLenta({$msg_id}, 0, '{$pfx}')\" style=\"cursor:pointer;\"></li>";
            $outHTML .= "<li><IMG alt=\"\" border=\"0\" id='favpic" . $pfx . $msg_id . "-1' width=\"15\" height=\"15\" src=\"/images/ico_star_1" . ($editfav['priority'] != 1 ? "_empty" : "") . ".gif\" hspace=\"1\" vspace=\"1\" onclick=\"FavPriorityLenta({$msg_id}, 1, '{$pfx}')\" style=\"cursor:pointer;\"></li>";
            $outHTML .= "<li><IMG alt=\"\" border=\"0\" id='favpic" . $pfx . $msg_id . "-2' width=\"15\" height=\"15\" src=\"/images/ico_star_2" . ($editfav['priority'] != 2 ? "_empty" : "") . ".gif\" hspace=\"1\" vspace=\"1\" onclick=\"FavPriorityLenta({$msg_id}, 2, '{$pfx}')\" style=\"cursor:pointer;\"></li>";
            $outHTML .= "<li><IMG alt=\"\" border=\"0\" id='favpic" . $pfx . $msg_id . "-3' width=\"15\" height=\"15\" src=\"/images/ico_star_3" . ($editfav['priority'] != 3 ? "_empty" : "") . ".gif\" hspace=\"1\" vspace=\"1\" onclick=\"FavPriorityLenta({$msg_id}, 3, '{$pfx}')\" style=\"cursor:pointer;\"></li>";
            $outHTML .= "</ul></td><td>";
            $outHTML .= "<div class=\"fav-one-edit-txt\">";
            $outHTML .= "<INPUT id='favpriority" . $pfx . $msg_id . "' type='hidden' value='" . $editfav['priority'] . "'>";
            $outHTML .= "<INPUT id='currtitle' type='hidden' value='" . $editfav['title'] . "'>";
            $outHTML .= "<textarea rows=\"3\" cols=\"7\" id='favtext" . $pfx . $msg_id . "'>{$editfav['title']}</textarea>";
            $outHTML .= "<div class=\"fav-one-edit-btns\">";
            $outHTML .= "<INPUT type='button' value='Сохранить' onClick='if(document.getElementById(\"favtext" . $pfx . $msg_id . "\").value.length>128){alert(\"Слишком длинное название закладки!\");return false;}else{xajax_Lenta_EditFav(" . $msg_id . ", document.getElementById(\"favpriority" . $pfx . $msg_id . "\").value, document.getElementById(\"favtext" . $pfx . $msg_id . "\").value, \"update\", \"{$pfx}\");}'>";
            $outHTML .= "<INPUT type='button' value='Отмена' onClick='xajax_Lenta_EditFav(" . $msg_id . ", " . $editfav['priority'] . ", document.getElementById(\"currtitle\").value, \"default\", \"{$pfx}\");'>";
            $outHTML .= "</div></td></tr></tbody></table>";
            //$outHTML = "<li class=\"fav-one-edit c\">";
            $outHTML = "<ul class=\"post-f-fav-sel\">";
            $outHTML .= "<li><a href=\"\" onclick=\"FavPriorityLenta({$msg_id}, 0, '{$pfx}'); return false;\"><img src=\"../../images/bookmarks/bsg.png\" alt=\"\" id='favpic" . $pfx . $msg_id . "-0' /></a></li>";
            $outHTML .= "<li><a href=\"\" onclick=\"FavPriorityLenta({$msg_id}, 1, '{$pfx}'); return false;\"><img src=\"../../images/bookmarks/bsgr.png\" alt=\"\" id='favpic" . $pfx . $msg_id . "-1'/></a></li>";
            $outHTML .= "<li><a href=\"\" onclick=\"FavPriorityLenta({$msg_id}, 2, '{$pfx}'); return false;\"><img src=\"../../images/bookmarks/bsy.png\" alt=\"\" id='favpic" . $pfx . $msg_id . "-2'/></a></li>";
            $outHTML .= "<li><a href=\"\" onclick=\"FavPriorityLenta({$msg_id}, 3, '{$pfx}'); return false;\"><img src=\"../../images/bookmarks/bsr.png\" alt=\"\" id='favpic" . $pfx . $msg_id . "-3'/></a></li>";
            $outHTML .= "</ul>";
            $outHTML .= "<div class=\"fav-one-edit-txt\">";
            $outHTML .= "<INPUT id='favpriority" . $pfx . $msg_id . "' type='hidden' value='" . $editfav['priority'] . "'>";
            $outHTML .= "<INPUT id='currtitle' type='hidden' value='" . $editfav['title'] . "'>";
            $outHTML .= "<textarea rows=\"3\" cols=\"7\" id='favtext" . $pfx . $msg_id . "'>{$editfav['title']}</textarea>";
            $outHTML .= "<div class=\"fav-one-edit-btns\"><input type=\"button\" value=\"Сохранить\" onClick='if(document.getElementById(\"favtext" . $pfx . $msg_id . "\").value.length>128){alert(\"Слишком длинное название закладки!\");return false;}else{xajax_Lenta_EditFav(" . $msg_id . ", document.getElementById(\"favpriority" . $pfx . $msg_id . "\").value, document.getElementById(\"favtext" . $pfx . $msg_id . "\").value, \"update\", \"{$pfx}\"); \$(\"fav" . $pfx . $msg_id . "edit\").dispose();}'/> <input type=\"button\" value=\"Отмена\" onClick='xajax_Lenta_EditFav(" . $msg_id . ", " . $editfav['priority'] . ", document.getElementById(\"currtitle\").value, \"default\", \"{$pfx}\"); \$(\"fav" . $pfx . $msg_id . "edit\").dispose();' /></div>";
            $outHTML .= "</div>";
            //$outHTML .= "</li>";
            $objResponse->insertAfter("fav" . $pfx . $msg_id, "li", "fav" . $pfx . $msg_id . "edit");
            $objResponse->assign("fav" . $pfx . $msg_id . "edit", "className", "fav-one-edit");
            $objResponse->assign("fav" . $pfx . $msg_id . "edit", "innerHTML", $outHTML);
            //			$objResponse->assign("fav".$pfx.$msg_id, "innerHTML", $outHTML);
            break;
        default:
            $editfav = lenta::GetFav($user_id, $msg_id, $pfx);
            $key = $msg_id;
            //		    $fav_href =  ( $pfx=='CM' ? "/commune/?id={$editfav['commune_id']}&site=Topic&post={$msg_id}" : "/users/{$editfav['login']}/viewproj.php?prjid={$msg_id}");
            switch ($pfx) {
                case 'CM':
                    $updatefav = lenta::AddFav($user_id, $msg_id, 0, 0, 0, $priority, $title);
                    $fav_href = "/commune/?id={$editfav['commune_id']}&site=Topic&post={$msg_id}";
                    break;
                case 'PF':
                    $updatefav = lenta::AddFav($user_id, 0, $msg_id, 0, 0, $priority, $title);
                    $fav_href = "/users/{$editfav['login']}/viewproj.php?prjid={$msg_id}";
                    break;
                case 'BL':
                    $updatefav = lenta::AddFav($user_id, 0, 0, $msg_id, 0, $priority, $title);
                    $fav_href = "/blogs/view.php?tr={$msg_id}";
                    break;
            }
            $outHTML = __lentaPrntFavContent($editfav, $key, $user_id, $pfx, $fav_href);
            $objResponse->assign("fav" . $pfx . $msg_id, "innerHTML", $outHTML);
            break;
    }
    return $objResponse;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:96,代码来源:lenta.server.php

示例3: GetGroupsForSelect

/**
* Получить список групп в виде SELECT.
*
* @param    integer $selected_group_id  ID выбранной группы
* @param    string  $element_id         ID <SELECT> для которого надо получить группы
*/
function GetGroupsForSelect($selected_group_id = 0, $element_id)
{
    session_start();
    $objResponse = new xajaxResponse();
    if (hasPermissions('ourcontacts')) {
        $html = '';
        $groups = contacts::getGroups();
        if ($groups) {
            $objResponse->remove($element_id);
            $objResponse->insertAfter($element_id . '_label', 'select', $element_id);
            $objResponse->assign($element_id, 'name', $element_id);
            foreach ($groups as $group) {
                $objResponse->create("{$element_id}", 'option', $element_id . '_o_' . $group['id']);
                $objResponse->assign($element_id . '_o_' . $group['id'], 'value', $group['id']);
                $objResponse->assign($element_id . '_o_' . $group['id'], 'innerHTML', $group['title']);
                if ($group['id'] == $selected_group_id) {
                    $objResponse->assign($element_id . '_o_' . $group['id'], 'selected', true);
                }
            }
        }
    }
    return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:29,代码来源:ourcontacts.server.php

示例4: FillDraftForm


//.........这里部分代码省略.........
                    } else {
                        $objResponse->script('$("ch_is_private").set("checked",false);');
                    }
                    $objResponse->script('$("fcategory").set("value","' . $draft['category'] . '|0");');
                    $answers = preg_split("/\\|-\\|-\\|/", htmlspecialchars($draft['poll_answers']), -1, PREG_SPLIT_NO_EMPTY);
                    $show = TRUE;
                    if (empty($answers)) {
                        $answers = array('');
                        $show = FALSE;
                    }
                    if (!empty($draft['poll_question']) || count($answers) && $show) {
                        $objResponse->script('$("trpollquestion").setStyle("display", "table-row");');
                        $objResponse->script('$("trpolltype").setStyle("display", "table-row");');
                    } else {
                        $objResponse->script('$("trpollquestion").setStyle("display", "none");');
                        $objResponse->script('$("trpolltype").setStyle("display", "none");');
                    }
                    $objResponse->assign("poll-question", "value", $draft['poll_question']);
                    $objResponse->assign("poll-question-source", "value", $draft['poll_question']);
                    if ($draft['poll_type'] == 0) {
                        $objResponse->script('$("fmultiple0").set("checked", true);');
                        $objResponse->script('$("fmultiple1").set("checked", false);');
                    } else {
                        $objResponse->script('$("fmultiple0").set("checked", false);');
                        $objResponse->script('$("fmultiple1").set("checked", true);');
                    }
                    if (count($answers)) {
                        $objResponse->script('$$(".poll-line").destroy();');
                        $i = 0;
                        $c = count($answers);
                        $out = '';
                        $insert_id = "trpolltype";
                        foreach ($answers as $answer) {
                            $objResponse->insertAfter($insert_id, "tr", "poll-{$i}");
                            $objResponse->script('$("poll-' . $i . '").set("class", "poll-line");');
                            $objResponse->script('$("poll-' . $i . '").set("valign", "top");');
                            $out = '';
                            $out .= '<td>Ответ #<span class="poll-num">' . ($i + 1) . '</span></td>';
                            $out .= '<td>';
                            $out .= '<table cellpadding="0" cellspacing="0" border="0">';
                            $out .= '<tr>';
                            $out .= '<td><input maxlength="' . blogs::MAX_POLL_ANSWER_CHARS . '" class="poll-answer" type="text" value="' . addslashes($answer) . '" name="answers[]" tabindex="20' . $i . '"></td>';
                            $out .= '<td class="poll-btn"><a class="poll-del" href="javascript: return false" onclick="poll.del(\'Blogs\', ' . $i++ . '); return false;"><img src="/images/delpoll.png" width="15" height="15" border="0" alt="Удалить ответ" title="Удалить ответ"></a></td>';
                            $out .= '<td class="poll-btn"><span class="poll-add">&nbsp;</span></td>';
                            $out .= '</tr>';
                            $out .= '</table>';
                            $out .= '</td>';
                            $objResponse->assign("poll-" . ($i - 1), "innerHTML", $out);
                            $insert_id = "poll-" . ($i - 1);
                        }
                        $objResponse->script("poll.init('Blogs', document.getElementById('frm'), " . blogs::MAX_POLL_ANSWERS . ", '');");
                    }
                    if (!empty($draft['poll_question']) || count($answers) && $show) {
                        $objResponse->script('$("poll-0").setStyle("display", "table-row");');
                    } else {
                        $objResponse->script('$("poll-0").setStyle("display", "none");');
                    }
                }
                break;
            case 4:
                // Сообщества
                $draft = drafts::getDraft($draft_id, $uid, 4);
                if ($draft) {
                    $objResponse->assign("draft_id", "value", $draft['id']);
                    $objResponse->script('$("f_category_id").set("value", "' . $draft['category'] . '");');
                    $objResponse->assign("f_title", "value", $draft['title']);
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:67,代码来源:drafts.server.php


注:本文中的xajaxResponse::insertAfter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。