Ejemplo n.º 1
0
 function ExecPhp_Admin(&$cache)
 {
     $this->m_cache =& $cache;
     if (!is_admin()) {
         return;
     }
     global $wp_version;
     if (version_compare($wp_version, '2.6.dev') >= 0) {
         load_plugin_textdomain(ExecPhp_PLUGIN_ID, false, ExecPhp_HOMEDIR . '/languages');
     } else {
         load_plugin_textdomain(ExecPhp_PLUGIN_ID, ExecPhp_PLUGINDIR . '/' . ExecPhp_HOMEDIR . '/languages');
     }
     $this->m_common_l10n = array('messageContainer' => ExecPhp_ID_MESSAGE);
     $this->m_common_script =& new ExecPhp_Script(ExecPhp_ID_SCRIPT_COMMON, ExecPhp_ID_L10N_COMMON, $this->m_common_l10n, '/js/common.js', array());
     $this->m_write_ui =& new ExecPhp_WriteUi($this->m_cache, $this->m_common_script);
     $this->m_user_ui =& new ExecPhp_UserUi($this->m_cache);
     add_action('admin_notices', array(&$this, 'action_admin_notices'), 5);
     if (version_compare($wp_version, '2.1.dev') < 0) {
         return;
     }
     $this->m_style =& new ExecPhp_Style();
     $this->m_config_ui =& new ExecPhp_ConfigUi($this->m_cache, $this->m_common_script);
     if (current_user_can(ExecPhp_CAPABILITY_EDIT_PLUGINS) || current_user_can(ExecPhp_CAPABILITY_EDIT_USERS)) {
         $this->m_admin_l10n = array('noUserFound' => escape_dquote(__s('No user matching the query.', ExecPhp_PLUGIN_ID)), 'securityAlertHeading' => escape_dquote(__s('Exec-PHP Security Alert.', ExecPhp_PLUGIN_ID)), 'securityAlertText' => escape_dquote(__s('The Exec-PHP plugin found a security hole with the configured user rights of this blog. For further information consult the plugin configuration menu or contact your blog administrator.', ExecPhp_PLUGIN_ID)), 'requestFile' => get_option('siteurl') . '/wp-admin/admin-ajax.php', 'ajaxError' => escape_dquote(__s("Exec-PHP AJAX HTTP error when receiving data: ", ExecPhp_PLUGIN_ID)), 'action' => ExecPhp_ACTION_REQUEST_USERS, 'executeArticlesContainer' => ExecPhp_ID_INFO_EXECUTE_ARTICLES, 'widgetsContainer' => ExecPhp_ID_INFO_WIDGETS, 'securityHoleContainer' => ExecPhp_ID_INFO_SECURITY_HOLE);
         $this->m_admin_script =& new ExecPhp_Script(ExecPhp_ID_SCRIPT_ADMIN, ExecPhp_ID_L10N_ADMIN, $this->m_admin_l10n, '/js/admin.js', array('sack'));
         add_action('admin_footer', array(&$this, 'action_admin_footer'));
     }
 }
Ejemplo n.º 2
0
 function adjust_reply($js_var, $output)
 {
     if (!empty($output)) {
         $output = "{$js_var} = \"<ul>" . escape_dquote($output) . "</ul>\"; ";
     }
     return $output;
 }
Ejemplo n.º 3
0
        function print_message($heading, $text)
        {
            $heading = escape_dquote($heading);
            $text = escape_dquote($text);
            ?>
	<script type="text/javascript">
		//<![CDATA[
		ExecPhp_setMessage("<?php 
            echo $heading;
            ?>
", "<?php 
            echo $text;
            ?>
");
		//]]>
	</script>
<?php 
        }
Ejemplo n.º 4
0
        function print_request_users($display_id, $feature, $title, $introduction)
        {
            global $wp_version;
            if (version_compare($wp_version, '2.6.dev') >= 0) {
                // since WP 2.6 it comes with its own progress animation
                $image_url = get_option('siteurl') . '/wp-admin/images/loading.gif';
            } else {
                $image_url = ExecPhp_HOME_URL . '/images/progress.gif';
            }
            ?>
			<fieldset class="options">
				<table class="editform optiontable form-table">
					<tr valign="top" id="<?php 
            echo $display_id;
            ?>
-container" >
						<th scope="row"><?php 
            echo $title;
            ?>
</th>
						<td>
							<label for="<?php 
            echo ExecPhp_POST_WIDGET_SUPPORT;
            ?>
">
								<?php 
            echo $introduction;
            ?>

								<div class="execphp-user-list" id="<?php 
            echo $display_id;
            ?>
">
									<?php 
            _es('The list can not be displayed because you may have disabled Javascript or your browser does not support Javascript.', ExecPhp_PLUGIN_ID);
            ?>

								</div>
								<script type="text/javascript">
									//<![CDATA[
									document.getElementById("<?php 
            echo $display_id;
            ?>
").innerHTML =
										"<p><img src=\"<?php 
            echo $image_url;
            ?>
\" alt=\"<?php 
            escape_dquote(_es('An animated icon signaling that this information is still be loaded.', ExecPhp_PLUGIN_ID));
            ?>
\" /> <?php 
            escape_dquote(_es('Loading user information...', ExecPhp_PLUGIN_ID));
            ?>
</p>";
									ExecPhp_subscribeForFeature("<?php 
            echo $feature;
            ?>
");
									//]]>
								</script>
							</label>
						</td>
					</tr>
				</table>
			</fieldset>
<?php 
        }