Joomlatwork
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 23, 2013, 04:17:32 AM

Login with username, password and session length
Search:     Advanced search
17648 Posts in 5950 Topics by 11217 Members
Latest Member: Poevylony
* Home Help Search Login Register
+  Joomlatwork
|-+  Joomla PrettyPDF
| |-+  Support questions Joomla 1.5.x version
| | |-+  Body content not showing
« previous next »
Pages: [1] Print
Author Topic: Body content not showing  (Read 764 times)
mrginger
Newbie
*
Posts: 1


View Profile
« on: October 07, 2010, 11:56:22 PM »

Hi,

I am in need of some help.

I have just purchased PrettyPDF but probably didn't think it through properly before I did so.

I am setting up a website for a training school using the Course Manager component (com_courseman) the component has the ability to create a PDF of the course details on the current page and it uses a combination of the the normal joomla pdf.php file and a view.pdf.php file.

After installing PrettyPDF, when I click on the PDF button the PDF that is created doesn't contain the course details. This isn't a problem with PrettyPDF as it works fine with normal articles.

My problem is that I don't need it for creating PDFs of articles, the PDF link is turned off in the global configuration. I only need it for the course details and I only really need one variable from the course details to appear in the PDF.

Anyone have any ideas about how to integrate this in to PrettyPDF? Although PrettyPDF works well and looks great, without being able to use it to create a PDF of the course details I have pretty much wasted the money buying it.

The code from the view.pdf.php file is below and the part that I need to integrate in to PrettyPDF is 'echo $course->text;'

Any help at all would be much appreciated.
 Undecided Undecided Undecided

Code:

defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');

class CoursemanViewCourses extends JView
{
    function display($tpl = null)
    {
        global $mainframe;

        $dispatcher = &JDispatcher::getInstance();

        $course = &$this->get('Course');
        $params = &$mainframe->getParams('com_courseman');

        JPluginHelper::importPlugin('content', 'image');
        $dispatcher->trigger('onPrepareContent', array(&$course, &$params, 0));

        $document = &JFactory::getDocument();

        $document->setTitle($course->title);
        $document->setName($course->alias);
        $document->setDescription($course->meta_description);
        $document->setMetaData('keywords', $course->meta_keywords);

        $document->setHeader($this->_getHeaderText($course, $params, meta_description));



     //show sessions
     $db =& JFactory::getDBO();
     $sql = 'SELECT *, min(session_date) AS start_date, max(session_date) AS finish_date FROM #__courseman_sessions'
     . ' WHERE published = 1'
     . ' AND courseid = '.$course->id
     . ' ORDER BY ordering';
     $db->setQuery($sql);
     $course_sessions_dates = $db->loadObjectList();

     foreach ($course_sessions_dates as $course_sessions2):
     $course->start_date = $course_sessions2->start_date;
     $course->finish_date = $course_sessions2->finish_date;
     endforeach;
     if ($params->get('show_start_date')):
     echo JText::_('START DATE') . ' : ';
     echo $course->start_date."\n";
     endif;

     if ($params->get('show_finish_date')):
     echo JText::_('FINISH DATE') . ' : ';
     echo $course->finish_date."\n";
     endif;

     if ($params->get('show_group')):
     echo JText::_('Group') . ' : ';
     echo $course->cgroup."\n";
     endif;


     echo JText::_('PRICE') . ' : ';
     echo $course->price.' '.$params->get('currency')."\n";

     if ($params->get('show_location')):
     echo JText::_('Location') . ' : ';
     echo $course->location."\n";
     endif;

     if ($params->get('show_experience_level')):
     echo JText::_('LEVEL') . ' : ';
     echo $course->level."\n";
     endif;

        echo $course->text;
    }

    function _getHeaderText(&$course, &$params)
    {

        $text = '';
        if ($params->get('show_create_date') && $params->get('show_author'))
        {

            $text .= "\n";
        }

        if ($params->get('show_create_date'))
        {

            if (intval($course->created))
            {
                $create_date = JHTML::_('date', $course->created, JText::_('DATE_FORMAT_LC2'));
                $text .= $create_date;
            }
        }

        if ($params->get('show_modify_date') && ($params->get('show_author') || $params->
            get('show_create_date')))
        {

            $text .= " - ";
        }

        if ($params->get('show_modify_date'))
        {

            if (intval($course->modified))
            {
                $mod_date = JHTML::_('date', $course->modified);
                $text .= JText::_('LAST REVISED') . ' ' . $mod_date;
            }
        }
        return $text;
    }
}
« Last Edit: October 11, 2010, 02:32:24 PM by mrginger » Logged
John
Administrator
Sr. Member
*****
Posts: 421


JoomlAtWork team member


View Profile Email
« Reply #1 on: November 14, 2010, 09:55:22 AM »

Is now fixed in v2.9 which is soon to be released.

John
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!