id); foreach ($assignedCategoryIds as $categoryId) { $toReplace = 'id="in-category-' . $categoryId . '"'; $replacement = $toReplace . ' checked="checked"'; $content = str_replace($toReplace, $replacement, $content); } return $content; } function FormError(){ if (RCCWP_Application::InWritePostPanel()){ echo ""; } } function ApplyCustomWritePanelHeader() { global $CUSTOM_WRITE_PANEL; // Validate capability require_once ('RCCWP_Options.php'); $assignToRole = RCCWP_Options::Get('assign-to-role'); $requiredPostsCap = 'edit_posts'; $requiredPagesCap = 'edit_pages'; if ($assignToRole == 1){ $requiredPostsCap = $CUSTOM_WRITE_PANEL->capability_name; $requiredPagesCap = $CUSTOM_WRITE_PANEL->capability_name; } if ($CUSTOM_WRITE_PANEL->type == "post") $requiredCap = $requiredPostsCap; else $requiredCap = $requiredPagesCap; if (!current_user_can($requiredCap)) wp_die( __('You do not have sufficient permissions to access this custom write panel.') ); // --- Apply Flutter CSS and javascript ?> ID == 0){ $blu = RCCWP_CustomWritePanel::Get($CUSTOM_WRITE_PANEL->id); if($post->post_type == "post"){ $name_title = "Post";} else{$name_title = "Page";} $title="Write ".$name_title." >> " .$blu->name; }else{ $blu = RCCWP_CustomWritePanel::Get($CUSTOM_WRITE_PANEL->id); if($post->post_type == "post"){ $name_title = "Post";} else{$name_title = "Page";} $title="Edit ".$name_title." >> " .$blu->name; } // Show/Hide Panel fields global $STANDARD_FIELDS; $standardFields = RCCWP_CustomWritePanel::GetStandardFields($CUSTOM_WRITE_PANEL->id); $hideCssIds = array(); foreach($STANDARD_FIELDS as $standardField){ if (!in_array($standardField->id, $standardFields)){ foreach($standardField->cssId as $cssID) array_push($hideCssIds, $cssID); } } if (empty($hideCssIds)) return; array_walk($hideCssIds, create_function('&$item1, $key', '$item1 = "#" . $item1;')); $hideCssIdString = implode(', ', $hideCssIds); ?> Event.observe(window, 'load', function() { $$('h2').each( function(element) { if ($(element).innerHTML= "Advanced Options") $(element).style.display="none"; }); }); */ } function CustomFieldCollectionInterfaceRight(){ RCCWP_WritePostPage::CustomFieldCollectionInterface(true); } function CustomFieldCollectionInterface($rightOnly = false) { global $CUSTOM_WRITE_PANEL, $post; if (!isset($CUSTOM_WRITE_PANEL)) return; $customGroups = RCCWP_CustomWritePanel::GetCustomGroups($CUSTOM_WRITE_PANEL->id); foreach ($customGroups as $customGroup) { if (($rightOnly && !$customGroup->at_right) || (!$rightOnly && $customGroup->at_right)) { continue; } // Render a block for each group in the module ?> id); if($post->post_type == "page"){ $type = "page"; }else if($post->post_type == "post"){ $type = "post"; } if( isset( $_REQUEST['post'] ) && count($customFields) > 0) { $firstFieldName = $customFields[0]->name; $gc = RCCWP_CustomField::GetFieldGroupDuplicates($_REQUEST['post'], $firstFieldName) ; if ($gc < 1) $gc = 1;//for backward compatability for($i=1;$i<=$gc;$i++) { // RCCWP_WritePostPage::GroupDuplicate2($customGroup,$i,false) ; /* * trying to create separate meta boxes <============= */ add_meta_box( 'Flutter', 'Flutter Custom Fields', array( 'RCCWP_WritePostPage', 'CustomFieldCollectionInterface2' ), $type, 'advanced' ); } } else { // RCCWP_WritePostPage::GroupDuplicate($customGroup,1,false) ; /* * trying to create separate meta boxes <============= */ add_meta_box( 'Flutter', 'Flutter Custom Fields', array( 'RCCWP_WritePostPage', 'CustomFieldCollectionInterface2' ), $type, 'advanced' ); $gc = 1 ; } ?>
" style="display:none"> Loading ...
id); foreach ($customGroups as $customGroup) { if (($rightOnly && !$customGroup->at_right) || (!$rightOnly && $customGroup->at_right)) { // continue; } // Render a block for each group in the module ?> id); if( isset( $_REQUEST['post'] ) && count($customFields) > 0) { $firstFieldName = $customFields[0]->name; $gc = RCCWP_CustomField::GetFieldGroupDuplicates($_REQUEST['post'], $firstFieldName) ; if ($gc < 1) $gc = 1;//for backward compatability for($i=1;$i<=$gc;$i++) { RCCWP_WritePostPage::GroupDuplicate2($customGroup,$i,false) ; } } else { RCCWP_WritePostPage::GroupDuplicate2($customGroup,1,false) ; $gc = 1 ; } ?>
" style="display:none"> Loading ...
id); if (count($customFields) == 0) return; if( $customGroup->duplicate == 0 & $groupCounter != 1 ) return ; require_once("RC_Format.php"); if ( $customGroup->name == "__default"){ // $customGroup->name = "Module general fields"; $customGroup->name = "" ; } ?> id); $customFieldName = RC_Format::GetInputName(attribute_escape($field->name)); $customFieldTitle = attribute_escape($customField->description); $inputName = $field->id."_".$groupCounter."_1_".$customFieldName ?> name,$groupCounter) ; if ($fc < 1) $fc = 1;//for backward compatability for($i=1;$i<=$fc;$i++) { //if ($i>1) echo "
" ; RCCWP_WritePostPage::CustomFieldInterface($field->id,$groupCounter,$i) ; //if ($i>1) echo "
" ; } } else { RCCWP_WritePostPage::CustomFieldInterface($field->id,$groupCounter,1); $fc = 1 ; } ?> ">

duplicate != 0 ){ if( $groupCounter == 1 ){ ?> ', id ?>)"> Add group duplicate Duplicate Group
Remove field duplicateRemove Group
id); if (count($customFields) == 0) return; if( $customGroup->duplicate == 0 & $groupCounter != 1 ) return ; require_once("RC_Format.php"); if ( $customGroup->name == "__default"){ // $customGroup->name = "Module general fields"; $customGroup->name = "" ; } ?>
id, 'post'): "postbox" ?>"> name != ""){ ?>

name ?>

name; ?>

+

name." ($groupCounter)" ?>

id); $customFieldName = RC_Format::GetInputName(attribute_escape($field->name)); $customFieldTitle = attribute_escape($customField->description); $inputName = $field->id."_".$groupCounter."_1_".$customFieldName ?> name,$groupCounter) ; if ($fc < 1) $fc = 1;//for backward compatability for($i=1;$i<=$fc;$i++) { //if ($i>1) echo "
" ; RCCWP_WritePostPage::CustomFieldInterface($field->id,$groupCounter,$i) ; //if ($i>1) echo "
" ; } } else { RCCWP_WritePostPage::CustomFieldInterface($field->id,$groupCounter,1); $fc = 1 ; } ?> ">

