Permalink
Browse files

remove EIP

  • Loading branch information...
1 parent c0b1be3 commit 9667225100fbca4ebba012c2aa4f16c8ae5bae93 @hunk committed May 3, 2010
View
@@ -133,16 +133,6 @@
}
}
-require_once ('RCCWP_EditnPlace.php');
-require_once ('RCCWP_Options.php');
-
-// Adding javascript for the editnplace only if it is turned on
-$customWritePanelOptions = RCCWP_Options::Get();
-if( isset($customWritePanelOptions['enable-editnplace']) ) {
- add_action('wp_head', array('RCCWP_EditnPlace', 'EditnHeader'));
- add_action('template_redirect',array('RCCWP_EditnPlace','EditnPlaceJavascript'));
-}
-
require_once ('RCCWP_Query.php');
add_action('pre_get_posts', array('RCCWP_Query', 'FilterPrepare'));
add_filter('posts_where', array('RCCWP_Query', 'FilterCustomPostsWhere'));
View
@@ -56,8 +56,6 @@ function Install(){
$options['prompt-editing-post'] = 0;
$options['assign-to-role'] = 0;
$options['default-custom-write-panel'] = "";
- $options['enable-editnplace'] = 1;
- $options['eip-highlight-color'] = "#FFFFCC";
RCCWP_Options::Update($options);
}
@@ -429,157 +427,6 @@ function CheckInstallation(){
echo "<div id='magic-fields-install-error-message-2' class='error'><p><strong>".__('Magic Fields is not ready yet.', $mf_domain)."</strong> ".__('The following folders must be writable (usually chmod 777 is neccesary):', $mf_domain)."</p><ul>";
echo $dir_list;
echo "</ul></div>";
- }
-
- if (empty($dir_list) && empty($dir_list2)){
- /* the directory exists and is writable
- * we can create the css and js files for the EIP feature
- */
- $EnPCSS = RCCWP_Application::create_EditnPlace_css();
- $EnPJS = RCCWP_Application::create_EditnPlace_js();
- if (!$EnPCSS || !$EnPJS) {
- echo "<div id='magic-fields-install-error-message-2' class='error'><p><strong>".__('There was an error creating the CSS file for edit in place, please check the permissions on the files_mf directory.', $mf_domain)."</strong> "."</p>";
- echo "</div>";
- }
- }
- }
-
- /**
- * This function create the EditInPlace.js file
- *
- * @param bool $created
- * @return bool true if the js file was successful created, false in the otherwise
- */
- function create_EditnPlace_js($create=FALSE) {
- $MF_URI = MF_URI;
- $enp_js[] = "var JS_MF_URI = '$MF_URI';";
- $editnplace_js_file = MF_FILES_PATH.'editnplacepath.js';
- if (!file_exists( $editnplace_js_file ) ) {
- $js_file_created = RCCWP_Application::save_editnplace_file( $editnplace_js_file, '', $enp_js, TRUE );
- } else {
- $js_file_created = RCCWP_Application::save_editnplace_file( $editnplace_js_file, '', $enp_js, $create );
- }
- return $js_file_created;
- }
-
- /**
- * Create The Edit In Place CSS file
- *
- * @return bool true if the css file was successful created
- */
- function create_EditnPlace_css($create=FALSE) {
- include_once('RCCWP_Options.php');
- $eip_highlight_color = RCCWP_Options::Get('eip-highlight-color');
- if(!$eip_highlight_color) $eip_highlight_color = '#FFFFFF';
- $MF_URI = MF_URI;
- $arrow_image_path = MF_URI."images/arrow.gif";
- $editnplace_css = "
-#savingDiv{
- font-size: medium;
- font-weight: bold;
-}
-
-.EIP_title:hover, .EIP_content:hover,
-.EIP_textbox:hover, .EIP_mulittextbox:hover {
- background-color: $eip_highlight_color
-}
-
-.EIPSaveCancel{
- padding: 5px;
- margin-top: -1px;
- z-index: 1000;
- border-color:#CCC;
- border-width:1px;
- border-style:solid;
- background-color:white;
- position:fixed;
- top:0px !important;
- width:100% !important;
- left: 0px !important;
- /*position:absolute;
- padding-top:2px;
- padding-bottom:2px;
- z-index: 1000;*/
-}
-
-.EIPSaveStatus{
- position:absolute;
- font-size: 14px;
- z-index: 1000;
-}
-
-.EIPnicPanelDiv{
- position: absolute;
- background-image: url($arrow_image_path);
- width:154px;
- height:38px;
- z-index: 1000;
- margin-top: -23px;
-}
-
-div.nicEdit-panel{
- background-color: white !important;
- width:140px !important;
-}
-
-div.nicEdit-panelContain{
- background-color: white !important;
- border-bottom: 0px !important;
- border-left: 0px !important;
- border-right: 0px !important;
- width: 92% !important;
- margin-left: 2px !important;
- margin-top: 1px !important;
-}
-
-.nicEdit-selected{
- /*background-color: #FFFFCC !important;*/
- border: thin inset !important;
- padding: 10px;
-}
-.nicEdit-button {
- background-color: white !important;
- border: 0px !important;
-}
-
-.FEIP_textbox {
- background-color: #CCC;
- height: 32px;
- width: 100%;
-}
-"
-;
- $editnplace_css_file = MF_UPLOAD_FILES_DIR.'editnplace.css';
- $css = explode( "\n", $editnplace_css );
- if (!file_exists( $editnplace_css_file ) ) {
- $css_file_created = RCCWP_Application::save_editnplace_file( $editnplace_css_file, 'EditnPlace css', $css, TRUE );
- } else {
- $css_file_created = RCCWP_Application::save_editnplace_file( $editnplace_css_file, 'EditnPlace css', $css, $create );
- }
- return $css_file_created;
- }
-
- /**
- * Save the edit inplace files in the MF_FILES folder
- *
- * @return bool
- */
- function save_editnplace_file( $filename, $comment, $data, $overwrite=FALSE ) {
- if (!file_exists( $filename ) || is_writeable( $filename ) ) {
- if ($overwrite) {
- if ( !$f = @fopen( $filename, 'w' ) )
- return false;
- if ($comment)
- fwrite( $f, "\n/* BEGIN {$comment} */\n" );
- foreach ( $data as $insertline )
- fwrite( $f, "{$insertline}\n" );
- if ($comment)
- fwrite( $f, "/* END {$comment} */\n" );
- fclose( $f );
- }
- return true;
- } else {
- return false;
}
}
View
@@ -1,49 +0,0 @@
-<?php
-
-require_once "RCCWP_Constant.php";
-
-class RCCWP_EditnPlace {
- /**
- * This function load all the necessary scripts for the
- * editnplace feature
- */
- function EditnPlaceJavascript(){
- wp_enqueue_script( 'EditnPlace',
- MF_URI.'js/editnplace.js',
- array('jquery')
- );
- wp_enqueue_script( 'nicEdit',
- MF_URI.'js/nicEdit.js'
- );
-
- $editnplaceCSSFile = MF_UPLOAD_FILES_DIR.'editnplace.css';
- $editnplaceJSFile = MF_UPLOAD_FILES_DIR.'editnplacepath.js';
-
-
- //checking if the both files exists
- if(!file_exists($editnplaceCSSFile) || !file_exists($editnplaceJSFile)){
- return false;
- }
-
- wp_register_style('mf_editnplace',MF_FILES_URI.'editnplace.css');
- wp_enqueue_style('mf_editnplace');
- wp_enqueue_script('editnplacepath',MF_FILES_URI.'editnplacepath.js');
- }
-
- /**
- * This function load all the stylesheets for the EIP feature
- */
- function EditnHeader (){
- global $post;
-
- $MF_URI = MF_URI;
- if (current_user_can('edit_posts', $post->ID)){
-
- echo <<<EOD
- <script language="JavaScript" type="text/javascript" >
- var JS_MF_URI = '$MF_URI';
- </script>
-EOD;
- }
- }
-}
@@ -1,12 +0,0 @@
-<?php
-require( dirname(__FILE__) . '/../../../wp-config.php' );
-
-// Start saving data
-global $wpdb;
-
-$field_value = urldecode($_POST['field_value']);
-$field_type = $wpdb->escape($_POST['field_type']);
-$meta_id = $wpdb->escape($_POST['meta_id']);
-
-//@todo Sanitize this query
-$wpdb->query("UPDATE $wpdb->postmeta SET meta_value = '{$field_value}' WHERE meta_id = '{$meta_id}'");
View
@@ -114,35 +114,6 @@ function Main() {
</table>
-
- <h3><?php _e('Other Options', $mf_domain); ?></h3>
- <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
- <tr valign="top">
- <th scope="row"><?php _e('Edit-n-place', $mf_domain); ?></th>
- <td>
- <label for="enable-editnplace">
- <input name="enable-editnplace" id="enable-editnplace" value="1" <?php echo RCCWP_OptionsPage::GetCheckboxState( $customWritePanelOptions['enable-editnplace'] )?> type="checkbox">
- &nbsp; <?php _e('Edit posts instantly from the post page.', $mf_domain); ?></label>
- </td>
- </tr>
- <script type='text/javascript' src='<?php echo MF_URI?>js/sevencolorpicker.js'></script>
- <script type="text/javascript">
- jQuery('document').ready(function(){
- jQuery('#eip-highlight-color').SevenColorPicker();
- });
- </script>
- <tr>
- <th scope="row"><?php _e('EIP highlight color', $mf_domain); ?> </th>
- <td>
- <label for="eip-highlight-color">
- <input name="eip-highlight-color" id="eip-highlight-color" value="<?php echo $customWritePanelOptions['eip-highlight-color']; ?>" >
- &nbsp; <?php _e('Use color to highlight areas EIP', $mf_domain); ?></label>
- </td>
- </tr>
-
- </table>
-
- <br />
<h3><?php _e('Uninstall Magic Fields', $mf_domain); ?></h3>
<table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
<tr valign="top">
View
@@ -471,9 +471,7 @@ function Main() {
'hide-visual-editor' => 0,
'prompt-editing-post' => 0,
'assign-to-role' => 0,
- 'default-custom-write-panel' => 0,
- 'enable-editnplace' => 0,
- 'eip-highlight-color' => "#FFFFCC"
+ 'default-custom-write-panel' => 0
);
$save_options = $_POST;
@@ -483,7 +481,7 @@ function Main() {
$save = array_merge($default,$save_options);
RCCWP_Options::Update($save);
- $EnP = RCCWP_Application::create_EditnPlace_css(TRUE);
+
}
}
}
View
@@ -68,22 +68,6 @@ function get ($fieldName, $groupIndex=1, $fieldIndex=1, $readyForEIP=true,$post_
$results = split('&',$results);
$results = $results[0];
}
-
- // Prepare fields for EIP
- include_once('RCCWP_Options.php');
- $enableEditnplace = RCCWP_Options::Get('enable-editnplace');
- if ($readyForEIP && $enableEditnplace == 1 && current_user_can('edit_posts', $post->ID)){
- switch($fieldType){
- case $FIELD_TYPES["textbox"]:
- if(!$results) $results="&nbsp";
- $results = "<div id='mfeip_".$fieldMetaID."' class='EIP_textbox' >".$results."</div>";
- break;
- case $FIELD_TYPES["multiline_textbox"]:
- if(!$results) $results="&nbsp";
- $results = "<div id='mfmueip_".$fieldMetaID."' class='EIP_mulittextbox' >".$results."</div>";
- break;
- }
- }
return $results;
}
Oops, something went wrong.

0 comments on commit 9667225

Please sign in to comment.