Example #1
0
 /**
  * Export item list to xml
  *
  * @access public
  */
 function toXML($mapKeysToText = false)
 {
     $this->_excluded = array_merge($this->_excluded, array('sectionid', 'mask', 'title_alias'));
     $this->_aliases['featured'] = 'SELECT IFNULL(f.ordering,0) FROM #__content_frontpage f RIGHT JOIN #__content a ON f.content_id = a.id WHERE a.id = ' . (int) $this->id;
     $this->_aliases['rating_sum'] = 'SELECT IFNULL(rating_sum,0) FROM #__content_rating f RIGHT JOIN #__content a ON f.content_id = a.id WHERE a.id = ' . (int) $this->id;
     $this->_aliases['rating_count'] = 'SELECT IFNULL(rating_count,0) FROM #__content_rating f RIGHT JOIN #__content a ON f.content_id = a.id WHERE a.id = ' . (int) $this->id;
     /*
     		$this->_aliases['source']='
     				SELECT CONCAT(\'index.php?option=com_content&view=article&id=\',a.id,\':\',a.alias,\'&catid=\',a.catid,\':\',c.alias,
     				IF(m.id, CONCAT(\'&Itemid=\',m.id), \'\'))
     				FROM #__content a 
     				INNER JOIN #__categories c ON a.catid = c.id 
     				LEFT JOIN #__menu m ON m.link = CONCAT(\'index.php?option=com_content&view=article&id=\',a.id)
     				WHERE a.id = '.(int)$this->id.'
     				UNION
     				SELECT CONCAT(\'index.php?option=com_content&view=article&id=\',a.id,\':\',a.alias,\'&catid=\',a.catid,\':\',c.alias,\'\')
     				FROM #__content a 
     				INNER JOIN #__categories c ON a.catid = c.id 
     				LEFT JOIN #__menu m ON m.link = CONCAT(\'index.php?option=com_content&view=article&id=\',a.id)
     				WHERE a.id = '.(int)$this->id;
     */
     if (class_exists('JPlatform') && version_compare(JPlatform::RELEASE, '12', 'ge')) {
         $this->_aliases['tag'] = 'SELECT t.path FROM #__tags t, #__contentitem_tag_map m WHERE type_alias = "com_content.article" AND t.id = m.tag_id AND m.content_item_id = ' . (int) $this->id;
     }
     return parent::_serialize();
 }
 /**
  * Export item list to xml
  *
  * @access public
  */
 function toXML($mapKeysToText = false)
 {
     JLog::add(new JLogEntry(__METHOD__, JLOG::DEBUG, 'lib_j2xml'));
     $this->_excluded = array_merge($this->_excluded, array('rules'));
     $this->_aliases['rule'] = 'SELECT g.title FROM #__j2xml_usergroups g WHERE g.id IN ' . str_replace(array("[", "]"), array("(", ")"), $this->rules);
     return parent::_serialize();
 }
Example #3
0
 /**
  * Export item list to xml
  *
  * @access public
  * @since 15.9.261
  */
 function toXML($mapKeysToText = false)
 {
     if (class_exists('JPlatform') && version_compare(JPlatform::RELEASE, '12', 'ge')) {
         $this->_aliases['tag'] = 'SELECT t.path FROM #__tags t, #__contentitem_tag_map m WHERE type_alias = "com_weblinks.weblink" AND t.id = m.tag_id AND m.content_item_id = ' . (int) $this->id;
     }
     return parent::_serialize();
 }
 /**
  * Export item list to xml
  *
  * @access public
  */
 function toXML($mapKeysToText = false)
 {
     $this->_excluded = array_merge($this->_excluded, array('filename_sys'));
     $this->_aliases['parent_id'] = 'SELECT CONCAT(cc.path,\'/\',c.alias) FROM #__content c LEFT JOIN #__categories cc ON c.catid = cc.id WHERE c.id = ' . (int) $this->parent_id;
     if ($this->uri_type == 'file') {
         $this->_excluded = array_merge($this->_excluded, array('url'));
         $this->_aliases['file'] = 'SELECT \'' . base64_encode(file_get_contents($this->filename_sys)) . '\' FROM DUAL';
     }
     return parent::_serialize();
 }
