示例#1
0
 function listTemplates()
 {
     global $toC_Json, $osC_Language;
     $osC_DirectoryListing = new osC_DirectoryListing('../templates');
     $osC_DirectoryListing->setIncludeDirectories(true);
     $osC_DirectoryListing->setIncludeFiles(false);
     $osC_DirectoryListing->setExcludeEntries('system');
     $files = $osC_DirectoryListing->getFiles(true);
     foreach ($files as $file) {
         include '../templates/' . $file['name'] . '/template.php';
         $code = $file['name'];
         $class = 'osC_Template_' . $code;
         if (class_exists($class)) {
             $module = new $class();
             $module_title = $module->getTitle();
             $action = array();
             if ($module->isInstalled()) {
                 if ($module->getCode() == DEFAULT_TEMPLATE) {
                     $module_title .= ' (' . $osC_Language->get('default_entry') . ')';
                     $action[] = array('class' => 'icon-default-record', 'qtip' => $osC_Language->get('field_set_as_default'));
                 } else {
                     $action[] = array('class' => 'icon-default-gray-record', 'qtip' => $osC_Language->get('field_set_as_default'));
                 }
                 $action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
             } else {
                 $action[] = array('class' => 'icon-empty-record', 'qtip' => $osC_Language->get('field_set_as_default'));
                 $action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
             }
             $modules[] = array('code' => $module->getCode(), 'title' => $module_title, 'author' => $module->getAuthorName(), 'url' => $module->getAuthorAddress(), 'action' => $action);
         }
     }
     $response = array(EXT_JSON_READER_ROOT => $modules);
     echo $toC_Json->encode($response);
 }
示例#2
0
 function listNodes()
 {
     global $toC_Json;
     $directory = '/';
     if (isset($_REQUEST['directory']) && !empty($_REQUEST['directory'])) {
         $directory = urldecode($_REQUEST['directory']);
     }
     $osC_DirectoryListing = new osC_DirectoryListing(OSC_ADMIN_FILE_MANAGER_ROOT_PATH . '/' . $directory);
     $osC_DirectoryListing->setIncludeFiles(false);
     $nodes = array();
     foreach ($osC_DirectoryListing->getFiles() as $file) {
         $path = $directory . '/' . $file['name'];
         $path = str_replace('//', '/', $path);
         if ($file['is_directory'] === true) {
             $nodes[] = array(id => $path, text => $file['name'], path => $path);
         }
     }
     $response = $nodes;
     echo $toC_Json->encode($response);
 }
示例#3
0
 function upload()
 {
     $logo_image = new upload('logo_image');
     if ($logo_image->exists()) {
         self::deleteLogo('originals');
         $img_type = substr($_FILES['logo_image']['name'], strrpos($_FILES['logo_image']['name'], '.') + 1);
         $original = DIR_FS_CATALOG . DIR_WS_IMAGES . 'logo_originals.' . $img_type;
         $logo_image->set_destination(realpath(DIR_FS_CATALOG . 'images/'));
         if ($logo_image->parse() && $logo_image->save()) {
             copy(DIR_FS_CATALOG . 'images/' . $logo_image->filename, $original);
             @unlink(DIR_FS_CATALOG . 'images/' . $logo_image->filename);
             $osC_DirectoryListing = new osC_DirectoryListing('../templates');
             $osC_DirectoryListing->setIncludeDirectories(true);
             $osC_DirectoryListing->setIncludeFiles(false);
             $osC_DirectoryListing->setExcludeEntries('system');
             $templates = $osC_DirectoryListing->getFiles();
             foreach ($templates as $template) {
                 $code = $template['name'];
                 if (file_exists('../templates/' . $code . '/template.php')) {
                     include '../templates/' . $code . '/template.php';
                     $class = 'osC_Template_' . $code;
                     self::deleteLogo($code);
                     if (class_exists($class)) {
                         $module = new $class();
                         $logo_height = $module->getLogoHeight();
                         $logo_width = $module->getLogoWidth();
                         $dest_image = DIR_FS_CATALOG . DIR_WS_IMAGES . 'logo_' . $code . '.' . $img_type;
                         osc_gd_resize($original, $dest_image, $logo_width, $logo_height);
                     }
                 }
             }
             return true;
         }
     }
     return false;
 }
示例#4
0
 function _createIndexSitemap()
 {
     global $osC_Language;
     $handle = fopen($this->_save_path . 'sitemapsIndex.xml', 'w');
     $xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
     $xml .= '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
     fwrite($handle, $xml);
     $directory_listing = new osC_DirectoryListing($this->_save_path);
     $directory_listing->setIncludeDirectories(false);
     $directory_listing->setIncludeFiles(true);
     $directory_listing->setCheckExtension('xml');
     $xmls = $directory_listing->getFiles();
     if (!empty($xmls)) {
         foreach ($xmls as $xml) {
             if ($xml['name'] !== $this->_file_name . 'Index.xml' && preg_match('/^sitemaps[A-Za-z_]+\\.xml$/', $xml['name'])) {
                 $content = "\t" . '<sitemap>' . "\n";
                 $content .= "\t\t" . '<loc>' . $this->_base_url . basename($xml['name']) . '</loc>' . "\n";
                 $content .= "\t\t" . '<lastmod>' . date("Y-m-d", filemtime($this->_save_path . basename($xml['name']))) . '</lastmod>' . "\n";
                 $content .= "\t" . '</sitemap>' . "\n";
                 fwrite($handle, $content);
             }
         }
     }
     fwrite($handle, '</sitemapindex>');
     fclose($handle);
     $osC_Language->set($this->_original_language_code);
     return true;
 }
