* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBAjax'); /** * Simple AJAX stub: Wxml * * Allow to call method via AJAX request * * @version 0.1.0 * @package WB * @subpackage base */ class WBAjax_Wxml extends WBAjax { /** * Wombax XML * @var WBMarkup_Wxml */ private $wxml; /** * second constructor * * Called by constructer of super class. * * @see include/WB/WBAjax#init() */ protected function init() { $this->wxml = WBClass::create('WBMarkup_Wxml'); } /** * display editor * * Article editor * * @return string HTML */ protected function edit() { $cs = $this->req->get('cs', null); if (empty($cs)) { return 'failed'; } $this->wxml->load($cs); return $this->wxml->edit(); } /** * display translation editor * * Article translation editor * * @return string */ public function translate() { $cs = $this->req->get('cs', null); if (empty($cs)) { return 'failed'; } $this->wxml->load($cs); return $this->wxml->translate($this->req->get('lang')); } /** * display actual content * * * @return string */ protected function display() { $cs = $this->req->get('cs', null); if (empty($cs)) { return 'failed'; } $this->wxml->load($cs); return $this->wxml->getHtml(); } }