Beispiel #1
0
	/**
	 * Render the document.
	 *
	 * @param   boolean  $cache   If true, cache the output
	 * @param   array    $params  Associative array of attributes
	 *
	 * @return  The rendered data
	 *
	 * @since   12.1
	 */
	public function render($cache = false, $params = array())
	{
		// Get the image type
		$type = JFactory::getApplication()->input->get('type', 'png');

		switch ($type)
		{
			case 'jpg':
			case 'jpeg':
				$this->_mime = 'image/jpeg';
				break;
			case 'gif':
				$this->_mime = 'image/gif';
				break;
			case 'png':
			default:
				$this->_mime = 'image/png';
				break;
		}

		$this->_charset = null;

		parent::render();

		return $this->getBuffer();
	}
Beispiel #2
0
    /**
     * Render the document.
     *
     * @access public
     * @param boolean 	$cache		If true, cache the output
     * @param array		$params		Associative array of attributes
     * @return 	The rendered data
     */
    function render($cache = false, $params = array())
    {
        // Instantiate feed renderer and set the mime encoding
        require_once dirname(__FILE__) . DS . 'renderer' . DS . 'xml.php';
        $renderer =& $this->loadRenderer('xml');
        if (!is_a($renderer, 'JDocumentRenderer')) {
            JError::raiseError(404, JText::_('Resource Not Found'));
        }
        $url = 'http://demo.fabrikar.com/index.php?option=com_fabrik&view=table&tableid=' . $this->tableid . '&format=raw&type=xml';
        $url = htmlspecialchars($url, ENT_COMPAT, 'UTF-8');
        $data = '<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
  <meta>
    <author>' . htmlspecialchars($this->author, ENT_COMPAT, 'UTF-8') . '</author>
    <documentationURL>None</documentationURL>
    <description>' . htmlspecialchars($this->description, ENT_COMPAT, 'UTF-8') . '</description>
    <sampleQuery>SELECT * FROM {table} WHERE jos_fabrik_calendar_events___visualization_id_raw="0"</sampleQuery>
  </meta>

  <bindings>
    <select itemPath="root.row" produces="XML">
      <urls>
        <url>' . $url . '</url>
      </urls>
    </select>
  </bindings>
</table>';
        // Render the feed
        //$data .= $renderer->render();
        parent::render();
        return $data;
    }
Beispiel #3
0
 /**
  * Render the document
  *
  * @param   boolean  $cache		If true, cache the output
  * @param   array    $params		Associative array of attributes
  */
 public function render($cache = false, $params = array())
 {
     // If no error object is set return null
     if (!isset($this->_error)) {
         return;
     }
     //Set the status header
     JResponse::setHeader('status', $this->_error->getCode() . ' ' . str_replace("\n", ' ', $this->_error->getMessage()));
     $file = 'error.php';
     // check template
     $directory = isset($params['directory']) ? $params['directory'] : 'templates';
     $template = isset($params['template']) ? JFilterInput::getInstance()->clean($params['template'], 'cmd') : 'system';
     if (!file_exists($directory . DS . $template . DS . $file)) {
         $template = 'system';
     }
     //set variables
     $this->baseurl = JURI::base(true);
     $this->template = $template;
     $this->debug = isset($params['debug']) ? $params['debug'] : false;
     $this->error = $this->_error;
     // load
     $data = $this->_loadTemplate($directory . DS . $template, $file);
     parent::render();
     return $data;
 }
Beispiel #4
0
 /**
  * @todo Implement testRender().
  */
 public function testRender()
 {
     $this->object = new JDocument();
     $this->object->render();
     $headers = JResponse::getHeaders();
     $lastMod = false;
     $contentType = false;
     foreach ($headers as $header) {
         if ($header['name'] == 'Last-Modified') {
             $lastMod = $header;
         }
         if ($header['name'] == 'Content-Type') {
             $contentType = $header;
         }
     }
     $this->assertThat($lastMod, $this->equalTo(false));
     $this->assertThat($contentType['value'], $this->equalTo('; charset=utf-8'));
     $this->object->setModifiedDate('My date');
     $this->object->setMimeEncoding('MyMimeType');
     $this->object->setCharset('MyCharset');
     $this->object->render();
     $headers = JResponse::getHeaders();
     $lastMod = false;
     $contentType = false;
     foreach ($headers as $header) {
         if ($header['name'] == 'Last-Modified') {
             $lastMod = $header;
         }
         if ($header['name'] == 'Content-Type') {
             $contentType = $header;
         }
     }
     $this->assertThat($lastMod['value'], $this->equalTo('My date'));
     $this->assertThat($contentType['value'], $this->equalTo('mymimetype; charset=MyCharset'));
 }
Beispiel #5
0
 /**
  * Render the document.
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  The rendered data
  *
  * @since  3.1
  */
 public function render($cache = false, $params = array())
 {
     JResponse::allowCache($cache);
     JResponse::setHeader('Content-disposition', 'attachment; filename="' . $this->getName() . '.json"', true);
     // Unfortunately, the exact syntax of the Content-Type header
     // is not defined, so we have to try to be a bit clever here.
     $contentType = $this->_mime;
     if (stripos($contentType, 'json') === false) {
         $contentType .= '+' . $this->_type;
     }
     $this->_mime = $contentType;
     parent::render();
     // Get the HAL object from the buffer.
     $hal = $this->getBuffer();
     // If required, change relative links to absolute.
     if ($this->absoluteHrefs && is_object($hal) && isset($hal->_links)) {
         // Adjust hrefs in the _links object.
         $this->relToAbs($hal->_links);
         // Adjust hrefs in the _embedded object (if there is one).
         if (isset($hal->_embedded)) {
             foreach ($hal->_embedded as $rel => $resources) {
                 foreach ($resources as $id => $resource) {
                     if (isset($resource->_links)) {
                         $this->relToAbs($resource->_links);
                     }
                 }
             }
         }
     }
     // Return it as a JSON string.
     return json_encode($hal);
 }
Beispiel #6
0
 /**
  * Render the document.
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  The rendered data
  *
  * @since  11.1
  */
 public function render($cache = false, $params = array())
 {
     JResponse::allowCache(false);
     JResponse::setHeader('Content-disposition', 'attachment; filename="' . $this->getName() . '.json"', true);
     parent::render();
     return $this->getBuffer();
 }
Beispiel #7
0
	/**
	 * Render the document.
	 *
	 * @param   boolean  $cache   If true, cache the output
	 * @param   array    $params  Associative array of attributes
	 *
	 * @return  The rendered data
	 *
	 * @since  11.1
	 */
	public function render($cache = false, $params = array())
	{
		parent::render();
		JResponse::setHeader('Content-disposition', 'inline; filename="' . $this->getName() . '.xml"', true);

		return $this->getBuffer();
	}
Beispiel #8
0
 /**
  * Render the document.
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  The rendered data
  *
  * @since  11.1
  */
 public function render($cache = false, $params = array())
 {
     $app = JFactory::getApplication();
     $app->allowCache(false);
     $app->setHeader('Content-disposition', 'attachment; filename="' . $this->getName() . '.json"', true);
     parent::render();
     return $this->getBuffer();
 }
