• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XMLElement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中XMLElement的典型用法代码示例。如果您正苦于以下问题:PHP XMLElement类的具体用法?PHP XMLElement怎么用?PHP XMLElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XMLElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: notify

 function notify($context)
 {
     var_dump($context);
     include_once TOOLKIT . '/class.gateway.php';
     $ch = new Gateway();
     $ch->init();
     $ch->setopt('URL', 'http://rpc.pingomatic.com/');
     $ch->setopt('POST', 1);
     $ch->setopt('CONTENTTYPE', 'text/xml');
     $ch->setopt('HTTPVERSION', '1.0');
     ##Create the XML request
     $xml = new XMLElement('methodCall');
     $xml->appendChild(new XMLElement('methodName', 'weblogUpdates.ping'));
     $params = new XMLElement('params');
     $param = new XMLElement('param');
     $param->appendChild(new XMLElement('value', $this->_Parent->Configuration->get('sitename', 'general')));
     $params->appendChild($param);
     $param = new XMLElement('param');
     $param->appendChild(new XMLElement('value', URL));
     $params->appendChild($param);
     $xml->appendChild($params);
     ####
     $ch->setopt('POSTFIELDS', $xml->generate(true, 0));
     //Attempt the ping
     $ch->exec(GATEWAY_FORCE_SOCKET);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:26,代码来源:extension.driver.php


示例2: __viewIndex

 public function __viewIndex()
 {
     $this->_driver = $this->_Parent->ExtensionManager->create('section_schemas');
     $this->setPageType('form');
     $this->setTitle('Symphony – Section Schema data sources');
     $this->appendSubheading('Section Schema data sources');
     $container = new XMLElement('fieldset');
     $container->setAttribute('class', 'settings');
     $container->appendChild(new XMLElement('legend', 'Sections'));
     $group = new XMLElement('div');
     $group->setAttribute('class', 'group');
     $sm = new SectionManager($this->_Parent);
     $sections = $sm->fetch();
     $options = array();
     $dsm = new DatasourceManager($this->_Parent);
     $datasources = $dsm->listAll();
     foreach ($sections as $section) {
         $selected = in_array('section_schema_' . str_replace('-', '_', $section->_data['handle']), array_keys($datasources));
         $options[] = array($section->_data['handle'], $selected, $section->_data['name']);
     }
     $section = Widget::Label('Create data sources for these sections:');
     $section->appendChild(Widget::Select('sections[]', $options, array('multiple' => 'multiple')));
     $group->appendChild($section);
     $container->appendChild($group);
     $this->Form->appendChild($container);
     //---------------------------------------------------------------------
     $div = new XMLElement('div');
     $div->setAttribute('class', 'actions');
     $attr = array('accesskey' => 's');
     $div->appendChild(Widget::Input('action[save]', 'Save Changes', 'submit', $attr));
     $this->Form->appendChild($div);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:32,代码来源:content.list.php


示例3: __addPreferences

 /**
  * Add site preferences
  */
 public function __addPreferences($context)
 {
     // Get selected languages
     $selection = Symphony::Configuration()->get('datetime');
     if (empty($selection)) {
         $selection = array();
     }
     // Build default options
     $options = array();
     foreach ($this->languages as $name => $codes) {
         $options[$name] = array($name . '::' . $codes, array_key_exists($name, $selection) ? true : false, __(ucfirst($name)));
     }
     // Add custom options
     foreach (array_diff_key($selection, $this->languages) as $name => $codes) {
         $options[$name] = array($name . '::' . $codes, true, __(ucfirst($name)));
     }
     // Sort options
     ksort($options);
     // Add fieldset
     $group = new XMLElement('fieldset', '<legend>' . __('Date and Time') . '</legend>', array('class' => 'settings'));
     $select = Widget::Select('settings[datetime][]', $options, array('multiple' => 'multiple'));
     $label = Widget::Label('Languages included in the Date and Time Data Source', $select);
     $group->appendChild($label);
     $help = new XMLElement('p', __('You can add more languages in you configuration file.'), array('class' => 'help'));
     $group->appendChild($help);
     $context['wrapper']->appendChild($group);
 }
开发者ID:brendo,项目名称:datetime,代码行数:30,代码来源:extension.driver.php


示例4: trigger

 function trigger()
 {
     $username = $_POST['username'];
     $password = md5($_POST['password']);
     if (isset($_COOKIE[__SYM_COOKIE__]) && !isset($_POST['action']['login'])) {
         $args = unserialize(base64_decode($_COOKIE[__SYM_COOKIE_SAFE__]));
         $username = $args['username'];
         $password = $args['password'];
     }
     $sql = "SELECT *\n\t\t\t\t\tFROM `tbl_authors`\n\t\t\t\t\tWHERE `username` = '" . addslashes($username) . "'\n\t\t\t\t\tAND `password` = '" . $password . "'";
     $row = $this->_db->fetchRow(0, $sql);
     if (!empty($row) && is_array($row)) {
         $sql = "UPDATE `tbl_authors` SET `lastvisit` = UNIX_TIMESTAMP() WHERE `id` = '" . $row['id'] . "'";
         $this->_db->query($sql);
         setcookie(__SYM_COOKIE__, serialize($row), time() + 31536000, $this->_parent->getCookieDomain());
         setcookie(__SYM_COOKIE_SAFE__, base64_encode(serialize($row)), time() + 31536000, $this->_parent->getCookieDomain());
         $status = 'Author';
         if ($row['owner'] == 1) {
             $status = 'Owner';
         } elseif ($row['superuser'] == 1) {
             $status = 'Administrator';
         }
         $result = new XMLElement("user");
         $result->setAttribute("logged-in", "true");
         $result->addChild(new XMLElement("username", $row['username']));
         $result->addChild(new XMLElement("first-name", $row['firstname']));
         $result->addChild(new XMLElement("last-name", $row['lastname']));
         $result->addChild(new XMLElement("email", $row['email']));
         $result->addChild(new XMLElement("account-type", $status));
     } else {
         $result = new XMLElement("user");
         $result->setAttribute("logged-in", "false");
     }
     return $result;
 }
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:35,代码来源:event.login.php


示例5: generate

 /**
  * The generate functions outputs the correct headers for
  * this `XMLPage`, adds `$this->getHttpStatusCode()` code to the root attribute
  * before calling the parent generate function and generating
  * the `$this->_Result` XMLElement
  *
  * @param null $page
  * @return string
  */
 public function generate($page = null)
 {
     // Set the actual status code in the xml response
     $this->_Result->setAttribute('status', $this->getHttpStatusCode());
     parent::generate($page);
     return $this->_Result->generate(true);
 }
开发者ID:jurajkapsz,项目名称:symphony-2,代码行数:16,代码来源:class.xmlpage.php


示例6: __buildFormContent

 private function __buildFormContent()
 {
     $fieldset = new XMLElement('fieldset');
     // email was not send
     // or first time here (email_sent == NULL)
     if ($this->_email_sent !== true) {
         $fieldset->appendChild(new XMLElement('p', __('Enter your email address to be sent a remote unban link with further instructions.')));
         $label = Widget::Label(__('Email Address'));
         $label->appendChild(Widget::Input('email', $_POST['email'], 'text', array('autofocus', 'autofocus')));
     }
     if (isset($this->_email_sent)) {
         if ($this->_email_sent) {
             $div = new XMLElement('div', __('Email sent. Follow the instruction in it.'));
             $fieldset->appendChild($div);
         } else {
             $div = new XMLElement('div', NULL, array('class' => 'invalid'));
             $div->appendChild($label);
             $div->appendChild(new XMLElement('p', __('There was a problem locating your account. Please check that you are using the correct email address.')));
             $fieldset->appendChild($div);
         }
     } else {
         $fieldset->appendChild($label);
     }
     $this->Form->appendChild($fieldset);
     if ($this->_email_sent !== true) {
         $div = new XMLElement('div', NULL, array('class' => 'actions'));
         $div->appendChild(new XMLElement('button', __('Send Email'), array('name' => 'action[send-email]', 'type' => 'submit')));
         $this->Form->appendChild($div);
     }
 }
开发者ID:korelogic,项目名称:anti_brute_force,代码行数:30,代码来源:content.login.php


示例7: lookup

 public static function lookup($ip)
 {
     $ch = curl_init();
     // Notice: the request back to the service API includes your domain name
     // and the version of Symphony that you're using
     $version = Symphony::Configuration()->get('version', 'symphony');
     $domain = $_SERVER[SERVER_NAME];
     curl_setopt($ch, CURLOPT_URL, "http://api.josephdenne.com/_geoloc/array/?symphony=" . $version . "&domain=" . $domain . "&ip=" . $ip);
     curl_setopt($ch, CURLOPT_HEADER, 0);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     $geoinfo = curl_exec($ch);
     $info = curl_getinfo($ch);
     curl_close($ch);
     if ($geoinfo === false || $info['http_code'] != 200) {
         return;
     } else {
         $geoinfo = explode(',', $geoinfo);
     }
     $result = new XMLElement("geolocation");
     $included = array('id', 'lookups', 'country', 'region', 'city', 'lat', 'lon', 'error');
     $i = 0;
     foreach ($included as $geoloc) {
         $result->appendChild(new XMLElement($geoloc, $geoinfo[$i]));
         $i++;
     }
     return $result;
 }
开发者ID:josephdenne,项目名称:geolocation_service,代码行数:27,代码来源:class.geolocation_service.php


示例8: displayPublishPanel

 public function displayPublishPanel(&$wrapper, $data = null, $error = null, $prefix = null, $postfix = null, $entry_id = null)
 {
     $sortorder = $this->get('sortorder');
     $element_name = $this->get('element_name');
     $classes = array();
     $label = Widget::Label($this->get('label'));
     $message = new XMLElement('span');
     switch ($data['handle']) {
         case 'none':
         case 'completed':
             return;
             break;
         case 'failed':
             $value = __('Video failed to upload.');
             break;
         case 'queued':
             $value = __('Video is waiting in queue.');
             break;
         case 'encoding':
             $value = __('Video is being encoded.');
             break;
         case 'uploading':
             $value = __('Video is being uploaded.');
             break;
     }
     if (isset($value)) {
         $message->setValue($value);
         $label->appendChild($message);
         $wrapper->appendChild($label);
     }
 }
开发者ID:psychoticmeowArchives,项目名称:brightcove,代码行数:31,代码来源:field.brightcove_status.php


示例9: view

 public function view()
 {
     $this->setTitle(__('Symphony &ndash; Indecent Filter'));
     $this->setPageType('form');
     $this->Form->setAttribute('enctype', 'multipart/form-data');
     $this->appendSubheading(__('Indecent Filter'));
     $words = extension_indecent::processFilterList(true);
     // Word List
     $container = new XMLElement('fieldset');
     $container->setAttribute('class', 'settings');
     $container->appendChild(new XMLElement('legend', __('Word Blacklist')));
     $p = new XMLElement('p', __('Enter each of the terms on a new line.'), array('class' => 'help'));
     $container->appendChild($p);
     // Add last saved timestamp
     if (!empty($words)) {
         $p->setValue($p->getValue() . '<br / >' . __('Last updated: %s', array(extension_indecent::lastUpdateFilterList())));
     }
     $container->appendChild(Widget::Textarea('fields[words]', 30, 30, $words));
     $this->Form->appendChild($container);
     // Actions
     $div = new XMLElement('div');
     $div->setAttribute('class', 'actions');
     $div->appendChild(Widget::Input('action[save]', 'Save', 'submit', array('accesskey' => 's')));
     $this->Form->appendChild($div);
 }
开发者ID:brendo,项目名称:indecent,代码行数:25,代码来源:content.indecent.php


示例10: __trigger

 protected function __trigger()
 {
     $result = new XMLElement(self::ROOTELEMENT);
     $success = false;
     self::__init();
     $db = ASDCLoader::instance();
     $Members = $this->_Parent->ExtensionManager->create('members');
     $Members->initialiseCookie();
     if ($Members->isLoggedIn() !== true) {
         $result->appendChild(new XMLElement('error', 'Must be logged in.'));
         $result->setAttribute('status', 'error');
         return $result;
     }
     $Members->initialiseMemberObject();
     // Make sure we dont accidently use an expired code
     extension_Members::purgeCodes();
     $em = new EntryManager($this->_Parent);
     $entry = end($em->fetch((int) $Members->Member->get('id')));
     $email = $entry->getData(self::findFieldID('email-address', 'members'));
     $name = $entry->getData(self::findFieldID('name', 'members'));
     $success = $Members->emailNewMember(array('entry' => $entry, 'fields' => array('username-and-password' => $entry->getData(self::findFieldID('username-and-password', 'members')), 'name' => $name['value'], 'email-address' => $email['value'])));
     if ($success == true && isset($_REQUEST['redirect'])) {
         redirect($_REQUEST['redirect']);
     }
     $result->setAttribute('result', $success === true ? 'success' : 'error');
     return $result;
 }
开发者ID:bauhouse,项目名称:members,代码行数:27,代码来源:event.members_resend_activation_email.php


示例11: ttf_form

 public function ttf_form(&$form, &$page)
 {
     $p = new XMLElement('p', __('Wrap patterns with slashes, e.g., "/pattern_here/". You can use backreferences in replacement. Syntax for pattern and replacement is exactly the same as in <a href="http://www.php.net/manual/en/function.preg-replace.php" target="_blank">preg_replace()</a> PHP function.'));
     $p->setAttribute('class', 'help');
     $form->appendChild($p);
     $subsection = new XMLElement('div');
     $subsection->setAttribute('class', 'frame templatedtextformatter-duplicator');
     $ol = new XMLElement('ol');
     $ol->setAttribute('data-add', __('Add regex'));
     $ol->setAttribute('data-remove', __('Remove regex'));
     $temp = $this->_patterns;
     $temp[''] = '';
     foreach ($temp as $pattern => $replacement) {
         $li = new XMLElement('li');
         $li->setAttribute('class', $pattern ? 'field-regex' : 'template field-regex');
         $li->setAttribute('data-type', 'regex');
         $header = new XMLElement('header');
         $header->appendChild(new XMLElement('h4', '<strong>' . __('Replace') . '</strong> <span class="type">' . __('regex') . '</span>'));
         $li->appendChild($header);
         $div = new XMLElement('div');
         $div->setAttribute('class', 'two columns');
         $label = Widget::Label(__('Find with pattern'));
         $label->setAttribute('class', 'column');
         $label->appendChild(Widget::Input('fields[patterns][]', htmlentities($pattern, ENT_QUOTES, 'UTF-8')));
         $div->appendChild($label);
         $label = Widget::Label(__('Replace with'));
         $label->setAttribute('class', 'column');
         $label->appendChild(Widget::Input('fields[replacements][]', htmlentities($replacement, ENT_QUOTES, 'UTF-8')));
         $div->appendChild($label);
         $li->appendChild($div);
         $ol->appendChild($li);
     }
     $subsection->appendChild($ol);
     $form->appendChild($subsection);
 }
开发者ID:ShinShinman,项目名称:MAWWW,代码行数:35,代码来源:formatter.ttf_wiszce_ziomy.php


示例12: execute

 public function execute(array &$param_pool = null)
 {
     $result = new XMLElement('se-permissions');
     $result->appendChild($this->buildActions());
     $result->appendChild($this->buildLevels());
     return $result;
 }
开发者ID:andrewminton,项目名称:sections_event,代码行数:7,代码来源:data.se_permissions.php


示例13: decode

 protected function decode(XMLElement &$result, array $json)
 {
     $result = new XMLElement($this->dsParamROOTELEMENT);
     $result->appendChild(new XMLElement('name', $json['name']));
     $result->appendChild(new XMLElement('version', $json['version']));
     return $result;
 }
开发者ID:BloodBrother,项目名称:symphony-2-template,代码行数:7,代码来源:data.package.php


示例14: fromXML

 /**
  * Instantiates Services_Gnip_Publisher with current class data values
  *
  * @access    public
  * @param     XMLElement               $xml      XML Publisher
  * @return    Services_Gnip_Publisher            Services_Gnip_Publisher object
  */
 function fromXML($xml)
 {
     if ($xml->getName() != "publisher") {
         throw new Exception("expected publisher");
     }
     return new Services_Gnip_Publisher($xml["name"]);
 }
开发者ID:nsimon,项目名称:gnip-php,代码行数:14,代码来源:Publisher.php


示例15: append_preferences

 public function append_preferences($context)
 {
     # Add new fieldset
     $group = new XMLElement('fieldset');
     $group->setAttribute('class', 'settings');
     $group->appendChild(new XMLElement('legend', 'PayPal Payments'));
     # Add Merchant Email field
     $label = Widget::Label('Merchant Email/Account ID');
     $label->appendChild(Widget::Input('settings[paypal-payments][business]', General::Sanitize($this->_get_paypal_business())));
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'The merchant email address or account ID of the payment recipient.', array('class' => 'help')));
     # Country <select>
     $countries = array('Australia', 'United Kingdom', 'United States');
     $selected_country = $this->_get_country();
     foreach ($countries as $country) {
         $selected = $country == $selected_country ? TRUE : FALSE;
         $options[] = array($country, $selected);
     }
     $label = Widget::Label();
     $select = Widget::Select('settings[paypal-payments][country]', $options);
     $label->setValue('PayPal Country' . $select->generate());
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Country you want to target.', array('class' => 'help')));
     # Sandbox
     $label = Widget::Label();
     $input = Widget::Input('settings[paypal-payments][sandbox]', 'yes', 'checkbox');
     if ($this->_Parent->Configuration->get('sandbox', 'paypal-payments') == 'yes') {
         $input->setAttribute('checked', 'checked');
     }
     $label->setValue($input->generate() . ' Enable testing mode');
     $group->appendChild($label);
     $group->appendChild(new XMLElement('p', 'Directs payments to PayPal’s Sandbox: <code>http://www.sandbox.paypal.com/</code>', array('class' => 'help')));
     $context['wrapper']->appendChild($group);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:34,代码来源:extension.driver.php


示例16: grab

 public function grab(&$param_pool)
 {
     self::__init();
     $result = new XMLElement($this->dsParamROOTELEMENT);
     $rows = Symphony::Database()->fetch("SELECT *\n\t\t\t\tFROM `tbl_sessions` \n\t\t\t\tWHERE `session_data` != 'sym-|a:0:{}sym-members|a:0:{}' \n\t\t\t\tAND `session_data` REGEXP 'sym-members'\n\t\t\t\tAND `session_expires` > (UNIX_TIMESTAMP() - " . self::AGE . ") \n\t\t\t\tORDER BY `session_expires` DESC");
     $added = array();
     if (count($rows) > 0) {
         foreach ($rows as $r) {
             $raw = $r['session_data'];
             $data = self::session_real_decode($raw);
             if (!isset($data['sym-members'])) {
                 continue;
             }
             $record = ASDCLoader::instance()->query(sprintf("SELECT\n\t\t\t\t\t\t\t\temail.value AS `email`,\n\t\t\t\t\t\t\t\tMD5(email.value) AS `hash`,\n\t\t\t\t\t\t\t\tcreated_by.username AS `username`\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tFROM `tbl_entries_data_%d` AS `created_by`\n\t\t\t\t\t\t\tLEFT JOIN `tbl_entries_data_%d` AS `email` ON created_by.member_id = email.entry_id\n\t\t\t\t\t\t\tWHERE `created_by`.username = '%s'\n\t\t\t\t\t\t\tLIMIT 1", self::findFieldID('created-by', 'comments'), self::findFieldID('email-address', 'members'), ASDCLoader::instance()->escape($data['sym-members']['username'])));
             if ($record->length() == 0) {
                 continue;
             }
             $member = $record->current();
             // This is so we dont end up with accidental duplicates. No way to select
             // distinct via the SQL since we grab raw session data
             if (in_array($member->username, $added)) {
                 continue;
             }
             $added[] = $member->username;
             $result->appendChild(new XMLElement('member', General::sanitize($member->username), array('email-hash' => $member->hash)));
         }
     } else {
         $result->setValue('No Records Found.');
         //This should never happen!
     }
     return $result;
 }
开发者ID:bauhouse,项目名称:sym-forum-ensemble,代码行数:32,代码来源:data.whosonline.php


示例17: displayPublishPanel

 public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $fieldnamePrefix = null, $fieldnamePostfix = null, $entry_id = null)
 {
     // Check 'mode' exists; otherwise set manually from 'editable'
     $mode = $this->get('mode');
     if (!$mode) {
         if ($this->get('editable') == 'yes') {
             $mode = 'normal';
         } else {
             $mode = 'hidden';
         }
     }
     // Render the field only if it's not hidden
     if ($mode != 'hidden') {
         $name = $this->get('element_name');
         $edited_local = DateTimeObj::get(__SYM_DATETIME_FORMAT__, $data['local']);
         $current_local = DateTimeObj::get(__SYM_DATETIME_FORMAT__, null);
         $label = Widget::Label($this->get('label'));
         if ($mode == 'disabled') {
             $input = Widget::Input("{$name}-display", $edited_local);
             $input->setAttribute('disabled', 'disabled');
         } else {
             $note = new XMLElement('i', __('Previous value: %s', array($edited_local)));
             $label->appendChild($note);
             $input = Widget::Input("fields{$fieldnamePrefix}[{$name}]", $current_local);
         }
         $label->appendChild($input);
         $label->setAttribute('class', 'date');
         if (!is_null($flagWithError)) {
             $label = Widget::Error($label, $error);
         }
         $wrapper->appendChild($label);
     }
 }