duplicate != 0 ){ if( $groupCounter == 1 ){ ?> ', id ?>)"> Add group duplicate Duplicate Group
', id ?>)"> Add group duplicate Duplicate Group Remove field duplicateRemove Group
name)); $customFieldTitle = attribute_escape($customField->description); $inputName = $customFieldId."_".$groupCounter."_".$fieldCounter."_".$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); ?> at_right){ ?>
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; default: ; } if($fieldCounter == 1) { ?> duplicate != 0 ){ ?>
Add field duplicate Duplicate
Remove field duplicate Remove id; $value = RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter); $checked = $value == 'true' ? 'checked="checked"' : ''; } ?> /> id; $values = (array) RCCWP_CustomField::GetCustomFieldValues(false, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter); } else { $values = $customField->default_value; } ?> options as $option) : $checked = in_array($option, (array)$values) ? 'checked="checked"' : ''; $option = attribute_escape(trim($option)); ?>
id; $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); } else { $value = $customField->default_value[0]; } if ($customField->required_field) $requiredClass = "field_required"; ?> id; $values = (array) RCCWP_CustomField::GetCustomFieldValues(false, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter); } else { $values = $customField->default_value; } $inputSize = (int)$customField->properties['size']; if ($customField->required_field) $requiredClass = "field_required"; ?> id; $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); } $inputHeight = (int)$customField->properties['height']; $inputWidth = (int)$customField->properties['width']; if ($customField->required_field) $requiredClass = "field_required"; ?> id; $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); } $inputSize = (int)$customField->properties['size']; if ($customField->required_field) $requiredClass = "field_required"; // If the field is at right, set a constant width to the text box $field_group = RCCWP_CustomGroup::Get($customField->group_id); if ($field_group->at_right){ if ($inputSize>14) $inputSize = 14; } ?> required_field) $requiredClass = "field_required"; if (isset($_REQUEST['post'])) { $customFieldId = $customField->id; $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); $path = CANVASURI.'files_flutter/'; $valueRelative = $value; $value = $path.$value; } // 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; } ?> (View Current)"; echo " Delete"; } ?> 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_URI_RELATIVE."files_flutter/"; $valueRelative = $value; $value = $path.$value; if(!(strpos($value, 'http') === FALSE)) $hidValue = str_replace('"', "'", $valueRelative); $value = stripslashes(trim("\")); } else { $noimage = ""; } if($valueRelative == '') { $noimage = ""; } 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; } ?>
' . $value .''; } } 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); ?>