Beispiel #9
0
 /**
  * Render the document.
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  The rendered data
  *
  * @since  11.1
  */
 public function render($cache = false, $params = array())
 {
     $app = JFactory::getApplication();
     $app->allowCache(false);
     if ($this->_mime == 'application/json') {
         // Browser other than Internet Explorer < 10
         $app->setHeader('Content-Disposition', 'attachment; filename="' . $this->getName() . '.json"', true);
     }
     parent::render();
     return $this->getBuffer();
 }
Beispiel #10
0
 /**
  * Render the document.
  *
  * @access public
  * @param boolean 	$cache		If true, cache the output
  * @param array		$params		Associative array of attributes
  * @return 	The rendered data
  */
 function render($cache = false, $params = array())
 {
     // Instantiate feed renderer and set the mime encoding
     require_once dirname(__FILE__) . DS . 'renderer' . DS . 'xml.php';
     $renderer =& $this->loadRenderer('xml');
     if (!is_a($renderer, 'JDocumentRenderer')) {
         JError::raiseError(404, JText::_('Resource Not Found'));
     }
     $data = '';
     // Render the feed
     $data .= $renderer->render();
     parent::render();
     return $data;
 }
Beispiel #11
0
 /**
  * Render the document
  *
  * @access public
  * @param boolean 	$cache		If true, cache the output
  * @param array		$params		Associative array of attributes
  * @return 	The rendered data
  */
 function render($cache = false, $params = array())
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     $option = $input->get('option');
     // Get the feed type
     $type = $input->get('type', 'rss');
     /*
      * Cache TODO In later release
      */
     $cache = 0;
     $cache_time = 3600;
     $cache_path = JPATH_BASE . '/cache';
     // Set filename for rss feeds
     $file = strtolower(str_replace('.', '', $type));
     $file = $cache_path . '/' . $file . '_' . $option . '.xml';
     // Instantiate feed renderer and set the mime encoding
     $renderer =& $this->loadRenderer($type ? $type : 'rss');
     if (!is_a($renderer, 'JDocumentRenderer')) {
         throw new RuntimeException('Resource Not Found', 404);
     }
     $this->setMimeEncoding($renderer->getContentType());
     // Generate prolog
     $data = "<?xml version=\"1.0\" encoding=\"" . $this->_charset . "\"?>\n";
     $data .= "<!-- generator=\"" . $this->getGenerator() . "\" -->\n";
     // Generate stylesheet links
     foreach ($this->_styleSheets as $src => $attr) {
         $data .= "<?xml-stylesheet href=\"{$src}\" type=\"" . $attr['mime'] . "\"?>\n";
     }
     // Render the feed
     $data .= $renderer->render();
     parent::render();
     return $data;
 }
Beispiel #12
0
 /**
  * Render the document.
  *
  * @access public
  * @param boolean 	$cache		If true, cache the output
  * @param array		$params		Associative array of attributes
  * @return 	The rendered data
  */
 function render($cache = false, $params = array())
 {
     $pdf =& $this->_engine;
     // Set PDF Metadata
     $pdf->SetCreator($this->getGenerator());
     $pdf->SetTitle($this->getTitle());
     $pdf->SetSubject($this->getDescription());
     $pdf->SetKeywords($this->getMetaData('keywords'));
     // Set PDF Header data
     $pdf->setHeaderData('', 0, $this->getTitle(), $this->getHeader());
     // Set PDF Header and Footer fonts
     $lang =& JFactory::getLanguage();
     $font = $lang->getPdfFontName();
     $font = $font ? $font : 'freesans';
     $pdf->setRTL($lang->isRTL());
     $pdf->setHeaderFont(array($font, '', 10));
     $pdf->setFooterFont(array($font, '', 8));
     // Initialize PDF Document
     $pdf->AliasNbPages();
     $pdf->AddPage();
     // Build the PDF Document string from the document buffer
     $this->fixLinks();
     $pdf->WriteHTML($this->getBuffer(), true);
     $data = $pdf->Output('', 'S');
     // Set document type headers
     parent::render();
     //JResponse::setHeader('Content-Length', strlen($data), true);
     JResponse::setHeader('Content-disposition', 'inline; filename="' . $this->getName() . '.pdf"', true);
     //Close and output PDF document
     return $data;
 }
Beispiel #13
0
 /**
  * Render the document
  *
  * @access public
  * @param boolean 	$cache		If true, cache the output
  * @param array		$params		Associative array of attributes
  * @return 	The rendered data
  */
 function render($cache = false, $params = array())
 {
     global $option;
     // Get the feed type
     $type = JRequest::getCmd('type', 'rss');
     /*
      * Cache TODO In later release
      */
     $cache = 0;
     $cache_time = 3600;
     $cache_path = JPATH_BASE . DS . 'cache';
     // set filename for rss feeds
     $file = strtolower(str_replace('.', '', $type));
     $file = $cache_path . DS . $file . '_' . $option . '.xml';
     // Instantiate feed renderer and set the mime encoding
     $renderer =& $this->loadRenderer($type ? $type : 'rss');
     if (!is_a($renderer, 'JDocumentRenderer')) {
         JError::raiseError(404, JText::_('Resource Not Found'));
     }
     $this->setMimeEncoding($renderer->getContentType());
     //output
     // Generate prolog
     $data = "<?xml version=\"1.0\" encoding=\"" . $this->_charset . "\"?>\n";
     $data .= "<!-- generator=\"" . $this->getGenerator() . "\" -->\n";
     // Generate stylesheet links
     foreach ($this->_styleSheets as $src => $attr) {
         $data .= "<?xml-stylesheet href=\"{$src}\" type=\"" . $attr['mime'] . "\"?>\n";
     }
     // Render the feed
     $data .= $renderer->render();
     parent::render();
     return $data;
 }
Beispiel #14
0
 /**
  * Outputs the template to the browser.
  *
  * @access public
  * @param boolean 	$cache		If true, cache the output
  * @param array		$params		Associative array of attributes
  * @return 	The rendered data
  */
 function render($caching = false, $params = array())
 {
     // check
     $directory = isset($params['directory']) ? $params['directory'] : 'templates';
     $template = JFilterInput::clean($params['template'], 'cmd');
     $file = JFilterInput::clean($params['file'], 'cmd');
     if (!file_exists($directory . DS . $template . DS . $file)) {
         $template = 'system';
     }
     // Parse the template INI file if it exists for parameters and insert
     // them into the template.
     if (is_readable($directory . DS . $template . DS . 'params.ini')) {
         $content = file_get_contents($directory . DS . $template . DS . 'params.ini');
         $params = new JParameter($content);
     }
     // Load the language file for the template
     $lang =& JFactory::getLanguage();
     $lang->load('tpl_' . $template);
     // Assign the variables
     $this->template = $template;
     $this->baseurl = JURI::base(true);
     $this->params = $params;
     // load
     $data = $this->_loadTemplate($directory . DS . $template, $file);
     // parse
     $data = $this->_parseTemplate($data);
     //output
     parent::render();
     return $data;
 }
