当前位置: 首页>>代码示例>>PHP>>正文


PHP XenForo_Helper_DevelopmentXml::createDomCdataSection方法代码示例

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


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

示例1: renderXml

 public function renderXml()
 {
     $system =& $this->_params['system'];
     $widgets =& $this->_params['widgets'];
     $document = new DOMDocument('1.0', 'utf-8');
     $document->formatOutput = true;
     $rootNode = $document->createElement('widget_framework');
     $rootNode->setAttribute('version', $system['version_string']);
     $document->appendChild($rootNode);
     foreach ($widgets as $widget) {
         $widgetNode = $document->createElement('widget');
         $widgetNode->setAttribute('title', $widget['title']);
         $widgetNode->setAttribute('class', $widget['class']);
         $optionsNode = $document->createElement('options');
         $optionsString = $widget['options'];
         if (!is_string($optionsString)) {
             $optionsString = serialize($optionsString);
         }
         $optionsData = XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $optionsString);
         $optionsNode->appendChild($optionsData);
         $widgetNode->appendChild($optionsNode);
         $widgetNode->setAttribute('position', $widget['position']);
         $widgetNode->setAttribute('display_order', $widget['display_order']);
         $widgetNode->setAttribute('active', $widget['active']);
         $rootNode->appendChild($widgetNode);
     }
     $this->setDownloadFileName('widget_framework-widgets-' . XenForo_Template_Helper_Core::date(XenForo_Application::$time, 'YmdHi') . '.xml');
     return $document->saveXml();
 }
开发者ID:maitandat1507,项目名称:bdWidgetFramework,代码行数:29,代码来源:Export.php

示例2: appendAdminTemplatesXml

 public function appendAdminTemplatesXml(DOMElement $rootNode, $blockId)
 {
     $document = $rootNode->ownerDocument;
     $adminTemplates = $this->getAdminTemplatesByBlock($blockId);
     foreach ($adminTemplates as $template) {
         $templateNode = $document->createElement('template');
         $templateNode->setAttribute('title', $template['title']);
         $templateNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $template['template']));
         $rootNode->appendChild($templateNode);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:11,代码来源:Templates.php

示例3: _appendContentModeratorXml

 /**
  * @param DOMElement $rootNode
  * @param array $moderator
  */
 protected function _appendContentModeratorXml(DOMElement $rootNode, $moderator)
 {
     $document = $rootNode->ownerDocument;
     $rootNode->setAttribute('content_id', $moderator['content_id']);
     $rootNode->setAttribute('content_type', $moderator['content_type']);
     $rootNode->setAttribute('username', $moderator['username']);
     $rootNode->setAttribute('user_id', $moderator['user_id']);
     $permissionsNode = $document->createElement('moderator_permissions');
     $rootNode->appendChild($permissionsNode);
     $permissionsNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $moderator['moderator_permissions']));
 }
开发者ID:ThemeHouse-XF,项目名称:Moderatorsa,代码行数:15,代码来源:Moderator.php

示例4: appendAdminTemplatesFieldXml

 /**
  * Appends the admin template XML for admin templates in the specified
  * custom field.
  *
  * @param DOMElement $rootNode
  * @param array $field
  */
 public function appendAdminTemplatesFieldXml(DOMElement $rootNode, array $field)
 {
     $document = $rootNode->ownerDocument;
     $titles = array();
     if ($field['export_callback_class'] && $field['export_callback_method']) {
         $error = '';
         $exportInfo = call_user_func_array(array($field['export_callback_class'], $field['export_callback_method']), array($field, &$error));
         $titles = $exportInfo['admin_templates'];
     }
     if (!empty($titles)) {
         $templates = $this->_getAdminTemplateModel()->getAdminTemplatesByTitles($titles);
         foreach ($templates as $template) {
             $templateNode = $document->createElement('template');
             $templateNode->setAttribute('title', $template['title']);
             $templateNode->setAttribute('addon_id', $template['addon_id']);
             $templateNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $template['template']));
             $rootNode->appendChild($templateNode);
         }
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:27,代码来源:AdminTemplate.php

示例5: _appendSmilieXml

 /**
  * @param DOMElement $rootNode
  * @param array $smilie
  */
 protected function _appendSmilieXml(DOMElement $rootNode, $smilie)
 {
     $document = $rootNode->ownerDocument;
     if ($smilie['sprite_params']) {
         $spriteParams = unserialize($smilie['sprite_params']);
     } else {
         $spriteParams = array('w' => '', 'h' => '', 'x' => '', 'y' => '');
     }
     $rootNode->setAttribute('y', $spriteParams['y']);
     $rootNode->setAttribute('x', $spriteParams['x']);
     $rootNode->setAttribute('h', $spriteParams['h']);
     $rootNode->setAttribute('w', $spriteParams['w']);
     $rootNode->setAttribute('sprite_mode', $smilie['sprite_mode']);
     $titleNode = $document->createElement('title');
     $rootNode->appendChild($titleNode);
     $titleNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $smilie['title']));
     $titleNode = $document->createElement('image_url');
     $rootNode->appendChild($titleNode);
     $titleNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $smilie['image_url']));
     $titleNode = $document->createElement('smilie_text');
     $rootNode->appendChild($titleNode);
     $titleNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $smilie['smilie_text']));
 }
