<?php /****************************************************************/ /* ATutor */ /****************************************************************/ /* Copyright (c) 2002-2010 */ /* Inclusive Design Institute */ /* http://atutor.ca */ /* */ /* This program is free software. You can redistribute it and/or*/ /* modify it under the terms of the GNU General Public License */ /* as published by the Free Software Foundation. */ /****************************************************************/ // $Id$
/** * Imports a theme from a URL or Zip file to Atutor * @access private * @author Shozub Qureshi */ functionimport_theme() { global $db; global $msg; if (isset($_POST['url']) && ($_POST['url'] != 'http://') ) { if ($content = @file_get_contents($_POST['url'])) { ⋮ // unzip file and save into directory in themes $archive = new PclZip($_FILES['file']['tmp_name']); //extract contents to importpath/foldrname if (!$archive->extract($import_path)) { $errors = array('IMPORT_ERROR_IN_ZIP', $archive->errorInfo(true)); clr_dir($import_path); $msg->addError($errors); header('Location: index.php'); exit; }