id); $customThemePage = RCCWP_CustomWritePanel::GetThemePage($CUSTOM_WRITE_PANEL->name); //hide all categories $all = get_categories( "get=all" ); foreach($all as $al){ $toReplace = 'class="selectit">term_id.'" type="checkbox" name="post_category[]" id="in-category-'.$al->term_id.'"'; $content = str_replace($toReplace, $replacement, $content); } //display ony categories and child $dos=$assignedCategoryIds; foreach($assignedCategoryIds as $id){ $childs= get_categories( "child_of=".$id."&hierarchical=0&hide_empty=0" ); foreach($childs as $child){ array_unshift($dos, $child->term_id); } } $dos=array_unique($dos); foreach($dos as $do){ $toReplace = 'class="selectit" style="display:none;">ID == 0){ $toReplace = "value='".$customThemePage."'"; $replacement = "value='".$customThemePage."'" . ' SELECTED"'; $content = str_replace($toReplace, $replacement, $content); } return $content; } function FormError(){ global $flutter_domain; if (RCCWP_Application::InWritePostPanel()){ echo ""; } } function CustomFieldsCSSScripts(){ ?> 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.',$flutter_domain) ); // --- 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); ?> id); foreach ($customGroups as $customGroup) { //render the elements $customFields = RCCWP_CustomGroup::GetCustomFields($customGroup->id); //when will be edit the Post if(isset( $_REQUEST['post'] ) && count($customFields) > 0){ //using the first field name we can know //the order of the groups $firstFieldName = $customFields[0]->name; $order = RCCWP_CustomField::GetOrderDuplicates($_REQUEST['post'],$firstFieldName); ?>
$element){ ?>
0){ ?>
id); //if don't have fields then finish if (count($customFields) == 0) return; //¿? if( $customGroup->duplicate == 0 && $groupCounter != 1 ) return ; require_once("RC_Format.php"); if(empty($customGroup->name) || $customGroup->name == "__default"){ $title = "Flutter custom fields"; }else{ $title = $customGroup->name; } ?>

id); $customFieldName = RC_Format::GetInputName(attribute_escape($field->name)); $customFieldTitle = attribute_escape($field->description); $groupId = $customGroup->id; $inputName = $field->id."_".$groupCounter."_1_".$groupId."_".$customFieldName; if(isset($_REQUEST['post'])){ $fc = RCCWP_CustomField::GetFieldDuplicates($_REQUEST['post'],$field->name,$groupCounter); $fields_order = RCCWP_CustomField::GetFieldsOrder($_REQUEST['post'],$field->name,$groupCounter); foreach($fields_order as $element){ RCCWP_WritePostPage::CustomFieldInterface($field->id,$groupCounter,$element,$customGroup->id); } }else{ RCCWP_WritePostPage::CustomFieldInterface($field->id,$groupCounter,1,$customGroup->id); $fc = 1; } if(!empty($fields_order)){ $tmp = $fields_order; sort($tmp); $top = $tmp[count($tmp) -1]; }else{ $top = 1; } ?> ">

duplicate != 0 ){ if($groupCounter != 1):?> <?php _e('Remove field duplicate', $flutter_domain); ?> id;?>" href="javascript:void(0);"> <?php _e('Add group duplicate', $flutter_domain); ?>
id); //if don't have any custom field then finish if (count($customFields) == 0) return; //if this group can't be duplicated and the group conter is != to 1 then finish if( $customGroup->duplicate == 0 && $groupCounter != 1 ) return ; //formating require_once("RC_Format.php"); ?>

+ name." ($groupCounter)" ?>

id); $customFieldName = RC_Format::GetInputName(attribute_escape($field->name)); $customFieldTitle = attribute_escape($customField->description); $groupId = $customGroup->id; $inputName = $field->id."_".$groupCounter."_1_".$groupId."_".$customFieldName; RCCWP_WritePostPage::CustomFieldInterface($field->id,$groupCounter,1,$customGroup->id); $fc = 1; } ?> ">

<?php _e('Remove field duplicate', $flutter_domain); ?>
name)); $customFieldTitle = attribute_escape($customField->description); $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); ?> 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; case 'Color Picker' : RCCWP_WritePostPage::ColorPickerInterface($customField, $inputName, $groupCounter, $fieldCounter); break; case 'Slider' : RCCWP_WritePostPage::SliderInterface($customField, $inputName, $groupCounter, $fieldCounter); break; default: ; } if($fieldCounter == 1) { ?> duplicate != 0 ){ ?>
<?php _e('Add field duplicate', $flutter_domain); ?>
<?php _e('Remove field duplicate', $flutter_domain); ?> 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)); ?> style="width:40px;"/>
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']; $requiredClass = "flutter_listbox"; if ($customField->required_field) $requiredClass = "flutter_listbox field_required"; ?> id; $value = RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter); $value = apply_filters('the_editor_content', $value); }else{ $value = $customField->value; } $inputHeight = (int)$customField->properties['height']; $inputWidth = (int)$customField->properties['width']; if ($customField->required_field) $requiredClass = "field_required"; ?>
HTML Visual
id; $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); }else{ $value = $customField->value; } $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 = FLUTTER_URI.'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",$flutter_domain).")"; echo " ".__("Delete",$flutter_domain).""; } ?> 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=../../files_flutter/"; $valueRelative = $value; $value = $path.$value; if(!(strpos($value, 'http') === FALSE)) $hidValue = str_replace('"', "'", $valueRelative); $value = stripslashes(trim("\")); } else if( !empty($customField->value)){ $path = PHPTHUMB."?src=../../files_flutter/"; $valueRelative = $customField->value; $value = $path.$customField->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(FLUTTER_URI."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]; $dateFormat = $customField->properties['format']; // 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 = FLUTTER_URI . '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",$flutter_domain).""; } ?> name, $groupCounter, $fieldCounter)); } ?> id; $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); if($fieldValue){ $value=$fieldValue; }else{ $value = attribute_escape(RCCWP_CustomField::GetCustomFieldValues(true, $_REQUEST['post'], $customField->name, $groupCounter, $fieldCounter)); } if(!$customField->properties['min']){ $customField->properties['min']=0; } if(!$value){ $value=$customField->properties['min']; } if(!$customField->properties['max']){ $customField->properties['max']=100; } if(!$customField->properties['step']){ $customField->properties['step']=0; } ?>