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


PHP xajaxResponse::setEvent方法代碼示例

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


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

示例1: XAJAX_changeList

function XAJAX_changeList($select)
{
    $objResponse = new xajaxResponse();
    if ($select == 'Normal') {
        $auswahl = array('u0' => 'an alle User');
        $erg = db_query("SELECT `name`,`id` FROM `prefix_groups` ORDER BY `id`");
        while ($RRrow = db_fetch_object($erg)) {
            $auswahl['g' . $RRrow->id] = $RRrow->name;
        }
        $listeB = '';
        $listeT = '';
        foreach ($auswahl as $k => $v) {
            if (strpos($k, 'u') !== false) {
                $listeB .= '<option value="P' . $k . '">' . $v . ' PrivMsg</option>' . "\n";
                $listeB .= '<option value="E' . $k . '">' . $v . ' eMail</option>' . "\n";
            } elseif (strpos($k, 'g') !== false) {
                $listeT .= '<option value="P' . $k . '">' . $v . ' PrivMsg</option>' . "\n";
                $listeT .= '<option value="E' . $k . '">' . $v . ' eMail</option>' . "\n";
            }
        }
        $content = <<<END
            <select id="nl_auswahl" name="auswahl">
                <option value="Enews" selected="selected">eMail Newsletter</option>
                <optgroup label="Benutzer">
                    {$listeB}
                </optgroup>
                <optgroup label="Gruppen">
                    {$listeT}
                </optgroup>
    \t\t</select>
END;
        $objResponse->assign('cb_html_cont', 'style.display', '');
    } else {
        $erg = db_query("SELECT * FROM `prefix_grundrechte` ORDER BY `id` ASC");
        $listeG = '';
        while ($row = db_fetch_assoc($erg)) {
            $listeG .= '<optgroup label="' . $row['name'] . '">';
            $listeG .= '<option value="Pr' . $row['id'] . '"> PrivMsg</option>';
            $listeG .= '<option value="Er' . $row['id'] . '"> eMail</option>';
            $listeG .= '</optgroup>';
        }
        $content = <<<END
            <select name="auswahl" id="nl_auswahl">
                <option selected="selected" disabled="disabled">Bitte treffen Sie eine Auswahl</option>
                    {$listeG}
            </select>
\t\t\t<input type="checkbox" name="andhigher" id="cb_andhigher" value="1" />
\t\t\t<label for="cb_andhigher">und f&uuml;r alle h&ouml;heren Rechte</label>
END;
    }
    $objResponse->assign('list', 'innerHTML', $content);
    $objResponse->setEvent('nl_auswahl', 'onchange', 'checkEmail();');
    return $objResponse;
}
開發者ID:rjdesign,項目名稱:Ilch-1.2,代碼行數:54,代碼來源:newsletter.php

示例2: save_model

function save_model($forms)
{
    global $DB;
    $obj = new xajaxResponse();
    $form = $forms['modeledit'];
    $formid = intval($form['id']);
    $pid = intval($form['pid']);
    $error = false;
    $obj->script("removeClass(xajax.\$('id_model_name'),'alert');");
    if (empty($form['name'])) {
        $error = true;
        $obj->setEvent("id_model_name", "onmouseover", "popup('<span class=\\\"red bold\\\">" . trans("Model name is required!") . "</span>')");
    }
    if (!$error) {
        if (!$form['id']) {
            $error = $DB->GetOne('SELECT COUNT(*) FROM netdevicemodels WHERE netdeviceproducerid = ? AND UPPER(name) = ? ', array($pid, strtoupper($form['name']))) ? true : false;
        } else {
            $error = $DB->GetOne('SELECT COUNT(*) FROM netdevicemodels WHERE id <> ? AND netdeviceproducerid = ? AND UPPER(name) = ?', array($formid, $pid, strtoupper($form['name']))) ? true : false;
        }
        if ($error) {
            $obj->setEvent("id_model_name", "onmouseover", "popup('<span class=\\\"red bold\\\">" . trans("Model already exists!") . "</span>')");
        }
    }
    if ($error) {
        $obj->script("addClass(xajax.\$('id_model_name'),'alert');");
        $obj->script("xajax.\$('id_model_name').focus();");
    } else {
        if ($formid) {
            $DB->Execute('UPDATE netdevicemodels SET name = ?, alternative_name = ? WHERE id = ?', array($form['name'], $form['alternative_name'] ? $form['alternative_name'] : NULL, $formid));
            $obj->script("xajax_cancel_model();");
            $obj->script("self.location.href='?m=netdevmodels&page=1&p_id={$pid}';");
        } else {
            $DB->Execute('INSERT INTO netdevicemodels (netdeviceproducerid, name, alternative_name) VALUES (?, ?, ?)', array($pid, $form['name'], $form['alternative_name'] ? $form['alternative_name'] : NULL));
            $obj->script("xajax_cancel_model();");
            $obj->script("self.location.href='?m=netdevmodels&page=1&p_id={$pid}';");
        }
    }
    return $obj;
}
開發者ID:kornelek,項目名稱:lms,代碼行數:39,代碼來源:netdevmodels.php


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