From 4d55e2ff71d48e607d9af9a740f25ad17d17182e Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sun, 7 Aug 2011 16:02:26 +0200 Subject: [PATCH 01/15] Fix header links --- application/views/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/header.php b/application/views/header.php index a62827d..78e724c 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -21,7 +21,7 @@ From 4040c40d697115d8eeccfb195ab7a4e636de0968 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sun, 7 Aug 2011 16:02:57 +0200 Subject: [PATCH 02/15] Implement table pagination with jQuery --- application/views/project/list.php | 15 +------ assets/css/style.css | 12 +++++- assets/css/table.css | 12 +++++- assets/js/scattport.js | 68 ++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 17 deletions(-) diff --git a/application/views/project/list.php b/application/views/project/list.php index 97344bf..682467e 100644 --- a/application/views/project/list.php +++ b/application/views/project/list.php @@ -8,7 +8,7 @@

Übersicht aller Projekte

- +
@@ -68,19 +68,6 @@
Projekt
- -
diff --git a/assets/css/style.css b/assets/css/style.css index 294fad3..546d0be 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -255,6 +255,16 @@ li { margin-left: 20px;} .pagination ul li a { } +.pagination ul li.clickable { + color: #0088cc; + cursor: pointer; +} + +.pagination ul li.active { + color: #222; + cursor: default; +} + /* Footer */ #footer { @@ -454,4 +464,4 @@ html ul.tabs li.active, html ul.tabs li.active a:hover { /*--Makes sure that th } .tab_content { padding: 20px; -} \ No newline at end of file +} diff --git a/assets/css/table.css b/assets/css/table.css index 2fdd9e0..fa5a1f5 100644 --- a/assets/css/table.css +++ b/assets/css/table.css @@ -34,5 +34,13 @@ table .odd { background: #f6f6f6; } -table tbody tr:nth-child(even) {background: #fff} -table tbody tr:nth-child(odd) {background: #f6f6f6} \ No newline at end of file +table .even { + background: #fff; +} + +table .hover { + background: #f0f0f0; +} +/*table tbody tr:nth-child(even) {background: #fff} +table tbody tr:nth-child(odd) {background: #f6f6f6}*/ + diff --git a/assets/js/scattport.js b/assets/js/scattport.js index 876d214..9f1e60f 100644 --- a/assets/js/scattport.js +++ b/assets/js/scattport.js @@ -6,6 +6,12 @@ function get_notifications() { }); } +$.fn.alternateRowColors = function() { + $('tbody tr:odd', this).removeClass('even').addClass('odd'); + $('tbody tr:even', this).removeClass('odd').addClass('even'); + return this; +}; + $(document).ready(function() { //When page loads... @@ -29,3 +35,65 @@ $(document).ready(function() { get_notifications(); setInterval('get_notifications()', '5000'); }); + +$(document).ready(function() { + var settings = $.extend( { + table_class : 'tableList' + }, settings); + + $('.' + settings.table_class + ' tbody tr').hover(function() { + $(this).addClass("hover"); + }, function() { + $(this).removeClass("hover"); + }); + + $('.' + settings.table_class + ' tbody input:checkbox').click(function() { + if ($(this).attr('checked') == true) { + $(this).parent().parent().addClass('selected'); + } else { + $(this).parent().parent().removeClass('selected'); + } + }); + + $('.' + settings.table_class).each(function() { + var table = $(this); + table.alternateRowColors(table); + }); +}); + +$(document).ready(function() { + $('.paginated').each(function() { + var currentPage = 0; + var numPerPage = 6; + var table = $(this); + + table.bind('repaginate', function() { + var start = currentPage * numPerPage; + var end = (currentPage + 1) * numPerPage; + table.find('tbody tr').slice(start, end).show().end().slice(0, start).hide().end().slice(end).hide().end(); + }); + + var numRows = table.find('tbody tr').length; + var numPages = Math.ceil(numRows / numPerPage); + + var $pager = $(''); + var $pagelist = $(''); + + $pagelist.append('
  • Seite:
  • '); + + for (var page = 0; page < numPages; page++) { + $('
  • ' + (page + 1) + '
  • ').bind('click', {'newPage': page}, function(event) { + currentPage = event.data['newPage']; + table.trigger('repaginate'); + + $(this).addClass('active').siblings().removeClass('active'); + }).appendTo($pagelist).addClass('clickable'); + } + + $pagelist.find('li.page-number:first').addClass('active'); + $pager.append($pagelist) + $pager.insertAfter(table); + + table.trigger('repaginate'); + }); +}); From d1b0998f388a272df24c6da24290e94fc68ef203 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sun, 7 Aug 2011 19:19:55 +0200 Subject: [PATCH 03/15] Better design for tabs --- assets/css/style.css | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 546d0be..201510a 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -422,23 +422,23 @@ ul.tabs { padding: 0; float: left; list-style: none; - height: 32px; /*--Set height of tabs--*/ - border-bottom: 1px solid #999; - border-left: 1px solid #999; + height: 27px; /*--Set height of tabs--*/ + border-bottom: 1px solid #e8e8e8; + border-left: 1px solid #e8e8e8; width: 100%; } ul.tabs li { float: left; margin: 0; padding: 0; - height: 31px; /*--Subtract 1px from the height of the unordered list--*/ - line-height: 31px; /*--Vertically aligns the text within the tab--*/ - border: 1px solid #999; + height: 26px; /*--Subtract 1px from the height of the unordered list--*/ + line-height: 26px; /*--Vertically aligns the text within the tab--*/ + border: 1px solid #e8e8e8; border-left: none; margin-bottom: -1px; /*--Pull the list item down 1px--*/ overflow: hidden; position: relative; - background: #e0e0e0; + background: #e0e0e0 url('../images/navigation-off.gif'); } ul.tabs li a { text-decoration: none; @@ -449,7 +449,7 @@ ul.tabs li a { outline: none; } ul.tabs li a:hover { - background: #ccc; + background: #f0f0f0; } html ul.tabs li.active, html ul.tabs li.active a:hover { /*--Makes sure that the active tab does not listen to the hover properties--*/ background: #fff; @@ -457,7 +457,7 @@ html ul.tabs li.active, html ul.tabs li.active a:hover { /*--Makes sure that th } .tab_container { - border: 1px solid #999; + border: 1px solid #e8e8e8; border-top: none; overflow: hidden; background: #fff; From 2d9259b8cadb9ec67f3dfab83b95e2764c598876 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sun, 7 Aug 2011 19:51:32 +0200 Subject: [PATCH 04/15] Translate the settings page --- .../language/english/settings_lang.php | 6 +++++ application/language/german/settings_lang.php | 6 +++++ application/views/user/settings.php | 22 +++++++++---------- assets/css/style.css | 3 +-- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/application/language/english/settings_lang.php b/application/language/english/settings_lang.php index bf17275..efe937e 100644 --- a/application/language/english/settings_lang.php +++ b/application/language/english/settings_lang.php @@ -1,5 +1,11 @@
    -

    Einstellungen

    +

    - +
      -
    - - +
  • +

    +
    +
  • -
    -
    +
    • -
      - +
      +
    diff --git a/assets/css/style.css b/assets/css/style.css index 201510a..d790b01 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -444,8 +444,7 @@ ul.tabs li a { text-decoration: none; color: #000; display: block; - padding: 0 20px; - border: 1px solid #fff; /*--Gives the bevel look with a 1px white border inside the list item--*/ + padding: 1px 21px; outline: none; } ul.tabs li a:hover { From 533daf7e246b25dc2a200309e9eaf3c344dbe9fc Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sun, 7 Aug 2011 19:52:34 +0200 Subject: [PATCH 05/15] Delete unused languages --- application/language/ca/datamapper_lang.php | 25 ------------------- application/language/es/datamapper_lang.php | 25 ------------------- application/language/fr/datamapper_lang.php | 25 ------------------- application/language/nl/datamapper_lang.php | 25 ------------------- .../language/pt_BR/datamapper_lang.php | 25 ------------------- 5 files changed, 125 deletions(-) delete mode 100644 application/language/ca/datamapper_lang.php delete mode 100644 application/language/es/datamapper_lang.php delete mode 100644 application/language/fr/datamapper_lang.php delete mode 100644 application/language/nl/datamapper_lang.php delete mode 100644 application/language/pt_BR/datamapper_lang.php diff --git a/application/language/ca/datamapper_lang.php b/application/language/ca/datamapper_lang.php deleted file mode 100644 index d1b0fca..0000000 --- a/application/language/ca/datamapper_lang.php +++ /dev/null @@ -1,25 +0,0 @@ - Date: Sun, 7 Aug 2011 19:53:21 +0200 Subject: [PATCH 06/15] Fix dashboard link in footer --- application/views/footer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/footer.php b/application/views/footer.php index 02945b5..050cf56 100644 --- a/application/views/footer.php +++ b/application/views/footer.php @@ -1,5 +1,5 @@ From 1512b07dc09017bdbe98d66e72a4efef9ee202c4 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sun, 7 Aug 2011 21:49:57 +0200 Subject: [PATCH 07/15] Add language field to settings page --- .../language/english/settings_lang.php | 1 + application/language/german/settings_lang.php | 1 + application/views/user/settings.php | 25 ++++++++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/application/language/english/settings_lang.php b/application/language/english/settings_lang.php index efe937e..15e80bb 100644 --- a/application/language/english/settings_lang.php +++ b/application/language/english/settings_lang.php @@ -6,6 +6,7 @@ $lang['tab_settings'] = "Settings"; $lang['projects_sortrecently'] = "Sort projects by date of the last access"; $lang['projects_sortrecently_note'] = "If the projects are sorted by the data of the last access, the rarely used projects "slip" to the end of the list."; +$lang['language_select'] = "Language"; /* End of file settings_lang.php */ /* Location: ./application/language/german/settings_lang.php */ diff --git a/application/language/german/settings_lang.php b/application/language/german/settings_lang.php index 5a238d4..a7154c4 100644 --- a/application/language/german/settings_lang.php +++ b/application/language/german/settings_lang.php @@ -6,6 +6,7 @@ $lang['tab_settings'] = "Einstellungen"; $lang['projects_sortrecently'] = "Projekte nach Zeitpunkt des letzten Zugriffs sortieren"; $lang['projects_sortrecently_note'] = "Werden die Projekte nach dem Zeitpunkt des letzten Zugriffs sortiert, "rutschen" die selten verwendeten Projekte in der Liste nach unten."; +$lang['language_select'] = "Sprache"; /* End of file settings_lang.php */ /* Location: ./application/language/german/settings_lang.php */ diff --git a/application/views/user/settings.php b/application/views/user/settings.php index a8f5413..4351bb1 100644 --- a/application/views/user/settings.php +++ b/application/views/user/settings.php @@ -1,4 +1,4 @@ -load->view('header'); ?> +load->view('header');?>
    @@ -13,20 +13,27 @@
      - +
    • -

      -
      + +
      + +
    • - +
      +
    • + +
      + +
      +

    • From e3608e413b2cd8930455ddf8fe29ffb41bacd7cb Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sun, 7 Aug 2011 21:50:27 +0200 Subject: [PATCH 08/15] Implement language selection link --- application/helpers/MY_language_helper.php | 54 ++++++++++++++++++++++ application/views/header.php | 5 +- 2 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 application/helpers/MY_language_helper.php diff --git a/application/helpers/MY_language_helper.php b/application/helpers/MY_language_helper.php new file mode 100644 index 0000000..fdefa01 --- /dev/null +++ b/application/helpers/MY_language_helper.php @@ -0,0 +1,54 @@ + + */ + +/** + * Generates a link for language selection. + * + * @access public + * @param string $img_folder Folder of the images for the language selection + * @param boolean $index_page Should index_page be added to the JavaScript path + * @return string + */ +if (!function_exists('lang_select')) { + function lang_select($img_folder = '', $index_page = false) { + $CI =& get_instance(); + + $link = 'config->item('lang_selected') == 'en') { + $link .= ' href="' . $CI->config->site_url('de') . '">'; + + if (isset($img_folder) && $img_folder != '') { + if ($index_page === true) { + $link .= ''; + } else { + $link .= ''; + } + } + $link .= ' English'; + } else if ($CI->config->item('lang_selected') == 'de') { + $link .= ' href="' . $CI->config->site_url('en') . '" >'; + + if (isset($img_folder) && $img_folder != '') { + if ($index_page === true) { + $link .= ''; + } else { + $link .= ''; + } + } + $link .= ' Deutsch'; + } + + $link .= "\n"; + + return $link; + } +} + +/* End of file MY_language_helper.php */ +/* Location: ./application/helpers/MY_language_helper.php */ + diff --git a/application/views/header.php b/application/views/header.php index 78e724c..6dd8de7 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -20,9 +20,8 @@
      From 197546b2edb3a4262393b5de9090e8431321455a Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sun, 7 Aug 2011 23:03:00 +0200 Subject: [PATCH 09/15] Translate dashboard --- application/language/english/dashboard_lang.php | 17 ++++++++++++++++- application/language/german/dashboard_lang.php | 15 +++++++++++++++ application/views/dashboard.php | 14 +++++++------- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/application/language/english/dashboard_lang.php b/application/language/english/dashboard_lang.php index db12754..bea812b 100644 --- a/application/language/english/dashboard_lang.php +++ b/application/language/english/dashboard_lang.php @@ -1,5 +1,20 @@
      -

      Dashboard

      +

      From a0530ea6e8bd25cd64a5f10704b142a69ee0a599 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Mon, 8 Aug 2011 00:00:01 +0200 Subject: [PATCH 10/15] Some clean-up in scattport.js --- assets/js/scattport.js | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/assets/js/scattport.js b/assets/js/scattport.js index 9f1e60f..4f2aa4b 100644 --- a/assets/js/scattport.js +++ b/assets/js/scattport.js @@ -13,21 +13,19 @@ $.fn.alternateRowColors = function() { }; $(document).ready(function() { + $(".tab_content").hide(); // hide all content + $("ul.tabs li:first").addClass("active").show(); // activate first tab + $(".tab_content:first").show(); // show first tab content - //When page loads... - $(".tab_content").hide(); //Hide all content - $("ul.tabs li:first").addClass("active").show(); //Activate first tab - $(".tab_content:first").show(); //Show first tab content - - //On Click Event + // onClick event $("ul.tabs li").click(function() { - $("ul.tabs li").removeClass("active"); //Remove any "active" class - $(this).addClass("active"); //Add "active" class to selected tab - $(".tab_content").hide(); //Hide all tab content + $("ul.tabs li").removeClass("active"); // remove any "active" class + $(this).addClass("active"); // add "active" class to selected tab + $(".tab_content").hide(); // hide all tab content - var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content - $(activeTab).fadeIn(); //Fade in the active ID content + var activeTab = $(this).find("a").attr("href"); + $(activeTab).fadeIn(); // fade in the active tab content return false; }); @@ -36,17 +34,22 @@ $(document).ready(function() { setInterval('get_notifications()', '5000'); }); +/* + * Tables + */ $(document).ready(function() { - var settings = $.extend( { + var settings = { table_class : 'tableList' - }, settings); + }; + // add or delete "hover" class on mouseOver event $('.' + settings.table_class + ' tbody tr').hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); }); + // add or delete "selected" class if a row is selected via checkbox $('.' + settings.table_class + ' tbody input:checkbox').click(function() { if ($(this).attr('checked') == true) { $(this).parent().parent().addClass('selected'); @@ -55,13 +58,15 @@ $(document).ready(function() { } }); + // alternate table rows $('.' + settings.table_class).each(function() { var table = $(this); table.alternateRowColors(table); }); -}); -$(document).ready(function() { + /* + * Pagination + */ $('.paginated').each(function() { var currentPage = 0; var numPerPage = 6; @@ -91,7 +96,7 @@ $(document).ready(function() { } $pagelist.find('li.page-number:first').addClass('active'); - $pager.append($pagelist) + $pager.append($pagelist); $pager.insertAfter(table); table.trigger('repaginate'); From 956ebb8ae36a434781757f563b8be6516da09466 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Mon, 8 Aug 2011 00:13:32 +0200 Subject: [PATCH 11/15] Add index.html to all folders --- application/datamapper/index.html | 10 ++++++++++ application/language/index.html | 10 ++++++++++ application/views/admin/index.html | 10 ++++++++++ application/views/admin/server/index.html | 10 ++++++++++ application/views/auth/index.html | 10 ++++++++++ application/views/global/index.html | 10 ++++++++++ application/views/index.html | 10 ++++++++++ application/views/project/index.html | 10 ++++++++++ application/views/trial/index.html | 10 ++++++++++ application/views/user/index.html | 10 ++++++++++ assets/css/index.html | 10 ++++++++++ assets/images/icons/index.html | 10 ++++++++++ assets/images/index.html | 10 ++++++++++ assets/index.html | 10 ++++++++++ assets/js/index.html | 10 ++++++++++ assets/js/language/index.html | 10 ++++++++++ 16 files changed, 160 insertions(+) create mode 100755 application/datamapper/index.html create mode 100755 application/language/index.html create mode 100755 application/views/admin/index.html create mode 100755 application/views/admin/server/index.html create mode 100755 application/views/auth/index.html create mode 100755 application/views/global/index.html create mode 100755 application/views/index.html create mode 100755 application/views/project/index.html create mode 100755 application/views/trial/index.html create mode 100755 application/views/user/index.html create mode 100755 assets/css/index.html create mode 100755 assets/images/icons/index.html create mode 100755 assets/images/index.html create mode 100755 assets/index.html create mode 100755 assets/js/index.html create mode 100755 assets/js/language/index.html diff --git a/application/datamapper/index.html b/application/datamapper/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/datamapper/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/language/index.html b/application/language/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/language/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/admin/index.html b/application/views/admin/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/admin/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/admin/server/index.html b/application/views/admin/server/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/admin/server/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/auth/index.html b/application/views/auth/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/auth/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/global/index.html b/application/views/global/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/global/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/index.html b/application/views/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/project/index.html b/application/views/project/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/project/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/trial/index.html b/application/views/trial/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/trial/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/application/views/user/index.html b/application/views/user/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/user/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/assets/css/index.html b/assets/css/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/assets/css/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/assets/images/icons/index.html b/assets/images/icons/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/assets/images/icons/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/assets/images/index.html b/assets/images/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/assets/images/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/assets/index.html b/assets/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/assets/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/assets/js/index.html b/assets/js/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/assets/js/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file diff --git a/assets/js/language/index.html b/assets/js/language/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/assets/js/language/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

      Directory access is forbidden.

      + + + \ No newline at end of file From 891caabb56581694c34b2cb1a1a3fb26f9cae73c Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Mon, 8 Aug 2011 00:33:26 +0200 Subject: [PATCH 12/15] Extend CI's controller to automatically load language files --- application/controllers/ajax.php | 17 +++++++---------- application/controllers/api.php | 8 ++++---- application/controllers/auth.php | 2 +- application/controllers/dashboard.php | 5 +---- application/controllers/jobs.php | 13 +++++-------- application/controllers/programs.php | 11 ++++------- application/controllers/projects.php | 5 +---- application/controllers/results.php | 19 ++++++++----------- application/controllers/settings.php | 5 +---- application/controllers/trials.php | 5 +---- application/core/MY_Controller.php | 20 ++++++++++++++++++++ 11 files changed, 53 insertions(+), 57 deletions(-) create mode 100644 application/core/MY_Controller.php diff --git a/application/controllers/ajax.php b/application/controllers/ajax.php index fbbf14e..a1c99b8 100644 --- a/application/controllers/ajax.php +++ b/application/controllers/ajax.php @@ -1,18 +1,18 @@ - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is + * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -24,19 +24,16 @@ /** * Controller for Ajax requests. - * + * * @author Karsten Heiken */ -class Ajax extends CI_Controller { +class Ajax extends MY_Controller { /** * Constructor. */ public function __construct() { parent::__construct(); - - // load language file - $this->lang->load(strtolower($this->router->class)); } /** diff --git a/application/controllers/api.php b/application/controllers/api.php index 04dbd41..eccb96b 100644 --- a/application/controllers/api.php +++ b/application/controllers/api.php @@ -27,14 +27,14 @@ * * @author Karsten Heiken */ -class api extends CI_Controller { - +class Api extends CI_Controller { + /** * Update the state of a given job. - * + * * Because we do not want any access from servers we do not trust, * we need a special secret to authenticate the servers. - * + * * @param type $secret The secret to authenticate the server. * @param type $job_id The job id that is running on the server. * @param type $state The state of the job. diff --git a/application/controllers/auth.php b/application/controllers/auth.php index 27b3f00..651e6df 100755 --- a/application/controllers/auth.php +++ b/application/controllers/auth.php @@ -5,7 +5,7 @@ * * @author Eike Foken */ -class Auth extends CI_Controller { +class Auth extends MY_Controller { /** * Constructor. diff --git a/application/controllers/dashboard.php b/application/controllers/dashboard.php index 739ebc3..159a649 100644 --- a/application/controllers/dashboard.php +++ b/application/controllers/dashboard.php @@ -25,7 +25,7 @@ /** * @author Karsten Heiken */ -class Dashboard extends CI_Controller { +class Dashboard extends MY_Controller { /** * Constructor. @@ -35,9 +35,6 @@ class Dashboard extends CI_Controller { $this->load->model('job'); $this->load->model('project'); $this->load->model('user'); - - // load language file - $this->lang->load(strtolower($this->router->class)); } public function index() { diff --git a/application/controllers/jobs.php b/application/controllers/jobs.php index 50211c9..12cf44b 100644 --- a/application/controllers/jobs.php +++ b/application/controllers/jobs.php @@ -25,7 +25,7 @@ /** * @author Karsten Heiken */ -class Jobs extends CI_Controller { +class Jobs extends MY_Controller { /** * Constructor. @@ -33,9 +33,6 @@ class Jobs extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('job'); - - // load language file - $this->lang->load(strtolower($this->router->class)); } /** @@ -45,11 +42,11 @@ class Jobs extends CI_Controller { $query = $this->db->order_by('progress', 'desc') ->get_where('jobs', array('started_by' => $this->session->userdata('user_id'))); $jobs = $query->result_array(); - + for($i=0; $idb->select('name')->get_where('projects', array('id' => $jobs[$i]['project_id']))->row()->name; $progress = $jobs[$i]['progress']; - + switch($progress) { case -1: $progress = lang('waiting'); @@ -64,9 +61,9 @@ class Jobs extends CI_Controller { $progress = $progress . "%"; break; } - + $jobs[$i]['progress'] = $progress; - } + } $this->output ->set_content_type('application/json') diff --git a/application/controllers/programs.php b/application/controllers/programs.php index 43a4e80..2e19bc8 100644 --- a/application/controllers/programs.php +++ b/application/controllers/programs.php @@ -25,7 +25,7 @@ /** * @author Karsten Heiken */ -class Programs extends CI_Controller { +class Programs extends MY_Controller { /** * Constructor. @@ -33,9 +33,6 @@ class Programs extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('program'); - - // load language file - $this->lang->load(strtolower($this->router->class)); } /** @@ -43,19 +40,19 @@ class Programs extends CI_Controller { */ public function index() { $programs = $this->program->getAll(); - + $tpl['programs'] = $programs; $this->load->view('program/list', $tpl); } /** * Show detailed information about a program. - * + * * @param type $prg_id The program's id */ public function detail($prg_id) { $program = $this->program->getById($prg_id); - + $tpl['program'] = $program; $this->load->view('program/detail', $tpl); } diff --git a/application/controllers/projects.php b/application/controllers/projects.php index 457d13f..b08ab52 100644 --- a/application/controllers/projects.php +++ b/application/controllers/projects.php @@ -25,7 +25,7 @@ /** * @author Karsten Heiken */ -class Projects extends CI_Controller { +class Projects extends MY_Controller { /** * Constructor. @@ -34,9 +34,6 @@ class Projects extends CI_Controller { parent::__construct(); $this->load->model('project'); $this->load->model('trial'); - - // load language file - $this->lang->load(strtolower($this->router->class)); } /** diff --git a/application/controllers/results.php b/application/controllers/results.php index 5604c6e..7a9482d 100644 --- a/application/controllers/results.php +++ b/application/controllers/results.php @@ -1,18 +1,18 @@ - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is + * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -24,10 +24,10 @@ /** * Result browser. - * + * * @author Karsten Heiken */ -class Results extends CI_Controller { +class Results extends MY_Controller { /** * Constructor. @@ -37,11 +37,8 @@ class Results extends CI_Controller { $this->load->model('program'); $this->load->model('job'); $this->load->model('server'); - - // load language file - $this->lang->load(strtolower($this->router->class)); } - + public function index() { } diff --git a/application/controllers/settings.php b/application/controllers/settings.php index ba33064..42205d7 100644 --- a/application/controllers/settings.php +++ b/application/controllers/settings.php @@ -25,7 +25,7 @@ /** * @author Karsten Heiken */ -class Settings extends CI_Controller { +class Settings extends MY_Controller { /** * Constructor. @@ -33,9 +33,6 @@ class Settings extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('program'); - - // load language file - $this->lang->load(strtolower($this->router->class)); } /** diff --git a/application/controllers/trials.php b/application/controllers/trials.php index ff75a2e..fb7609d 100644 --- a/application/controllers/trials.php +++ b/application/controllers/trials.php @@ -27,7 +27,7 @@ * * @author Karsten Heiken */ -class Trials extends CI_Controller { +class Trials extends MY_Controller { /** * Constructor. @@ -37,9 +37,6 @@ class Trials extends CI_Controller { $this->load->model('trial'); $this->load->model('program'); $this->load->model('project'); - - // load language file - // $this->lang->load(strtolower($this->router->class)); } /** diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php new file mode 100644 index 0000000..e425238 --- /dev/null +++ b/application/core/MY_Controller.php @@ -0,0 +1,20 @@ + +*/ +class MY_Controller extends CI_Controller { + + /** + * Calls the parent constructor and loads the relevant language file. + */ + public function __construct() { + parent::__construct(); + + // load relevant language file + $this->lang->load(strtolower($this->router->class)); + } + +} \ No newline at end of file From e1f1ef140da9aae1211a41ea5d34e50f7b1ad22d Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Mon, 8 Aug 2011 00:33:44 +0200 Subject: [PATCH 13/15] Create missing language files --- application/language/english/trials_lang.php | 5 +++++ application/language/german/trials_lang.php | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 application/language/english/trials_lang.php create mode 100644 application/language/german/trials_lang.php diff --git a/application/language/english/trials_lang.php b/application/language/english/trials_lang.php new file mode 100644 index 0000000..242c041 --- /dev/null +++ b/application/language/english/trials_lang.php @@ -0,0 +1,5 @@ + Date: Mon, 8 Aug 2011 01:16:19 +0200 Subject: [PATCH 14/15] Implement project deletion + some clean-up --- application/controllers/projects.php | 38 +++++++++++++++++++++------- application/views/project/detail.php | 4 +-- application/views/project/list.php | 2 +- 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/application/controllers/projects.php b/application/controllers/projects.php index b08ab52..d3f8f10 100644 --- a/application/controllers/projects.php +++ b/application/controllers/projects.php @@ -37,7 +37,17 @@ class Projects extends MY_Controller { } /** - * Create a new project. + * Shows a list of all projects. + */ + public function index() { + $projects = $this->project->getAll(); + + $tpl['projects'] = $projects; + $this->load->view('project/list', $tpl); + } + + /** + * Allows users to create a new project. */ public function create() { $this->load->library('form_validation'); @@ -98,18 +108,16 @@ class Projects extends MY_Controller { } } - public function index() { - $projects = $this->project->getAll(); - - $tpl['projects'] = $projects; - $this->load->view('project/list', $tpl); - } - + /** + * Shows the project details + * + * @param integer $prj_id The ID of the project to show + */ public function detail($prj_id) { $project = $this->project->getById($prj_id); if (!$project) { $this->messages->add('Das Projekt konnte nicht geladen werden.', 'error'); - redirect('/projects/', 301); + redirect('projects', 301); } $this->session->set_userdata('active_project', $prj_id); @@ -121,4 +129,16 @@ class Projects extends MY_Controller { $this->load->view('project/detail', $tpl); } + /** + * Allows users to delete a project. + * + * @param unknown_type $projectId + */ + public function delete($projectId) { + $this->project->delete($projectId); + $this->session->unset_userdata('active_project'); + $this->messages->add("Das Projekt wurde gelöscht.", 'notice'); + redirect('projects'); + } + } diff --git a/application/views/project/detail.php b/application/views/project/detail.php index bf068e1..51f58e7 100644 --- a/application/views/project/detail.php +++ b/application/views/project/detail.php @@ -8,7 +8,7 @@

      Versuche

      - +
      @@ -50,7 +50,7 @@
      -
      Versuch
      +
      diff --git a/application/views/project/list.php b/application/views/project/list.php index 682467e..7509673 100644 --- a/application/views/project/list.php +++ b/application/views/project/list.php @@ -25,7 +25,7 @@ - + Date: Mon, 8 Aug 2011 12:42:31 +0200 Subject: [PATCH 15/15] Replace shadmin logo --- application/views/header.php | 6 +++--- assets/images/logo.png | Bin 2422 -> 2445 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/views/header.php b/application/views/header.php index 6dd8de7..f3b0bf0 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -20,13 +20,13 @@
      - +
      Versuch Erfolgreich abgeschlossenErgebnisse anzeigen | EntfernenErgebnisse anzeigen |