本文整理汇总了PHP中xml::getElementById方法的典型用法代码示例。如果您正苦于以下问题:PHP xml::getElementById方法的具体用法?PHP xml::getElementById怎么用?PHP xml::getElementById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml
的用法示例。
在下文中一共展示了xml::getElementById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
function install()
{
if (!$this->getForm()) {
$data_xml = new xml(PATH_MODULE . __CLASS__ . '/data.xml');
$this->getSection()->getXML()->elementIncludeTo($data_xml->getElementById('meta_form'), '//modules/module[@id="' . $this->getId() . '"]');
if ($form = $this->getForm()) {
$form->getXML()->save();
}
}
if ($sec = ap::getClientSection($this->getSection()->getId())) {
$modules = $sec->getModules();
if (!$modules->getById($this->getId())) {
$moduleName = $this->getName();
if (preg_match('/ap([A-Z].*)/', $moduleName, $m)) {
$moduleName = strtolower($m[1]);
}
$modules->add($moduleName, $this->getTitle(), $this->getId());
$modules->getXML()->save();
}
return true;
}
}
示例2: settings
function settings($action)
{
global $_out, $_site;
$xml = new xml(PATH_MODULE . get_class($this) . '/data.xml');
if ($e = $xml->getElementById('feedback_form_settings')) {
$form = new form($e);
$form->replaceURI(array('MD' => $this->getId(), 'ID' => $this->getSection()->getId()));
switch ($action) {
case 'update':
case 'apply_update':
$form->save($_REQUEST);
return;
}
//fill select from connect
$select_connects = $form->getField('form__db_name_connect');
$mysqlConnects = $_site->query('//mysql/con');
foreach ($mysqlConnects as $con) {
$select_connects->addOption($con->getAttribute('id'), $con->getAttribute('id'));
}
//fill selects from mail templates
$tpls = apTemplateManager::getAllTemplates();
$select_tpl = $form->getField('form_email_tpl');
$select_uTpl = $form->getField('form_email_tpl_user');
foreach ($tpls as $item) {
$select_tpl->addOption($item, $item);
$select_uTpl->addOption($item, $item);
}
#fill tables
$form->load();
//for database connection
$con = $select_connects->getValue();
$mysql = new mysql($con ? $con : null);
$rs = $mysql->query('SHOW TABLES');
$select_tb = $form->getField('form_db_name_table');
while ($res = mysql_fetch_array($rs)) {
$select_tb->addOption($res[0], $res[0]);
}
$form->load();
$_out->addSectionContent($form->getRootElement());
}
}
示例3: settings
function settings($action)
{
global $_out;
$xml = new xml(PATH_MODULE . __CLASS__ . '/data.xml');
if ($e = $xml->getElementById('settings')) {
$form = new form($e);
if (($ff = $form->getField('section_template')) && ($tl = apSectionTemplate::getPackages())) {
$val = $ff->getValue();
foreach ($tl as $e) {
$ff->addOption($e->getAttribute('id'), $e->getAttribute('title'));
if ($val == $e->getAttribute('id')) {
$ff->setValue($val);
}
}
}
$form->replaceURI(array('MD' => $this->getId(), 'ID' => $this->getSection()->getId()));
switch ($action) {
case 'update':
case 'apply_update':
$form->save($_REQUEST);
return;
}
$form->load();
$_out->addSectionContent($form->getRootElement());
}
}