コード例 #1
0
ファイル: MF_GetDuplicate.php プロジェクト: hunk/Magic-Fields
 function resolve()
 {
     global $mf_domain;
     check_ajax_referer('nonce_ajax_duplicate', 'nonce_ajax_duplicate');
     if (!(is_user_logged_in() && (current_user_can('edit_posts') || current_user_can('edit_published_pages')))) {
         echo __("Athentication failed", $mf_domain);
         wp_die();
     }
     if (isset($_POST['flag']) && $_POST['flag'] == "group") {
         $customGroup = RCCWP_CustomGroup::Get($_POST['groupId']);
         RCCWP_WritePostPage::GroupDuplicate($customGroup, $_POST['groupCounter'], $_POST['order']);
     } else {
         $customFieldId = $_POST['customFieldId'];
         $groupCounter = $_POST['groupCounter'];
         $fieldCounter = $_POST['fieldCounter'];
         $groupId = $_POST['groupId'];
         RCCWP_WritePostPage::CustomFieldInterface($customFieldId, $groupCounter, $fieldCounter, $groupId);
     }
     wp_die();
 }
コード例 #2
0
ファイル: FlutterLayout.php プロジェクト: mark2me/pressform
    function GetModuleSettings($blockID)
    {
        require_once "RCCWP_WritePostPage.php";
        // Retieve the settings for $blockID
        $moduleSettings = FlutterLayoutBlock::GetModuleSettingsByBlock($blockID);
        foreach ($moduleSettings->variables as $variable) {
            $variable->properties = array();
            $inputName = $variable->variable_name;
            $variableValue = $variable->value;
            ?>
					<label for="item3" class="checkbox"><?php 
            echo $variable->description;
            ?>
					<?php 
            switch ($variable->type) {
                case 'textbox':
                    $variable->properties['size'] = "";
                    RCCWP_WritePostPage::TextboxInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'multiline_textbox':
                    $variable->properties['height'] = "10";
                    $variable->properties['width'] = "10";
                    RCCWP_WritePostPage::MultilineTextboxInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'checkbox':
                    RCCWP_WritePostPage::CheckboxInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'checkbox_list':
                    //$variableValue = unserialize($variableValue);
                    RCCWP_WritePostPage::CheckboxListInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'radiobutton_list':
                    RCCWP_WritePostPage::RadiobuttonListInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'dropdown_list':
                    RCCWP_WritePostPage::DropdownListInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'listbox':
                    //$variableValue = unserialize($variableValue);
                    $variable->properties['size'] = "";
                    RCCWP_WritePostPage::ListboxInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'file':
                    RCCWP_WritePostPage::FileInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'image':
                    RCCWP_WritePostPage::PhotoInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'date':
                    $variable->properties['format'] = "m.d.y";
                    RCCWP_WritePostPage::DateInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'audio':
                    RCCWP_WritePostPage::AudioInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
            }
            ?>
				</label>
			<?php 
        }
    }
