| [21] | 1 | <?php |
|---|
| 2 | global $wpdb; |
|---|
| 3 | |
|---|
| 4 | // General Constants |
|---|
| 5 | define('RC_CWP_DB_VERSION', 26); |
|---|
| 6 | define('RC_CWP_POST_WRITE_PANEL_ID_META_KEY', '_rc_cwp_write_panel_id'); |
|---|
| 7 | define('RC_CWP_OPTION_KEY', 'rc_custom_write_panel'); |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | // Flutter paths |
|---|
| 11 | preg_match('/wp-content(.*)(RCCWP_Constant\.php)$/',__FILE__,$flutterpath); |
|---|
| 12 | $flutterpath = str_replace('\\', '/', $flutterpath); |
|---|
| 13 | define('FLUTTER_PLUGIN_DIR', dirname(plugin_basename(__FILE__))); // returns Flutter |
|---|
| 14 | //define("FLUTTER_PATH", str_replace('/RCCWP_Constant.php', '', str_replace('\\', '/', __FILE__))); |
|---|
| 15 | define("FLUTTER_PATH", dirname(__FILE__)); |
|---|
| 16 | define("FLUTTER_URI", get_bloginfo('wpurl').'/wp-content'.$flutterpath[1]); //returns somthing similar to "http://127.0.0.1/wp-content/plugins/Flutter/" |
|---|
| 17 | define("FLUTTER_URI_RELATIVE", 'wp-content'.$flutterpath[1]); //returns somthing similar to "wp-content/plugins/Flutter/" |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | // -- Tables names |
|---|
| 22 | |
|---|
| 23 | // Tables containing somehow constant data |
|---|
| 24 | define('RC_CWP_TABLE_CUSTOM_FIELD_TYPES', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_custom_field_types'); |
|---|
| 25 | define('RC_CWP_TABLE_STANDARD_FIELDS', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_standard_fields'); |
|---|
| 26 | |
|---|
| 27 | // Panels - Groups - Fields |
|---|
| 28 | define('RC_CWP_TABLE_PANELS', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_write_panels'); |
|---|
| 29 | define('RC_CWP_TABLE_PANEL_GROUPS', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_module_groups'); |
|---|
| 30 | define('RC_CWP_TABLE_GROUP_FIELDS', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_panel_custom_field'); |
|---|
| 31 | |
|---|
| 32 | // Extra information about panels |
|---|
| 33 | define('RC_CWP_TABLE_PANEL_CATEGORY', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_panel_category'); |
|---|
| 34 | define('RC_CWP_TABLE_PANEL_STANDARD_FIELD', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_panel_standard_field'); |
|---|
| 35 | define('RC_CWP_TABLE_PANEL_HIDDEN_EXTERNAL_FIELD', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_panel_hidden_external_field'); |
|---|
| 36 | |
|---|
| 37 | // Extra information about fields |
|---|
| 38 | define('RC_CWP_TABLE_CUSTOM_FIELD_OPTIONS', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_custom_field_options'); |
|---|
| 39 | define('RC_CWP_TABLE_CUSTOM_FIELD_PROPERTIES', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_custom_field_properties'); |
|---|
| 40 | |
|---|
| 41 | // Modules |
|---|
| 42 | define('RC_CWP_TABLE_MODULES', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_modules'); |
|---|
| 43 | |
|---|
| 44 | // Extra information about post meta values. |
|---|
| 45 | define('RC_CWP_TABLE_POST_META', $wpdb->prefix . 'rc_cwp_post_meta'); |
|---|
| 46 | |
|---|
| 47 | //define('RC_CWP_TABLE_PANEL_MODULES', (isset($current_blog)?$wpdb->base_prefix:$wpdb->prefix) . 'rc_cwp_panel_modules'); |
|---|
| 48 | |
|---|
| 49 | // Field Types |
|---|
| 50 | global $FIELD_TYPES; |
|---|
| 51 | $FIELD_TYPES = array( |
|---|
| 52 | "textbox" => 1, |
|---|
| 53 | "multiline_textbox" => 2, |
|---|
| 54 | "checkbox" => 3, |
|---|
| 55 | "checkbox_list" => 4, |
|---|
| 56 | "radiobutton_list" => 5, |
|---|
| 57 | "dropdown_list" => 6, |
|---|
| 58 | "listbox" => 7, |
|---|
| 59 | "file" => 8, |
|---|
| 60 | "image" => 9, |
|---|
| 61 | "date" => 10, |
|---|
| 62 | "audio" => 11 |
|---|
| 63 | ); |
|---|
| 64 | |
|---|
| 65 | // Field Types |
|---|
| 66 | global $STANDARD_FIELDS; |
|---|
| 67 | $STANDARD_FIELDS = array(); |
|---|
| 68 | |
|---|
| 69 | // Standard fields |
|---|
| 70 | $STANDARD_FIELDS[12] = new FlutterPanelFields(12, 'Post/Page', array('postdivrich'), true, false, true, true, 1000); |
|---|
| 71 | $STANDARD_FIELDS[2] = new FlutterPanelFields(2, 'Categories', array('categorydiv'), false, false, true, false, 1000); |
|---|
| 72 | $STANDARD_FIELDS[14] = new FlutterPanelFields(14, 'Tags', array('tagsdiv'), true, false, true, false, 1000); |
|---|
| 73 | |
|---|
| 74 | // Common advanced fields |
|---|
| 75 | $STANDARD_FIELDS[11] = new FlutterPanelFields(11, 'Custom Fields', array('postcustom', 'pagepostcustom', 'pagecustomdiv'), true, true, true, true, 1000); |
|---|
| 76 | $STANDARD_FIELDS[3] = new FlutterPanelFields(3, 'Comments & Pings', array('commentstatusdiv', 'pagecommentstatusdiv'), true, true, true, true, 1000); |
|---|
| 77 | $STANDARD_FIELDS[4] = new FlutterPanelFields(4, 'Password', array('passworddiv', 'pagepassworddiv'), true, true, true, true, 1000); |
|---|
| 78 | $STANDARD_FIELDS[18] = new FlutterPanelFields(4, 'Post/Page Author', array('authordiv', 'pageauthordiv'), true, true, true, true, 1000); |
|---|
| 79 | |
|---|
| 80 | // Post-specific advanced fields |
|---|
| 81 | $STANDARD_FIELDS[9] = new FlutterPanelFields(9, 'Excerpt', array('postexcerpt'), true, true, true, false, 1000); |
|---|
| 82 | $STANDARD_FIELDS[10] = new FlutterPanelFields(10, 'Trackbacks', array('trackbacksdiv'), true, true, true, false, 1000); |
|---|
| 83 | $STANDARD_FIELDS[5] = new FlutterPanelFields(5, 'Post Slug', array('slugdiv'), true, true, true, false, 1000); |
|---|
| 84 | |
|---|
| 85 | // Page-specific advanced fields |
|---|
| 86 | $STANDARD_FIELDS[15] = new FlutterPanelFields(15, 'Page Parent', array('pageparentdiv'), true, true, false, true, 1000); |
|---|
| 87 | $STANDARD_FIELDS[16] = new FlutterPanelFields(16, 'Page Template', array('pagetemplatediv'), true, true, false, true, 1000); |
|---|
| 88 | $STANDARD_FIELDS[17] = new FlutterPanelFields(17, 'Page Order', array('pageorderdiv'), true, true, false, true, 1000); |
|---|
| 89 | |
|---|
| 90 | // Important folders |
|---|
| 91 | define('FLUTTER_UPLOAD_FILES_DIR', dirname(__FILE__)."/files_flutter/"); |
|---|
| 92 | define('FLUTTER_IMAGES_CACHE_DIR', dirname(__FILE__)."/cache/"); |
|---|
| 93 | define('FLUTTER_MODULES_DIR', dirname(__FILE__)."/modules/"); |
|---|
| 94 | define('FLUTTER_PURIFIER_CACHE_DIR', dirname(__FILE__)."/purifier_lib/HTMLPurifier/DefinitionCache/Serializer/HTML/"); |
|---|
| 95 | |
|---|
| 96 | // Capabilities names |
|---|
| 97 | define('FLUTTER_CAPABILITY_PANELS', "Create Flutter Panels"); |
|---|
| 98 | define('FLUTTER_CAPABILITY_MODULES', "Create Flutter Modules"); |
|---|
| 99 | define('FLUTTER_CAPABILITY_LAYOUT', "Change Flutter Layout"); |
|---|
| 100 | define('FLUTTER_CAPABILITY_STYLE', "Change Flutter Style"); |
|---|
| 101 | |
|---|
| 102 | if (!defined('DIRECTORY_SEPARATOR')) |
|---|
| 103 | { |
|---|
| 104 | if (strpos(php_uname('s'), 'Win') !== false ) |
|---|
| 105 | define('DIRECTORY_SEPARATOR', '\\'); |
|---|
| 106 | else |
|---|
| 107 | define('DIRECTORY_SEPARATOR', '/'); |
|---|
| 108 | } |
|---|
| 109 | ?> |
|---|