Beispiel #1
0
<?php

header('Content-Type: application/json');
/* yadl_spaceid - Skip Stamping */
include 'exampleslib.inc';
// Use Services_JSON
require_once 'JSON.php';
$json = new Services_JSON();
$h = getRawData('height');
$w = getRawData('width');
$t = getRawData('top');
$l = getRawData('left');
$data = 'Height: ' . $h;
$data .= ', Width: ' . $w;
$data .= ', Top: ' . $t;
$data .= ', Left: ' . $l;
$response = new stdclass();
$response->data = '<p>This example does not really resize, but here is the data we received: ' . $data . '</p><p>If we used ImageMagick &amp; PHP we could issue this command: convert yui.jpg -crop [' . $w . ' x ' . $h . ' + ' . $l . ' + ' . $t . '] yui-new.jpg</p>';
echo $json->encode($response);
Beispiel #2
0
		</div>

		<div id="header">
			<h1 id="title">Editing <?php 
print getPage();
?>
</h1>
		</div>

		<div id="form">
			<form method="post" action="<?php 
print getPostURL();
?>
">
				<p><textarea name="data" cols="80" rows="20" style="width: 100%"><?php 
print getRawData();
?>
</textarea></p>
				<p><input type="submit" value="publish" /></p>
			</form>
		</div>

		<div id="footer" style='text-align: left;'>
			<p class='syntax'>
				<span style='font-weight: bold;'>Syntax:</span> Besides normal HTML
				code (e.g. <code>&lt;b&gt;Bold&lt;/b&gt;</code>), the following 
				markup is available as well:
				<ul>
					<li><code>[SomePage]</code>: Internal link to SomePage</li>
					<li><code>h1. Section</code>, <code>h2. Subsection</code>: 
						Section headers</li>