Beispiel #1
0
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' );
	}
Beispiel #2
0
function ultimatum_filter_plugin_count( $value ) {

	//remove any conflicting slug local Ultimatum plugins from WP update notifications
	$local_projects = ultimatum_get_local_projects();
	foreach ( $local_projects as $id => $plugin ) {
		if (isset($value->response[$plugin['filename']]))
			unset($value->response[$plugin['filename']]);
	}

	$updates = get_site_option('ultimatum_updates_available');
	if ( is_array($updates) && count($updates) ) {
		$api_key = ultimatum_get_api();
		$enable_autoupdates = get_site_option('ultimatum_updates_available');
		foreach ( $updates as $id => $plugin ) {
			if ( $plugin['type'] == 'plugin'){

				//build plugin class
				$object = new stdClass;
				$object->url = $plugin['url'];
				$object->slug = "ultimatum_install-$id";
				$object->upgrade_notice = $plugin['changelog'];
				$object->new_version = $plugin['new_version'];
				$object->package = ULTIMATUM_API . "?task=plugin&key=$api_key&pid=$id";
				//enable autoupdates of this plugin if allowed by user
//				 $object->autoupdate = true;

				//add to class
				$value->response[$plugin['filename']] = $object;
			}
		}
	}

	return $value;
}
Beispiel #3
0
		?>
		</tbody></table>
		</form>

		<p><?php _e('Please note that all data is updated every 12 hours.', 'ultimatum') ?> <?php _e('Last updated:', 'ultimatum'); ?> <?php echo get_date_from_gmt(date('Y-m-d H:i:s', $last_run), get_option('date_format') . ' ' . get_option('time_format')); ?> - <a id="refresh-link" href="<?php echo $ultimatum_updates_url; ?>&action=update"><i class='icon-refresh'></i> <?php _e('Update Now', 'ultimatum'); ?></a></p>
		<?php
		break;

	case "installed":
		?>
		<h2><?php _e('Ultimatum & Installed Extras', 'ultimatum') ?></h2>
		<?php
		$projects = array();
		if ( is_array( $data ) ) {
			$remote_projects = isset($data['toolset']) ? $data['toolset'] : array();
			$local_projects = ultimatum_get_local_projects();
			if ( is_array( $local_projects ) ) {
				foreach ( $local_projects as $local_id => $local_project ) {
					//skip if not in remote results
					if (!isset($remote_projects[$local_id]))
						continue;

					$type = $remote_projects[$local_id]['type'];

					$projects[$type][$local_id]['thumbnail'] = $remote_projects[$local_id]['thumbnail'];
					$projects[$type][$local_id]['name'] = $remote_projects[$local_id]['name'];
					$projects[$type][$local_id]['description'] = $remote_projects[$local_id]['short_description'];
					$projects[$type][$local_id]['url'] = $remote_projects[$local_id]['url'];
					$projects[$type][$local_id]['wp_config_url'] = $remote_projects[$local_id]['wp_config_url'];
					$projects[$type][$local_id]['ms_config_url'] = $remote_projects[$local_id]['ms_config_url'];
					$projects[$type][$local_id]['instructions_url'] = $remote_projects[$local_id]['instructions_url'];