<commit_before><?php
/**
* @version		$Id: html.php 3541 2012-04-02 18:24:42Z johanjanssens $
* @package     	Nooku_Server
* @subpackage  	Contacts
* @copyright	Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net)
* @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link			http://www.nooku.org
*/

/**
 * Contact Html View
 *
 * @author    	<NAME> <http://nooku.assembla.com/profile/johanjanssens>
 * @package     Nooku_Server
 * @subpackage  Contacts
 */
class ComContactsViewContactHtml extends ComDefaultViewHtml
{
    public function display()
    {
        //Get the parameters
        $params = JFactory::getApplication()->getParams();
        
        //Get the contact
        $contact = $this->getModel()->getData();

        //Get the category
        $category = $this->getCategory();

        //Get the parameters of the active menu item
        if ($page = JFactory::getApplication()->getPages()->getActive())
        {
            $menu_params = new JParameter( $page->params );
            if (!$menu_params->get( 'page_title')) {
                $params->set('page_title',	$contact->name);
            }
        }
        else $params->set('page_title',	$contact->name);

        //Set the page title
        JFactory::getDocument()->setTitle( $params->get( 'page_title' ) );

        //Set the breadcrumbs
        $pathway = JFactory::getApplication()->getPathway();

        if($page->link->query['view'] == 'categories' ) {
            $pathway->addItem($category->title, $this->getTemplate()->getHelper('route')->category(array('row' => $category)));
            $pathway->addItem($contact->name, '');
        }

        if($page->link->query['view'] == 'contacts' ) {
            $pathway->addItem($contact->name, '');
        }

        $this->assign('params', $params);
        return parent::display();
    }

    public function getCategory()
    {
        //Get the category
        $category = $this->getService('com://site/contacts.model.categories')
                         ->table('contacts')
                         ->id($this->getModel()->getState()->category)<commit_msg>re #228 : Replaced JFactory::getApplication() with $this->getService('application')<commit_after><?php
/**
* @version		$Id: html.php 3541 2012-04-02 18:24:42Z johanjanssens $
* @package     	Nooku_Server
* @subpackage  	Contacts
* @copyright	Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net)
* @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link			http://www.nooku.org
*/

/**
 * Contact Html View
 *
 * @author    	<NAME> <http://nooku.assembla.com/profile/johanjanssens>
 * @package     Nooku_Server
 * @subpackage  Contacts
 */
class ComContactsViewContactHtml extends ComDefaultViewHtml
{
    public function display()
    {
        //Get the parameters
        $params = $this->getService('application')->getParams();
        
        //Get the contact
        $contact = $this->getModel()->getData();

        //Get the category
        $category = $this->getCategory();

        //Get the parameters of the active menu item
        if ($page = $this->getService('application')->getPages()->getActive())
        {
            $menu_params = new JParameter( $page->params );
            if (!$menu_params->get( 'page_title')) {
                $params->set('page_title',	$contact->name);
            }
        }
        else $params->set('page_title',	$contact->name);

        //Set the page title
        JFactory::getDocument()->setTitle( $params->get( 'page_title' ) );

        //Set the breadcrumbs
        $pathway =$this->getService('application')->getPathway();

        if($page->link->query['view'] == 'categories' ) {
            $pathway->addItem($category->title, $this->getTemplate()->getHelper('route')->category(array('row' => $category)));
            $pathway->addItem($contact->name, '');
        }

        if($page->link->query['view'] == 'contacts' ) {
            $pathway->addItem($contact->name, '');
        }

        $this->assign('params', $params);
        return parent::display();
    }

    public function getCategory()
    {
        //Get the category
        $category = $this->getService('com://site/contacts.model.categories')
                         ->table('contacts')
                         ->id($this->getModel()->getState()->category)
{'fraction_non_alphanumeric': 0.17097142857142858, 'fraction_numerical': 0.01302857142857143, 'mean_word_length': 2.4294670846394983, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3952246', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1287, 'n_words': 240}