' ; return '' ; */ return 'http://services.snipshot.com/?snipshot_input='. urlencode($fileLink).'&snipshot_callback='.urlencode(CANVASURI."RCCWP_SnipshotCallback.php").'&snipshot_output=file&snipshot_callback_agent=user&test=hello&snipshot_output_options='.urlencode("{\"filetype\":\"$ext\"}").'&KeepThis=true&TB_iframe=true&height=400&width=600' ; } function RadiobuttonListInterface($customField, $inputName, $groupCounter, $fieldCounter) { $customFieldId = ''; if (isset($_REQUEST['post'])) { $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); } else { $value = $customField->default_value[0]; } ?> options as $option) : $checked = $option == $value ? 'checked="checked"' : ''; $option = attribute_escape(trim($option)); ?>
id; $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); } else $value = strftime("%Y-%m-%d"); $sQuery = "SELECT * FROM " . RC_CWP_TABLE_CUSTOM_FIELD_PROPERTIES . " WHERE custom_field_id='".$customField->id."'"; $result = $wpdb->get_results($sQuery); $arrDateFormat = explode('"', $result[0]->properties); $dateFormat = $arrDateFormat[3]; // If the field is at right, set a constant width to the text box $field_group = RCCWP_CustomGroup::Get($customField->group_id); $inputSize = 25; if ($field_group->at_right){ $inputSize = 15; } ?> required_field) $requiredClass = "field_required"; if (isset($_REQUEST['post'])) { $customFieldId = $customField->id; $valueOriginal = RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter); $path = CANVASURI . 'files_flutter/'; $$valueOriginalRelative = $valueOriginal; $valueOriginal = $path.$valueOriginal; if (!empty($valueOriginal)) $value = stripslashes(trim("\
\\\\\\\
")); } // 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; } ?> Delete"; } ?>