Beispiel #15
0
 /**
  * Outputs the template to the browser.
  *
  * @param   boolean  $caching  If true, cache the output
  * @param   array    $params   Associative array of attributes
  *
  * @return  The rendered data
  *
  * @since   11.1
  */
 public function render($caching = false, $params = array())
 {
     $this->_caching = $caching;
     if (!empty($this->_template)) {
         $data = $this->_renderTemplate();
     } else {
         $this->parse($params);
         $data = $this->_renderTemplate();
     }
     parent::render();
     return $data;
 }
 /**
  * Render the document.
  *
  * @access public
  * @param boolean 	$cache		If true, cache the output
  * @param array		$params		Associative array of attributes
  * @return 	The rendered data
  */
 function render($cache = false, $params = array())
 {
     $pdf =& $this->_engine;
     $config =& JFactory::getConfig();
     $site = $config->get('config.sitename');
     $lang = JFactory::getLanguage();
     // parse PDF document Metadata
     // most pdf use same function.
     // if function not exist add it to the renderer engine file to set yourself the basic functions if needed.
     $this->Set('Creator', $this->getGenerator());
     $this->Set('Author', $this->getGenerator());
     $this->Set('Title', $this->getTitle());
     $this->Set('Subject', $this->getDescription());
     $this->Set('Keywords', $this->getMetaData('keywords'));
     $this->Set('RTL', $lang->isRTL());
     // echo $this->getPath().' '.$this->_pdfFilepath; jexit();
     // Benchmark render engine
     // $this->rendertime = microtime(true); // Gets microseconds
     // $this->_destination = "F";
     $data = $pdf->render($this->getPath(), $this->_destination, $this->getBuffer());
     // test mode to get real html
     // echo filesize($this->getPath()) . ' bytes</br>';
     // echo "Time Elapsed: ".(microtime(true) - $this->rendertime)."s Engine : ".$this->engineName." ";
     if (JRequest::getInt('print', null) == 2) {
         return $data;
     }
     // case of no browser render, work is done ;
     if ($this->_destination === 'F') {
         return $this->_pdfFilepath;
     }
     // Set document type headers
     parent::render();
     //JResponse::setHeader('Content-Length', strlen($data), true);
     JResponse::setHeader('Content-type', 'application/pdf', true);
     if ($this->_destination === 'D') {
         JResponse::setHeader('Content-disposition', 'attachment; filename="' . $this->getName() . '.pdf"', true);
     } else {
         JResponse::setHeader('Content-disposition', 'inline; filename="' . $this->getName() . '.pdf"', true);
     }
     //Close and output PDF document
     return $data;
 }
Beispiel #17
0
 /**
  * Render the document
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  The rendered data
  *
  * @since  11.1
  * @todo   Make this cacheable
  */
 public function render($cache = false, $params = array())
 {
     global $option;
     // Get the feed type
     $type = JRequest::getCmd('type', 'rss');
     // Instantiate feed renderer and set the mime encoding
     $renderer = $this->loadRenderer($type ? $type : 'rss');
     if (!is_a($renderer, 'JDocumentRenderer')) {
         JError::raiseError(404, JText::_('JGLOBAL_RESOURCE_NOT_FOUND'));
     }
     $this->setMimeEncoding($renderer->getContentType());
     // Output
     // Generate prolog
     $data = "<?xml version=\"1.0\" encoding=\"" . $this->_charset . "\"?>\n";
     $data .= "<!-- generator=\"" . $this->getGenerator() . "\" -->\n";
     // Generate stylesheet links
     foreach ($this->_styleSheets as $src => $attr) {
         $data .= "<?xml-stylesheet href=\"{$src}\" type=\"" . $attr['mime'] . "\"?>\n";
     }
     // Render the feed
     $data .= $renderer->render();
     parent::render();
     return $data;
 }
Beispiel #18
0
 /**
  * Render the document
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  string   The rendered data
  *
  * @since   11.1
  */
 public function render($cache = false, $params = array())
 {
     // If no error object is set return null
     if (!isset($this->_error)) {
         return;
     }
     // Set the status header
     $status = $this->_error->getCode();
     if ($status < 400 || $status > 599) {
         $status = 500;
     }
     JFactory::getApplication()->setHeader('status', $status . ' ' . str_replace("\n", ' ', $this->_error->getMessage()));
     $file = 'error.php';
     // Check template
     $directory = isset($params['directory']) ? $params['directory'] : 'templates';
     $template = isset($params['template']) ? JFilterInput::getInstance()->clean($params['template'], 'cmd') : 'system';
     if (!file_exists($directory . '/' . $template . '/' . $file)) {
         $template = 'system';
     }
     // Set variables
     $this->baseurl = JUri::base(true);
     $this->template = $template;
     $this->debug = isset($params['debug']) ? $params['debug'] : false;
     $this->error = $this->_error;
     // Load the language file for the template if able
     if (JFactory::$language) {
         $lang = JFactory::getLanguage();
         // 1.5 or core then 1.6
         $lang->load('tpl_' . $template, JPATH_BASE, null, false, true) || $lang->load('tpl_' . $template, $directory . '/' . $template, null, false, true);
     }
     // Load
     $data = $this->_loadTemplate($directory . '/' . $template, $file);
     parent::render();
     return $data;
 }
Beispiel #19
0
 /**
  * Render the document
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  The rendered data
  *
  * @since   11.1
  * @throws  Exception
  * @todo    Make this cacheable
  */
 public function render($cache = false, $params = array())
 {
     // Get the feed type
     $type = JFactory::getApplication()->input->get('type', 'rss');
     // Instantiate feed renderer and set the mime encoding
     $renderer = $this->loadRenderer($type ? $type : 'rss');
     if (!$renderer instanceof JDocumentRenderer) {
         throw new Exception(JText::_('JGLOBAL_RESOURCE_NOT_FOUND'), 404);
     }
     $this->setMimeEncoding($renderer->getContentType());
     // Output
     // Generate prolog
     $data = "<?xml version=\"1.0\" encoding=\"" . $this->_charset . "\"?>\n";
     $data .= "<!-- generator=\"" . $this->getGenerator() . "\" -->\n";
     // Generate stylesheet links
     foreach ($this->_styleSheets as $src => $attr) {
         $data .= "<?xml-stylesheet href=\"{$src}\" type=\"" . $attr['mime'] . "\"?>\n";
     }
     // Render the feed
     $data .= $renderer->render();
     parent::render();
     return $data;
 }
 /**
  * Render the document
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  string   The rendered data
  *
  * @since   11.1
  */
 public function render($cache = false, $params = array())
 {
     // If no error object is set return null
     if (isset($this->_error)) {
         $code = $this->_error->getCode();
         if (!isset(JHttpResponse::$status_messages[$code])) {
             $code = '500';
         }
         if (ini_get('display_errors')) {
             $message = $this->_error->getMessage();
         } else {
             $message = JHttpResponse::$status_messages[$code];
         }
         // Set the status header
         JFactory::getApplication()->setHeader('status', $code . ' ' . str_replace("\n", ' ', $message));
         $file = 'error.php';
         // Check template
         $directory = isset($params['directory']) ? $params['directory'] : 'templates';
         $template = isset($params['template']) ? JFilterInput::getInstance()->clean($params['template'], 'cmd') : 'system';
         if (!file_exists($directory . '/' . $template . '/' . $file)) {
             $template = 'system';
         }
         // Set variables
         $this->baseurl = JUri::base(true);
         $this->template = $template;
         $this->error = $this->_error;
         $this->debug = isset($params['debug']) ? $params['debug'] : false;
         $this->code = isset($params['code']) ? $params['code'] : $code;
         $this->message = isset($params['message']) ? $params['message'] : $message;
         // Load
         $data = $this->_loadTemplate($directory . '/' . $template, $file);
         parent::render();
         return $data;
     }
 }
