|
@@ -34,6 +34,11 @@ function hackpoint_install($id){
|
|
|
if($id != 'fr.idleman.hackpoint') return;
|
|
|
Entity::install(__DIR__);
|
|
|
|
|
|
+ global $conf;
|
|
|
+ require_once(__DIR__.SLASH.'ResourceType.class.php');
|
|
|
+ foreach(ResourceType::types(null,true) as $uid=>$type){
|
|
|
+ $conf->put('hackpoint_resource_'.$uid,true);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//Fonction executée lors de la désactivation du plugin
|
|
@@ -58,12 +63,12 @@ function hackpoint_menu_setting(&$settingMenu){
|
|
|
|
|
|
if(!$myUser->can('hackpoint','configure')) return;
|
|
|
|
|
|
- /* $settingMenu[]= array(
|
|
|
+ $settingMenu[]= array(
|
|
|
'sort' =>1,
|
|
|
'url' => 'setting.php?section=global.hackpoint',
|
|
|
'icon' => 'fas fa-angle-right',
|
|
|
- 'label' => 'hackpoint Général'
|
|
|
- );*/
|
|
|
+ 'label' => ' Hackpoint'
|
|
|
+ );
|
|
|
|
|
|
|
|
|
}
|
|
@@ -76,14 +81,6 @@ function hackpoint_content_setting(){
|
|
|
}
|
|
|
|
|
|
|
|
|
-//Déclaration des settings de base
|
|
|
-//Types possibles : text,select ( + "values"=> array('1'=>'Val 1'),password,checkbox. Un simple string définit une catégorie.
|
|
|
-Configuration::setting('hackpoint',array(
|
|
|
- "Général",
|
|
|
- //'hackpoint_enable' => array("label"=>"Activer","type"=>"checkbox"),
|
|
|
-));
|
|
|
-
|
|
|
-
|
|
|
function hackpoint_manage_types(&$types){
|
|
|
$types = array_merge($types,glob(__DIR__.SLASH.'types'.SLASH.'*.class.php'));
|
|
|
}
|
|
@@ -332,4 +329,18 @@ Plugin::addHook("content_setting", "hackpoint_content_setting");
|
|
|
Plugin::addHook("hackpoint_resource_type", "hackpoint_manage_types");
|
|
|
Plugin::addHook("rewrite", "hackpoint_dav");
|
|
|
|
|
|
+
|
|
|
+require_once('ResourceType.class.php');
|
|
|
+
|
|
|
+$configuration = array("Types de ressources");
|
|
|
+
|
|
|
+foreach(ResourceType::types() as $uid=>$type){
|
|
|
+ $configuration['hackpoint_resource_'.$uid] = array("label"=>"Activer : ".$type['label'],"type"=>"checkbox");
|
|
|
+}
|
|
|
+
|
|
|
+//Déclaration des settings de base
|
|
|
+//Types possibles : text,select ( + "values"=> array('1'=>'Val 1'),password,checkbox. Un simple string définit une catégorie.
|
|
|
+Configuration::setting('hackpoint',$configuration);
|
|
|
+
|
|
|
+
|
|
|
?>
|