开发者ID:symphonists,项目名称:datemodified,代码行数:33,代码来源:field.datemodified.php


示例18: view

 public function view()
 {
     $this->appendSubheading(__('Preferences'));
     $bIsWritable = true;
     $formHasErrors = is_array($this->_errors) && !empty($this->_errors);
     if (!is_writable(CONFIG)) {
         $this->pageAlert(__('The Symphony configuration file, <code>/manifest/config.php</code>, is not writable. You will not be able to save changes to preferences.'), Alert::ERROR);
         $bIsWritable = false;
     } else {
         if ($formHasErrors) {
             $this->pageAlert(__('An error occurred while processing this form. <a href="#error">See below for details.</a>'), Alert::ERROR);
         } else {
             if (isset($this->_context[0]) && $this->_context[0] == 'success') {
                 $this->pageAlert(__('Preferences saved.'), Alert::SUCCESS);
             }
         }
     }
     ###
     # Delegate: AddCustomPreferenceFieldsets
     # Description: Add Extension custom preferences. Use the $wrapper reference to append objects.
     $this->_Parent->ExtensionManager->notifyMembers('AddCustomPreferenceFieldsets', '/system/preferences/', array('wrapper' => &$this->Form));
     $div = new XMLElement('div');
     $div->setAttribute('class', 'actions');
     $attr = array('accesskey' => 's');
     if (!$bIsWritable) {
         $attr['disabled'] = 'disabled';
     }
     $div->appendChild(Widget::Input('action[save]', __('Save Changes'), 'submit', $attr));
     $this->Form->appendChild($div);
 }
