Пример #1
0
	/**
	 * @todo Implement testGetMetaData().
	 */
	public function testGetMetaData() {
		$this->object = new JDocument;
		$this->assertThat(
			$this->object->getMetaData('generator'),
			$this->equalTo('Joomla! 1.7 - Open Source Content Management'),
			'JDocument::getMetaData did not return generator properly'
		);

		$this->object->setMetaData('generator', 'My Custom Generator');

		$this->assertThat(
			$this->object->getMetaData('generator'),
			$this->equalTo('My Custom Generator'),
			'JDocument::getMetaData did not return generator properly or setMetaData with generator did not work'
		);

		$this->assertThat(
			$this->object->getMetaData('description'),
			$this->equalTo(''),
			'JDocument::getMetaData did not return description properly'
		);

		$this->object->setMetaData('description', 'My Description');

		$this->assertThat(
			$this->object->getMetaData('description'),
			$this->equalTo('My Description'),
			'JDocument::getMetaData did not return description properly or setMetaData with description didn not set properly'
		);

		$this->object->setMetaData('myMetaTag', 'myMetaContent');

		$this->assertThat(
			$this->object->getMetaData('myMetaTag'),
			$this->equalTo('myMetaContent'),
			'JDocument::getMetaData or setMetaData failed'
		);

		$this->assertThat(
			$this->object->getMetaData('myMetaTag', true),
			$this->logicalNot($this->equalTo('myMetaContent')),
			'JDocument::getMetaData or setMetaData returned http_equiv when it should not have'
		);

		$this->object->setMetaData('myOtherMetaTag', 'myOtherMetaContent', true);

		$this->assertThat(
			$this->object->getMetaData('myOtherMetaTag', true),
			$this->equalTo('myOtherMetaContent'),
			'JDocument::getMetaData or setMetaData failed'
		);

		$this->assertThat(
			$this->object->getMetaData('myOtherMetaTag'),
			$this->logicalNot($this->equalTo('myOtherMetaContent')),
			'JDocument::getMetaData or setMetaData returned http_equiv when it should not have'
		);


	}
	/**
	 * Prepares the document
	 *
	 * @return void
	 *
	 * @since       1.7.2
	 */
	protected function prepareDocument()
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();
		$title = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading', JText::_('COM_CHURCHDIRECTORY_DEFAULT_PAGE_TITLE'));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($this->category->metadesc)
		{
			$this->document->setDescription($this->category->metadesc);
		}
		elseif (!$this->category->metadesc && $this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->category->metakey)
		{
			$this->document->setMetaData('keywords', $this->category->metakey);
		}
		elseif (!$this->category->metakey && $this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetaData('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetaData('robots', $this->params->get('robots'));
		}
	}
Пример #3
0
 /**
  * @testdox  Test the return for getMetaData with a custom param and HTTP-Equiv flag false with data not set to HTTP-Equiv
  */
 public function testTheReturnForGetMetaDataWithCustomParamAndHttpEquivFalseAndDataSet()
 {
     $this->object->setMetaData('myMetaTag', 'myMetaContent');
     $this->assertSame('myMetaContent', $this->object->getMetaData('myMetaTag'));
 }
Пример #4
0
http://www.yourwebsite.com/index.php?option=com_blastchatc&d=1

Load client with parameters defined in admin backend for BlastChat component, but force to go to room with id
http://www.yourwebsite.com/index.php?option=com_blastchatc&rid=123
**********************************************************************************************************/
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
/* disable cache */
$cache =& JFactory::getCache();
$cache->setCaching(false);
// make sure it caches
$nowDate = date("D, d M Y H:i:s", time());
JDocument::setMetaData("robots", "noindex, nofollow", true);
JDocument::setMetaData("expires", $nowDate . " GMT");
JDocument::setMetaData("cache-control", "no-store, no-cache, must-revalidate");
JDocument::setMetaData("pragma", "no-store");
/* check - server to server communication for public access
*  keepsession - keep user session active with your website
*  signoff - chatter logout/signoff from chat
*  return null (stop precessing this file)
 */
$bc_task = JRequest::getString('bc_task', null);
if ($bc_task) {
    require_once JPATH_ROOT . DS . 'components' . DS . 'com_blastchatc' . DS . 'api.blastchatc.php';
    switch ($bc_task) {
        case 'updatelist':
            if (file_exists(JPATH_ROOT . DS . 'modules' . DS . 'mod_blastchatc' . DS . 'mod_blastchatc_api.php')) {
                require_once JPATH_ROOT . DS . 'modules' . DS . 'mod_blastchatc' . DS . 'mod_blastchatc_api.php';
            } else {
                echo "BlastChat module dynamic support not available.";
            }