Example #1
0
 /**
  * Display the view.
  *
  * @param	string	$tpl	The subtemplate to display.
  *
  * @return	void
  */
 function display($tpl = null)
 {
     // Get params
     JLoader::import('helpers.redmigrator', JPATH_COMPONENT_ADMINISTRATOR);
     $params = redMigratorHelper::getParams();
     //
     // Joomla bug: JInstaller not save the defaults params reading config.xml
     //
     $db = JFactory::getDBO();
     if (!$params->method) {
         $default_params = '{"method":"rest","rest_hostname":"http:\\/\\/www.example.org\\/","rest_username":"","rest_password":"","rest_key":"","path":"","driver":"mysql","hostname":"localhost","username":"","password":"","database":"","prefix":"jos_","skip_checks":"0","skip_files":"1","skip_templates":"1","skip_extensions":"1","skip_core_users":"0","skip_core_categories":"0","skip_core_sections":"0","skip_core_contents":"0","skip_core_contents_frontpage":"0","skip_core_menus":"0","skip_core_menus_types":"0","skip_core_modules":"0","skip_core_modules_menu":"0","skip_core_banners":"0","skip_core_banners_clients":"0","skip_core_banners_tracks":"0","skip_core_contacts":"0","skip_core_newsfeeds":"0","skip_core_weblinks":"0","positions":"0","debug":"0"}';
         $query = "UPDATE #__extensions SET `params` = '{$default_params}' WHERE `element` = 'com_redmigrator'";
         $db->setQuery($query);
         $db->query();
         // Get params.. again
         $params = redMigratorHelper::getParams();
     }
     // Load mooTools
     JHtml::_('behavior.framework', true);
     $xmlfile = JPATH_COMPONENT_ADMINISTRATOR . '/redmigrator.xml';
     $xml = JFactory::getXML($xmlfile);
     $this->params = $params;
     $this->version = $xml->version[0];
     parent::display($tpl);
 }
Example #2
0
 /**
  * Constructor
  *
  * @param   array  $config  A named configuration array for object construction.<br/>
  *                          name: the name (optional) of the view (defaults to the view class name suffix).<br/>
  *                          charset: the character set to use for display<br/>
  *                          escape: the name (optional) of the function to use for escaping strings<br/>
  *                          base_path: the parent path (optional) of the views directory (defaults to the component folder)<br/>
  *                          template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name<br/>
  *                          helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)<br/>
  *                          layout: the layout (optional) to use to display the view<br/>
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->sidebarData = array('active' => strtolower($this->_name));
     // Only show Joomla! menu for 3.X
     if (version_compare(JVERSION, '3.0', '<')) {
         $this->displayJoomlaMenu = false;
     }
 }
Example #3
0
 /**
  * Constructor
  *
  * @param   array  $config  A named configuration array for object construction.<br/>
  *                          name: the name (optional) of the view (defaults to the view class name suffix).<br/>
  *                          charset: the character set to use for display<br/>
  *                          escape: the name (optional) of the function to use for escaping strings<br/>
  *                          base_path: the parent path (optional) of the views directory (defaults to the component folder)<br/>
  *                          template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name<br/>
  *                          helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)<br/>
  *                          layout: the layout (optional) to use to display the view<br/>
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->sidebarData = array('active' => strtolower($this->_name));
 }