RCCWP_WritePostPage::PhotoInterface PHP Method

PhotoInterface() public static method

public static PhotoInterface ( $customField, $inputName, $groupCounter, $fieldCounter )
    public static function PhotoInterface($customField, $inputName, $groupCounter, $fieldCounter)
    {
        global $mf_domain;
        $idField = RCCWP_WritePostPage::changeNameInput($inputName);
        $mf_post_id = apply_filters('mf_source_post_data', @$_REQUEST['post']);
        if (!empty($mf_post_id)) {
            $hidValue = RCCWP_CustomField::GetCustomFieldValues(true, $mf_post_id, $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)) {
            $value = aux_image($hidValue, 'w=150&h=120&zc=1');
            $value = "<img src='{$value}' id='{$imageThumbID}'/>";
        }
        ?>
		<p 	class="error_msg_txt upload-msg" id="upload_progress_<?php 
        echo $idField;
        ?>
" style="display:none;">
		</p>	

		<div class="image_layout">

		<div class="image_photo">
		  <div class="image_wrap">
			<?php 
        echo $value;
        ?>
      </div>
		<div id="photo_edit_link_<?php 
        echo $idField;
        ?>
" class="photo_edit_link"> 
			<?php 
        if (isset($mf_post_id)) {
            echo '<a href="' . MF_FILES_URI . $hidValue . '" target="_blank">View</a>&nbsp;&nbsp;|&nbsp;&nbsp;<strong><a href="#remove" class="remove" id="remove-' . $idField . '">' . __("Delete", $mf_domain) . '</a></strong>';
        }
        ?>
		</div>
		</div>
		<div class="image_input">
	<?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 
        include_once "RCCWP_SWFUpload.php";
        RCCWP_SWFUpload::Body($inputName, 1, 0, false);
        ?>
			</div>
		</div>
		
	  </div>
	  <!-- /.image_layout -->
	  
		<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 
    }

Usage Example

コード例 #1
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 
        }
    }
All Usage Examples Of RCCWP_WritePostPage::PhotoInterface