Skip to content

Commit

Permalink
fix addon update urls in admin toolbar, handle remote_install cmds f…
Browse files Browse the repository at this point in the history
…rom typesettercms.com
  • Loading branch information
oyejorge committed Mar 25, 2016
1 parent 0083412 commit ecc0f53
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
18 changes: 12 additions & 6 deletions include/admin/Addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function RunScript(){
$this->LocalInstall();
break;

case 'remote_install':
case 'RemoteInstall':
$this->RemoteInstall();
return;
Expand Down Expand Up @@ -604,12 +605,17 @@ function UpgradeLinks($addon_config){

//upgrade cms
if( isset($addon_config['id']) && isset(\gp\admin\Tools::$new_versions[$addon_config['id']]) ){
$version_info = \gp\admin\Tools::$new_versions[$addon_config['id']];
echo '<div class="gp_notice">';
echo '<a href="'.addon_browse_path.'/Plugins?id='.$addon_config['id'].'" data-cmd="remote">';
echo $langmessage['new_version'];
echo ' &nbsp; '.$version_info['version'].' ('.CMS_READABLE_DOMAIN.')</a>';
echo '</div>';

$new_version = \gp\admin\Tools::$new_versions[$addon_config['id']];

if( version_compare($new_version['version'],$addon_config['version'],'>') ){

echo '<div class="gp_notice">';
echo '<a href="'.addon_browse_path.'/Plugins?id='.$addon_config['id'].'" data-cmd="remote">';
echo $langmessage['new_version'];
echo ' &nbsp; '.$new_version['version'].' ('.CMS_READABLE_DOMAIN.')</a>';
echo '</div>';
}
}

}
Expand Down
1 change: 1 addition & 0 deletions include/admin/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function RunScript(){


//Installation
$this->cmds['remote_install'] = 'RemoteInstall';
$this->cmds['RemoteInstall'] = '';
$this->cmds['RemoteInstallConfirmed'] = 'DefaultDisplay';
$this->cmds['UpgradeTheme'] = 'DefaultDisplay';
Expand Down
2 changes: 1 addition & 1 deletion include/admin/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ public static function AdminPanelLinks($in_panel=true){
continue;
}

echo '<li><a href="'.addon_browse_path.'/'.$url.'/'.$addon_id.'" data-cmd="remote">'.$label.'</a></li>';
echo '<li><a href="'.$url.'/'.$addon_id.'" data-cmd="remote">'.$label.'</a></li>';

}

Expand Down

0 comments on commit ecc0f53

Please sign in to comment.