开发者ID:Sywooch,项目名称:forums,代码行数:27,代码来源:Smilie.php

示例6: appendTemplatesStyleXml

 /**
  * Appends the template XML for templates in the specified style.
  *
  * @param DOMElement $rootNode
  * @param integer $styleId
  * @param string|null $limitAddOnId If non-null, limits only to templates in this add-on
  * @param boolean $independent If true, all customizations from parent styles will be included in this
  */
 public function appendTemplatesStyleXml(DOMElement $rootNode, $styleId, $limitAddOnId = null, $independent = false)
 {
     $document = $rootNode->ownerDocument;
     if (!$styleId) {
         // getting master data
         $independent = false;
     }
     if ($independent) {
         $templates = $this->getAllEffectiveTemplatesInStyle($styleId);
     } else {
         $templates = $this->getAllTemplatesInStyle($styleId);
     }
     foreach ($templates as $template) {
         if ($limitAddOnId !== null && $template['addon_id'] !== $limitAddOnId) {
             // wrong add-on
             continue;
         }
         if ($independent && !$template['style_id']) {
             // master version of a template
             continue;
         }
         $templateNode = $document->createElement('template');
         $templateNode->setAttribute('title', $template['title']);
         $templateNode->setAttribute('addon_id', $template['addon_id']);
         $templateNode->setAttribute('version_id', $template['version_id']);
         $templateNode->setAttribute('version_string', $template['version_string']);
         $templateNode->setAttribute('disable_modifications', $template['disable_modifications']);
         $templateNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $template['template']));
         $rootNode->appendChild($templateNode);
     }
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:39,代码来源:Template.php

示例7: appendBbCodeMediaSitesAddOnXml

 /**
  * Appends the add-on BB code media sites XML to a given DOM element.
  *
  * @param DOMElement $rootNode Node to append all elements to
  * @param string $addOnId Add-on ID to be exported
  */
 public function appendBbCodeMediaSitesAddOnXml(DOMElement $rootNode, $addOnId)
 {
     $document = $rootNode->ownerDocument;
     $siteFields = XenForo_DataWriter::create('XenForo_DataWriter_BbCodeMediaSite')->getFieldNames();
     $childTags = array('match_urls', 'embed_html');
     foreach ($this->getBbCodeMediaSitesByAddOnId($addOnId) as $site) {
         $siteNode = $document->createElement('site');
         foreach ($siteFields as $fieldName) {
             if ($fieldName != 'addon_id') {
                 if (in_array($fieldName, $childTags)) {
                     $fieldNode = $document->createElement($fieldName);
                     $fieldNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $site[$fieldName]));
                     $siteNode->appendChild($fieldNode);
                 } else {
                     $siteNode->setAttribute($fieldName, $site[$fieldName]);
                 }
             }
         }
         $rootNode->appendChild($siteNode);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:27,代码来源:BbCode.php

示例8: _getHookXmlNode

 protected function _getHookXmlNode(DOMDocument $document, array $hook)
 {
     $attributes = array('hook_id', 'active');
     $children = array('hook_title', 'template', 'hook_name');
     $hookNode = $document->createElement('hook');
     foreach ($attributes as $attribute) {
         $hookNode->setAttribute($attribute, $hook[$attribute]);
     }
     foreach ($children as $child) {
         $fieldNode = $document->createElement($child);
         $fieldNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $hook[$child]));
         $hookNode->appendChild($fieldNode);
     }
     return $hookNode;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:15,代码来源:Hooks.php

