class mw_config_actions_logs extends mw_controller{
- function index(&$env){
+ public function index(){
+ $env = $this->env();
$env->run("config/actions_logs/historique");
}
- function historique(&$env){
+ public function historique(){
+ $env = $this->env();
$env->set_config(array("max_list" => 20));
$data = $env->data();
if(
$env->set_out("historique", $historique);
}
- function del_historique(&$env){
+ public function del_historique(){
+ $env = $this->env();
$data = $env->data();
if(!$data->clear_actions_logs()){
$env->erreur("impossible de vider l'historique");
);
}
- function config(&$env){
+ public function config(){
+ $env = $this->env();
$data = $env->data();
if(($actions_logs_config = $data->get_actions_logs_config()) === false){
$env->erreur("impossible de lire la configuration");
$env->set_out("actions_logs_config", $actions_logs_config);
}
- function logs_actions(&$env){
+ public function logs_actions(){
+ $env = $this->env();
$data = $env->data();
if(($actions_logs_config = $data->get_actions_logs_config()) === false){
$env->erreur("impossible de lire la configuration");
$env->set_out("logs_actions", $logs_actions);
}
- function add_log_action(&$env){
+ public function add_log_action(){
+ $env = $this->env();
$data = $env->data();
if(($actions_logs_config = $data->get_actions_logs_config()) === false){
$env->erreur("impossible de lire la configuration");
$env->set_out("log_action", $log_action);
}
- function del_log_action(&$env){
+ public function del_log_action(){
+ $env = $this->env();
$data = $env->data();
if(!($log_action = $data->get_logs_actions("id", $_GET[$env->param("id")]))){
$env->erreur("impossible de lire les informations de cette action dans la liste");
);
}
- function del_logs_actions(&$env){
+ public function del_logs_actions(){
+ $env = $this->env();
$data = $env->data();
if(!$data->clear_logs_actions()){
$env->erreur("impossible de vider la liste");
}
}
-
-?>
\ No newline at end of file
// config
//
- function get_actions_logs_config(){
+ public function get_actions_logs_config(){
$env = $this->env();
return array(
"do_log" => $env->config("actions_logs_do_log") ? true : false,
);
}
- function set_actions_logs_config($params = array()){
+ public function set_actions_logs_config($params = array()){
if(isset($params["do_log"])){
if(!$this->set_config("actions_logs_do_log", $params["do_log"] ? 1 : 0)){
return false;
// actions
//
- function clear_logs_actions(){
+ public function clear_logs_actions(){
$sgbd = $this->sgbd();
try{
$sgbd->query("DELETE FROM #--logs_actions");
// logs
//
- function add_action_log($params = array()){
+ public function add_action_log($params = array()){
$env = $this->env();
$sgbd = $this->sgbd();
$log = array();
return true;
}
- function clear_actions_logs(){
+ public function clear_actions_logs(){
$sgbd = $this->sgbd();
try{
$sgbd->query("DELETE FROM #--actions_logs");
}
}
-
-?>
\ No newline at end of file
class mw_observer_actions_logs extends mw_observer{
- var $config;
+ public $config;
- function init_actions_logs(){
+ public function init_actions_logs(){
$env = $this->env();
$data = $env->data();
if(($this->config = $data->get_actions_logs_config()) === false) return false;
return true;
}
- function before_action(){
+ public function before_action(){
$env = $this->env();
$data = $env->data();
$user = $env->user();
}
}
- function after_action(){
+ public function after_action(){
}
}
-
-?>
\ No newline at end of file
class mw_actions_logs extends mw_plugin{
- function title(){
+ public function title(){
return "Actions logs";
}
- function description(){
+ public function description(){
return "Enregistre un historique des actions sur le site";
}
- function init($env){
+ public function init($env){
$env->set_link("config/actions_logs", $env->url("config/actions_logs/historique"), "Historique des actions", 50);
$env->set_link("config/actions_logs/config", $env->url("config/actions_logs/config"), "Configuration des logs", 20);
$env->set_link("config/actions_logs/logs_actions", $env->url("config/actions_logs/logs_actions"), "Liste des actions", 30);
return true;
}
- function enable($env){
+ public function enable($env){
return true;
}
- function disable($env){
+ public function disable($env){
return true;
}
- function install($env){
+ public function install($env){
if($env->bdd("sgbd") == "xml") return "ce plugin necessite un stockage de données sql";
$data = $env->data();
$sgbd = $data->sgbd();
return true;
}
- function uninstall($env){
+ public function uninstall($env){
$data = $env->data();
$sgbd = $data->sgbd();
if(!$this->disable($env)) return "impossible de desactiver le plugin";
}
}
-
-?>
\ No newline at end of file