当前位置: 首页>>代码示例>>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;未经允许,请勿转载。