Beispiel #21
0
 /**
  * Render the document
  *
  * @param   boolean  $cache   If true, cache the output
  * @param   array    $params  Associative array of attributes
  *
  * @return  The rendered data
  *
  * @since   11.1
  */
 public function render($cache = false, $params = array())
 {
     $xml = new DOMDocument('1.0', 'utf-8');
     if (defined('JDEBUG') && JDEBUG) {
         $xml->formatOutput = true;
     }
     // The OpenSearch Namespace
     $osns = 'http://a9.com/-/spec/opensearch/1.1/';
     // Create the root element
     $elOs = $xml->createElementNS($osns, 'OpenSearchDescription');
     $elShortName = $xml->createElementNS($osns, 'ShortName');
     $elShortName->appendChild($xml->createTextNode(htmlspecialchars($this->_shortName)));
     $elOs->appendChild($elShortName);
     $elDescription = $xml->createElementNS($osns, 'Description');
     $elDescription->appendChild($xml->createTextNode(htmlspecialchars($this->description)));
     $elOs->appendChild($elDescription);
     // Always set the accepted input encoding to UTF-8
     $elInputEncoding = $xml->createElementNS($osns, 'InputEncoding');
     $elInputEncoding->appendChild($xml->createTextNode('UTF-8'));
     $elOs->appendChild($elInputEncoding);
     foreach ($this->_images as $image) {
         $elImage = $xml->createElementNS($osns, 'Image');
         $elImage->setAttribute('type', $image->type);
         $elImage->setAttribute('width', $image->width);
         $elImage->setAttribute('height', $image->height);
         $elImage->appendChild($xml->createTextNode(htmlspecialchars($image->data)));
         $elOs->appendChild($elImage);
     }
     foreach ($this->_urls as $url) {
         $elUrl = $xml->createElementNS($osns, 'Url');
         $elUrl->setAttribute('type', $url->type);
         // Results is the default value so we don't need to add it
         if ($url->rel != 'results') {
             $elUrl->setAttribute('rel', $url->rel);
         }
         $elUrl->setAttribute('template', $url->template);
         $elOs->appendChild($elUrl);
     }
     $xml->appendChild($elOs);
     parent::render();
     return $xml->saveXML();
 }
Beispiel #22
0
 /**
  * Render the document.
  *
  * @param boolean 	$cache		If true, cache the output
  * @param array		$params		Associative array of attributes
  * @return 	The rendered data
  */
 public function render($cache = false, array $params = array())
 {
     $data = 'BEGIN:VCARD';
     $data .= "\r\n";
     $data .= 'VERSION:2.1';
     $data .= "\r\n";
     foreach ($this->_properties as $key => $value) {
         $data .= "{$key}:{$value}";
         $data .= "\r\n";
     }
     $data .= 'REV:' . date('Y-m-d') . 'T' . date('H:i:s') . 'Z';
     $data .= "\r\n";
     $data .= 'MAILER: Joomla! vCard for ' . $this->getBase();
     $data .= "\r\n";
     $data .= 'END:VCARD';
     $data .= "\r\n";
     // Set document type headers
     parent::render();
     // Send vCard file headers
     JResponse::setHeader('Content-Length', strlen($data), true);
     JResponse::setHeader('Content-disposition', 'attachment; filename="' . $this->_filename . '"', true);
     return $data;
 }
Beispiel #23
0
 /**
  * Render the document.
  *
  * @param   bool   $cache   If true, cache the output
  * @param   array  $params  Associative array of attributes
  *
  * @return	The rendered data
  */
 public function render($cache = false, $params = array())
 {
     parent::render();
     return $this->getBuffer();
 }