コード例 #3
0
ファイル: RCCWP_upload.php プロジェクト: mark2me/pressform
    ?>
){
			par.getElementById("<?php 
    echo $_POST["input_name"];
    ?>
").value = "<?php 
    echo $filename;
    ?>
";
			
			//Set image
			<?php 
    //$newImagePath = FLUTTER_URI.'phpThumb.php
    $newImagePath = PHPTHUMB . '?&w=150&h=120&src=' . FLUTTER_FILES_PATH . $filename;
    include_once "RCCWP_WritePostPage.php";
    $edit_anchor = RCCWP_WritePostPage::snipshot_anchor($newImagePath);
    if (isset($_POST['imageThumbID'])) {
        ?>
				if( par.getElementById('<?php 
        echo $_POST['imageThumbID'];
        ?>
') )
				{ 
					par.getElementById('<?php 
        echo $_POST['imageThumbID'];
        ?>
').src = "<?php 
        echo $newImagePath;
        ?>
";
					//var s = "<a class='thickbox' href='#impossible_location' onclick=\"call_thickbox('<?php 
コード例 #4
0
ファイル: RCCWP_GetFile.php プロジェクト: mark2me/pressform
        }
        // 			$result_msg = "Error downloading file: ".$_POST['upload_url'].$infoStr;
        $result_msg = "<font color='red'><b>" . __("Upload Unsuccessful", $flutter_domain) . "!</b></font>";
    } else {
        // 			$result_msg = 'The URL '.$_POST['upload_url'].' was downloaded successfuly. Please remember to click the save button.';
        $result_msg = "<font color='green'><b>" . __("Successful upload", $flutter_domain) . "!</b></font>";
        $operationSuccess = "true";
    }
    include_once "RCCWP_WritePostPage.php";
    $edit_anchor = RCCWP_WritePostPage::snipshot_anchor(FLUTTER_FILES_URI . $filename);
    echo $result_msg . "*" . $filename . "*" . $edit_anchor;
}
if (isset($_FILES['async-upload'])) {
    if ($_FILES['async-upload']['error'] == UPLOAD_ERR_OK) {
        $special_chars = array(' ', '`', '"', '\'', '\\', '/', " ", "#", "\$", "%", "^", "&", "*", "!", "~", "‘", "\"", "’", "'", "=", "?", "/", "[", "]", "(", ")", "|", "<", ">", ";", "\\", ",");
        $filename = str_replace($special_chars, '', $_FILES['async-upload']['name']);
        $filename = time() . $filename;
        @move_uploaded_file($_FILES['async-upload']['tmp_name'], FLUTTER_FILES_PATH . $filename);
        @chmod(FLUTTER_FILES_PATH . $filename, 0644);
        // 		$result_msg = 'The file '.$_FILES['Filedata']['name'].' was uploaded successfuly. Please remember to click the save button.';
        $result_msg = "<font color='green'><b>" . __("Successful upload", $flutter_domain) . "!</b></font>";
        $operationSuccess = "true";
    } elseif ($_FILES['Filedata']['error'] == UPLOAD_ERR_INI_SIZE) {
        $result_msg = __('The uploaded file exceeds the maximum upload limit', $flutter_domain);
    } else {
        $result_msg = "<font color='red'><b>" . __("Upload Unsuccessful", $flutter_domain) . "!</b></font>";
    }
    include_once "RCCWP_WritePostPage.php";
    $edit_anchor = RCCWP_WritePostPage::snipshot_anchor(FLUTTER_FILES_URI . $filename);
    echo $result_msg . "*" . $filename . "*" . $edit_anchor;
}
コード例 #5
0
<?php

require dirname(__FILE__) . '/../../../wp-load.php';
global $mf_domain;
if (!(is_user_logged_in() && (current_user_can('edit_posts') || current_user_can('edit_published_pages')))) {
    die(__("Athentication failed!", $mf_domain));
}
require_once "RCCWP_WritePostPage.php";
require_once "RCCWP_CustomGroup.php";
require_once 'RCCWP_Options.php';
if (isset($_POST['flag']) && $_POST['flag'] == "group") {
    $customGroup = RCCWP_CustomGroup::Get($_POST['groupId']);
    RCCWP_WritePostPage::GroupDuplicate($customGroup, $_POST['groupCounter'], $_POST['order']);
} else {
    $customFieldId = $_POST['customFieldId'];
    $groupCounter = $_POST['groupCounter'];
    $fieldCounter = $_POST['fieldCounter'];
    $groupId = $_POST['groupId'];
    RCCWP_WritePostPage::CustomFieldInterface($customFieldId, $groupCounter, $fieldCounter, $groupId);
}
コード例 #6
0
    /**
     * @todo Add documentation
     */
    function CustomFieldInterface($customFieldId, $groupCounter = 1, $fieldCounter = 1, $customGroup_id = 0)
    {
        global $mf_domain;
        require_once "RC_Format.php";
        $customField = RCCWP_CustomField::Get($customFieldId);
        $customFieldName = RC_Format::GetInputName(attribute_escape($customField->name));
        $customFieldTitle = attribute_escape($customField->description);
        $customFieldHelp = htmlentities2($customField->help_text);
        $groupId = $customGroup_id;
        $inputName = $customFieldId . "_" . $groupCounter . "_" . $fieldCounter . "_" . $groupId . "_" . $customFieldName;
        // Create input tag name
        if ($fieldCounter > 1 && $customField->duplicate == 0) {
            return;
        }
        if ($fieldCounter > 1) {
            $titleCounter = " ({$fieldCounter})";
        }
        $field_group = RCCWP_CustomGroup::Get($customField->group_id);
        ?>
		<div class="mf-field <?php 
        echo str_replace(" ", "_", $customField->type);
        ?>
" id="row_<?php 
        echo $inputName;
        ?>
">
			<label for="<?php 
        echo $inputName;
        ?>
">
				<?php 
        if (empty($titleCounter)) {
            $titleCounter = "";
        }
        ?>
				<?php 
        echo $customFieldTitle . $titleCounter;
        ?>
				<?php 
        if (!empty($customFieldHelp)) {
            ?>
					<small class="tip">(what's this?)<span class="field_help"><?php 
            echo $customFieldHelp;
            ?>
</span></small>
				<?php 
        }
        ?>
			</label>
			<span>
				<p class="error_msg_txt" id="fieldcellerror_<?php 
        echo $inputName;
        ?>
" style="display:none"></p>
				<?php 
        switch ($customField->type) {
            case 'Textbox':
                RCCWP_WritePostPage::TextboxInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Multiline Textbox':
                RCCWP_WritePostPage::MultilineTextboxInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Checkbox':
                RCCWP_WritePostPage::CheckboxInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Checkbox List':
                RCCWP_WritePostPage::CheckboxListInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Radiobutton List':
                RCCWP_WritePostPage::RadiobuttonListInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Dropdown List':
                RCCWP_WritePostPage::DropdownListInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Listbox':
                RCCWP_WritePostPage::ListboxInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'File':
                RCCWP_WritePostPage::FileInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Image':
                RCCWP_WritePostPage::PhotoInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Date':
                RCCWP_WritePostPage::DateInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Audio':
                RCCWP_WritePostPage::AudioInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Color Picker':
                RCCWP_WritePostPage::ColorPickerInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            case 'Slider':
                RCCWP_WritePostPage::SliderInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
                //eeble
            //eeble
            case 'Related Type':
                RCCWP_WritePostPage::RelatedTypeInterface($customField, $inputName, $groupCounter, $fieldCounter);
                break;
            default:
        }
        if ($fieldCounter == 1) {
            ?>
					<?php 
            if ($customField->duplicate != 0) {
                ?>
					<br />
					
					 <a class ="typeHandler" href="javascript:void(0);" id="type_handler-<?php 
                echo $inputName;
                ?>
" > 
						<img class="duplicate_image"  src="<?php 
                echo MF_URI;
                ?>
images/duplicate.png" alt="<?php 
                _e('Add field duplicate', $mf_domain);
                ?>
"/>  <?php 
                _e('Duplicate', $mf_domain);
                ?>
					</a>
					<?php 
            }
            ?>
					<?php 
        } else {
            ?>
					<br />
					<a class ="delete_duplicate_field" href="javascript:void(0)" id="delete_field_repeat-<?php 
            echo $inputName;
            ?>
"> 
						<img class="duplicate_image"  src="<?php 
            echo MF_URI;
            ?>
images/delete.png" alt="<?php 
            _e('Remove field duplicate', $mf_domain);
            ?>
 "/> <?php 
            _e('Remove', $mf_domain);
            ?>
 
					</a>
				<?php 
        }
        ?>
				<input type="hidden" name="rc_cwp_meta_keys[]" value="<?php 
        echo $inputName;
        ?>
" />
		</span>
		</div>
	<?php 
    }
コード例 #7
0
    /**
     * This function show the panel for 
     * add new panels and change his values
     *
     * @author David Valdez <*****@*****.**>
     *
     */
    function Main()
    {
        global $wpdb, $flutter_domain;
        //FlutterLayoutBlock::UpdateModuleSettings(get_template_directory().'/configure.xml', -1, '-', get_option('template'));
        $template = get_option('template');
        $template_module_id = $wpdb->get_var("SELECT module_id  FROM " . FLUTTER_TABLE_LAYOUT_MODULES . " WHERE theme = '{$template}'");
        $moduleSettings = FlutterLayoutBlock::GetModuleSettings($template_module_id);
        if (!$moduleSettings) {
            die(__('This theme has no settings', $flutter_domain));
        }
        if (isset($_POST['_savesetttings'])) {
            foreach ($moduleSettings->variables as $varKey => $variable) {
                $moduleSettings->variables[$varKey]->value = $_POST[$variable->variable_name];
            }
            $moduleSettings->SaveValues();
        }
        ?>
		
		<script type="text/javascript">
			var wp_root         = "<?php 
        echo get_bloginfo('wpurl');
        ?>
";
		</script>
		<script type="text/javascript" src="<?php 
        echo FLUTTER_URI;
        ?>
js/ui.core.js"></script>
		<div class="wrap">
		<h2><?php 
        _e('Flutter Theme Settings', $flutter_domain);
        ?>
</h2>
		<input type='hidden' id='editorcontainer'/>
		<form name="themesettings_form" action="?page=Flutter_ThemeSettings" id="themesettings_form" method="post">
		<table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
		<?php 
        foreach ($moduleSettings->variables as $variable) {
            $variable->properties = array();
            $inputName = $variable->variable_name;
            $variableValue = $variable->value;
            ?>
			<tr valign="top">
				<th scope="row"><?php 
            echo $variable->description;
            ?>
</th>
				<td>
				<?php 
            switch ($variable->type) {
                case 'textbox':
                    $variable->properties['size'] = "";
                    RCCWP_WritePostPage::TextboxInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'multiline_textbox':
                    $variable->properties['height'] = "10";
                    $variable->properties['width'] = "10";
                    RCCWP_WritePostPage::MultilineTextboxInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'checkbox':
                    RCCWP_WritePostPage::CheckboxInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'checkbox_list':
                    RCCWP_WritePostPage::CheckboxListInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'radiobutton_list':
                    RCCWP_WritePostPage::RadiobuttonListInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'dropdown_list':
                    RCCWP_WritePostPage::DropdownListInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'listbox':
                    $variable->properties['size'] = "";
                    RCCWP_WritePostPage::ListboxInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'file':
                    RCCWP_WritePostPage::FileInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'image':
                    RCCWP_WritePostPage::PhotoInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'date':
                    $variable->properties['format'] = "m.d.y";
                    RCCWP_WritePostPage::DateInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'audio':
                    RCCWP_WritePostPage::AudioInterface($variable, $inputName, 0, 0, $variableValue);
                    break;
                case 'Color Picker':
                    RCCWP_WritePostPage::ColorPickerInterface($customField, $inputName, 0, 0, $variableValue);
                    break;
                case 'Slider':
                    RCCWP_WritePostPage::SliderInterface($customField, $inputName, 0, 0, $variableValue);
                    break;
            }
            ?>
				</td>
			</tr>
		<?php 
        }
        ?>
		
		</table>
		
		<p class="submit" ><input name="_savesetttings" type="submit" value="<?php 
        _e('Save Settings', $flutter_domain);
        ?>
" /></p>
		</form>
		</div>
		<?php 
    }
コード例 #8
0
    public static function MediaPhotoInterface($customField, $inputName, $groupCounter, $fieldCounter)
    {
        global $mf_domain, $post;
        $idField = RCCWP_WritePostPage::changeNameInput($inputName);
        if (!empty($_GET['post'])) {
            $hidValue = RCCWP_CustomField::GetCustomFieldValues(true, $_GET['post'], $customField->name, $groupCounter, $fieldCounter);
        } else {
            $hidValue = '';
        }
        $filepath = $inputName . '_filepath';
        //The Image is required?
        $requiredClass = "";
        if ($customField->required_field) {
            $requiredClass = "field_required";
        }
        $imageThumbID = "img_thumb_" . $idField;
        $value = "<img src='" . MF_URI . "images/noimage.jpg' id='{$imageThumbID}'/>";
        if (!empty($hidValue)) {
            $path = PHPTHUMB . "?src=";
            $info = wp_get_attachment_image_src($hidValue, 'original');
            $path_image_media = $info[0];
            $value = $path . $path_image_media . "&w=150&h=120&zc=1";
            $value = "<img src='{$value}' id='{$imageThumbID}'/>";
        }
        ?>
  		<p 	class="error_msg_txt" id="upload_progress_<?php 
        echo $idField;
        ?>
" style="visibility:hidden;height:0px">
  		</p>	
  		<div id="image_photo" style="width:150px; float: left">
  			<?php 
        echo $value;
        ?>
  		<div id="photo_edit_link_<?php 
        echo $idField;
        ?>
" class="photo_edit_link"> 
  			<?php 
        if ($hidValue) {
            echo "&nbsp;<strong><a href='#remove' class='remove_media' id='remove-{$idField}'>" . __("Remove Image", $mf_domain) . "</a></strong>";
        }
        ?>
  		</div>
  		</div>
  		<div id="image_input" style="padding-left: 170px;">
  	<?php 
        if (empty($requiredClass)) {
            $requiredClass = '';
        }
        ?>
		
  			<div class="mf_custom_field">
  			<input tabindex="3" 
  				id="<?php 
        echo $idField;
        ?>
" 
  				name="<?php 
        echo $inputName;
        ?>
" 
  				type="hidden" 
  				class="<?php 
        echo $requiredClass;
        ?>
"
  				size="46"
  				value="<?php 
        echo $hidValue;
        ?>
"
  				<?php 
        if ($customField->required_field) {
            echo 'validate="required:true"';
        }
        ?>
  				/>
  				<?php 
        $thumb_class = 'thickbox1';
        if (is_wp30()) {
            $thumb_class = 'thickbox';
        }
        ?>

  			<a class="<?php 
        echo $thumb_class;
        ?>
 update_field_media_upload" id="thumb_<?php 
        echo $idField;
        ?>
" href="media-upload.php?post_id=<?php 
        echo $post->ID;
        ?>
&#038;type=image&#038;TB_iframe=1" ><?php 
        _e('Set Image', $mf_domain);
        ?>
</a>
  			</div>
  			<?php 
        if (!is_wp30()) {
            ?>
  			<script>
  			jQuery(document).ready(function(){
        	tb_init('a#thumb_<?php 
            echo $idField;
            ?>
');
        	jQuery('a#thumb_<?php 
            echo $idField;
            ?>
').click( function(){
        	  window.mf_field_id = jQuery(this).attr('id');
        	});
        });
  			</script>
  			<?php 
        }
        ?>
  		</div>

  		<div style="clear: both; height: 1px;"> </div>
  			<?php 
        if ($customField->required_field) {
            ?>
  				<div class="mf_message_error"><label for="<?php 
            echo $inputName;
            ?>
" class="error_magicfields error"><?php 
            _e("This field is required", $mf_domain);
            ?>
</label></div>
  			<?php 
        }
        ?>

  		<?php 
    }
コード例 #9
0
    function PhotoInterface($customField, $inputName, $groupCounter, $fieldCounter)
    {
        global $flutter_domain;
        $customFieldId = '';
        // <---- ¿?
        $filepath = $inputName . '_filepath';
        /// <---- ¿?
        $noimage = "";
        // <---- if no exists image?
        $freshPageFolderName = dirname(plugin_basename(__FILE__));
        if ($customField->required_field) {
            $requiredClass = "field_required";
        }
        //global $countImageThumbID;
        $imageThumbID = "";
        $imageThumbID = "img_thumb_" . $inputName;
        if (isset($_REQUEST['post'])) {
            $customFieldId = $customField->id;
            $value = RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter);
            $path = PHPTHUMB . "?src=" . FLUTTER_FILES_PATH;
            $valueRelative = $value;
            $value = $path . $value;
            if (!(strpos($value, 'http') === FALSE)) {
                $hidValue = str_replace('"', "'", $valueRelative);
            }
            $value = stripslashes(trim("\\<img src=\\'" . $value . "\\' class=\"freshout\" \\/\\>"));
        } else {
            if (!empty($customField->value)) {
                $path = PHPTHUMB . "?src=" . FLUTTER_FILES_PATH;
                $valueRelative = $customField->value;
                $value = $path . $customField->value;
                if (!(strpos($value, 'http') === FALSE)) {
                    $hidValue = str_replace('"', "'", $valueRelative);
                    $value = stripslashes(trim("\\<img src=\\'" . $value . "\\' class=\"freshout\" \\/\\>"));
                }
            } else {
                $noimage = "<img src='" . FLUTTER_URI . "images/noimage.jpg' id='" . $imageThumbID . "'/>";
            }
        }
        if ($valueRelative == '') {
            $noimage = "<img src='" . FLUTTER_URI . "images/noimage.jpg' id='" . $imageThumbID . "'/>";
        }
        include_once 'RCCWP_Options.php';
        $useSnipshot = RCCWP_Options::Get('use-snipshot');
        // If the field is at right, set a constant width to the text box
        $field_group = RCCWP_CustomGroup::Get($customField->group_id);
        $urlInputSize = false;
        $is_canvas = 0;
        if ($field_group->at_right) {
            $urlInputSize = 5;
            $is_canvas = 1;
        }
        ?>

		<p class="error_msg_txt" id="upload_progress_<?php 
        echo $inputName;
        ?>
" style="visibility:hidden;height:0px"></p>
		

        <!--- This Script is for remove the image -->
	    <script type="text/javascript">
             remove_photo2 = function(ide){
                if(confirm("<?php 
        _e('Are you sure?', $flutter_domain);
        ?>
")){
                        //get the  name to the image
                        //id = ide.split("-")[1];
                        id = ide;
                        image = jQuery('#'+id).val();
                        jQuery.get('<?php 
        echo FLUTTER_URI;
        ?>
RCCWP_removeFiles.php',{'action':'delete','file':image},
                                    function(message){
                                        if(message == "true"){
                                            photo = "img_thumb_" + id;
                                            jQuery("#"+photo).attr("src","<?php 
        echo FLUTTER_URI . "images/noimage.jpg";
        ?>
");
                                            jQuery("#photo_edit_link_"+id).empty();
                                            jQuery("#"+id).val("");

                                        }
                                    });
                    }
            }

            remove_photo = function(){
                if(confirm("<?php 
        _e('Are you sure?', $flutter_domain);
        ?>
")){
                        //get the  name to the image
                        id = jQuery(this).attr('id').split("-")[1];
                        image = jQuery('#'+id).val();
                        jQuery.get('<?php 
        echo FLUTTER_URI;
        ?>
RCCWP_removeFiles.php',{'action':'delete','file':image},
                                    function(message){
                                        if(message == "true"){
                                            photo = "img_thumb_" + id;
                                            jQuery("#"+photo).attr("src","<?php 
        echo FLUTTER_URI . "images/noimage.jpg";
        ?>
");
                                            jQuery("#photo_edit_link_"+id).empty();
                                            jQuery("#"+id).val("");

                                        }
                                    });
                    }
            }

            jQuery(document).ready(function(){
                jQuery(".remove").click(remove_photo);
            });
        </script>
        <!-- Here finish -->


		<div id="image_photo" style="width:150px;">
		
			<?php 
        if ($valueRelative != "") {
            if (!(strpos($value, '<img src') === FALSE)) {
                $valueLinkArr = explode("'", $value);
                $valueLink = $valueLinkArr[1];
                //$valueLink = $value;
                if (!(strpos($value, '&sw') === FALSE)) {
                    // Calculating Image Width/Height
                    $arrSize = explode("=", $value);
                    $arrSize1 = explode("&", $arrSize[3]);
                    $arrSize2 = explode("&", $arrSize[4]);
                    $imageWidth = $arrSize1[0];
                    $imageHeight = $arrSize2[0];
                    // END
                    $valueArr = explode("&sw", $value);
                    $valueArr = explode("'", $valueArr[1]);
                    $value = str_replace("&sw" . $valueArr[0] . "'", "&sw" . $valueArr[0] . "&w=150&h=120' align='center' id='" . $imageThumbID . "'", $value);
                } else {
                    if (!(strpos($value, '&w') === FALSE)) {
                        // Calculating Image Width/Height
                        $arrSize = explode("=", $value);
                        $arrSize1 = explode("&", $arrSize[3]);
                        $arrSize2 = explode("'", $arrSize[4]);
                        $imageWidth = $arrSize1[0];
                        $imageHeight = $arrSize2[0];
                        // END
                        $valueArr = explode("&", $value);
                        $valueArr = explode("'", $valueArr[2]);
                        $value = str_replace($valueArr[0], "&w=150&h=120' align='left' id='" . $imageThumbID . "'", $value);
                    } else {
                        // Calculating Image Width/Height
                        $arrSize = explode("&", $params);
                        $arrSize1 = explode("=", $arrSize[1]);
                        $arrSize2 = explode("=", $arrSize[2]);
                        $imageWidth = $arrSize1[1];
                        $imageHeight = $arrSize2[1];
                        // END
                        $valueArr = explode("'", $value);
                        $value = str_replace($valueArr[1], $valueArr[1] . "&w=150' id='" . $imageThumbID . "' align='", $value);
                    }
                }
                if (!empty($imageWidth)) {
                    ?>

						<?php 
                }
                echo '<a style="display: block;margin-left: auto;margin-right: auto " href="' . $valueLink . '" target="_blank">' . $value . '</a>';
            }
        }
        echo $noimage;
        $arrSize = explode("phpThumb.php?src=", $valueLink);
        $fileLink = $arrSize[1];
        $andPos = strpos($arrSize[1], "?");
        if ($andPos === FALSE) {
            $andPos = strpos($arrSize[1], "&");
        }
        // Remove & parameters from file path
        if ($andPos > 0) {
            $fileLink = substr($arrSize[1], 0, $andPos);
        }
        $ext = substr($fileLink, -3, 3);
        ?>
	
		
		<div id="photo_edit_link_<?php 
        echo $inputName;
        ?>
" class="photo_edit_link"> 
			
				<?php 
        if (isset($_REQUEST['post']) && $hidValue != '') {
            if (False) {
                echo "<a href='" . RCCWP_WritePostPage::snipshot_anchor($fileLink) . "' class='thickbox' tittle='Flutter'<strong onclick=prepareUpdatePhoto('{$inputName}')>" . __("Edit", $flutter_domain) . "</strong> </a>";
            } else {
                $cropperLink = FLUTTER_URI . "cropper.php?input_name=" . urlencode($inputName) . "&id=" . urlencode($hidValue) . "&url=" . urlencode($_SERVER['REQUEST_URI']) . "&imageThumbId={$imageThumbID}";
                ?>
						<a  rel="gb_page_fs[]" href="<?php 
                echo $cropperLink;
                ?>
" title="Flutter" class="greybox" id="lnkCropper"> <strong><?php 
                _e('Crop', $flutter_domain);
                ?>
</strong> </a>
				<?php 
            }
            echo "&nbsp;<strong><a href='#remove' class='remove' id='remove-{$inputName}'>" . __("Delete", $flutter_domain) . "</a></strong>";
        }
        ?>
			
		    </div>
		</div>
		<br />
		<div id="image_input">
					
			<input tabindex="3" 
				id="<?php 
        echo $inputName;
        ?>
" 
				name="<?php 
        echo $inputName;
        ?>
" 
				type="hidden" 
				class="<?php 
        echo $requiredClass;
        ?>
"
				size="46"
				value="<?php 
        echo $hidValue;
        ?>
"
				/>
			
			<?php 
        include_once "RCCWP_SWFUpload.php";
        RCCWP_SWFUpload::Body($inputName, 1, $is_canvas, $urlInputSize);
        ?>

		</div>
		
		<input type="hidden" name="rc_cwp_meta_photos[]" value="<?php 
        echo $inputName;
        ?>
" 	/>
		<input type="hidden" name="<?php 
        echo $inputName;
        ?>
_dorename" id="<?php 
        echo $inputName;
        ?>
_dorename" value="0" />
		

		<!-- Used to store name of URL Field -->
		<!--<input type="hidden" name="parent_text_<?php 
        echo $countImageThumbID;
        ?>
" id="parent_text_<?php 
        echo $countImageThumbID;
        ?>
" value="<?php 
        echo $filepath;
        ?>
"/>
		<input type="hidden" name="hidImgValue<?php 
        echo $countImageThumbID;
        ?>
" id="hidImgValue<?php 
        echo $countImageThumbID;
        ?>
" value="<?php 
        echo $inputName;
        ?>
_last" />-->

		<?php 
    }
コード例 #10
0
    function Body($inputName, $fileType, $isCanvas = 0, $urlInputSize = false)
    {
        global $mf_domain;
        include_once 'RCCWP_Options.php';
        $idField = RCCWP_WritePostPage::changeNameInput($inputName);
        if (!$urlInputSize) {
            $urlInputSize = 20;
        }
        if ($isCanvas == 0) {
            $iframeInputSize = $urlInputSize;
            $iframeWidth = 380;
            $iframeHeight = 40;
            $inputSizeParam = '';
        } else {
            $isCanvas = 1;
            $iframeWidth = 150;
            $iframeHeight = 60;
            $iframeInputSize = 3;
            $inputSizeParam = "&inputSize={$iframeInputSize}";
        }
        $iframePath = MF_URI . "RCCWP_upload.php?input_name=" . urlencode($inputName) . "&type={$fileType}&imageThumbID=img_thumb_{$idField}&canvas={$isCanvas}" . $inputSizeParam;
        ?>
      <?php 
        if (RCCWP_Options::Get('use-standard-uploader')) {
            ?>
			<div id='upload_iframe_<?php 
            echo $idField;
            ?>
' class="iframeload { iframe: { id: 'upload_internal_iframe_<?php 
            echo $idField;
            ?>
', src: '<?php 
            echo $iframePath;
            ?>
', height: <?php 
            echo $iframeHeight;
            ?>
, width: <?php 
            echo $iframeWidth;
            ?>
 } }">
			</div>
      <?php 
        } else {
            ?>
			<div id='upload_ajax_<?php 
            echo $idField;
            ?>
' class="ajaxupload { lang: { upload_error: '<?php 
            echo __("Upload Failed", $mf_domain);
            ?>
', upload_success: '<?php 
            echo __("Successful Upload", $mf_domain);
            ?>
', upload: '<?php 
            echo __("Choose File...", $mf_domain);
            ?>
', replace: '<?php 
            echo __("Replace File...", $mf_domain);
            ?>
', drop: '<?php 
            echo __("drop file here to upload", $mf_domain);
            ?>
' }}">
      </div>
      <?php 
        }
        ?>
			<table border="0">
				<tr >
					<td style="border-bottom-width: 0px; padding: 0"><label for="upload_url"><?php 
        _e('Or URL', $mf_domain);
        ?>
:</label></td>
					<td style="border-bottom-width: 0px; padding-left: 4px;">
						<input id="upload_url_<?php 
        echo $idField;
        ?>
"
							name="upload_url_<?php 
        echo $inputName;
        ?>
"
							type="text"
							size="<?php 
        echo $urlInputSize;
        ?>
"
							class="mf-upload-url" />
                                                        <input type="button" onclick="uploadurl('<?php 
        echo $idField;
        ?>
','<?php 
        echo $fileType;
        ?>
','<?php 
        echo wp_create_nonce("nonce_url_file");
        ?>
')" value="Upload" class="button" style="width:70px"/>
					</td>
				</tr>
			</table>
		<?php 
    }