diff --git a/www/application/classes/controller/filemanager.php b/www/application/classes/controller/filemanager.php
index 82082e3b..29b093a7 100644
--- a/www/application/classes/controller/filemanager.php
+++ b/www/application/classes/controller/filemanager.php
@@ -32,6 +32,7 @@ public function action_index() {
$this->templateData['files_size'] = DB_ORM::model('map_element')->sizeFormat($fileInfo['size']);
$this->templateData['files_count'] = $fileInfo['count'];
+ $this->templateData['media_copyright'] = Kohana::$config->load('media_upload_copyright');
$fileView = View::factory('labyrinth/file/view');
$fileView->set('templateData', $this->templateData);
diff --git a/www/application/classes/controller/systemmanager.php b/www/application/classes/controller/systemmanager.php
new file mode 100644
index 00000000..dd8b9ae0
--- /dev/null
+++ b/www/application/classes/controller/systemmanager.php
@@ -0,0 +1,120 @@
+.
+ *
+ * @copyright Copyright 2012 Open Labyrinth. All Rights Reserved.
+ *
+ */
+ defined('SYSPATH') or die('No direct script access.');
+
+class Controller_SystemManager extends Controller_Base {
+
+ public function before() {
+ parent::before();
+
+ if(Auth::instance()->get_user()->type->name != 'superuser') {
+ Request::initial()->redirect(URL::base());
+ }
+
+ unset($this->templateData['right']);
+ $this->template->set('templateData', $this->templateData);
+ }
+
+ public function action_index(){
+ $this->templateData['token'] = Security::token();
+ $this->templateData['email_config'] = Kohana::$config->load('email');
+ $viewPasswordReset = View::factory('systemmanager/passwordReset');
+ $viewPasswordReset->set('templateData', $this->templateData);
+ $this->templateData['tabsName'][0] = __('Password recovery settings');
+ $this->templateData['tabs'][0] = $viewPasswordReset;
+
+ $this->templateData['media_copyright'] = Kohana::$config->load('media_upload_copyright');
+ $viewCopyright = View::factory('systemmanager/mediaUploadCopyright');
+ $viewCopyright->set('templateData', $this->templateData);
+ $this->templateData['tabsName'][1] = __('Media Upload - Copyright Notice');
+ $this->templateData['tabs'][1] = $viewCopyright;
+
+ $view = View::factory('systemmanager/view');
+ $view->set('templateData', $this->templateData);
+
+ $this->templateData['center'] = $view;
+ $this->template->set('templateData', $this->templateData);
+ }
+
+ public function action_updatePasswordResetSettings(){
+ if ($_POST){
+ if (Security::check($_POST['token'])){
+ unset($_POST['token']);
+ $string = 'return array (';
+ foreach($_POST as $key => $value){
+ $value = str_replace('"', '\"', $value);
+ $string .= '"'.$key.'" => "'.$value.'", ';
+ }
+ $string .= ');';
+
+ $content = '';
+ $handle = fopen(DOCROOT.'application/config/email.php', 'r');
+ while (($buffer = fgets($handle)) !== false) {
+ $content .= $buffer;
+ }
+
+ $position = strpos($content, 'return array');
+ $header = substr($content, 0, $position);
+
+ file_put_contents(DOCROOT.'application/config/email.php', $header.$string);
+
+ Request::initial()->redirect(URL::base().'systemManager');
+ }else{
+ Request::initial()->redirect(URL::base());
+ }
+ }else{
+ Request::initial()->redirect(URL::base());
+ }
+ }
+
+ public function action_updateMediaUploadCopyright(){
+ if ($_POST){
+ if (Security::check($_POST['token'])){
+ unset($_POST['token']);
+ $string = 'return array (';
+ foreach($_POST as $key => $value){
+ $value = str_replace('"', '\"', $value);
+ $string .= '"'.$key.'" => "'.$value.'", ';
+ }
+ $string .= ');';
+
+ $content = '';
+ $handle = fopen(DOCROOT.'application/config/media_upload_copyright.php', 'r');
+ while (($buffer = fgets($handle)) !== false) {
+ $content .= $buffer;
+ }
+
+ $position = strpos($content, 'return array');
+ $header = substr($content, 0, $position);
+
+ file_put_contents(DOCROOT.'application/config/media_upload_copyright.php', $header.$string);
+
+ Request::initial()->redirect(URL::base().'systemManager#tabs-1');
+ }else{
+ Request::initial()->redirect(URL::base());
+ }
+ }else{
+ Request::initial()->redirect(URL::base());
+ }
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/www/application/classes/controller/usermanager.php b/www/application/classes/controller/usermanager.php
index 0d35a72f..68f9e733 100644
--- a/www/application/classes/controller/usermanager.php
+++ b/www/application/classes/controller/usermanager.php
@@ -200,47 +200,6 @@ public function action_removeMember() {
DB_ORM::model('user_group')->remove((int)$groupId, (int)$userId);
Request::initial()->redirect(URL::base().'usermanager/editGroup/'.$groupId);
}
-
- public function action_passwordResetSettings(){
- $this->templateData['token'] = Security::token();
- $this->templateData['email_config'] = Kohana::$config->load('email');
- $view = View::factory('usermanager/passwordReset');
- $view->set('templateData', $this->templateData);
-
- $this->templateData['center'] = $view;
- $this->template->set('templateData', $this->templateData);
- }
-
- public function action_updatePasswordResetSettings(){
- if ($_POST){
- if (Security::check($_POST['token'])){
- unset($_POST['token']);
- $string = 'return array (';
- foreach($_POST as $key => $value){
- $value = str_replace('"', '\"', $value);
- $string .= '"'.$key.'" => "'.$value.'", ';
- }
- $string .= ');';
-
- $content = '';
- $handle = fopen(DOCROOT.'application/config/email.php', 'r');
- while (($buffer = fgets($handle)) !== false) {
- $content .= $buffer;
- }
-
- $position = strpos($content, 'return array');
- $header = substr($content, 0, $position);
-
- file_put_contents(DOCROOT.'application/config/email.php', $header.$string);
-
- Request::initial()->redirect(URL::base().'usermanager/passwordResetSettings/');
- }else{
- Request::initial()->redirect(URL::base());
- }
- }else{
- Request::initial()->redirect(URL::base());
- }
- }
}
?>
diff --git a/www/application/classes/model/leap/map/element.php b/www/application/classes/model/leap/map/element.php
index a21da4ce..c1ba2b00 100644
--- a/www/application/classes/model/leap/map/element.php
+++ b/www/application/classes/model/leap/map/element.php
@@ -261,14 +261,18 @@ public function deleteFile($fileId) {
}
public function getFilesSize($filesArray) {
- $totalsize = 0;
- foreach($filesArray as $file){
- $totalsize += filesize(DOCROOT.$file->path);
- }
+ $totalsize = 0;
+ $total['size'] = 0;
+ $total['count'] = 0;
+ if (count($filesArray) > 0){
+ foreach($filesArray as $file){
+ $totalsize += filesize(DOCROOT.$file->path);
+ }
- $total['size'] = $totalsize;
- $total['count'] = count($filesArray);
- return $total;
+ $total['size'] = $totalsize;
+ $total['count'] = count($filesArray);
+ }
+ return $total;
}
public function sizeFormat($size)
diff --git a/www/application/config/media_upload_copyright.php b/www/application/config/media_upload_copyright.php
new file mode 100644
index 00000000..a7987c1a
--- /dev/null
+++ b/www/application/config/media_upload_copyright.php
@@ -0,0 +1,23 @@
+.
+ *
+ * @copyright Copyright 2012 Open Labyrinth. All Rights Reserved.
+ *
+ */
+defined('SYSPATH') or die('No direct access allowed.');
+
+return array ("title" => "General statement", "copyright_message" => "I acknowledge that I own the copyright to the digital media I upload, or that I have obtained the written permission of the copyright owner, or am using an digital media with an appropriate Creative Commons license.", );
\ No newline at end of file
diff --git a/www/application/views/adminMenu.php b/www/application/views/adminMenu.php
index 0c3fe5f1..c7be41fc 100644
--- a/www/application/views/adminMenu.php
+++ b/www/application/views/adminMenu.php
@@ -70,8 +70,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/www/application/views/labyrinth/file/view.php b/www/application/views/labyrinth/file/view.php
index c9df5d91..1acde212 100644
--- a/www/application/views/labyrinth/file/view.php
+++ b/www/application/views/labyrinth/file/view.php
@@ -109,18 +109,21 @@
"name; ?>"
-
+
+
+
JPEG (.jpg + .jpeg), GIF (.gif), PNG (.png), Acrobat PDF (.pdf), Shockwave Flash (.swf), Microsoft Word, (.doc), Microsoft Excel (.xls), Microsoft PowerPoint (.ppt), Rich Text Format (.rtf), Quicktime Video (.mov), MPEG-4 Video (.mp4), Windows Media (.wmv), Real Stream (.ram), Real Stream (.rpm), Flash video, (.flv), MP3 audio (.mp3), WAV audio (.wav), AAC (m4a) audio (.m4a)
diff --git a/www/application/views/systemmanager/mediaUploadCopyright.php b/www/application/views/systemmanager/mediaUploadCopyright.php
new file mode 100644
index 00000000..715fd332
--- /dev/null
+++ b/www/application/views/systemmanager/mediaUploadCopyright.php
@@ -0,0 +1,49 @@
+.
+ *
+ * @copyright Copyright 2012 Open Labyrinth. All Rights Reserved.
+ *
+ */
+?>
+
\ No newline at end of file
diff --git a/www/application/views/systemmanager/passwordReset.php b/www/application/views/systemmanager/passwordReset.php
new file mode 100644
index 00000000..6c007dc5
--- /dev/null
+++ b/www/application/views/systemmanager/passwordReset.php
@@ -0,0 +1,86 @@
+.
+ *
+ * @copyright Copyright 2012 Open Labyrinth. All Rights Reserved.
+ *
+ */
+?>
+
diff --git a/www/application/views/systemmanager/view.php b/www/application/views/systemmanager/view.php
new file mode 100644
index 00000000..87ae226a
--- /dev/null
+++ b/www/application/views/systemmanager/view.php
@@ -0,0 +1,46 @@
+.
+ *
+ * @copyright Copyright 2012 Open Labyrinth. All Rights Reserved.
+ *
+ */
+?>
+