Beispiel #24
0
 /**
  * Render the document.
  *
  * @access public
  * @param boolean 	$cache		If true, cache the output
  * @param array		$params		Associative array of attributes
  * @return 	The rendered data
  */
 function render($cache = true, $params = array())
 {
     //Formu PDF'e cevir
     if (isset($_GET['form'])) {
         $form = $_GET['form'];
         $evrak_id = $_GET['id'];
         if ($form < 5) {
             // T1, T2, T3, T4
             global $mainframe;
             $user =& JFactory::getUser();
             $user_id = $user->getOracleUserId();
             if ($form == 1) {
                 $group_id = T1_GROUP_ID;
             } else {
                 if ($form == 2) {
                     $group_id = T2_GROUP_ID;
                 } else {
                     if ($form == 3) {
                         $group_id = T3_GROUP_ID;
                     } else {
                         if ($form == 4) {
                             $group_id = T4_GROUP_ID;
                         }
                     }
                 }
             }
             //AKREDITASYON BASVURU
             $isSektorSorumlusu = FormFactory::sektorSorumlusuMu($user);
             $aut = FormFactory::checkAuthorization($user, $group_id);
             if (!$aut && !$isSektorSorumlusu) {
                 $mainframe->redirect('index.php?', YETKI_MESAJ);
             }
             $personelCount = $this->getPersonelCount($evrak_id);
             $titles = array("Meslek Standardı Hazırlama Başvuru Formu", "Yeterlilik Başvuru Formu", "Belgelendirme Başvuru Formu", "Akreditasyon Başvuru Formu");
             //Title Configuration
             $title = $titles[$form - 1];
             //Unique Filename
             $name = FormFactory::generateUniqueFilename("basvuru_" . $form);
             $titleFont = 'freeserif';
             $titleStyle = 'BI';
             $titleFontSize = 15;
             //Data Configuration
             $dataFont = 'freeserif';
             $dataStyle = '';
             $dataFontSize = 10;
             $pdf = $this->render_InitializePDF(PDF_TIPI_BASVURU, TRUE, PDF_MARGIN_TOP + 10, PDF_MARGIN_HEADER + 10, PDF_MARGIN_FOOTER, 25, 25);
             // ---------------------------------------------------------
             // Form Title
             // set font
             $pdf->SetFont($titleFont, $titleStyle, $titleFontSize);
             // add a page
             if ($form != -5) {
                 //ek degilse yeni sayfa ekle onyazi için
                 $pdf->AddPage();
             }
             // print a line using Cell()
             $pdf->Cell(0, 5, $title, 0, 1, 'C');
             // ---------------------------------------------------------
             // Form Data
             $pdf->SetFont($dataFont, $dataStyle, $dataFontSize);
             // ON YAZI
             if ($form != -5) {
                 //ekleri yazdırırken on yazi koymamak için
                 $this->writeOnyazi($form, $pdf);
             }
             $pdf->Ln(15);
             // HTML
             $pdf->WriteHTML($this->parseTaslak($this->getBuffer(), "basvuru", "ek"), true);
             //$pdf->WriteHTML($this->fixHTML($this->getBuffer(), $form), true);
             // ALT YAZ
             $pdf->SetFont($dataFont, 'B', $dataFontSize);
             if ($form != -5) {
                 //ekleri yazdırırken alt yazi koymamak için
                 $this->writeAltyazi($pdf, $evrak_id);
             }
             $pdf->SetFont($dataFont, '', $dataFontSize);
             if ($personelCount > 0) {
                 $pdf->AddPage();
                 $pdf->WriteHTML($this->parseTaslak($this->getBuffer(), "ek", "personel_0"), true);
                 for ($i = 0; $i < $personelCount; $i++) {
                     $sec = "";
                     if ($i < $personelCount - 1) {
                         $sec = "personel_" . ($i + 1);
                         $pdf->WriteHTML($this->parseTaslak($this->getBuffer(), "personel_" . $i, $sec), true);
                         $pdf->AddPage();
                     } else {
                         $pdf->WriteHTML($this->parseTaslak($this->getBuffer(), "personel_" . $i, $sec), true);
                     }
                 }
             }
         } else {
             // Taslaklar
             $taslakHTML = $this->fixHTML($this->getBuffer(), $form);
             //Unique Filename
             $name = FormFactory::generateUniqueFilename("taslak_" . $form);
             //Data Configuration
             $dataFont = 'freeserif';
             $dataStyle = '';
             $dataFontSize = 10;
             if (isset($_GET["standart_id"])) {
                 //Meslek Standart Taslak
                 //  YETKI KONTROL� COM_MESLEK_STD_TASLAK'DA TASLAK LISTELEME SAYFASINDAN ALINDI
                 global $mainframe;
                 $user =& JFactory::getUser();
                 $sektorSorumlusu = FormFactory::sektorSorumlusuMu($user);
                 $standartKurulusu = FormFactory::checkAuthorization($user, YT1_GROUP_ID);
                 //YETKI KONTROL
                 /////////////////////////////////////////////////////////////////////////////////
                 $message = YETKI_MESAJ;
                 if (!$sektorSorumlusu && !$standartKurulusu) {
                     $mainframe->redirect('index.php?', $message);
                 }
                 /////////////////////////////////////////////////////////////////////////////////
                 $pdf = $this->render_InitializePDF(PDF_TIPI_MS_TASLAK, FALSE, PDF_MARGIN_TOP - 5, PDF_MARGIN_HEADER, PDF_MARGIN_FOOTER);
                 global $globalStandartId;
                 $standart_id = $_GET["standart_id"];
                 $globalStandartId = $standart_id;
                 $bilgi = $this->getStandartRevizyonBilgi($standart_id);
                 $data = $this->getStandartSeviye($_GET["standart_id"]);
                 $std = FormFactory::toUpperCase($data["STANDART_ADI"]);
                 $seviye = FormFactory::toUpperCase($data["SEVIYE_ADI"]);
                 $kurulusAd = $this->getKurulusAd($evrak_id);
                 $sektor = "MYK " . $bilgi["SEKTOR_ADI"] . " Sektör Komitesi";
                 $resmi = $bilgi["RESMI_GAZETE_TARIH"] != null ? $bilgi["RESMI_GAZETE_TARIH"] . " / " . $bilgi["RESMI_GAZETE_SAYI"] : "";
                 $karar = $bilgi["KARAR_TARIHI"] != null ? $bilgi["KARAR_TARIHI"] . " Tarih ve " . $bilgi["KARAR_SAYI"] . " Sayılı Karar" : "....... Tarih ve ....... Sayılı Karar";
                 $kurulusAdlari = $this->parseTaslak($taslakHTML, "hazirlayan", "terim");
                 // ---------------------------------------------------------
                 $pdf->SetPrintHeader(false);
                 $eksiz = '0';
                 $eksiz = $_GET['eksiz'];
                 if ($eksiz != '1') {
                     $this->render_Kapak($pdf, $dataFont, $bilgi, $resmi, $std, $seviye);
                 }
                 $pdf->SetFont($dataFont, $dataStyle, $dataFontSize);
                 // ILK SAYFA
                 $pdf->AddPage();
                 $pdf->SetFont($dataFont, "B", $dataFontSize);
                 $arr = array("Meslek :", "Seviye :", "Referans Kodu:", "Standardı Hazırlayan Kuruluş(lar):", "Standardı Doğrulayan Sektör Komitesi:", "MYK Yönetim Kurulu Onay Tarih/Sayı:", "Resmi Gazete Tarih/Sayı:", "Revizyon No:");
                 $dataArr = array($std, $seviye . "<sup>I</sup>", $bilgi["STANDART_KODU"], $kurulusAdlari, $sektor, $karar, $resmi, $bilgi["REVIZYON_NO"]);
                 for ($i = 0; $i < count($arr); $i++) {
                     //MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0, $valign=0)
                     $pdf->MultiCell(85, 28, $arr[$i], 1, "L", 0, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->MultiCell(85, 28, $dataArr[$i], 1, "L", 0, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->Ln();
                     //new row
                 }
                 $pdf->Ln(16);
                 $dipnot = "<sup>I</sup> Mesleğin yeterlilik seviyesi, sekizli (8) seviye matrisinde seviye " . $this->convertRakam($data["SEVIYE_ID"]) . " (" . $data["SEVIYE_ID"] . ") olarak belirlenmiştir.";
                 $pdf->MultiCell(50, 7, "", "B", "L", 0, 1, '', '', 1, 0, 1, 1, 0, 1);
                 $pdf->SetFont($dataFont, $dataStyle, 9);
                 $pdf->WriteHTML($dipnot, false);
                 // set auto page breaks
                 $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
                 $pdf->SetFont($dataFont, $dataStyle, $dataFontSize);
                 // TERIMLER
                 $pdf->AddPage();
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "terim", "tanitim"), false);
                 $indexPage = $pdf->getPage() + 1;
                 // DATA
                 $pdf->AddPage();
                 $pdf->Bookmark('1.  GİRİŞ', 0, 0);
                 $pdf->Ln();
                 $pdf->WriteHTML($this->getHTMLTitle("1.  GİRİŞ"));
                 $pdf->Ln();
                 $girisIlk = FormFactory::ucwordsTR($data["STANDART_ADI"]) . " (" . $data["SEVIYE_ADI"] . ") ulusal meslek standardı 5544 sayılı Mesleki Yeterlilik Kurumu (MYK) Kanunu ile anılan Kanun uyarınca çıkartılan \"Ulusal Meslek Standartlarının Hazırlanması Hakkında Yönetmelik\" ve \"Mesleki Yeterlilik Kurumu Sektör Komitelerinin Kuruluş, Görev, Çalışma Usul ve Esasları Hakkında Yönetmelik\" hükümlerine göre MYK'nın görevlendirdiği " . FormFactory::ucWordsLeaveConjunction($kurulusAd) . " tarafından hazırlanmıştır.";
                 $pdf->writeHTML('<span style="text-align:justify;">' . $girisIlk . '</span>', true, 0, true, true);
                 //$pdf->Write(2, $girisIlk, 0, 0, 'J');
                 //$pdf->Ln();
                 $pdf->Ln();
                 $girisSon = FormFactory::ucwordsTR($data["STANDART_ADI"]) . " (" . $data["SEVIYE_ADI"] . ") ulusal meslek standardı, sektördeki ilgili kurum ve kuruluşların görüşleri alınarak değerlendirilmiş, " . $sektor . " tarafından incelendikten sonra MYK Yönetim Kurulunca onaylanmıştır.";
                 $pdf->writeHTML('<span style="text-align:justify;">' . $girisSon . '</span>', true, 0, true, true);
                 //$pdf->Write(2, $girisSon, 0, 0, 'J');
                 $pdf->AddPage();
                 $pdf->Bookmark('2.  MESLEK TANITIMI', 0, 0);
                 $pdf->Bookmark('2.1. Meslek Tanımı', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "tanitim", "tanitim2"), true);
                 $pdf->Bookmark('2.2.  Mesleğin Uluslararası Sınıflandırma Sistemlerindeki Yeri', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "tanitim2", "tanitim3"), true);
                 $pdf->Bookmark('2.3. Sağlık, Güvenlik ve Çevre ile İlgili Düzenlemeler', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "tanitim3", "tanitim4"), true);
                 $pdf->Bookmark('2.4. Meslek ile İlgili Diğer Mevzuat', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "tanitim4", "tanitim5"), true);
                 $pdf->Bookmark('2.5. Çalışma Ortamı ve Koşulları', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "tanitim5", "tanitim6"), true);
                 $pdf->Bookmark('2.6. Mesleğe İlişkin Diğer Gereklilikler', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "tanitim6", "profil_tablo"), false);
                 $pdf->AddPage("L");
                 $tabloCount = $this->getProfilCount($_GET["standart_id"]);
                 $pdf->Bookmark('3.  MESLEK PROFİLİ', 0, 0);
                 $pdf->Bookmark('3.1. Görevler, İşlemler ve Başarım Ölçütleri', 1, 0);
                 $this->writeProfilTable($pdf, $standart_id);
                 //					for ($i = 0; $i < $tabloCount-1; $i++){
                 //						if ($i == 0){
                 //							$pdf->WriteHTML($this->parseTaslak ($taslakHTML, "profil_tablo", "gibTablo1"), true);
                 //						}
                 //
                 //						$pdf->WriteHTML($this->parseTaslak ($taslakHTML, "gibTablo".($i+1), "gibTablo".($i+2)), true);
                 //						$pdf->AddPage();
                 //					}
                 //					$pdf->WriteHTML($this->parseTaslak ($taslakHTML, "gibTablo".$tabloCount, "ekipman"), true);
                 $pdf->AddPage("P");
                 $pdf->Write(0, "", 0, 0, 'L');
                 $pdf->Bookmark('3.2. Kullanılan Araç, Gereç ve Ekipman', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "ekipman", "bilgiBeceri"), true);
                 $pdf->Bookmark('3.3. Bilgi ve Beceriler', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "bilgiBeceri", "tutumDavranis"), true);
                 $pdf->Bookmark('3.4. Tutum ve Davranışlar', 1, 0);
                 $pdf->WriteHTML($this->parseTaslak($taslakHTML, "tutumDavranis", "tutumDavranis_son"), false);
                 $pdf->AddPage();
                 $pdf->Bookmark('4.  ÖLÇME, DEĞERLENDİRME VE BELGELENDİRME', 0, 0);
                 $pdf->Ln();
                 $pdf->WriteHTML($this->getHTMLTitle("4.  ÖLÇME, DEĞERLENDİRME VE BELGELENDİRME"));
                 $pdf->Ln();
                 $olcmeIlk = FormFactory::ucwordsTR($data["STANDART_ADI"]) . " (" . $data["SEVIYE_ADI"] . ") meslek standardını esas alan ulusal yeterliliklere göre belgelendirme amacıyla yapılacak ölçme ve değerlendirme, gerekli şartların sağlandığı ölçme ve değerlendirme merkezlerinde yazılı ve/veya sözlü teorik ve uygulamalı olarak gerçekleştirilecektir.";
                 $pdf->writeHTML('<span style="text-align:justify;">' . $olcmeIlk . '</span>', true, 0, true, true);
                 //$pdf->Write(2, $olcmeIlk, 0, 0, 'L');
                 $pdf->Ln();
                 $olcmeSon = "Ölçme ve değerlendirme yöntemi ile uygulama esasları bu meslek standardına göre hazırlanacak ulusal yeterliliklerde detaylandırılır. Ölçme ve değerlendirme ile belgelendirmeye ilişkin işlenmeler Mesleki Yeterlilik, Sınav ve Belgelendirme Yönetmeliği çerçevesinde yürütülür.";
                 $pdf->writeHTML('<span style="text-align:justify;">' . $olcmeSon . '</span>', true, 0, true, true);
                 //$pdf->Write(2, $olcmeSon, 0, 0, 'L');
                 $gorevAlan = $this->parseTaslak($taslakHTML, "gorev_alan", "");
                 $gorevAlanGoster = $this->canViewGorevAlan($standart_id);
                 if ($gorevAlan !== FALSE && $gorevAlanGoster) {
                     $pdf->AddPage();
                     $pdf->WriteHTML($gorevAlan, false);
                 }
                 //İçindekiler
                 if ($eksiz != '1') {
                     $pdf->AddPage();
                     // write the TOC title
                     $pdf->SetFont($dataFont, "B", $dataFontSize);
                     $pdf->MultiCell(0, 0, 'İÇİNDEKİLER', 0, 'C', 0, 1, '', '', true, 0);
                     $pdf->Ln();
                     $pdf->addTOC($indexPage, 'courier', '.', 'İçindekiler');
                 }
             } else {
                 if (isset($_GET["yeterlilik_id"])) {
                     //Yeterlilik Taslak
                     ///// BU KISIM COM_YETERLILIK_TASLAK / YETERLILIK TASLAK KISMINDAN ALINDI
                     global $mainframe;
                     $message = YETKI_MESAJ;
                     $user =& JFactory::getUser();
                     $user_id = $user->getOracleUserId();
                     $yeterlilik_id = $_GET["yeterlilik_id"];
                     $isSektorSorumlusu = FormFactory::sektorSorumlusuMu($user);
                     $isYetkiliKurulus = FormFactory::yeterlilikHazirlamayaYetkiliMi($user_id, $yeterlilik_id);
                     //YETKI KONTROL
                     /////////////////////////////////////////////////////////////////////////////////
                     if (!$isSektorSorumlusu && !$isYetkiliKurulus) {
                         $mainframe->redirect('index.php?', $message);
                     }
                     /////////////////////////////////////////////////////////////////////////////////
                     /////////////////////////////////////////////////////////////////////////////////
                     $pdf = $this->render_InitializePDF(PDF_TIPI_YET_TASLAK, TRUE, PDF_MARGIN_TOP - 5, PDF_MARGIN_HEADER, PDF_MARGIN_FOOTER);
                     global $globalYeterlilikId;
                     $yeterlilik_id = $_GET["yeterlilik_id"];
                     $globalYeterlilikId = $yeterlilik_id;
                     $bilgi = $this->getYeterlilikRevizyonBilgi($yeterlilik_id);
                     $data = $this->getYeterlilikSeviye($yeterlilik_id);
                     $yet = $data["YETERLILIK_ADI"];
                     $seviye = $data["SEVIYE_ADI"];
                     $kurulusAd = $this->getKurulusAd($evrak_id);
                     // ---------------------------------------------------------
                     $pdf->setPrintHeader(false);
                     $pdf->setPrintFooter(false);
                     $pdf->SetAutoPageBreak(FALSE, 0);
                     $pdf->AddPage();
                     // KAPAK
                     $pdf->SetMargins(0, 0, 0);
                     $pdf->setJPEGQuality(100);
                     $x = 90;
                     $y = 3;
                     $width = 20;
                     $height = 25;
                     //TURUNCU KISIM
                     $pdf->SetY(0);
                     $pdf->SetFillColor(227, 108, 10);
                     //TURUNCU
                     $pdf->MultiCell(0, 32, "", 0, 'C', 1);
                     $pdf->Image(K_PATH_IMAGES . 'myk_logo.jpg', $x, $y, $width, $height);
                     $pdf->Ln(1);
                     //YESIL KISIM
                     $widthY = 3 * 210 / 4 - 1;
                     $pdf->SetFont($dataFont, "B", "30");
                     $firstY = $pdf->GetY();
                     $pdf->SetFillColor(155, 187, 89);
                     //YESIL
                     $pdf->MultiCell($widthY, 20, "", 0, 'C', 1);
                     $pdf->MultiCell($widthY, 33, "ULUSAL YETERLİLİK", 0, "C", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->SetFont($dataFont, "B", "18");
                     $pdf->Ln();
                     $pdf->MultiCell($widthY, 6, $bilgi["YETERLILIK_KODU"] . " " . FormFactory::toUpperCase($yet), 0, "C", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->Ln();
                     $pdf->MultiCell($widthY, 6, FormFactory::toUpperCase($seviye), 0, "C", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->Ln();
                     $pdf->MultiCell($widthY, 65, "", 0, 'C', 1);
                     $pdf->SetFont($dataFont, "B", "10");
                     $pdf->MultiCell($widthY, 6, "YAYIN TARİHİ : " . $bilgi["YAYIN_TARIHI"], 0, "C", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->Ln();
                     $pdf->MultiCell($widthY, 6, "REVİZYON NO : " . $bilgi["REVIZYON_NO"], 0, "C", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->Ln();
                     $pdf->MultiCell($widthY, 12, "", 0, 'C', 1);
                     $lastY = $pdf->GetY();
                     //MAVI KISIM
                     $widthM = 210 / 4;
                     $heightM = $lastY - $firstY;
                     $pdf->SetY($firstY);
                     $pdf->MultiCell($widthY + 1, $heightM, "", 0, "L", 0, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->SetFillColor(219, 229, 241);
                     //MAVI
                     $pdf->MultiCell($widthM, $heightM, "", 0, "L", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     //KIRMIZI KISIM
                     $heightK = 20;
                     $pdf->SetY($lastY);
                     $pdf->Ln(1);
                     $pdf->SetFillColor(148, 54, 52);
                     //KIRMIZI
                     for ($i = 0; $i < 4; $i++) {
                         $widthK = 210 / 4 - 1;
                         if ($i == 3) {
                             $widthK = 210 / 4;
                         }
                         $pdf->MultiCell($widthK, $heightK, "", 0, "L", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                         $pdf->SetX($pdf->getX() + 1);
                     }
                     $pdf->Ln($heightK + 1);
                     //PEMBE & KOYU MAVI
                     $heightP = 75;
                     $pdf->SetFillColor(192, 80, 77);
                     //PEMBE
                     $pdf->MultiCell($widthY, $heightP, "", 0, "L", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->SetX($pdf->getX() + 1);
                     $pdf->SetFillColor(120, 192, 212);
                     //KOYU MAVI
                     $pdf->MultiCell($widthM, $heightP, "", 0, "L", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     $pdf->Ln($heightP + 1);
                     //ALT KIRMIZI
                     $pdf->SetFillColor(148, 54, 52);
                     //KIRMIZI
                     $pdf->MultiCell(0, $heightK - 5, "", 0, "L", 1, 0, '', '', 1, 0, 1, 1, 0, 1);
                     //KAPAK SON
                     // ---------------------------------------------------------
                     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
                     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
                     $pdf->SetFont($dataFont, $dataStyle, $dataFontSize);
                     $pdf->SetPrintHeader(true);
                     $pdf->AddPage();
                     $pdf->setPrintFooter(true);
                     //ONSOZ
                     $pdf->WriteHTML($this->getHTMLTitle("ÖNSÖZ", 'center'));
                     $pdf->Ln();
                     // $yet, yeterlilik ismi buyuk harf yapildi:
                     $onsozIlk = "<b>" . FormFactory::ucwordsTR($yet) . " - " . $seviye . "</b> Ulusal Yeterliliği 5544 sayılı Mesleki Yeterlilik Kurumu (MYK) Kanunu ile anılan Kanun uyarınca çıkarılan “Mesleki Yeterlilik, Sınav ve Belgelendirme Yönetmeliği” hükümlerine göre hazırlanmıştır.";
                     $pdf->writeHTML('<span style="text-align:justify;">' . $onsozIlk . '</span>', true, 0, true, true);
                     //$pdf->Write(2, $onsozIlk, 0, 0, 'L');
                     //$pdf->Ln();
                     $pdf->Ln();
                     $onsozOrta = "Yeterlilik taslağı, " . $bilgi["KARAR_TARIHI"] . " tarihinde imzalanan işbirliği protokolü ile görevlendirilen " . FormFactory::ucWordsLeaveConjunction($kurulusAd) . " tarafından hazırlanmıştır. Hazırlanan taslak hakkında sektördeki ilgili kurum ve kuruluşların görüşleri alınmış ve görüşler değerlendirilerek taslak üzerinde gerekli düzenlemeler yapılmıştır. Nihai taslak MYK " . $bilgi["SEKTOR_ADI"] . " Sektör Komitesi tarafından incelenip değerlendirildikten ve Komitenin uygun görüşü alındıktan sonra, MYK Yönetim Kurulunun " . $bilgi["KARAR_TARIHI"] . " tarih ve " . $bilgi["KARAR_SAYI"] . " sayılı kararı ile onaylanarak Ulusal Yeterlilik Çerçevesine (UYÇ) yerleştirilmesine karar verilmiştir.";
                     $pdf->writeHTML('<span style="text-align:justify;">' . $onsozOrta . '</span>', true, 0, true, true);
                     $pdf->Ln();
                     $onsozSon = "Yeterliliğin hazırlanması, görüş bildirilmesi, incelenmesi ve doğrulanmasında katkı sağlayan kişi, kurum ve kuruluşlara görüş ve katkıları için teşekkür eder, yararlanabilecek tüm tarafların bilgisine sunarız.";
                     //$pdf->Write(2, $onsozSon, 0, 0, 'L');
                     $pdf->writeHTML('<span style="text-align:justify;">' . $onsozSon . '</span>', true, 0, true, true);
                     //$pdf->Ln();
                     $pdf->Ln();
                     $pdf->Write(2, "Mesleki Yeterlilik Kurumu", 0, 0, 'R');
                     $pdf->AddPage();
                     //GIRIS
                     $pdf->WriteHTML($this->getHTMLTitle("GİRİŞ", 'center'));
                     $pdf->Ln();
                     $girisP1 = "Ulusal yeterliliğin hazırlanmasında, sektör komitelerinde incelenmesinde ve MYK Yönetim Kurulu tarafından onaylanarak yürürlüğe konulmasında temel ölçütler Mesleki Yeterlilik, Sınav Ve Belgelendirme Yönetmeliğinde belirlenmiştir.";
                     $pdf->writeHTML('<span style="text-align:justify;">' . $girisP1 . '</span><br />', true, 0, true, true);
                     //					$pdf->Write(2, $girisP1, 0, 0, 'L');
                     //					$pdf->Ln();
                     //$pdf->Ln();
                     $girisP2 = "Ulusal yeterlilik aşağıdaki hususlarla tanımlanır;";
                     $pdf->writeHTML('<span style="text-align:justify;">' . $girisP2 . '</span>', false, 0, true, true);
                     //$pdf->Write(2, $girisP2, 0, 0, 'L');
                     $pdf->SetMargins(PDF_MARGIN_LEFT + 10, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
                     //$pdf->Ln();
                     $pdf->Ln();
                     //$girisP3 = "a)Yeterliliğin adı ve seviyesi,\nb)Yeterliliğin amacı ve gerekçesi,\nc)Yeterliliğin ilgili olduğu sektör,\nç)Yeterlilik için gerekli olan; şekli, içeriği, süresi gibi özellikleri belirtilen eğitim ve deneyim şartları,\nd)Yeterliliğe kaynak teşkil eden meslek standardı, meslek standardı birimleri/görevleri veya yeterlilik birimleri,\ne)Yeterliliğin kazanılması için sahip olunması gereken öğrenme çıktıları,\nf)Yeterliliğin kazanılmasında uygulanacak değerlendirme usul ve esasları, değerlendirmede ihtiyaç duyulan asgari sınav materyali ile değerlendirici ölçütleri,\ng)Yeterlilik belgesinin geçerlilik süresi, yenilenme şartları, gerekli görülmesi halinde belge sahibinin gözetimine ilişkin şartlar.";
                     // ornek ciktidaki gibi buradaki listeye harfler eklendi:
                     $girisP3 = "<ol type=" . "a" . "><li>Yeterliliğin adı ve seviyesi,</li><li>Yeterliliğin amacı ve gerekçesi,</li><li>Yeterliliğin ilgili olduğu sektör,</li><li>Yeterlilik için gerekli olan; şekli, içeriği, süresi gibi özellikleri belirtilen eğitim ve deneyim şartları,</li><li>Yeterliliğe kaynak teşkil eden meslek standardı, meslek standardı birimleri/görevleri veya yeterlilik birimleri,</li><li>Yeterliliğin kazanılması için sahip olunması gereken öğrenme çıktıları,</li><li>Yeterliliğin kazanılmasında uygulanacak değerlendirme usul ve esasları, değerlendirmede ihtiyaç duyulan asgari sınav materyali ile değerlendirici ölçütleri,</li><li>Yeterlilik belgesinin geçerlilik süresi, yenilenme şartları, gerekli görülmesi halinde belge sahibinin gözetimine ilişkin şartlar.</li></ol>";
                     $pdf->writeHTML('<span style="text-align:justify;">' . $girisP3 . '</span>', false, 0, true, true);
                     //$pdf->Write(2, $girisP3, 0, 0, 'L');
                     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
                     $pdf->Ln();
                     $girisP4 = "Ulusal yeterlilikler ulusal meslek standardının bulunduğu alanlarda söz konusu ulusal meslek standardı esas alınarak, bulunmadığı alanlarda ise uluslararası meslek standardı esas alınarak oluşturulur.";
                     $pdf->writeHTML('<span style="text-align:justify;">' . $girisP4 . '</span>', true, 0, true, true);
                     //$pdf->Write(2, $girisP4, 0, 0, 'L');
                     //$pdf->Ln();
                     $girisP5 = "Ulusal yeterlilikler;";
                     $pdf->Write(2, $girisP5, 0, 0, 'L');
                     $pdf->SetMargins(PDF_MARGIN_LEFT + 10, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
                     $pdf->Ln();
                     //$girisP6 = "Örgün ve yaygın eğitim ve öğretim kurumları,\nYetkilendirilmiş belgelendirme kuruluşları,\nKuruma yetkilendirme ön başvurunda bulunmuş kuruluşlar,\nUlusal meslek standardı hazırlamış kuruluşlar,\nMeslek kuruluşları ile bunların müşterek çalışmasıyla oluşturulur.";
                     $girisP6 = "<ul style=" . "list-style-type: square" . "><li>Örgün ve yaygın eğitim ve öğretim kurumları,</li><li>Yetkilendirilmiş belgelendirme kuruluşları,</li><li>Kuruma yetkilendirme ön başvurunda bulunmuş kuruluşlar,</li><li>Ulusal meslek standardı hazırlamış kuruluşlar,</li><li>Meslek kuruluşları ile bunların müşterek çalışmasıyla oluşturulur.</li></ul>";
                     $pdf->writeHTML('<span style="text-align:justify;">' . $girisP6 . '</span>', false, 0, true, true);
                     //$pdf->Write(2, $girisP6, 0, 0, 'L');
                     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
                     $pdf->AddPage();
                     //TASLAK DATA
                     $pdf->WriteHTML($this->getHTMLTitle("ULUSAL YETERLİLİK", 'center'));
                     $pdf->Ln();
                     //$pdf->WriteHTML ($taslakHTML);
                     $pdf->WriteHTML($this->parseTaslak($taslakHTML, "taslak", "ek1"), true);
                     $pdf->AddPage();
                     $pdf->WriteHTML($this->getHTMLTitle("EKLER", 'center'));
                     $num = 3;
                     for ($i = 1; $i < $num; $i++) {
                         if ($i == $num - 1) {
                             $pdf->WriteHTML($this->parseTaslak($taslakHTML, "ek" . $i, ""), true);
                         } else {
                             $pdf->WriteHTML($this->parseTaslak($taslakHTML, "ek" . $i, "ek" . ($i + 1)), true);
                             $pdf->AddPage();
                         }
                     }
                 }
             }
             // ---------------------------------------------------------
         }
         //$this->savePdfFile ($pdf, $name, $id);
     } else {
         //Article PDF'e cevir
         $name = $this->getName();
         $pdf =& $this->_engine;
         // Set PDF Metadata
         $pdf->SetCreator($this->getGenerator());
         $pdf->SetTitle($this->getTitle());
         $pdf->SetSubject($this->getDescription());
         $pdf->SetKeywords($this->getMetaData('keywords'));
         // Set PDF Header data
         $pdf->setHeaderData('', 0, $this->getTitle(), $this->getHeader());
         // Set PDF Header and Footer fonts
         $lang =& JFactory::getLanguage();
         $font = $lang->getPdfFontName();
         $font = $font ? $font : 'freeserif';
         $pdf->setRTL($lang->isRTL());
         $pdf->setHeaderFont(array($font, '', 10));
         $pdf->setFooterFont(array($font, '', 8));
         // Initialize PDF Document
         $pdf->AliasNbPages();
         $pdf->AddPage();
         // Build the PDF Document string from the document buffer
         $this->fixLinks();
         $pdf->WriteHTML($this->getBuffer(), true);
     }
     $data = $pdf->Output('', 'S');
     // Set document type headers
     parent::render();
     //JResponse::setHeader('Content-Length', strlen($data), true);
     JResponse::setHeader('Content-disposition', 'inline; filename="' . $name . '.pdf"', true);
     //Close and output PDF document
     return $data;
 }