function actionDefault() { // Create the template object $tpl = new YDTemplate(); // Assign some stuff $browser = new YDBrowserInfo(); $tpl->assign('browser', $browser); // Display the template $tpl->display(); }
function actionDefault() { // create template object $tpl = new YDTemplate(); // create ajax object with waiting message $this->ajax = new YDAjax($tpl); $this->ajax->useWaitingMessage(); // add custom event $this->ajax->addEvent('customFunction(x)', array(&$this, 'getResult'), 'var x'); // process ajax events $this->ajax->processEvents(); // assign title and display template $tpl->assign('title', 'This example demonstrates YDAjax without YDForm'); $tpl->display(); }
function actionDefault() { // Create the form $form = new YDForm('form1'); // Add the checkboxgroup $form->addElement('checkboxgroup', 'choose_multiple', 'Choose multiple default', array(), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple2', 'Choose multiple HORIZONTAL', array('sep' => 'h'), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple3', 'Choose multiple VERTICAL', array('sep' => 'v'), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple4', 'Choose multiple LEFT', array('sep' => 'l'), array(0 => 'choice 1', 1 => 'choice 2')); $el =& $form->addElement('checkboxgroup', 'choose_multiple5', 'Choose multiple RIGHT', array('sep' => 'r'), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple6', 'Choose multiple VERTICAL LEFT', array('sep' => 'vl'), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple7', 'Choose multiple VERTICAL RIGHT', array('sep' => 'vr'), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple8', 'Choose multiple HORIZONTAL LEFT', array('sep' => 'hl'), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple9', 'Choose multiple HORIZONTAL RIGHT', array('sep' => 'hr'), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple10', 'Custom Separator "|"', array('separator' => ' | '), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple11', 'Custom Separator "XXX" and LEFT', array('sep' => 'l', 'separator' => ' XXX '), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple12', 'Custom Separator "...", LEFT and VERTICAL', array('sep' => 'l', 'separator' => '...<br />'), array(0 => 'choice 1', 1 => 'choice 2')); $form->addElement('checkboxgroup', 'choose_multiple_big', 'Choose with column format', array(), array(0 => 'choice 1', 'choice 2', 'choice 3', 'choice 4', 'choice 5', 'choice 6', 'choice 7', 'choice 8')); $el2 =& $form->addElement('checkboxgroup', 'choose_multiple_big2', 'Choose with column format (2 columns)', array(), array(0 => 'choice 1', 'choice 2', 'choice 3', 'choice 4', 'choice 5', 'choice 6', 'choice 7', 'choice 8')); $el2->setColumns(2); $el3 =& $form->addElement('checkboxgroup', 'choose_multiple_big3', 'Choose with column format (3 columns and a default "select all")', array(), array(0 => 'choice 1', 'choice 2', 'choice 3', 'choice 4', 'choice 5', 'choice 6', 'choice 7', 'choice 8', 'choice 9')); $el3->setColumns(3); $el3->addSelectAll(); $el4 =& $form->addElement('checkboxgroup', 'choose_multiple_big4', 'Choose with column format (3 columns and a "select all" on top)', array(), array(0 => 'choice 1', 'choice 2', 'choice 3', 'choice 4', 'choice 5', 'choice 6', 'choice 7', 'choice 8')); $el4->setColumns(3); $el4->addSelectAll(false); // demonstrate disable on checkboxgroup $form->disable('choose_multiple', 1); $form->disable('choose_multiple2', array(0, 1)); $form->disable('choose_multiple3'); // Add and example about 'select all' button $el->addSelectAll(); // Add the submit button $form->addElement('submit', 'btnSubmit', 'submit'); // Set the defaults $form->setDefaults(array('choose_multiple' => array(0 => 0, 1 => 1))); // Process the form if ($form->validate() === true) { YDDebugUtil::dump($form->getValues()); } // Add the template $tpl = new YDTemplate(); // Add the form to the template $tpl->assign('form', $form->toHTML()); // Display the template $tpl->display(); }
/** * This function will be executed if there is no post data found. This is happening when there is no XML/RPC * request found. */ function requestNotXmlRpc() { // Get the list of methods $methods = array(); $methodNames = $this->_server->listMethods(null); // Loop over the methods foreach ($methodNames as $method) { if (isset($this->_server->signatures[$method])) { if (sizeof($this->_server->signatures[$method]) == 1) { $paramsIn = null; $paramsOut = $this->_server->signatures[$method]; } else { $paramsIn = $this->_server->signatures[$method]; $paramsOut = array_shift($paramsIn); } } else { $paramsIn = null; $paramsOut = null; } $methodInfo = array(); $methodInfo['signature'] = @$this->_server->signatures[$method]; $methodInfo['paramsIn'] = $paramsIn; $methodInfo['paramsOut'] = $paramsOut; $methodInfo['help'] = @$this->_server->help[$method]; $methods[$method] = $methodInfo; } // Create a new template YDInclude('YDTemplate.php'); $template = new YDTemplate(); $template->template_dir = dirname(__FILE__); $template->assign('methods', $methods); $template->assign('xmlRpcUrl', $this->getCurrentUrl()); $template->assign('capabilities', $this->_server->getCapabilities(null)); $template->assign('rowcolor', '#EEEEEE'); $template->display('YDXmlRpcServer.tpl'); }