本文整理汇总了PHP中xajaxResponse::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::assign方法的具体用法?PHP xajaxResponse::assign怎么用?PHP xajaxResponse::assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xajaxResponse
的用法示例。
在下文中一共展示了xajaxResponse::assign方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testForm
function testForm($formData)
{
$objResponse = new xajaxResponse();
$objResponse->alert("formData: " . print_r($formData, true));
$objResponse->assign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)));
return $objResponse;
}
示例2: sortdata
function sortdata($table, $column, $direction)
{
global $tpl;
global $user_data;
global $getmonth;
$objResponse = new xajaxResponse();
//include('settings/template.php');
include 'settings/tables.php';
if ($user_data == '') {
require_once 'lib/functions/get_userdata.php';
}
if ($table == $tbl_goals) {
//define sort column
$goals_order = $column . " " . $direction;
include "lib/functions/fetch_goals.php";
$tpl->assign('ay_goals', $ay_goals);
//define direction DESC or ASC
if ($direction == 'DESC') {
$tpl->assign("sort_" . $column, 'ASC');
} else {
$tpl->assign("sort_" . $column, 'DESC');
}
//update template
$html = $tpl->fetch('modules/improve/goals/sort_' . $column . '.tpl');
$objResponse->assign("sortdiv_" . $column, "innerHTML", $html);
$html2 = $tpl->fetch("modules/improve/goals/goal_entries.tpl");
$objResponse->assign("goal_entries", "innerHTML", $html2);
}
return $objResponse;
}
示例3: action_get_user_settings_page
/**
* set the html for user settings page
* this function is registered in xajax
* @return xajaxResponse every xajax registered function needs to return this object
*/
function action_get_user_settings_page()
{
global $logging;
global $user;
global $user_settings_table_configuration;
global $firstthingsfirst_portal_title;
global $user_start_time_array;
$logging->info("USER_ACTION " . __METHOD__ . " (user=" . $user->get_name() . ")");
# store start time
$user_start_time_array[__METHOD__] = microtime(TRUE);
# create necessary objects
$result = new Result();
$response = new xajaxResponse();
$html_database_table = new HtmlDatabaseTable($user_settings_table_configuration);
# create an array with selection of fields that user may change
$db_fields_array = array(DB_ID_FIELD_NAME, USER_NAME_FIELD_NAME, USER_PW_FIELD_NAME, USER_LANG_FIELD_NAME, USER_DATE_FORMAT_FIELD_NAME, USER_DECIMAL_MARK_FIELD_NAME, USER_LINES_PER_PAGE_FIELD_NAME, USER_THEME_FIELD_NAME);
$user_record_key_string = DatabaseTable::_get_encoded_key_string(array(DB_ID_FIELD_NAME => $user->get_id()));
# set page, title, explanation and navigation
$response->assign("page_title", "innerHTML", translate("LABEL_USER_SETTINGS_TITLE"));
$response->assign("navigation_container", "innerHTML", get_page_navigation(PAGE_TYPE_USER_SETTINGS));
$html_database_table->get_page(translate("LABEL_USER_SETTINGS_TITLE"), $result);
$response->assign("main_body", "innerHTML", $result->get_result_str());
# get action pane for current user
$html_database_table->get_record($user, USER_TABLE_NAME, $user_record_key_string, $db_fields_array, $result);
$response->custom_response->assign_with_effect("action_pane", $result->get_result_str());
# set footer
$response->assign("footer_text", "innerHTML", " ");
# check post conditions
if (check_postconditions($result, $response) == FALSE) {
return $response;
}
# log total time for this function
$logging->info(get_function_time_str(__METHOD__));
return $response;
}
示例4: procesarFormContactanos
function procesarFormContactanos($form_values)
{
$respuestaXajax = new xajaxResponse();
$datos['nombre'] = $form_values['nombre'];
$datos['empresa'] = $form_values['empresa'];
$datos['correo'] = $form_values['correo'];
$datos['telefono'] = $form_values['telefono'];
$datos['mensaje'] = $form_values['mensaje'];
$email = 'jesuslobaton@gmail.com';
$to = "ventas@toyolobaimport.com";
$asunto = "Consulta Web TLI";
$headers .= "Reply-To: " . $email . " \r\n";
$headers .= "From: " . $email . " \n";
//mando el correo...
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
if (!empty($email)) {
mail($to, $asunto, $codhtml, $headers);
//echo "si";
}
//enviarcorreo($datos);
$cadena = "<div class='mensaje'>Hola {$nombre}, tu correo ha sido enviado.<br/> <br/>Gracias por contactarnos.</div>";
//$respuestaXajax->assign("formcont","innerHTML", $cadena);
$respuestaXajax->assign("formcont", "innerHTML", $cadena);
$respuestaXajax->assign("formcont", "innerHTML", $cadena);
return $respuestaXajax;
}
示例5: action_get_user_admin_page
/**
* set the html for user admin page
* this function is registered in xajax
* @return xajaxResponse every xajax registered function needs to return this object
*/
function action_get_user_admin_page()
{
global $logging;
global $user;
global $user_admin_table_configuration;
global $user_start_time_array;
$logging->info("USER_ACTION " . __METHOD__ . " (user=" . $user->get_name() . ")");
# store start time
$user_start_time_array[__METHOD__] = microtime(TRUE);
# create necessary objects
$result = new Result();
$response = new xajaxResponse();
$html_database_table = new HtmlDatabaseTable($user_admin_table_configuration);
# set page, title, explanation and navigation
$response->assign("page_title", "innerHTML", translate("LABEL_USER_ADMIN_TITLE"));
$response->assign("navigation_container", "innerHTML", get_page_navigation(PAGE_TYPE_USER_ADMIN));
$html_database_table->get_page(translate("LABEL_USER_ADMIN_TITLE"), $result);
$response->assign("main_body", "innerHTML", $result->get_result_str());
# set content
$html_database_table->get_content($user, HTML_NO_LIST_PERMISSION_CHECK, "", DATABASETABLE_UNKWOWN_PAGE, $result);
$response->custom_response->assign_with_effect(PORTAL_CSS_NAME_PREFIX . "content_pane", $result->get_result_str());
# set action pane
$html_str = $html_database_table->get_action_bar(USER_TABLE_NAME, "");
$response->custom_response->assign_and_show("action_pane", $html_str);
# set footer
$response->assign("footer_text", "innerHTML", " ");
# check post conditions
if (check_postconditions($result, $response) == FALSE) {
return $response;
}
# log total time for this function
$logging->info(get_function_time_str(__METHOD__));
return $response;
}
示例6: ajaxpreview
function ajaxpreview($params)
{
global $gCms;
$urlext = '?' . CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY];
$config =& $gCms->GetConfig();
$contentops =& $gCms->GetContentOperations();
$content_type = $params['content_type'];
$contentops->LoadContentType($content_type);
$contentobj = UnserializeObject($params["serialized_content"]);
if (strtolower(get_class($contentobj)) != strtolower($content_type)) {
copycontentobj($contentobj, $content_type, $params);
}
updatecontentobj($contentobj, true, $params);
$tmpfname = createtmpfname($contentobj);
// str_replace is because of stupid windows machines.... when will they die.
$_SESSION['cms_preview'] = str_replace('\\', '/', $tmpfname);
$tmpvar = substr(str_shuffle(md5($tmpfname)), -3);
$url = $config["root_url"] . '/index.php?' . $config['query_var'] . "=__CMS_PREVIEW_PAGE__&r={$tmpvar}";
// temporary
$objResponse = new xajaxResponse();
$objResponse->assign("previewframe", "src", $url);
$objResponse->assign("serialized_content", "value", SerializeObject($contentobj));
$count = 0;
foreach ($contentobj->TabNames() as $tabname) {
$objResponse->script("Element.removeClassName('editab" . $count . "', 'active');Element.removeClassName('editab" . $count . "_c', 'active');\$('editab" . $count . "_c').style.display = 'none';");
$count++;
}
$objResponse->script("Element.addClassName('edittabpreview', 'active');Element.addClassName('edittabpreview_c', 'active');\$('edittabpreview_c').style.display = '';");
return $objResponse;
}
示例7: GetCities
function GetCities($country, $city)
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
$response = new xajaxResponse();
$cities = city::GetCities(intval($country));
/*$html = '<option value="0">Все города</option>';
foreach ($cities as $id=>$val) {
$html .= '<option value="'.$id.'">'.htmlspecialchars($val).'</option>';
}*/
$script = "document.getElementById('cities').options.length = 0; \n";
$script .= "document.getElementById('cities').options[0] = new Option('Все города', 0); \n";
$i = 1;
foreach ($cities as $id => $val) {
$script .= "document.getElementById('cities').options[{$i}] = new Option('" . htmlspecialchars($val) . "', {$id}); \n";
++$i;
}
$response->assign('cities', 'innerHTML', $html);
$response->assign('cities', 'disabled', false);
$script .= "document.getElementById('btnAddLocation').onclick = function() { locations.add(); return false; }; \n";
if ($city) {
$script .= "\n\t\t\tfor (var i=0; i<document.getElementById('cities').options.length; i++) {\n\t\t\t\tif (document.getElementById('cities').options[i].value == {$city}) {\n\t\t\t\t\tdocument.getElementById('cities').selectedIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t} \n\n\t\t";
}
$script .= 'if (spam.busy > 1) { spam.busy = 0; spam.send(); } spam.busy = 0;';
$response->script($script);
return $response;
}
示例8: cancelar_borrar_foto
function cancelar_borrar_foto($id)
{
$objResponse = new xajaxResponse();
$objResponse->assign('links_' . $id, 'style.display', 'inline');
$objResponse->assign('ampliar_' . $id, 'style.display', 'inline');
$objResponse->assign('msg_' . $id, 'innerHTML', '');
return $objResponse;
}
示例9: streamFile
function streamFile($arquivoId, $type, $screenSize)
{
global $smarty;
require_once "lib/persistentObj/PersistentObjectFactory.php";
$objResponse = new xajaxResponse();
if (!$arquivoId) {
return $objResponse;
}
$arquivo = PersistentObjectFactory::createObject("Publication", (int) $arquivoId);
$file =& $arquivo->filereferences[0];
$file->hitStream();
$screenSize -= 250;
if ($type == 'Imagem') {
$smarty->assign('src', $file->baseDir . $file->fileName);
if ($file->width > $screenSize) {
$file->height = $screenSize * ($file->height / $file->width);
$file->width = $screenSize;
$smarty->assign('note', tra("Imagem redimensionada"));
} else {
$smarty->assign('note', '');
}
$objResponse->remove('ajax-gPlayerImagem');
$objResponse->append('ajax-contentBubble', 'innerHTML', $smarty->fetch('el-playerImage.tpl'));
$objResponse->assign('ajax-gImagem', 'style.maxWidth', $screenSize . "px");
$objResponse->assign('ajax-gPlayerImagem', 'style.width', $file->width . "px");
$objResponse->assign('ajax-gPlayerImagem', 'style.height', $file->height . "px");
$objResponse->script("showLightbox('ajax-gPlayerImagem')");
return $objResponse;
}
$validUrl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$validUrl = preg_replace('/el-.+\\.php.*$/', '', $validUrl);
$validUrl .= $file->baseDir . $file->fileName;
if ($type == 'Video') {
$width = $file->width;
$height = $file->height;
$video = "true";
} else {
$width = 200;
$height = 20;
$video = "false";
}
/*pra quando rolar tutoriais em swf
* if (preg_match('/.*\.swf$/i', $arquivo.arquivo)) {
$smarty->assign('src', 'repo/' . $arquivo['arquivo']);
$objResponse->remove('gPlayerSwf');
$objResponse->append('ajax-contentBubble', 'innerHTML', $smarty->fetch('el-playerSwf.tpl'));
$objResponse->script("showLightbox('gPlayerSwf')");
} else {
*/
$objResponse->remove('ajax-gPlayer');
$objResponse->append('ajax-contentBubble', 'innerHTML', $smarty->fetch('el-player.tpl'));
$objResponse->script("loadFile('{$validUrl}', {$width}, {$height}, '{$video}')");
//}
return $objResponse;
}
示例10: 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ür alle höheren Rechte</label>
END;
}
$objResponse->assign('list', 'innerHTML', $content);
$objResponse->setEvent('nl_auswahl', 'onchange', 'checkEmail();');
return $objResponse;
}
示例11: DeletePhoto
/**
* Удаление фотографии.
*
* @param integer $id ID пользователя
*/
function DeletePhoto($id)
{
session_start();
$objResponse = new xajaxResponse();
if (hasPermissions('users')) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/team.php';
team::DeletePhoto($id);
$objResponse->assign('peoplephoto_' . $id, 'src', '/images/team_no_foto.gif');
$objResponse->assign('pt_photo_file', 'style.display', 'none');
}
return $objResponse;
}
示例12: add
function add($vF)
{
$resp = new xajaxResponse();
$html = '';
for ($i = 1; $i <= $vF['num']; $i++) {
$html .= '<tr><td>选项' . $i . '<input type="text" size="25" name="add[]" value=""></td></tr>';
}
$resp->assign("set", "style.display", "none");
$resp->assign("addB", "style.display", "block");
$resp->assign('hm', 'innerHTML', $html);
return $resp->getXML();
}
示例13: checkStatic
function checkStatic($from, $to)
{
$objResponse = new xajaxResponse();
$banners = new banners();
$stat_bans = $banners->GetBannersByDate($from, $to, true);
if ($stat_bans) {
$objResponse->alert("Внимание! На этот период уже есть статические размещения!");
$objResponse->assign("stat_info", 'innerHTML', "<a href=\"#\" class=\"blue\" onclick=\"window.showModalDialog('actbanners.php?from=" . $from . "&to=" . $to . "&stat=1', null, 'dialogHeight: 300px; dialogWidth: 500px; edge: Raised; center: Yes; help: No; resizable: No; scroll: Vertical; status: No;')\">Статические размещения на этот период</a>");
} else {
$objResponse->assign("stat_info", 'innerHTML', "");
}
return $objResponse;
}
示例14: mostrarPersona
function mostrarPersona($id)
{
global $ObjPersona;
global $cnx;
$sql = "SELECT IdPersona,CONCAT(apellidos,' ',nombres) as Nombres FROM Persona WHERE 1=1";
$sql .= " AND IdPersona=" . $id;
$rs = $cnx->query($sql);
$reg = $rs->fetchObject();
$objResp = new xajaxResponse();
$objResp->assign('txtIdPersona', 'value', $reg->IdPersona);
$objResp->assign('txtNombres', 'value', utf8_encode($reg->Nombres));
return $objResp;
}
示例15: show_hint
function show_hint($wid)
{
$hint = get_hint($wid);
if ($hint) {
$hint = htmlspecialchars(stripslashes($hint));
} else {
$hint = "No hint!";
}
$response = new xajaxResponse();
$response->assign("result", "innerHTML", $hint);
$response->assign("result", "style.display", "block");
return $response;
}