/** * Constructor. * * @param Registry $options JOpenstreetmapOauth options object. * @param JHttp $client The HTTP client object. * @param JInput $input The input object * * @since 13.1 */ public function __construct(Registry $options = null, JHttp $client = null, JInput $input = null) { $this->options = isset($options) ? $options : new Registry(); $this->options->def('accessTokenURL', 'http://www.openstreetmap.org/oauth/access_token'); $this->options->def('authoriseURL', 'http://www.openstreetmap.org/oauth/authorize'); $this->options->def('requestTokenURL', 'http://www.openstreetmap.org/oauth/request_token'); /* $this->options->def('accessTokenURL', 'http://api06.dev.openstreetmap.org/oauth/access_token'); $this->options->def('authoriseURL', 'http://api06.dev.openstreetmap.org/oauth/authorize'); $this->options->def('requestTokenURL', 'http://api06.dev.openstreetmap.org/oauth/request_token'); */ // Call the JOauth1Client constructor to setup the object. parent::__construct($this->options, $client, $input, null, '1.0'); }
/** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 12.3 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { // Setup the default API url if not already set. $options->def('api.url', 'https://www.googleapis.com/plus/v1/'); parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://www.googleapis.com/auth/plus.me'); } }
/** * Constructor. * * @param JOpenstreetmapOauth $oauth Openstreetmap oauth client * @param Registry $options Openstreetmap options object * @param JHttp $client The HTTP client object * * @since 13.1 */ public function __construct(JOpenstreetmapOauth $oauth = null, Registry $options = null, JHttp $client = null) { $this->oauth = $oauth; $this->options = isset($options) ? $options : new Registry(); $this->client = isset($client) ? $client : new JHttp($this->options); // Setup the default API url if not already set. $this->options->def('api.url', 'http://api.openstreetmap.org/api/0.6/'); // $this->options->def('api.url', 'http://api06.dev.openstreetmap.org/api/0.6/'); }
/** * 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->def('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->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($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')); } }
/** * Method to set a default parameter if it does not exist * * @param string $key Parameter key * @param mixed $value Parameter value * * @return mixed Set parameter value * * @since 11.1 */ public function defParam($key, $value) { return $this->_params->def($key, $value); }
/** * Test the Joomla\Registry\Registry::def method. * * @return void * * @covers Joomla\Registry\Registry::def * @since 1.0 */ public function testDef() { $a = new Registry(); $this->assertThat($a->def('foo', 'bar'), $this->equalTo('bar'), 'Line: ' . __LINE__ . '. def should return default value'); $this->assertThat($a->get('foo'), $this->equalTo('bar'), 'Line: ' . __LINE__ . '. default should now be the current value'); }
/** * @testdox A default value is not assigned to a key if already set * * @covers Joomla\Registry\Registry::def */ public function testDoNotDefineADefaultValueIfKeyIsSet() { $a = new Registry(array('foo' => 'bar')); $this->assertSame($a->def('foo', 'car'), 'bar', 'Calling def() on a key with a value should return the current value.'); }