Ver código fonte

Fix home path

Julio Montoya 9 anos atrás
pai
commit
5e26bb4e22

+ 2 - 2
main/admin/settings.lib.php

@@ -1004,7 +1004,7 @@ function add_edit_template() {
                     $new_file_name = add_ext_on_mime(stripslashes($_FILES['template_image']['name']), $_FILES['template_image']['type']);
 
                     // The upload directory.
-                    $upload_dir = api_get_path(SYS_PATH).'home/default_platform_document/template_thumb/';
+                    $upload_dir = api_get_path(SYS_APP_PATH).'home/default_platform_document/template_thumb/';
 
                     // Create the directory if it does not exist.
                     if (!is_dir($upload_dir)) {
@@ -1079,7 +1079,7 @@ function delete_template($id) {
     $result = Database::query($sql);
     $row = Database::fetch_array($result);
     if (!empty($row['image'])) {
-        @unlink(api_get_path(SYS_PATH).'home/default_platform_document/template_thumb/'.$row['image']);
+        @unlink(api_get_path(SYS_APP_PATH).'home/default_platform_document/template_thumb/'.$row['image']);
     }
 
     // Now we remove it from the database.

+ 4 - 4
main/help/faq.php

@@ -25,14 +25,14 @@ if (!empty($_GET['edit']) && $_GET['edit'] == 'true' && api_is_platform_admin())
     $form = new FormValidator('set_faq', 'post', 'faq.php?edit=true');
     $form->addHtmlEditor('faq_content', null, false, false, array('ToolbarSet' => 'FAQ', 'Width' => '100%', 'Height' => '300'));
     $form->addButtonSave(get_lang('Ok'), 'faq_submit');
-    $faq_content = @(string)file_get_contents(api_get_path(SYS_PATH).'home/faq.html');
+    $faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/faq.html');
     $faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
     $form->setDefaults(array('faq_content' => $faq_content));
     if ($form->validate()) {
         $content = $form->getSubmitValue('faq_content');
-        $fpath = api_get_path(SYS_PATH).'home/'.$faq_file;
+        $fpath = api_get_path(SYS_APP_PATH).'home/'.$faq_file;
         if (is_file($fpath) && is_writeable($fpath)) {
-            $fp = fopen(api_get_path(SYS_PATH).'home/'.$faq_file, 'w');
+            $fp = fopen(api_get_path(SYS_APP_PATH).'home/'.$faq_file, 'w');
             fwrite($fp, $content);
             fclose($fp);
         } else {
@@ -43,7 +43,7 @@ if (!empty($_GET['edit']) && $_GET['edit'] == 'true' && api_is_platform_admin())
         $form->display();
     }
 } else {
-	$faq_content = @(string)file_get_contents(api_get_path(SYS_PATH).'home/'.$faq_file);
+	$faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
 	$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
 	echo $faq_content;
 }

+ 1 - 1
src/Chamilo/CoreBundle/Component/Editor/Driver/HomeDriver.php

@@ -25,7 +25,7 @@ class HomeDriver extends Driver implements DriverInterface
     public function getConfiguration()
     {
         if ($this->allow()) {
-            $home = api_get_path(SYS_PATH).'home';
+            $home = api_get_path(SYS_APP_PATH).'home';
 
             return array(
                 'driver' => 'HomeDriver',