示例#5
0
 function uploadLanguage()
 {
     global $toC_Json, $osC_Language, $osC_Currencies;
     $osC_Currencies = new osC_Currencies();
     $error = false;
     $feedback = array();
     $language = $_FILES['upload_file'];
     $tmp_path = DIR_FS_CACHE . 'languages/' . time();
     if (!is_dir(DIR_FS_CACHE . 'languages')) {
         if (!mkdir(DIR_FS_CACHE . 'languages', 0777)) {
             $error = true;
         }
     }
     if ($error === false && mkdir($tmp_path, 0777)) {
         $temp_file = new upload($language, $tmp_path);
         if ($temp_file->exists() && $temp_file->parse() && $temp_file->save()) {
             require_once '../ext/zip/pclzip.lib.php';
             $archive = new PclZip($tmp_path . '/' . $temp_file->filename);
             if ($archive->extract(PCLZIP_OPT_PATH, $tmp_path) == 0) {
                 $error = true;
                 $feedback[] = $osC_Language->get('ms_error_wrong_zip_file_format');
             }
         } else {
             $error = true;
             $feedback[] = $osC_Language->get('ms_error_save_file_failed');
         }
     } else {
         $error = true;
         $feedback[] = sprintf($osC_Language->get('ms_error_creating_directory_failed'), DIR_FS_CACHE);
     }
     if ($error === false) {
         $osC_DirectoryListing = new osC_DirectoryListing($tmp_path);
         $osC_DirectoryListing->setIncludeDirectories(true);
         $osC_DirectoryListing->setIncludeFiles(false);
         $files = $osC_DirectoryListing->getFiles();
         $code = null;
         foreach ($files as $file) {
             if (is_dir($tmp_path . '/' . $file['name'] . '/includes') && is_dir($tmp_path . '/' . $file['name'] . '/' . DIR_FS_ADMIN) && is_dir($tmp_path . '/' . $file['name'] . '/install')) {
                 $code = $file['name'];
                 break;
             }
         }
         if ($code != null) {
             toc_dircopy($tmp_path . '/' . $code . "/includes/languages", DIR_FS_CATALOG . 'includes/languages');
             toc_dircopy($tmp_path . '/' . $code . "/" . DIR_FS_ADMIN . "includes/languages", DIR_FS_CATALOG . DIR_FS_ADMIN . 'includes/languages');
             toc_dircopy($tmp_path . '/' . $code . "/install/includes/languages", DIR_FS_CATALOG . 'install/includes/languages');
             toc_dircopy($tmp_path . '/' . $code . "/install/templates", DIR_FS_CATALOG . 'install/templates');
             osc_remove($tmp_path);
         } else {
             $error = true;
             $feedback[] = $osC_Language->get('ms_error_wrong_language_package');
         }
     }
     if ($error === false) {
         if (osC_Language_Admin::import($code, 'replace')) {
             $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
         } else {
             $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
         }
     } else {
         $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed') . '<br />' . implode('<br />', $feedback));
     }
     header('Content-Type: text/html');
     echo $toC_Json->encode($response);
 }
$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
while ($Qtc->next()) {
    $tax_class_array[] = array('id' => $Qtc->valueInt('tax_class_id'), 'text' => $Qtc->value('tax_class_title'));
}
$Qwc = $osC_Database->query('select weight_class_id, weight_class_title from :table_weight_class where language_id = :language_id order by weight_class_title');
$Qwc->bindTable(':table_weight_class', TABLE_WEIGHT_CLASS);
$Qwc->bindInt(':language_id', $osC_Language->getID());
$Qwc->execute();
$weight_class_array = array();
while ($Qwc->next()) {
    $weight_class_array[] = array('id' => $Qwc->valueInt('weight_class_id'), 'text' => $Qwc->value('weight_class_title'));
}
require 'includes/classes/directory_listing.php';
$osC_Dir_Images = new osC_DirectoryListing('../images');
$osC_Dir_Images->setExcludeEntries('CVS');
$osC_Dir_Images->setIncludeFiles(false);
$osC_Dir_Images->setRecursive(true);
$osC_Dir_Images->setAddDirectoryToFilename(true);
$files = $osC_Dir_Images->getFiles();
$image_directories = array(array('id' => '', 'text' => 'images/'));
foreach ($files as $file) {
    $image_directories[] = array('id' => $file['name'], 'text' => 'images/' . $file['name']);
}
?>

<script type="text/javascript" src="external/FCKeditor/2.0b1/fckeditor.js"></script>
<style type="text/css">@import url('external/jscalendar/calendar-win2k-1.css');</style>
<script type="text/javascript" src="external/jscalendar/calendar.js"></script>
<script type="text/javascript" src="external/jscalendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="external/jscalendar/calendar-setup.js"></script>