diff options
author | Brice Maron <brice@bmaron.net> | 2011-10-29 10:07:01 +0200 |
---|---|---|
committer | Brice Maron <brice@bmaron.net> | 2011-10-29 10:07:01 +0200 |
commit | a21908cf18fe139976a4eec494c0dce037c08841 (patch) | |
tree | fad2afc7aa7107b616a0df0e4d80527d6959bbc0 /apps/admin_dependencies_chk | |
parent | a809fe9a048d53c23bb962da5f1b133f4aac82b8 (diff) | |
download | nextcloud-server-a21908cf18fe139976a4eec494c0dce037c08841.tar.gz nextcloud-server-a21908cf18fe139976a4eec494c0dce037c08841.zip |
Change name and fix a typo
Diffstat (limited to 'apps/admin_dependencies_chk')
-rw-r--r-- | apps/admin_dependencies_chk/appinfo/app.php | 9 | ||||
-rw-r--r-- | apps/admin_dependencies_chk/appinfo/info.xml | 11 | ||||
-rw-r--r-- | apps/admin_dependencies_chk/css/style.css | 9 | ||||
-rw-r--r-- | apps/admin_dependencies_chk/settings.php | 91 | ||||
-rw-r--r-- | apps/admin_dependencies_chk/templates/settings.php | 16 |
5 files changed, 136 insertions, 0 deletions
diff --git a/apps/admin_dependencies_chk/appinfo/app.php b/apps/admin_dependencies_chk/appinfo/app.php new file mode 100644 index 00000000000..e2169b5dd77 --- /dev/null +++ b/apps/admin_dependencies_chk/appinfo/app.php @@ -0,0 +1,9 @@ +<?php +$l=new OC_L10N('admin_dependencies_chk'); + +OC_App::register( array( + 'order' => 14, + 'id' => 'admin_dependencies_chk', + 'name' => 'Owncloud Install Info' )); + +OC_APP::registerAdmin('admin_dependencies_chk','settings'); diff --git a/apps/admin_dependencies_chk/appinfo/info.xml b/apps/admin_dependencies_chk/appinfo/info.xml new file mode 100644 index 00000000000..7216a1ee862 --- /dev/null +++ b/apps/admin_dependencies_chk/appinfo/info.xml @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<info> + <id>admin_dependencies_chk</id> + <name>Owncloud dependencies info</name> + <version>0.01</version> + <licence>MIT</licence> + <author>Brice Maron (eMerzh)</author> + <require>2</require> + <description>Display OwnCloud's dependencies informations (missings modules, ...)</description> + <default_enable/> +</info> diff --git a/apps/admin_dependencies_chk/css/style.css b/apps/admin_dependencies_chk/css/style.css new file mode 100644 index 00000000000..30f204be7bc --- /dev/null +++ b/apps/admin_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/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php new file mode 100644 index 00000000000..a3c93964977 --- /dev/null +++ b/apps/admin_dependencies_chk/settings.php @@ -0,0 +1,91 @@ +<?php + +/** + * ownCloud - user_ldap + * + * @author Brice Maron + * @copyright 2011 Brice Maron brice __from__ bmaron _DOT_ net + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ +$l=new OC_L10N('admin_dependencies_chk'); +$tmpl = new OC_Template( 'admin_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 applications 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('admin_dependencies_chk', 'style'); +$tmpl->assign( 'items', $modules ); + +return $tmpl->fetchPage(); diff --git a/apps/admin_dependencies_chk/templates/settings.php b/apps/admin_dependencies_chk/templates/settings.php new file mode 100644 index 00000000000..8ff27ebb187 --- /dev/null +++ b/apps/admin_dependencies_chk/templates/settings.php @@ -0,0 +1,16 @@ +<fieldset id="status_list" class="personalblock"> + <legend><?php echo $l->t('Dependencies status');?></legend> + <ul class="state"> + <?php foreach($_['items'] as $item):?> + <li class="state_<?php echo $item['status'];?>"> + <span class="state_module" title="<?php echo $item['message'];?>"><?php echo $item['part'];?></span> + <div class="state_used"><?php echo $l->t('Used by :');?> + <ul> + <?php foreach($item['modules'] as $module):?> + <li><?php echo $module;?></li> + <?php endforeach;?> + </ul> + </li> + <?php endforeach;?> + </ul> +</fieldset>
\ No newline at end of file |