function save($data) { // Get the previous configuration. if (is_object($data)) { $data = JArrayHelper::fromObject($data); } $prev = JTheFactoryHelper::getConfig(); $prev = JArrayHelper::fromObject($prev); $data = array_merge($prev, $data); $configfile = JTheFactoryAdminHelper::getConfigFile(); $config = new JRegistry('config'); $config->loadArray($data); jimport('joomla.filesystem.path'); jimport('joomla.filesystem.file'); jimport('joomla.client.helper'); // Get the new FTP credentials. $ftp = JClientHelper::getCredentials('ftp', true); // Attempt to make the file writeable if using FTP. if (!$ftp['enabled'] && JPath::isOwner($configfile) && !JPath::setPermissions($configfile, '0644')) { JError::raiseNotice(101, JText::_('FACTORY_SETTINGS_FILE_IS_NOT_WRITABLE')); } // Attempt to write the configuration file as a PHP class named JConfig. $configString = $config->toString('PHP', array('class' => ucfirst(APP_PREFIX) . "Config", 'closingtag' => false)); if (!JFile::write($configfile, $configString)) { JError::raiseWarning(101, JText::_('FACTORY_SETTINGS_FILE_WRITE_FAILED')); return false; } // Attempt to make the file unwriteable if using FTP. if (!$ftp['enabled'] && JPath::isOwner($configfile) && !JPath::setPermissions($configfile, '0444')) { JError::raiseNotice(101, JText::_('FACTORY_SETTINGS_FILE_IS_NOT_WRITABLE')); } return true; }
<?php defined('_JEXEC') or die('Restricted access'); ?> <div id="cpanel"> <?php foreach ($this->links as $k => $link) { JTheFactoryAdminHelper::quickiconButton($link, 'admin/' . $k . '_integration.png', $this->lables[$k]); } ?> </div>