當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。