RCCWP_WritePostPage::AudioInterface PHP 메소드

AudioInterface() 공개 정적인 메소드

Audio field
public static AudioInterface ( $customField, $inputName, $groupCounter, $fieldCounter )
    public static function AudioInterface($customField, $inputName, $groupCounter, $fieldCounter)
    {
        global $mf_domain;
        $idField = RCCWP_WritePostPage::changeNameInput($inputName);
        $customFieldId = '';
        $freshPageFolderName = dirname(plugin_basename(__FILE__));
        $requiredClass = "";
        $mf_post_id = apply_filters('mf_source_post_data', @$_REQUEST['post']);
        if ($customField->required_field) {
            $requiredClass = "field_required";
        }
        if (isset($mf_post_id)) {
            $customFieldId = $customField->id;
            $valueOriginal = RCCWP_CustomField::GetCustomFieldValues(true, $mf_post_id, $customField->name, $groupCounter, $fieldCounter);
            $path = MF_FILES_URI;
            if (empty($valueOriginal)) {
                $valueOriginal = '';
            }
            if (empty($valueOriginalRelative)) {
                $valueOriginalRelative = '';
            }
            ${$valueOriginalRelative} = $valueOriginal;
            $valueOriginal = $path . $valueOriginal;
            if (!empty($valueOriginal)) {
                $value = stripslashes(trim("\\<div  id='obj-{$idField}' style=\\'width:260px;padding-top:3px;\\'\\>\\<object classid=\\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\\' codebase='\\http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\\' width=\\'95%\\' height=\\'20\\' wmode=\\'transparent\\' \\>\\<param name=\\'movie\\' value=\\'" . MF_URI . "js/singlemp3player.swf?file=" . urlencode($valueOriginal) . "\\' wmode=\\'transparent\\' /\\>\\<param name=\\'quality\\' value=\\'high\\' wmode=\\'transparent\\' /\\>\\<embed src=\\'" . MF_URI . "js/singlemp3player.swf?file=" . urlencode($valueOriginal) . "' width=\\'100\\%\\' height=\\'20\\' quality=\\'high\\' pluginspage=\\'http://www.macromedia.com/go/getflashplayer\\' type=\\'application/x-shockwave-flash\\' wmode=\\'transparent\\' \\>\\</embed\\>\\</object\\>\\</div\\><br />"));
            }
        }
        // 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 upload-msg" id="upload_progress_<?php 
        echo $idField;
        ?>
" style="display:none;"></p>
		<script type="text/javascript">
			//this script is for remove the audio file using ajax
			remove_audio = function(){
				if(confirm("<?php 
        _e('Are you sure?', $mf_domain);
        ?>
")){
					//get the name to the image
				  	//id = jQuery(this).attr('id').split("-")[1];
          			pattern = /remove\-([a-z0-9\-\_]+)/i;
					id = jQuery(this).attr("id");
          			id = pattern.exec(id);
          			id = id[1];

					file = jQuery('#'+id).val(); 

					delete_field = jQuery('#magicfields_remove_files').val();
					if(delete_field != ''){
						jQuery('#magicfields_remove_files').val(delete_field+"|||"+file);
					}else{
						jQuery('#magicfields_remove_files').val(file);
					}

					// set the value to empty
					jQuery('#obj-'+id).empty();
					jQuery('#actions-'+id).empty();
					jQuery('#remove-'+id).empty();
					jQuery('#'+id).val("");
					jQuery('#'+id).closest(".mf-field").find(".ajax-upload-list").html('');
				} 
			}

			jQuery(document).ready(function(){
				jQuery("#remove-<?php 
        echo $idField;
        ?>
").click(remove_audio);
			});
		</script>
		
		<div class="mf-audio-value-actions">
		<?php 
        if (!empty(${$valueOriginalRelative})) {
            echo '<div class="mf-audio-value">' . $value . '</div>';
            echo "<div id='actions-{$idField}' class='actions-audio'><a href='javascript:void(0);' id='remove-{$idField}' class='remove-audio'>" . __("Delete", $mf_domain) . "</a></div>";
        } else {
            echo '<div class="mf-audio-value"></div>';
            echo "<div id='actions-{$idField}' class='actions-audio' style='display: none'><a href='javascript:void(0);' id='remove-{$idField}' class='remove-audio'>" . __("Delete", $mf_domain) . "</a></div>";
        }
        if (empty($valueOriginalRelative)) {
            $valueOriginalRelative = '';
        }
        ?>
	  </div>
	  <!-- /.mf-audio-value-actions -->
	  
		<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 ${$valueOriginalRelative};
        ?>
"
			<?php 
        if ($customField->required_field) {
            echo 'validate="required:true"';
        }
        ?>
	
			/>
	
		<?php 
        // adding the SWF upload
        include_once "RCCWP_SWFUpload.php";
        RCCWP_SWFUpload::Body($inputName, 2, $is_canvas, $urlInputSize);
        ?>
		</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);
            ?>
.audio</label></div>
		<?php 
        }
    }

Usage Example

예제 #1
0
    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 
        }
    }
All Usage Examples Of RCCWP_WritePostPage::AudioInterface