Ejemplo n.º 1
0
 public function onExport()
 {
     ini_set('max_execution_time', 5000);
     //require(JPATH_COMPONENT.'/helpers/archive.php');
     require JPATH_COMPONENT . '/helpers/archivefactory.php';
     //copy XML file
     jimport('joomla.filesystem.file');
     $src = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'jckeditor.xml';
     $dest = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jckman' . DS . 'editor' . DS . 'plugins' . DS . 'jckeditor.xml';
     if (!JFile::copy($src, $dest)) {
         $this->app->enqueueMessage(JText::_('COM_JCKMAN_CPANEL_UNABLE_TO_COPY_MANIFEST'));
     }
     $src = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'jckeditor' . DS . 'includes' . DS . 'ckeditor' . DS . 'toolbar';
     $dest = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jckman' . DS . 'editor' . DS . 'toolbar';
     if (!JFolder::copy($src, $dest, '', true)) {
         $this->app->enqueueMessage(JText::_('COM_JCKMAN_CPANEL_UNABLE_TO_COPY_TOOLBARS'));
     }
     $src = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jckman' . DS . 'language' . DS . 'overrides';
     $dest = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jckman' . DS . 'editor' . DS . 'overrides';
     if (!JFolder::copy($src, $dest, '', true)) {
         $this->app->enqueueMessage(JText::_('COM_JCKMAN_CPANEL_UNABLE_TO_COPY_TOOLBARS'));
     }
     //process SQL
     if ($this->_createSQL()) {
         // Create a new gzip file test.tgz in htdocs/test
         $backup_file_name = 'bak_jckeditor' . date('dmyHis');
         /*
               		$tgz = new gzip_file($backup_file_name);
         $tgz->set_options(array('basedir' => JPATH_COMPONENT."/editor", 'overwrite' =>1,'inmemory'=>1,level=>5));
         $tgz->add_files('import.xml');
         $tgz->add_files('toolbar');
         $tgz->add_files('plugins');
         $tgz->create_archive();
         $tgz->download_file();
         exit;
         */
         $tgz = new ArchiveFactory(JPATH_COMPONENT . "/editor", $backup_file_name);
         $tgz->downloadFile();
     } else {
         JCKHelper::error(JText::_("COM_JCKMAN_CPANEL_COULD_NOT_CREATE_SQL"));
     }
 }
Ejemplo n.º 2
0
 public function onExport()
 {
     //require(JPATH_COMPONENT.'/helpers/archive.php');
     require JPATH_COMPONENT . '/helpers/archivefactory.php';
     //copy XML file
     jimport('joomla.filesystem.file');
     $src = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'jckeditor.xml';
     $dest = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jckman' . DS . 'editor' . DS . 'plugins' . DS . 'jckeditor.xml';
     if (!JFile::copy($src, $dest)) {
         $mainframe->enqueueMessage(JText::_('Unable to copy JCK Editor\'s Manifest file'));
     }
     $src = JPATH_PLUGINS . DS . 'editors' . DS . 'jckeditor' . DS . 'jckeditor' . DS . 'includes' . DS . 'ckeditor' . DS . 'toolbar';
     $dest = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jckman' . DS . 'editor' . DS . 'toolbar';
     if (!JFolder::copy($src, $dest, '', true)) {
         $mainframe->enqueueMessage(JText::_('Unable to copy JCK Editor\'s toolbars'));
     }
     //process SQL
     if ($this->_createSQL()) {
         // Create a new gzip file test.tgz in htdocs/test
         $backup_file_name = 'bak_jckeditor' . date('dmyHis');
         /*
         $tgz = new gzip_file($backup_file_name);
         $tgz->set_options(array('basedir' => JPATH_COMPONENT."/editor", 'overwrite' =>1,'inmemory'=>1,level=>5));
         $tgz->add_files('import.xml');
         $tgz->add_files('toolbar');
         $tgz->add_files('plugins');
         $tgz->create_archive();
         $tgz->download_file();
         		
         exit;
         */
         $tgz = new ArchiveFactory(JPATH_COMPONENT . "/editor", $backup_file_name);
         $tgz->downloadFile();
     } else {
         JError::raiseWarning(100, "Could not create SQL file");
     }
 }