From a809fe9a048d53c23bb962da5f1b133f4aac82b8 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sat, 29 Oct 2011 00:27:25 +0200 Subject: [PATCH 1/3] Add a dependencies check apps --- apps/dependencies_chk/appinfo/app.php | 9 ++ apps/dependencies_chk/appinfo/info.xml | 11 +++ apps/dependencies_chk/css/style.css | 9 ++ apps/dependencies_chk/settings.php | 91 ++++++++++++++++++++ apps/dependencies_chk/templates/settings.php | 16 ++++ 5 files changed, 136 insertions(+) create mode 100644 apps/dependencies_chk/appinfo/app.php create mode 100644 apps/dependencies_chk/appinfo/info.xml create mode 100644 apps/dependencies_chk/css/style.css create mode 100644 apps/dependencies_chk/settings.php create mode 100644 apps/dependencies_chk/templates/settings.php diff --git a/apps/dependencies_chk/appinfo/app.php b/apps/dependencies_chk/appinfo/app.php new file mode 100644 index 0000000000..dea2cd39f8 --- /dev/null +++ b/apps/dependencies_chk/appinfo/app.php @@ -0,0 +1,9 @@ + 14, + 'id' => 'dependencies_chk', + 'name' => 'Owncloud Install Info' )); + +OC_APP::registerAdmin('dependencies_chk','settings'); diff --git a/apps/dependencies_chk/appinfo/info.xml b/apps/dependencies_chk/appinfo/info.xml new file mode 100644 index 0000000000..38a6dee256 --- /dev/null +++ b/apps/dependencies_chk/appinfo/info.xml @@ -0,0 +1,11 @@ + + + dependencies_chk + Owncloud dependencies info + 0.01 + MIT + Brice Maron (eMerzh) + 2 + Display OwnCloud's dependencies informations (missings modules, ...) + + diff --git a/apps/dependencies_chk/css/style.css b/apps/dependencies_chk/css/style.css new file mode 100644 index 0000000000..30f204be7b --- /dev/null +++ b/apps/dependencies_chk/css/style.css @@ -0,0 +1,9 @@ +#status_list legend { font-weight: bold; color: #888888; } +.state > li { margin-bottom: 3px; padding-left: 0.5em; list-style-type: circle; } +.state .state_module { font-weight:bold; text-shadow: 0 1px 0 #DDD; cursor:help;} + +.state_used ul, .state_used li { display:inline; } + +.state_ok .state_module { color: #009700; } +.state_warning .state_module { color: #FF9B29; } +.state_error .state_module { color: #FF3B3B; } diff --git a/apps/dependencies_chk/settings.php b/apps/dependencies_chk/settings.php new file mode 100644 index 0000000000..ca60953215 --- /dev/null +++ b/apps/dependencies_chk/settings.php @@ -0,0 +1,91 @@ +. + * + */ +$l=new OC_L10N('dependencies_chk'); +$tmpl = new OC_Template( 'dependencies_chk', 'settings'); + +$modules = array(); + +//Possible status are : ok, error, warning +$modules[] =array( + 'status' => function_exists('json_encode') ? 'ok' : 'error', + 'part'=> 'php-json', + 'modules'=> array('core'), + 'message'=> $l->t('The php-json module is needed by the many application for inter communications')); + +$modules[] =array( + 'status' => function_exists('curl_init') ? 'ok' : 'error', + 'part'=> 'php-curl', + 'modules'=> array('bookmarks'), + 'message'=> $l->t('The php-curl modude is needed to fetch the page title when adding a bookmarks')); + +$modules[] =array( + 'status' => function_exists('imagepng') ? 'ok' : 'error', + 'part'=> 'php-gd', + 'modules'=> array('gallery'), + 'message'=> $l->t('The php-gd module is needed to create thumbnails of your images')); + +$modules[] =array( + 'status' => OC_Helper::canExecute("mp3info") ? 'ok' : 'warning', + 'part'=> 'mp3info', + 'modules'=> array('media'), + 'message'=> $l->t('The program mp3info is useful to discover ID3 tags of your music files')); + +$modules[] =array( + 'status' => OC_Helper::canExecute("ldap_bind") ? 'ok' : 'error', + 'part'=> 'php-ldap', + 'modules'=> array('user_ldap'), + 'message'=> $l->t('The php-ldap module is needed connect to your ldap server')); + +$modules[] =array( + 'status' => class_exists('ZipArchive') ? 'ok' : 'warning', + 'part'=> 'php-zip', + 'modules'=> array('admin_export','core'), + 'message'=> $l->t('The php-zip module is needed download multiple files at once')); + +$modules[] =array( + 'status' => function_exists('mb_detect_encoding') ? 'ok' : 'error', + 'part'=> 'php-mb_multibyte ', + 'modules'=> array('core'), + 'message'=> $l->t('The php-mb_multibyte module is needed to manage correctly the encoding.')); + +$modules[] =array( + 'status' => function_exists('ctype_digit') ? 'ok' : 'error', + 'part'=> 'php-ctype', + 'modules'=> array('core'), + 'message'=> $l->t('The php-ctype module is needed validate data.')); + + +foreach($modules as $key => $module) { + $enabled = false ; + foreach($module['modules'] as $app) { + if(OC_App::isEnabled($app) || $app=='core'){ + $enabled = true; + } + } + if($enabled == false) unset($modules[$key]); +} + +OC_UTIL::addStyle('dependencies_chk', 'style'); +$tmpl->assign( 'items', $modules ); + +return $tmpl->fetchPage(); diff --git a/apps/dependencies_chk/templates/settings.php b/apps/dependencies_chk/templates/settings.php new file mode 100644 index 0000000000..8ff27ebb18 --- /dev/null +++ b/apps/dependencies_chk/templates/settings.php @@ -0,0 +1,16 @@ +
+ t('Dependencies status');?> + +
\ No newline at end of file From a21908cf18fe139976a4eec494c0dce037c08841 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sat, 29 Oct 2011 10:07:01 +0200 Subject: [PATCH 2/3] Change name and fix a typo --- apps/admin_dependencies_chk/appinfo/app.php | 9 +++++++++ .../appinfo/info.xml | 2 +- .../css/style.css | 0 .../settings.php | 8 ++++---- .../templates/settings.php | 0 apps/dependencies_chk/appinfo/app.php | 9 --------- 6 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 apps/admin_dependencies_chk/appinfo/app.php rename apps/{dependencies_chk => admin_dependencies_chk}/appinfo/info.xml (90%) rename apps/{dependencies_chk => admin_dependencies_chk}/css/style.css (100%) rename apps/{dependencies_chk => admin_dependencies_chk}/settings.php (93%) rename apps/{dependencies_chk => admin_dependencies_chk}/templates/settings.php (100%) delete mode 100644 apps/dependencies_chk/appinfo/app.php diff --git a/apps/admin_dependencies_chk/appinfo/app.php b/apps/admin_dependencies_chk/appinfo/app.php new file mode 100644 index 0000000000..e2169b5dd7 --- /dev/null +++ b/apps/admin_dependencies_chk/appinfo/app.php @@ -0,0 +1,9 @@ + 14, + 'id' => 'admin_dependencies_chk', + 'name' => 'Owncloud Install Info' )); + +OC_APP::registerAdmin('admin_dependencies_chk','settings'); diff --git a/apps/dependencies_chk/appinfo/info.xml b/apps/admin_dependencies_chk/appinfo/info.xml similarity index 90% rename from apps/dependencies_chk/appinfo/info.xml rename to apps/admin_dependencies_chk/appinfo/info.xml index 38a6dee256..7216a1ee86 100644 --- a/apps/dependencies_chk/appinfo/info.xml +++ b/apps/admin_dependencies_chk/appinfo/info.xml @@ -1,6 +1,6 @@ - dependencies_chk + admin_dependencies_chk Owncloud dependencies info 0.01 MIT diff --git a/apps/dependencies_chk/css/style.css b/apps/admin_dependencies_chk/css/style.css similarity index 100% rename from apps/dependencies_chk/css/style.css rename to apps/admin_dependencies_chk/css/style.css diff --git a/apps/dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php similarity index 93% rename from apps/dependencies_chk/settings.php rename to apps/admin_dependencies_chk/settings.php index ca60953215..a3c9396497 100644 --- a/apps/dependencies_chk/settings.php +++ b/apps/admin_dependencies_chk/settings.php @@ -20,8 +20,8 @@ * License along with this library. If not, see . * */ -$l=new OC_L10N('dependencies_chk'); -$tmpl = new OC_Template( 'dependencies_chk', 'settings'); +$l=new OC_L10N('admin_dependencies_chk'); +$tmpl = new OC_Template( 'admin_dependencies_chk', 'settings'); $modules = array(); @@ -30,7 +30,7 @@ $modules[] =array( 'status' => function_exists('json_encode') ? 'ok' : 'error', 'part'=> 'php-json', 'modules'=> array('core'), - 'message'=> $l->t('The php-json module is needed by the many application for inter communications')); + 'message'=> $l->t('The php-json module is needed by the many applications for inter communications')); $modules[] =array( 'status' => function_exists('curl_init') ? 'ok' : 'error', @@ -85,7 +85,7 @@ foreach($modules as $key => $module) { if($enabled == false) unset($modules[$key]); } -OC_UTIL::addStyle('dependencies_chk', 'style'); +OC_UTIL::addStyle('admin_dependencies_chk', 'style'); $tmpl->assign( 'items', $modules ); return $tmpl->fetchPage(); diff --git a/apps/dependencies_chk/templates/settings.php b/apps/admin_dependencies_chk/templates/settings.php similarity index 100% rename from apps/dependencies_chk/templates/settings.php rename to apps/admin_dependencies_chk/templates/settings.php diff --git a/apps/dependencies_chk/appinfo/app.php b/apps/dependencies_chk/appinfo/app.php deleted file mode 100644 index dea2cd39f8..0000000000 --- a/apps/dependencies_chk/appinfo/app.php +++ /dev/null @@ -1,9 +0,0 @@ - 14, - 'id' => 'dependencies_chk', - 'name' => 'Owncloud Install Info' )); - -OC_APP::registerAdmin('dependencies_chk','settings'); From eaad3ab45fa8a1d33a24afd7147b674aa79434ee Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sat, 29 Oct 2011 10:15:29 +0200 Subject: [PATCH 3/3] Be consistent with licencing --- apps/admin_dependencies_chk/appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/admin_dependencies_chk/appinfo/info.xml b/apps/admin_dependencies_chk/appinfo/info.xml index 7216a1ee86..10721ece15 100644 --- a/apps/admin_dependencies_chk/appinfo/info.xml +++ b/apps/admin_dependencies_chk/appinfo/info.xml @@ -3,7 +3,7 @@ admin_dependencies_chk Owncloud dependencies info 0.01 - MIT + AGPL Brice Maron (eMerzh) 2 Display OwnCloud's dependencies informations (missings modules, ...)