开发者ID:bauhouse,项目名称:sym-fluidgrids,代码行数:30,代码来源:content.systempreferences.php


示例19: AddElementToFooter

 public function AddElementToFooter($context)
 {
     $ul =& $context['wrapper'];
     $li = new XMLElement('li');
     $li->setValue("<a href=\"http://symphony-cms.com/\">Symphony CMS Version <strong>" . Administration::instance()->Configuration->get('version', 'symphony') . "</strong></a>");
     $ul->prependChild($li);
 }
开发者ID:nils-werner,项目名称:version_info,代码行数:7,代码来源:extension.driver.php


示例20: getXPath

 public function getXPath($entry)
 {
     $entry_xml = new XMLElement('entry');
     $section_id = $entry->_fields['section_id'];
     $data = $entry->getData();
     $fields = array();
     $entry_xml->setAttribute('id', $entry->get('id'));
     $associated = $entry->fetchAllAssociatedEntryCounts();
     if (is_array($associated) and !empty($associated)) {
         foreach ($associated as $section => $count) {
             $handle = $this->_Parent->Database->fetchVar('handle', 0, "\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\ts.handle\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t`tbl_sections` AS s\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\ts.id = '{$section}'\n\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t");
             $entry_xml->setAttribute($handle, (string) $count);
         }
     }
     // Add fields:
     foreach ($data as $field_id => $values) {
         if (empty($field_id)) {
             continue;
         }
         $field =& $entry->_Parent->fieldManager->fetch($field_id);
         $field->appendFormattedElement($entry_xml, $values, false);
     }
     $xml = new XMLElement('data');
     $xml->appendChild($entry_xml);
     $dom = new DOMDocument();
     $dom->loadXML($xml->generate(true));
     return new DOMXPath($dom);
 }
开发者ID:bauhouse,项目名称:sym-spectrum-members,代码行数:28,代码来源:extension.driver.php



注:本文中的XMLElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XMLParser类代码示例发布时间:2022-05-23
下一篇:
PHP XMLDBTable类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap