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. + * + */ +?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+
+

+
+

+
+

+
+

+
+

+
+

+
+

- tag that inserts name into email body'; ?>

+

- tag that inserts user name into email body'; ?>

+

- tag that inserts link to new password page into email body'; ?>

+

+ +

+
+

+
+

+
+

+
+

+ +

+
+ +
+ +
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. + * + */ +?> + + + + +
+

+ + +
+
+ + $tabs){ + echo '
'.$tabs.'
'; + } + ?> +
+
+
\ No newline at end of file diff --git a/www/application/views/usermanager/passwordReset.php b/www/application/views/usermanager/passwordReset.php deleted file mode 100644 index 359d5de5..00000000 --- a/www/application/views/usermanager/passwordReset.php +++ /dev/null @@ -1,97 +0,0 @@ -. - * - * @copyright Copyright 2012 Open Labyrinth. All Rights Reserved. - * - */ -?> - - - - -
-

- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

-
-

-
-

-
-

-
-

-
-

-
-

-
-

- tag that inserts name into email body'; ?>

-

- tag that inserts user name into email body'; ?>

-

- tag that inserts link to new password page into email body'; ?>

-

- -

-
-

-
-

-
-

-
-

- -

-
- -
- -
-
-
diff --git a/www/css/basic.css b/www/css/basic.css index c5f8cf2e..9da5d9a6 100644 --- a/www/css/basic.css +++ b/www/css/basic.css @@ -19,7 +19,7 @@ */ /* Layout Stylesheet */ -p { font-family: Arial, Helvetica, sans-serif; font-size: 80%;font-style: normal; font-weight: normal; color: #000000} +p { font-family: Arial, Helvetica, sans-serif; font-size: 13px;font-style: normal; font-weight: normal; color: #000000} h1 { font-family: Arial, Helvetica, sans-serif; font-size: 262.5%; font-weight: bold; color: #000000} h2 { font-family: Arial, Helvetica, sans-serif; font-size: 187.5%; font-weight: bold; color: #000000} h3 { font-family: Arial, Helvetica, sans-serif; font-size: 150%; font-weight: bold; color: #000000} @@ -295,4 +295,8 @@ ul.auto-list > li{ background: #fff; line-height: 80%; padding: 7px 7px 8px; +} + +#tabs li { + font-size:14px; } \ No newline at end of file diff --git a/www/css/jquery-ui-1.9.1.custom.css b/www/css/jquery-ui-1.9.1.custom.css index a46fe50d..97b6da55 100644 --- a/www/css/jquery-ui-1.9.1.custom.css +++ b/www/css/jquery-ui-1.9.1.custom.css @@ -9,7 +9,7 @@ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: block; } .ui-helper-clearfix:after { clear: both; } .ui-helper-clearfix { zoom: 1; } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } @@ -133,9 +133,10 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad width: 200px; /*must have*/ height: 200px; /*must have*/ }.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } + .ui-dialog .dialog-box {font-size:12px; text-align: left;} .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; display:none; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } @@ -227,9 +228,9 @@ body .ui-tooltip { border-width: 2px; } /* Component containers ----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 14px; } +.ui-widget .ui-widget { font-size: 12px; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { } .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(/images/jqueryui/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(/images/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } diff --git a/www/scripts/application.js b/www/scripts/application.js index 7136c406..a543b7d3 100644 --- a/www/scripts/application.js +++ b/www/scripts/application.js @@ -131,4 +131,27 @@ jQuery(document).ready(function(){ myField.value += myValue; } } + + jQuery("#dialog-confirm").dialog({ + autoOpen: false, + draggable: false, + resizable: false, + modal: true, + buttons: { + "I agree": function() { + jQuery(this).dialog( "close" ); + jQuery('#upload-form').submit(); + }, + Cancel: function() { + jQuery(this).dialog( "close" ); + } + } + }); + + jQuery("#opener").click(function() { + $("#dialog-confirm").dialog( "open" ); + return false; + }); + + jQuery("#tabs").tabs(); });