From dabd2bcbac50948222c9a4277e5858f14bda0d78 Mon Sep 17 00:00:00 2001 From: Blair2004 Date: Thu, 31 Mar 2016 01:44:59 +0200 Subject: [PATCH] Update Update --- application/models/Dashboard_Model.php | 35 +++----------------------- application/models/Update_Model.php | 7 +++--- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/application/models/Dashboard_Model.php b/application/models/Dashboard_Model.php index 65ff32c9..ce111470 100644 --- a/application/models/Dashboard_Model.php +++ b/application/models/Dashboard_Model.php @@ -344,7 +344,7 @@ function settings() } public function __set_admin_menu() - { + { $admin_menus = array( 'dashboard' => array( array( @@ -355,29 +355,15 @@ public function __set_admin_menu() array( 'href' => site_url( array( 'dashboard', 'update' ) ), 'icon' => 'fa fa-dashboard', - 'title' => __( 'Update Center' ) + 'title' => __( 'Update Center' ), + 'notices_nbr' => $this->events->apply_filters( 'update_center_notice_nbr', 0 ) ), array( 'href' => site_url( array( 'dashboard', 'about' ) ), 'icon' => 'fa fa-dashboard', - 'title' => __( 'About' ) + 'title' => __( 'About' ), ), ), - /** 'media' => array( - array( - 'title' => __( 'Media Library' ), - 'icon' => 'fa fa-image', - 'href' => site_url('dashboard/media') - ) - ), - 'installer' => array( - array( - 'title' => __( 'Install Apps' ), - 'icon' => 'fa fa-flask', - 'href' => site_url('dashboard/installer') - ) - ), - **/ 'modules' => array( array( 'title' => __( 'Modules' ), @@ -385,19 +371,6 @@ public function __set_admin_menu() 'href' => site_url('dashboard/modules') ) ), - /** 'themes' => array( - array( - 'title' => __( 'Themes' ), - 'icon' => 'fa fa-columns', - 'href' => site_url('dashboard/themes') - ), - array( - 'href' => site_url('dashboard/controllers'), - 'icon' => 'fa fa-bookmark', - 'title' => __( 'Menus' ) - ) - ), - **/ 'settings' => array( array( 'title' => __( 'Settings' ), diff --git a/application/models/Update_Model.php b/application/models/Update_Model.php index 77eceb0f..25e8c83c 100644 --- a/application/models/Update_Model.php +++ b/application/models/Update_Model.php @@ -29,10 +29,10 @@ function auto_update() ) { // La valeur change lorsqu'il y a une mise à jour supérieure - if( version_compare( $regular_release, $_ref[ 'tag_name' ], '<' ) ) { + if( version_compare( $regular_release, $_rel[ 'tag_name' ], '<' ) ) { $regular_release = $_rel[ 'tag_name' ]; } - if( version_compare( $major_release, $_ref[ 'tag_name' ], '<' ) && preg_match("/\#auto_update\#/", $_ref[ 'body' ] ) ) { + if( version_compare( $major_release, $_rel[ 'tag_name' ], '<' ) && preg_match("/\#auto_update\#/", $_rel[ 'body' ] ) ) { $major_release = $_rel[ 'tag_name' ]; } } @@ -52,6 +52,7 @@ function auto_update() if( $this->session->userdata( 'auto_update_step' ) <= 3 ) { $this->install( $this->session->userdata( 'auto_update_step' ) , $major_release ); } + } // Save cache @@ -66,7 +67,7 @@ function auto_update() version_compare( $this->cache->get( 'major_release' ), $this->config->item( 'version' ), '>' ) ) { $this->events->add_filter( 'update_center_notice_nbr', function( $nbr ) { - return $nbr++; + return $nbr + 1; }); } }