Example #5
0
 /**
  * Export item list to xml
  *
  * @access public
  */
 function toXML($mapKeysToText = false)
 {
     // Initialise variables.
     $xml = array();
     // Open root node.
     $xml[] = '<content>';
     $xml[] = parent::_serialize(array('asset_id', 'sectionid', 'mask', 'checked_out', 'checked_out_time', 'parentid', 'title_alias'), array('catid' => 'SELECT path FROM #__categories WHERE id = ' . (int) $this->catid, 'created_by' => 'SELECT username FROM #__users WHERE id = ' . (int) $this->created_by, 'modified_by' => 'SELECT username modified_by FROM #__users WHERE id = ' . (int) $this->modified_by, 'featured' => 'SELECT IFNULL(f.ordering,0) FROM #__content_frontpage f RIGHT JOIN #__content a ON f.content_id = a.id WHERE a.id = ' . (int) $this->id, 'rating_sum' => 'SELECT IFNULL(rating_sum,0) FROM #__content_rating f RIGHT JOIN #__content a ON f.content_id = a.id WHERE a.id = ' . (int) $this->id, 'rating_count' => 'SELECT IFNULL(rating_count,0) FROM #__content_rating f RIGHT JOIN #__content a ON f.content_id = a.id WHERE a.id = ' . (int) $this->id), array());
     // Close root node.
     $xml[] = '</content>';
     // Return the XML array imploded over new lines.
     return implode("\n", $xml);
 }
Example #6
0
 /**
  * Export item list to xml
  *
  * @access public
  */
 function toXML($mapKeysToText = false)
 {
     // Initialise variables.
     $xml = array();
     // Open root node.
     $xml[] = '<weblink>';
     $xml[] = parent::_serialize(array('checked_out', 'checked_out_time'), array('catid' => 'SELECT path FROM #__categories WHERE id = ' . (int) $this->catid, 'created_by' => 'SELECT username FROM #__users WHERE id = ' . (int) $this->created_by, 'modified_by' => 'SELECT username modified_by FROM #__users WHERE id = ' . (int) $this->modified_by), array());
     // Close root node.
     $xml[] = '</weblink>';
     // Return the XML array imploded over new lines.
     return implode("\n", $xml);
 }
Example #7
0
 /**
  * Export item list to xml
  *
  * @access public
  */
 function toXML($mapKeysToText = false)
 {
     $xml = '';
     // Initialise variables.
     $xml = array();
     // Open root node.
     $xml[] = '<user>';
     $xml[] = parent::_serialize(null, array('group' => 'SELECT g.title FROM #__j2xml_usergroups g, #__user_usergroup_map m WHERE g.id = m.group_id AND m.user_id = ' . (int) $this->id));
     // $excluded,$aliases,$jsons
     // Close root node.
     $xml[] = '</user>';
     // Return the XML array imploded over new lines.
     return implode("\n", $xml);
 }
Example #8
0
 /**
  * Export item list to xml
  *
  * @access public
  */
 function toXML($mapKeysToText = false)
 {
     $xml = '';
     $renamed = array('created_user_id' => 'SELECT username created_by FROM #__users WHERE id = ' . (int) $this->created_user_id, 'modified_user_id' => 'SELECT username modified_by FROM #__users WHERE id = ' . (int) $this->modified_user_id);
     // Initialise variables.
     $xml = array();
     // Open root node.
     $xml[] = '<category>';
     $xml[] = parent::_serialize(array('asset_id', 'parent_id', 'lft', 'rgt', 'level', 'checked_out', 'checked_out_time'), array('created_user_id' => 'SELECT username created_by FROM #__users WHERE id = ' . (int) $this->created_user_id, 'modified_user_id' => 'SELECT username modified_by FROM #__users WHERE id = ' . (int) $this->modified_user_id), array());
     // Close root node.
     $xml[] = '</category>';
     // Return the XML array imploded over new lines.
     return implode("\n", $xml);
 }
Example #9
0
 /**
  * @param database A database connector object
  */
 function __construct(&$db)
 {
     parent::__construct('#__categories', 'id', $db);
 }
Example #10
0
 /**
  * Constructor
  *
  * @param object Database connector object
  */
 function __construct(&$db)
 {
     parent::__construct('#__tags', 'id', $db);
 }
Example #11
0
 /**
  * Export item list to xml
  *
  * @access public
  */
 function toXML($mapKeysToText = false)
 {
     $this->_aliases['group'] = 'SELECT g.title FROM #__j2xml_usergroups g, #__user_usergroup_map m WHERE g.id = m.group_id AND m.user_id = ' . (int) $this->id;
     return parent::_serialize();
 }