HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //opt/cloudlinux/alt-php54/root/usr/share/doc/pear/HTML_AJAX/examples/support/testHaa.class.php
<?php
/**
 * Require the action class
 */
require_once 'HTML/AJAX/Action.php';

class testHaa {
	function updateClassName() {
		$response = new HTML_AJAX_Action();

		$response->assignAttr('test','className','test');

		return $response;
	}

	function greenText($id) {
		$response = new HTML_AJAX_Action();
		$response->assignAttr($id,'style','color: green');
		return $response;
	}

	function highlight($id) {
		$response = new HTML_AJAX_Action();
		$response->assignAttr($id,'style','background-color: yellow');
		return $response;
	}

	function duplicate($id,$dest) {
		// there really should be an action method to do this
		$response = new HTML_AJAX_Action();
		$response->insertScript("
			var newNode = document.getElementById('$id').cloneNode(true);
			newNode.id = 'newNode';
			document.getElementById('$dest').appendChild(newNode);");
		return $response;
	}
}