function ultimatum_toolset_plugins() { global $wpdb, $current_site; if ( !current_user_can( 'install_plugins' ) ) { echo "<p>Nice Try...</p>"; //If accessed properly, this message doesn't appear. return; } $page_type = 'plugin'; $page_title = __('Plugins', 'ultimatum'); $data = ultimatum_get_updates(); $local_projects = ultimatum_get_local_projects(); //rearrange incompatible products to the bottom of the list if ( isset($data['toolset']) ) { $incompatible = $other = array(); foreach ($data['toolset'] as $project) { if ( $project['requires'] == 'visualcomposer' ) $incompatible[] = $project; else $other[] = $project; } $data['projects'] = array_merge($other, $incompatible); } //($data); //echo '<pre>';print_r($data);echo '</pre>'; require_once( dirname(__FILE__) . '/views/listings.php' ); }
function ultimatum_foreigner_project($project_id) { $data = ultimatum_get_updates(); $local_projects = ultimatum_get_local_projects(); $installed_foreigner = ($data['toolset'][$project_id]['type'] == 'plugin' && file_exists(WP_PLUGIN_DIR.'/'.$data['toolset'][$project_id]['standalone'])) ? true : false; if ( !isset($local_projects[$project_id]) && $installed_foreigner) { return true; } return false; }
function ultimatum_toolset(){ if(isset($_REQUEST['task']) && 'reset_toolset'==$_REQUEST['task']){ $resettab =' nav-tab-active'; $statustab=''; } else { $statustab =' nav-tab-active'; $resettab=''; } // ?> <div class="wrap about-wrap ult-wrap"> <h1><?php _e( 'Welcome to Ultimatum ToolSet','ultimatum' ); ?></h1> <div class="about-text"> <?php _e('Ultimatum ToolSet is central control Panel for Ultimatum and available Themes/Plugins to extend it.','ultimatum'); ?> </div> <div class="ut-badge"></div> <h2 class="nav-tab-wrapper"> <a href="./admin.php?page=ultimatum_toolset" class="nav-tab<?php echo $statustab;?>"> <?php _e( 'Status','ultimatum' ); ?> </a> <a href="./admin.php?page=ultimatum_toolset&task=reset_toolset" class="nav-tab<?php echo $resettab;?>"> <?php _e( 'Reset','ultimatum' ); ?> </a> </h2> <?php if(isset($_REQUEST['task']) && 'reset_toolset'==$_REQUEST['task']){ if(isset($_POST['action']) && 'reset_toolset' ==$_POST['action']){ delete_site_option('ultimatum_toolset'); $location = trailingslashit(network_admin_url()).'admin.php?page=ultimatum_toolset_setup'; wp_safe_redirect(esc_url_raw($location)); } echo '<p>'; _e('If you have moved the site from another domain Toolset will fail to receive updates as each domain is licensed seperately.', 'ultimatum'); echo '</p></p>'; _e(' To overcome the issue please reset toolset reqistry with below button. You will be sent back to toolset login page so you can register the new domain.','ultimatum'); echo '</p>'; ?> <form action="" method="post"> <input type="hidden" name="action" value="reset_toolset" /> <input type="submit" value="<?php _e('Reset ToolSet', 'ultimatum');?>" class="button button-primary button-hero" /> </form> <?php } else { $ultimatum_ts = get_site_option('ultimatum_toolset'); $allowed= get_userdata($ultimatum_ts['allowed_user']); ?> <p> <strong><?php _e('Ultimatum Toolset User','ultimatum');?></strong> : <?php echo $allowed->user_login;?><br /> <em><?php _e('Any other user registered to this Site/Network will not be able to reach these screens','ultimatum');?></em> </p> <?php include_once ULTIMATUM_ADMIN_HELPERS.'/class.options.php'; $data = ultimatum_get_updates(); if(!is_multisite()){ $onur = new optionGenerator($data['options']['single']["name"], $data['options']['single']["options"]); } else { $onur = new optionGenerator($data['options']['multi']["name"], $data['options']['multi']["options"]); } } ?> </div> <?php }
<?php //handle forced update if ( isset($_GET['action']) && $_GET['action'] == 'update' ) { $result = ultimatum_refresh_updates(); if ( is_array($result) ) { ?><div class="updated fade"><p><?php _e('Update data successfully refreshed from Ultimatum API Server.', 'ultimatum'); ?></p></div><?php } else { ?><div class="error fade"><p><?php _e('There was a problem refreshing data from Ultimatum API Server.', 'ultimatum'); ?></p></div><?php } } else { ultimatum_refresh_local_projects(); } $data = ultimatum_get_updates(); //load up the data $ultimatum_updates_url = './admin.php?page=ultimatum_toolset_updates'; $allow_auto = true; if (!ultimatum_allowed_user()) { $allow_auto = false; } ?> <style> tr.wdv-update td, tr.wdv-changelog td { background-color: rgba(239,242,245,0.5); } tr.wdv-changelog td { background:none; background-color: rgb(239, 247, 255); } a.button-secondary { padding:6px 10px } div#wpbody a.button-secondary:hover { color:#ffffff; } div.wdv-changelog-drop > p { padding:10px 20px; } .wdv-changelog-drop {