* This file renders a plugin for the admin screen, including active/deactive, manifest details & display plugin
 * settings.
 *
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */
$plugin = $vars['plugin'];
$details = $vars['details'];
$active = $details['active'];
$manifest = $details['manifest'];
// Check elgg version if available
$version_check_valid = false;
if ($manifest['elgg_version']) {
    $version_check_valid = check_plugin_compatibility($manifest['elgg_version']);
}
$ts = time();
$token = generate_action_token($ts);
?>
<div class="plugin_details <?php 
if ($active) {
    echo "active";
} else {
    echo "not-active";
}
?>
">
	<div class="admin_plugin_reorder">
<?php 
if ($vars['order'] > 10) {
Esempio n. 2
0
function srp_admin_menu_options()
{
    // Checking if we have the manage option permission enabled.
    if (!current_user_can('manage_options')) {
        wp_die(__('You do not have sufficient permissions to access this page.', SRP_TRANSLATION_ID));
    }
    // For first, let's check if there is some kind of compatibility error.
    check_plugin_compatibility();
    ?>
	<!-- Generating Option Page HTML. -->
	<div class="wrap">
		<div id="srp-admin-container">
			<?php 
    // Updating and validating data/POST Check.
    srp_update_data($_POST, get_option('srp_plugin_options'));
    // Importing global default options array.
    $srp_current_options = get_option('srp_plugin_options');
    ?>
			
			<!-- BOF Title and Description section. -->
			<h2 class="srp_admin_headertitle"><?php 
    _e('Special Recent Posts FREE Edition (version ' . SRP_PLUGIN_VERSION . ') - Settings Page', SRP_TRANSLATION_ID);
    ?>
</h2>
			<div class="srp_option_header_l1">
				<?php 
    _e('<strong>Welcome to the Special Recent Posts FREE Edition Admin Panel.</strong><br /> In this page you can configure the main settings for the Special Recent Posts FREE Edition plugin. Keep in mind that these are basic options. 
				Special options apply for each widget instance, shortcode or PHP code to ensure an high level of customization. Go to Widget Page and drag the Special Recent Posts FREE Edition widget to see additional options available.', SRP_TRANSLATION_ID);
    ?>
				<div class="error">
					<h3>Want to go PRO? Special Recent Posts PRO Edition is now available. <a href="http://codecanyon.net/item/special-recent-posts-pro/552356" title="Upgrade now to Special Recent Posts PRO Edition" target="_blank">Upgrade Now!</a></h3>
				</div>
			</div>
			<!-- EOF Title and Description section. -->
				
			<!-- BOF Admin Tabs -->
			<ul id="srp_widget_tabs">
				<li>
					<a onClick="javascript:srpTabsSwitcher(1);" class="srp_tab_1 active" title="<?php 
    _e('General Settings', SRP_TRANSLATION_ID);
    ?>
" href="#"><?php 
    _e('General Settings', SRP_TRANSLATION_ID);
    ?>
</a>
				</li>
				
				<li>
					<a onClick="javascript:srpTabsSwitcher(2);" class="srp_tab_2" title="<?php 
    _e('Cache Settings', SRP_TRANSLATION_ID);
    ?>
" href="#"><?php 
    _e('Cache Settings', SRP_TRANSLATION_ID);
    ?>
</a>
				</li>
			</ul>
			<!-- EOF Admin Tabs -->
				
			
			<div class="metabox-holder" id="srp_tab1">
				<!--  Open Form. -->
				<form id="srp_admin_form" name="srp_admin_form" action="" method="POST">
					<input type="hidden" value="yes" name="srp_dataform">
					<input type="hidden" value="<?php 
    echo $srp_current_options["srp_version"];
    ?>
" name="srp_version">
					<input type="hidden" value="<?php 
    echo $srp_current_options["srp_global_post_limit"];
    ?>
" name="srp_global_post_limit">
					<div class="postbox">
						
						<h3><?php 
    _e('General Settings', SRP_TRANSLATION_ID);
    ?>
</h3>

						<!-- BOF Left Box. -->
						<div id="srp-admin-leftcontent">
							<p>
							<?php 
    _e('This is the General Settings page. Here you can customize all of the settings that globally apply to the plugin.', SRP_TRANSLATION_ID);
    ?>
							</p>
							
							<dl>
								<dt>
									<strong><?php 
    _e('Enable Compatibility Mode', SRP_TRANSLATION_ID);
    ?>
</strong>
								</dt>
								<dd>
									<?php 
    _e('This option enables some compatibility features that change the behaviour of the SRP plugin, in order to work seamlessly with other plugins.
									If you are experiencing problems with Special Recent Posts PRO and other plugins, you might want to disable this option.', SRP_TRANSLATION_ID);
    ?>
								</dd>
								
								<dt>
									<strong><?php 
    _e('Log Errors on Screen', SRP_TRANSLATION_ID);
    ?>
</strong>
								</dt>
								<dd>
									<?php 
    _e('This option enables the error logging on screen. It\'s useful to understand where something has gone wrong during the image generation process.', SRP_TRANSLATION_ID);
    ?>
								</dd>
								
								<dt>
									<strong><?php 
    _e('No-Posts Image Placeholder', SRP_TRANSLATION_ID);
    ?>
</strong>
								</dt>
								<dd>
									<?php 
    _e('This is the default image that appears when no other images are available inside a post. 
									You can use the one you prefer, by simply typing in the full URL of the image. 
									If you leave this field empty, the default no-image placeholder will be loaded.', SRP_TRANSLATION_ID);
    ?>
								</dd>
								
								<dt>
									<strong><?php 
    _e('Disable Plugin CSS?', SRP_TRANSLATION_ID);
    ?>
</strong>
								</dt>
								<dd>
									<?php 
    _e('This option enables/disables the built-in widget stylesheet. Set this option to "Yes" if you wish to use your own style.', SRP_TRANSLATION_ID);
    ?>
								</dd>
								
								<dt>
									<strong><?php 
    _e('Theme CSS', SRP_TRANSLATION_ID);
    ?>
</strong>
								</dt>
								<dd>
									<?php 
    _e('This is the global Stylesheet. All layout changements must be done here. 
									Consider that in some cases, your custom theme CSS might override these settings. 
									In this case, edit this stylesheet using the <i>"<strong>!important"</strong></i> attribute beside each rule to override your theme css rules.', SRP_TRANSLATION_ID);
    ?>
								</dd>
							</dl>
						</div>
						<!-- EOF Left Box. -->
						
						<!-- BOF Right Box. -->
						<div id="srp-admin-rightcontent">
							<ul>
								<li>
									<!--BOF Compatibility Mode -->
									<label for="srp_compatibility_mode"><?php 
    _e('Enable Compatibility Mode', SRP_TRANSLATION_ID);
    ?>
</label>
									<span class="srp-smalltext"><?php 
    _e('Switch this to No if you\'re experiencing visualization problems or other kind of incompatibility with other plugins.', SRP_TRANSLATION_ID);
    ?>
</span><br />
									<select id="srp_compatibility_mode" name="srp_compatibility_mode">
										<option value="yes" <?php 
    selected($srp_current_options["srp_compatibility_mode"], 'yes');
    ?>
><?php 
    _e('Yes', SRP_TRANSLATION_ID);
    ?>
</option>
										<option value="no" <?php 
    selected($srp_current_options["srp_compatibility_mode"], 'no');
    ?>
><?php 
    _e('No', SRP_TRANSLATION_ID);
    ?>
</option>
									</select>
									<!--EOF Compatibility Mode -->
								</li>
								
								<li>
									<!--BOF Log Errors on Screen -->
									<label for="srp_log_errors_screen"><?php 
    _e('Log Errors on Screen?', SRP_TRANSLATION_ID);
    ?>
</label>
									<span class="srp-smalltext"><?php 
    _e('Switch this to Yes if you want to log potential errors or warnings on screen.', SRP_TRANSLATION_ID);
    ?>
</span><br />
									<select id="srp_log_errors_screen" name="srp_log_errors_screen">
										<option value="yes" <?php 
    selected($srp_current_options["srp_log_errors_screen"], 'yes');
    ?>
><?php 
    _e('Yes', SRP_TRANSLATION_ID);
    ?>
</option>
										<option value="no" <?php 
    selected($srp_current_options["srp_log_errors_screen"], 'no');
    ?>
><?php 
    _e('No', SRP_TRANSLATION_ID);
    ?>
</option>
									</select>
									<!--EOF Log Errors on Screen -->
								</li>
								
								
								<!--BOF Thumbnail Custom URL -->
								<li>
									<label for="srp_noimage_url"><?php 
    _e('No-Posts Image Placeholder', SRP_TRANSLATION_ID);
    ?>
</label>
									<input type="text" id="srp_noimage_url" name="srp_noimage_url" value="<?php 
    echo stripslashes($srp_current_options['srp_noimage_url']);
    ?>
" size="90" /><br />
									<span class="srp-smalltext"><?php 
    _e('Enter the absolute url of the image placeholder. Default size: 100px x 100px.', SRP_TRANSLATION_ID);
    ?>
</span>
								</li>
								<!--EOF Thumbnail Custom URL -->
								
								<!--BOF Disable Theme CSS -->
								<li>
									<label for="srp_disable_theme_css"><?php 
    _e('Disable Plugin CSS?', SRP_TRANSLATION_ID);
    ?>
</label>
									<select id="srp_disable_theme_css" name="srp_disable_theme_css">
										<option value="yes" <?php 
    selected($srp_current_options["srp_disable_theme_css"], 'yes');
    ?>
><?php 
    _e('Yes', SRP_TRANSLATION_ID);
    ?>
</option>
										<option value="no" <?php 
    selected($srp_current_options["srp_disable_theme_css"], 'no');
    ?>
><?php 
    _e('No', SRP_TRANSLATION_ID);
    ?>
</option>
									</select>
								</li>
								<!--EOF Disable Theme CSS -->								
							</ul>
						</div>
						<!-- EOF Right Box. -->
						
						<div class="clearer"></div>
						
					</div><!-- EOF postbox. -->
					<input type="submit" name="submit" class="button-primary" value="<?php 
    _e('Save Options', SRP_TRANSLATION_ID);
    ?>
" />
				</form> <!--EOF Form. -->
			</div><!-- EOF metabox-holder. -->
		
			<div class="metabox-holder" id="srp_tab2">
				<form id="srp-cache-flush-form" action="" method="POST">
					<div class="postbox">
						
						<h3><?php 
    _e('Cache Settings', SRP_TRANSLATION_ID);
    ?>
</h3>
						<!-- BOF Left Box. -->
						<div id="srp-admin-leftcontent">
							<dl>
								<dt>
									<strong><?php 
    _e('Empty Cache Folder', SRP_TRANSLATION_ID);
    ?>
</strong>
								</dt>
								<dd>
									<?php 
    _e('Click this button to empty the thumbnails cache folder.', SRP_TRANSLATION_ID);
    ?>
								</dd>
						</div>
						<!-- EOF Left Box. -->
						
						<!-- BOF Right Box. -->
						<div id="srp-admin-rightcontent">
							
							<input type="hidden" value="yes" name="cache_flush">
							<input type="submit" value="<?php 
    _e('Empty Cache Folder', SRP_TRANSLATION_ID);
    ?>
" class="button-primary">
							
							<!-- EOF Cache Flush Section -->
						</div>

						<div class="clearer"></div>		
					</div><!-- EOF postbox. -->
				</form>
			</div><!-- EOF metabox-holder. -->
		</div> <!-- EOF srp_adm_container -->
	</div> <!-- EOF Wrap. -->
<?php 
}