Ejemplo n.º 1
0
 public function __construct($db, $settings, $page)
 {
     parent::__construct($db);
     $this->settings = $settings;
     $this->page = $page;
     if ($this->page->ajax_request) {
         $this->mode = "xml";
         $this->add_layout_data = false;
     } else {
         if (isset($_GET["output"])) {
             if (($this->mode = $_GET["output"]) == "raw") {
                 $this->mode = "xml";
             } else {
                 $this->add_layout_data = false;
             }
         }
     }
     $this->language = $this->settings->default_language;
     $this->description = $this->settings->head_description;
     $this->set_layout();
     /* Mobile devices
      */
     $mobiles = array("iPhone", "Android");
     foreach ($mobiles as $mobile) {
         if (strpos($_SERVER["HTTP_USER_AGENT"], $mobile) !== false) {
             $this->mobile = true;
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Instantiates an RSS Encoder.
  * 
  * @param array 	$channelElements 	An assosiative array of channel elements. Per RSS
  *                                	 	specification: title, link, and description are
  *                                	 	required. "element" => "value"
  * @param array 	$itemElements    	An array of elements to include in each data item;
  *                                 		for example, title, link, author, etc...
  * @param array 	$data            	An array of items in the feed
  * @param array  	$dataMap         	An associative array mapping fields in the items
  *                                  	passed $data array to RSS-specific fields.
  *                                  	"UserField" => "RSSField"
  *                                  	For example:
  *                                  	$dataMap = array(
  *                                  		"published" => "pubDate",
  *                                  		"body" => "description"
  *                                  	);
  */
 public function __construct($channelElements, $itemElements, $data, $dataMap = array())
 {
     parent::__construct($data);
     $this->channelElements = $channelElements;
     $this->itemElements = $itemElements;
     $this->dataMap = $dataMap;
     $this->setupFeed();
 }
Ejemplo n.º 3
0
 public function __construct($name, $url, $title, $img, $author)
 {
     $this->url = $url;
     $this->title = $title;
     $this->img = $img;
     $this->author = $author;
     $date = new \DateTime();
     $this->date = $date->format('Y-m-d\\TH:i:s\\Z');
     $this->initEntries();
     parent::__construct($name, 'xml version="1.0" encoding="utf-8"');
 }
 /**
  * Class constructor initiates parent class and sends all the
  * required parameters to the parent
  */
 public function __construct()
 {
     parent::__construct(Configuration::getXMLPath() . $this->xml_file);
 }