本文整理汇总了PHP中NextendForm::getSubform方法的典型用法代码示例。如果您正苦于以下问题:PHP NextendForm::getSubform方法的具体用法?PHP NextendForm::getSubform怎么用?PHP NextendForm::getSubform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NextendForm
的用法示例。
在下文中一共展示了NextendForm::getSubform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: subform
function subform()
{
$response = array();
if (!isset($_POST['data'])) {
echo json_encode(array('error' => 'Post not OK!'));
exit;
}
if (get_magic_quotes_gpc() || nextendIsWordPress()) {
$_POST['data'] = stripslashes($_POST['data']);
}
$data = json_decode($_POST['data'], true);
$configurationXmlFile = rtrim(NextendFilesystem::getBasePath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $data['xml'];
if (NextendFilesystem::fileexists($configurationXmlFile)) {
nextendimport('nextend.css.css');
nextendimport('nextend.javascript.javascript');
$css = NextendCSS::getInstance();
$js = NextendJavascript::getInstance();
$js->loadLibrary('dojo');
nextendimport('nextend.form.form');
$form = new NextendForm();
$form->loadArray($data['orig']);
$form->loadArray(array($data['name'] => $data['value']));
$form->loadXMLFile($configurationXmlFile);
ob_start();
$subform = $form->getSubform($data['tab'], $data['name']);
$subform->initAjax($data['control_name']);
echo $subform->renderForm();
echo "<style>";
echo $css->generateAjaxCSS($data['loadedCSS']);
echo "</style>";
$scripts = $js->generateAjaxJs($data['loadedJSS']);
$html = ob_get_clean();
$response = array('html' => $html, 'scripts' => $scripts);
} else {
$response = array('error' => 'Configuration file not found');
}
echo json_encode($response);
exit;
}