Example #1
0
function connectionsShowUpgradePage()
{
	/*
	 * Check whether user can access.
	 */
	if (!current_user_can('connections_view_entry_list'))
	{
		wp_die('<p id="error-page" style="-moz-background-clip:border;
				-moz-border-radius:11px;
				background:#FFFFFF none repeat scroll 0 0;
				border:1px solid #DFDFDF;
				color:#333333;
				display:block;
				font-size:12px;
				line-height:18px;
				margin:25px auto 20px;
				padding:1em 2em;
				text-align:center;
				width:700px">You do not have sufficient permissions to access this page.</p>');
	}
	else
	{
		global $connections;
		
		?>
			
			<div class="wrap nosubsub">
				<div class="icon32" id="icon-connections"><br/></div>
				<h2>Connections : Upgrade</h2>
				<?php echo $connections->displayMessages(); ?>
				<div id="connections-upgrade">
				
					<?php
						$urlPath = admin_url() . 'admin.php?page=' . $_GET['page'];
						
						if ($_GET['upgrade-db'] === 'do')
						{
							cnRunDBUpgrade();
						}
						else
						{
							?>
								<h3>Upgrade Required!</h3>
								<p>Your database tables for Connections is out of date and must be upgraded before you can continue.</p>
								<p>If you would like to downgrade later, please first make a complete backup of your database tables.</p>
								<h4><a href="<?php echo $urlPath;?>&amp;upgrade-db=do">Start Upgrade</a></h4>
							<?php
						}
					
					?>
				
				</div>
			</div>
			
		<?php
	}
}
function connectionsShowUpgradePage()
{
    /*
     * Check whether user can access.
     */
    if (!current_user_can('connections_manage')) {
        wp_die('<p id="error-page" style="-moz-background-clip:border;
				-moz-border-radius:11px;
				background:#FFFFFF none repeat scroll 0 0;
				border:1px solid #DFDFDF;
				color:#333333;
				display:block;
				font-size:12px;
				line-height:18px;
				margin:25px auto 20px;
				padding:1em 2em;
				text-align:center;
				width:700px">' . __('You do not have sufficient permissions to access this page.', 'connections') . '</p>');
    } else {
        $url = add_query_arg(array('page' => $_GET['page'], 'upgrade-db' => 'do'), self_admin_url('admin.php'));
        ?>

		<div class="wrap nosubsub">
			<h2>Connections : <?php 
        _e('Upgrade', 'connections');
        ?>
</h2>

			<div id="connections-upgrade">

				<?php 
        if (isset($_GET['upgrade-db']) && 'do' === $_GET['upgrade-db']) {
            cnRunDBUpgrade();
        } else {
            ?>
					<h3><?php 
            esc_html_e('Upgrade Required!', 'connections');
            ?>
</h3>
					<p><?php 
            esc_html_e('Your database tables are out of date and must be upgraded before you can continue.', 'connections');
            ?>
</p>
					<p><?php 
            esc_html_e('If you would like to downgrade later, please first make a complete backup of your database tables.', 'connections');
            ?>
</p>
					<h4><a class="button-primary" href="<?php 
            echo esc_url($url);
            ?>
"><?php 
            _e('Start Upgrade', 'connections');
            ?>
</a></h4>
				<?php 
        }
        ?>

			</div>
		</div>

		<?php 
    }
}