示例9: _appendFieldXml

 /**
  *
  * @param DOMElement $rootCategory
  * @param array $field
  */
 protected function _appendFieldXml(DOMElement $rootCategory, $field)
 {
     $document = $rootCategory->ownerDocument;
     $rootCategory->setAttribute('export_callback_method', $field['export_callback_method']);
     $rootCategory->setAttribute('export_callback_class', $field['export_callback_class']);
     $rootCategory->setAttribute('field_callback_method', $field['field_callback_method']);
     $rootCategory->setAttribute('field_callback_class', $field['field_callback_class']);
     $rootCategory->setAttribute('field_choices_callback_class', $field['field_choices_callback_class']);
     $rootCategory->setAttribute('field_choices_callback_method', $field['field_choices_callback_method']);
     $rootCategory->setAttribute('display_callback_method', $field['display_callback_method']);
     $rootCategory->setAttribute('display_callback_class', $field['display_callback_class']);
     $rootCategory->setAttribute('max_length', $field['max_length']);
     $rootCategory->setAttribute('match_callback_method', $field['match_callback_method']);
     $rootCategory->setAttribute('match_callback_class', $field['match_callback_class']);
     $rootCategory->setAttribute('match_regex', $field['match_regex']);
     $rootCategory->setAttribute('match_type', $field['match_type']);
     $rootCategory->setAttribute('field_type', $field['field_type']);
     $rootCategory->setAttribute('display_order', $field['display_order']);
     $rootCategory->setAttribute('field_id', $field['field_id']);
     $rootCategory->setAttribute('addon_id', $field['addon_id']);
     $titleCategory = $document->createElement('title');
     $rootCategory->appendChild($titleCategory);
     $titleCategory->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, new XenForo_Phrase('resource_field_' . $field['field_id'])));
     $descriptionCategory = $document->createElement('description');
     $rootCategory->appendChild($descriptionCategory);
     $descriptionCategory->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, new XenForo_Phrase('resource_field_' . $field['field_id'] . '_desc')));
     $displayTemplateCategory = $document->createElement('display_template');
     $rootCategory->appendChild($displayTemplateCategory);
     $displayTemplateCategory->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $field['display_template']));
     $fieldChoicesCategory = $document->createElement('field_choices');
     $rootCategory->appendChild($fieldChoicesCategory);
     if ($field['field_choices']) {
         $fieldChoices = unserialize($field['field_choices']);
         foreach ($fieldChoices as $fieldChoiceValue => $fieldChoiceText) {
             $fieldChoiceCategory = $document->createElement('field_choice');
             $fieldChoiceCategory->setAttribute('value', $fieldChoiceValue);
             $fieldChoiceCategory->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $fieldChoiceText));
             $fieldChoicesCategory->appendChild($fieldChoiceCategory);
         }
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:46,代码来源:ResourceField.php

示例10: _appendClassXml

 /**
  * @param DOMElement $rootNode
  * @param array $class
  */
 protected function _appendClassXml(DOMElement $rootNode, $class)
 {
     $document = $rootNode->ownerDocument;
     $rootNode->setAttribute('class_id', $class['class_id']);
     $rootNode->setAttribute('class_id_plural', $class['class_id_plural']);
     $rootNode->setAttribute('route_prefix', $class['route_prefix']);
     $rootNode->setAttribute('route_prefix_admin', $class['route_prefix_admin']);
     $titleNode = $document->createElement('title');
     $rootNode->appendChild($titleNode);
     $titleNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $class['title']));
     $titleNode = $document->createElement('title_plural');
     $rootNode->appendChild($titleNode);
     $titleNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $class['title_plural']));
     $titleNode = $document->createElement('title_full');
     $rootNode->appendChild($titleNode);
     $titleNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $class['title_full']));
     $rootNode->setAttribute('table_name', $class['table_name']);
     //        $rootNode->setAttribute('primary_key_id', $class['primary_key_id']);
 }
开发者ID:ThemeHouse-XF,项目名称:Objects,代码行数:23,代码来源:Class.php

示例11: appendModificationAddOnXml

 /**
  * Appends the add-on template modification XML to a given DOM element.
  *
  * @param DOMElement $rootNode Node to append all prefix elements to
  * @param string $addOnId Add-on ID to be exported
  */
 public function appendModificationAddOnXml(DOMElement $rootNode, $addOnId)
 {
     $modifications = $this->getModificationsByAddOnId($addOnId);
     $document = $rootNode->ownerDocument;
     foreach ($modifications as $modification) {
         $modNode = $document->createElement('modification');
         $modNode->setAttribute('template', $modification['template']);
         $modNode->setAttribute('modification_key', $modification['modification_key']);
         $modNode->setAttribute('description', $modification['description']);
         $modNode->setAttribute('execution_order', $modification['execution_order']);
         $modNode->setAttribute('enabled', $modification['enabled']);
         $modNode->setAttribute('action', $modification['action']);
         $findNode = $document->createElement('find');
         $findNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $modification['find']));
         $modNode->appendChild($findNode);
         $replaceNode = $document->createElement('replace');
         $replaceNode->appendChild(XenForo_Helper_DevelopmentXml::createDomCdataSection($document, $modification['replace']));
         $modNode->appendChild($replaceNode);
         $this->_modifyAddOnXmlNode($modNode, $modification);
         $rootNode->appendChild($modNode);
     }
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:28,代码来源:TemplateModificationAbstract.php


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