當前位置: 首頁>>代碼示例>>PHP>>正文


PHP xajaxResponse::prepend方法代碼示例

本文整理匯總了PHP中xajaxResponse::prepend方法的典型用法代碼示例。如果您正苦於以下問題:PHP xajaxResponse::prepend方法的具體用法?PHP xajaxResponse::prepend怎麽用?PHP xajaxResponse::prepend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xajaxResponse的用法示例。


在下文中一共展示了xajaxResponse::prepend方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ssu_add_input

function ssu_add_input()
{
    global $db;
    $oResponse = new xajaxResponse();
    $sql_query = "INSERT IGNORE INTO " . TABLE_LINKS_ALIASES . " (link_url, link_alias) VALUES('/default_link/','/default_alias/')";
    $db->Execute($sql_query);
    $id = $db->insert_ID();
    if ($id !== 0) {
        $oResponse->prepend('linkBox', 'innerHTML', "\n\t\t\t\t<div id='link_{$id}' name='{$id}' class='editable links'>default_link</div>\n\t\t\t\t<div id='alias_{$id}' name='{$id}' class='editable aliases'>default_alias</div>\n\t\t\t\t<br class='clearBoth'/>");
        $oResponse->script('location.reload(true)');
        $oResponse->assign('message', 'innerHTML', "New record added");
    } else {
        $oResponse->assign('message', 'innerHTML', "No new record added!");
    }
    return $oResponse;
}
開發者ID:andychang88,項目名稱:daddy-store.com,代碼行數:16,代碼來源:ssu_xajax.php

示例2: action_add_attachment

/**
 * delete the current attachment
 * this function is registered in xajax
 * @param string $list_title title of current list
 * @param int $attachment_id id of this attachment
 * @param string $attachment_specifications specifications of the attachment 
 * @return xajaxResponse every xajax registered function needs to return this object
 */
function action_add_attachment($list_title, $attachment_id, $attachment_specifications)
{
    global $logging;
    global $user;
    global $user_start_time_array;
    $logging->info("USER_ACTION " . __METHOD__ . " (user=" . $user->get_name() . ", attachment_specifications={$attachment_specifications})");
    # store start time
    $user_start_time_array[__METHOD__] = microtime(TRUE);
    # create necessary objects
    $response = new xajaxResponse();
    $attachment_arrayrray = explode("|", $attachment_specifications);
    # decrease upload_attachment_id by 1
    $attachment_id += 1;
    $response->script("\$('#upload_attachment_id').html({$attachment_id}); ");
    # add new upload file to html
    $html_str = get_list_record_attachment($list_title, $attachment_id, $attachment_specifications);
    # todo: why does statement below not work????
    #    $response->script("$('#$td_id').html('$html_str' + $('#$td_id').html()); ");
    $response->prepend("attachments_container", "innerHTML", $html_str);
    # log total time for this function
    $logging->info(get_function_time_str(__METHOD__));
    return $response;
}
開發者ID:jzp74,項目名稱:firstthingsfirst,代碼行數:31,代碼來源:Html.ListTableAttachment.php

示例3: updatePost

function updatePost($post_id, $mode = 'full', $content = 'not needed')
{
    $objResponse = new xajaxResponse();
    $project7 = new editsee_App();
    if ($project7->loggedIn()) {
        if ($post_id == 'new') {
            $post_div = 'new-post';
            $post['id'] = 'new';
            $post['content'] = 'enter your new post content here';
            if ($mode == 'page') {
                $objResponse->assign('posts', 'innerHTML', '');
            }
            $objResponse->prepend('posts', 'innerHTML', '<div id="new-post" class="post"></div>');
        } else {
            $result = $project7->db->_query($project7->post_select(" and id='" . $post_id . "'"));
            $post = $result->_fetch_assoc();
            $post['title'] = stripslashes($post['title']);
            $post['content'] = stripslashes($post['content']);
            $post_div = 'post-' . $post['id'];
            if ($mode == 'draft') {
                $result = $project7->db->_query("select title,content from " . $project7->db->get_table_prefix() . "post where draft='" . $post_id . "'");
                $draft = $result->_fetch_assoc();
                $post['title'] = stripslashes($draft['title']);
                $post['content'] = stripslashes($draft['content']);
            }
        }
        if ($mode == 'quick') {
            if ($_SESSION['in-quick' . $post_id] != 'yes') {
                $_SESSION['in-quick' . $post_id] = 'yes';
                ob_start();
                include 'includes/layout/quickedit.php';
                $quick_edit = ob_get_contents();
                ob_end_clean();
                $objResponse->assign('post-' . $post['id'], 'innerHTML', $quick_edit);
                $objResponse->script("mynicEditornew= new nicEditor({iconsPath : '" . str_replace('index.php', '', $_SERVER['SCRIPT_NAME']) . "includes/nicEdit/nicEditorIcons.gif',buttonList : [],uploadURI : 'http://" . $_SERVER['HTTP_HOST'] . "/nicUpload.php'}).panelInstance('post_content')");
            }
        } else {
            if ($mode == 'inquick') {
                $post['content'] = stripslashes($content);
            }
            if ($project7->is_page($post_id)) {
                $mode = 'page';
            }
            if ($mode == 'page') {
                $post_type = 'page';
            } else {
                $post_type = 'post';
            }
            $_SESSION['in-quick' . $post_id] = 'yes';
            ob_start();
            include 'includes/layout/newpost.php';
            $newpost = ob_get_contents();
            ob_end_clean();
            $objResponse->assign($post_div, 'innerHTML', $newpost);
            $objResponse->script("mynicEditornew = new nicEditor({iconsPath : '" . str_replace('index.php', '', $_SERVER['SCRIPT_NAME']) . "includes/nicEdit/nicEditorIcons.gif',fullPanel: true,uploadURI : 'http://" . $_SERVER['HTTP_HOST'] . "/nicUpload.php'}).panelInstance('post_content')");
            if ($project7->get_config('es_draft_save_time') == '') {
                $project7->update_config('es_draft_save_time', '60');
            }
        }
    } else {
        $objResponse->alert($project7->notLoggedIn());
    }
    return $objResponse;
}
開發者ID:apexad,項目名稱:editsee,代碼行數:64,代碼來源:xajax.php

示例4: AddOpComentForm

/**
 * @param type $op_id
 * @param type $from
 * @param type $isFeedback если true значит это отзыв из СБР, если false - мнение
 *
 * @return \xajaxResponse
 */
function AddOpComentForm($op_id, $from = 'frl', $isFeedback = false)
{
    $objResponse = new xajaxResponse();
    if ($isFeedback) {
        $prefix = 'feedback_';
    } else {
        $prefix = '';
    }
    $link_id = $prefix . 'comment_content_' . $op_id;
    $objResponse->script('opinionCloseAllForms()');
    $objResponse->script("\$('{$link_id}').setStyle('display', 'none');");
    $objResponse->prepend($prefix . 'comment_' . $op_id, 'innerHTML', opinions::printEditComForm($op_id, $from, $isFeedback));
    $objResponse->script("opinionCheckMaxLengthStart('coment', '" . $prefix . "edit_comm_{$op_id}'); window._opiLock = false;");
    $objResponse->script("opinionCheckMaxLengthUpdater('" . $prefix . "edit_comm_{$op_id}')");
    $objResponse->script("\$('" . $prefix . "comment_{$op_id}').setStyle('display', '')");
    return $objResponse;
}
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:24,代碼來源:opinions.server.php


注:本文中的xajaxResponse::prepend方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。