Changeset 2645866
- Timestamp:
- 12/17/2021 03:44:36 PM (4 years ago)
- Location:
- tilda-publishing
- Files:
-
- 25 added
- 4 edited
-
tags/0.3.03 (added)
-
tags/0.3.03/README.md (added)
-
tags/0.3.03/class.tilda-admin.php (added)
-
tags/0.3.03/class.tilda.php (added)
-
tags/0.3.03/css (added)
-
tags/0.3.03/css/jquery-ui-tabs.css (added)
-
tags/0.3.03/css/styles.css (added)
-
tags/0.3.03/images (added)
-
tags/0.3.03/images/ajax-loader.gif (added)
-
tags/0.3.03/images/icon_tilda.png (added)
-
tags/0.3.03/index.php (added)
-
tags/0.3.03/js (added)
-
tags/0.3.03/js/configuration.js (added)
-
tags/0.3.03/js/plugin.js (added)
-
tags/0.3.03/languages (added)
-
tags/0.3.03/languages/tilda-ru_RU.mo (added)
-
tags/0.3.03/languages/tilda-ru_RU.po (added)
-
tags/0.3.03/readme.txt (added)
-
tags/0.3.03/screenshot-1.jpg (added)
-
tags/0.3.03/screenshot-2.jpg (added)
-
tags/0.3.03/tilda-wordpress-plugin.php (added)
-
tags/0.3.03/views (added)
-
tags/0.3.03/views/configuration.php (added)
-
tags/0.3.03/views/pages_meta_box.php (added)
-
tags/0.3.03/views/switcher_status.php (added)
-
trunk/class.tilda-admin.php (modified) (28 diffs)
-
trunk/class.tilda.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/tilda-wordpress-plugin.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tilda-publishing/trunk/class.tilda-admin.php
r2643950 r2645866 37 37 self::$ts_start_plugin = time(); 38 38 } 39 40 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);41 39 42 40 self::$initiated = true; … … 123 121 } 124 122 } 125 //map_page_post ready to save126 123 127 124 //If everything goes fine until this, then save new data structure … … 157 154 public static function admin_init() 158 155 { 159 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);160 161 156 register_setting( 162 157 static::OPTION_KEYS, … … 194 189 public static function admin_menu() 195 190 { 196 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);197 191 self::load_menu(); 198 192 } … … 200 194 public static function load_menu() 201 195 { 202 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);203 196 add_submenu_page( 204 197 'options-general.php', … … 213 206 public static function add_meta_box() 214 207 { 215 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);216 217 208 $post = get_post(); 218 209 $data = get_post_meta($post->ID, '_tilda', true); … … 220 211 $options = get_option(Tilda_Admin::OPTION_OPTIONS); 221 212 $screens = (isset($options['enabledposttypes'])) ? $options['enabledposttypes'] : array('post','page'); 222 223 //$screens = array('post', 'page');224 225 213 226 214 foreach ($screens as $screen) { … … 235 223 'high' 236 224 ); 237 } ;225 } 238 226 if (isset($data["status"]) && $data["status"] == 'on') { 239 227 add_meta_box( … … 245 233 'high' 246 234 ); 247 } ;235 } 248 236 } 249 237 } … … 251 239 public static function pages_list_callback($post) 252 240 { 253 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);254 255 241 $data = get_post_meta($post->ID, '_tilda', true); 256 $page_id = isset($data["page_id"]) ? $data["page_id"] : false;257 $project_id = isset($data["project_id"]) ? $data["project_id"] : false;242 //$page_id = isset($data["page_id"]) ? $data["page_id"] : false; 243 //$project_id = isset($data["project_id"]) ? $data["project_id"] : false; 258 244 259 245 if (isset($data['update_data']) && $data['update_data'] == 'update_data') { … … 277 263 public static function save_tilda_data($postID) 278 264 { 279 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);280 281 265 if (!isset($_POST['tilda'])) { 282 266 return; … … 307 291 public static function admin_enqueue_scripts($hook) 308 292 { 309 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);310 311 293 wp_register_style('tilda_css', TILDA_PLUGIN_URL . 'css/styles.css', array() , '3'); 312 294 wp_enqueue_style('tilda_css'); … … 358 340 public static function initialize() 359 341 { 360 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);361 342 $keys = Tilda::get_local_keys(); 362 343 … … 392 373 private static function scandir($dir) 393 374 { 394 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);395 396 375 $list = scandir($dir); 397 376 return array_values($list); … … 400 379 private static function clear_dir($dir) 401 380 { 402 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);403 404 381 $list = self::scandir($dir); 405 382 … … 677 654 } 678 655 } 679 680 //Those settings moved to project level681 /*if (empty($input['acceptcssinlist']) || $input['acceptcssinlist'] != 'no') {682 $input['acceptcssinlist'] = 'yes';683 } else {684 $input['acceptcssinlist'] = 'no';685 }686 687 if (empty($input['type_stored']) || $input['type_stored'] != 'html') {688 $input['type_stored'] = 'meta';689 } else {690 $input['type_stored'] = 'html';691 }*/692 656 693 657 if (isset($input['secret_key'])) { … … 812 776 } 813 777 814 private static function validate_required_libs(){ 815 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__); 816 778 private static function validate_required_libs() 779 { 817 780 $libs = self::$libs; 818 foreach ($libs as $lib_name){ 819 if(!extension_loaded($lib_name)){ 820 Tilda::$errors->add( 'no_library',__('Not found library ','tilda').$lib_name); 821 } 822 } 823 824 781 foreach ($libs as $lib_name) { 782 if (!extension_loaded($lib_name)) { 783 Tilda::$errors->add('no_library', __('Not found library ', 'tilda') . $lib_name); 784 } 785 } 825 786 } 826 787 827 788 public static function display_configuration_page() 828 789 { 829 // self::validate_required_libs();830 831 790 self::view('configuration'); 832 791 } … … 834 793 public static function switcher_callback($post) 835 794 { 836 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);837 838 795 $data = get_post_meta($post->ID, '_tilda', true); 839 796 if (! is_array($data)) { … … 849 806 public static function view($name, array $args = array()) 850 807 { 851 // Tilda_Admin::log(__CLASS__."::".__FUNCTION__, __FILE__, __LINE__);852 853 808 $args = apply_filters('tilda_view_arguments', $args, $name); 854 809 … … 897 852 if (!is_dir($upload_dir)) { 898 853 wp_mkdir_p($upload_dir); 899 // mkdir($upload_dir, 0755); 900 } 901 902 // self::clear_dir($upload_dir); 854 } 903 855 904 856 $css_path = $upload_dir . 'css/'; … … 908 860 if (!is_dir($css_path)) { 909 861 wp_mkdir_p($css_path); 910 //mkdir($css_path, 0755);911 862 } 912 863 if (!is_dir($js_path)) { 913 //mkdir($js_path, 0755);914 864 wp_mkdir_p($js_path); 915 865 } 916 866 if (!is_dir($pages_path)) { 917 //mkdir($pages_path, 0755);918 867 wp_mkdir_p($pages_path); 919 868 } … … 1075 1024 if (is_wp_error($project)) { 1076 1025 return $project; 1077 //$arResult['error'] = __("Error. Can't find project with this 'projectid' parameter");1078 //echo json_encode($arResult);1079 //wp_die();1080 1026 } 1081 1027 $tildaoptions = get_option(Tilda_Admin::OPTION_OPTIONS); … … 1085 1031 if (is_wp_error($tildapage)) { 1086 1032 return $tildapage; 1087 //$arResult['error'] = __("Error. Can't find page with this 'pageid' parameter");1088 //echo json_encode($arResult);1089 //wp_die();1090 1033 } 1091 1034 // ||s|| is custom escaping symbol used to bypass '<\/script>' text from wordpress engine processing … … 1108 1051 $tildapage->html = str_replace("||imgsvalue-{$key}||", $match, $tildapage->html); 1109 1052 } 1053 } 1054 1055 //remove all css <link> occurrences that was already added to the <header> tag 1056 foreach ($tildapage->css as $css) { 1057 $tildapage->html = str_replace('<link rel="stylesheet" href="' . $css->to . '">', '', $tildapage->html); 1110 1058 } 1111 1059 … … 1226 1174 1227 1175 $meta['current_page'] = $tildapage; 1228 //unset($meta['current_page']->html);1229 1176 update_post_meta($post_id, '_tilda', $meta); 1230 1177 … … 1314 1261 if (!session_id()) { 1315 1262 session_start(); 1316 /*if (session_status() != PHP_SESSION_ACTIVE) {1317 Tilda::$errors->add( 'no_start_session', 'Cannoyt start session.');1318 echo Tilda::json_errors();1319 wp_die();1320 }*/1321 1263 } 1322 1264 … … 1335 1277 $arResult['post_id'] = $post_id; 1336 1278 1337 //$arResult['dump'] = $arDownload;1338 1339 1279 echo json_encode($arResult); 1340 1280 wp_die(); … … 1355 1295 if (!session_id()) { 1356 1296 session_start(); 1357 /*if (session_status() != PHP_SESSION_ACTIVE) {1358 Tilda::$errors->add( 'no_start_session', 'Cannoyt start session.');1359 echo Tilda::json_errors();1360 wp_die();1361 }*/1362 1297 } 1363 1298 -
tilda-publishing/trunk/class.tilda.php
r2643304 r2645866 259 259 if ($post) { 260 260 $data = get_post_meta($post->ID, '_tilda', true); 261 if (empty($data['project_id'])) { 262 $data['project_id'] = (!empty($data['current_page']->projectid)) ? $data['current_page']->projectid : null; 263 } 261 264 262 265 $key_id = Tilda::get_key_for_project_id($data['project_id']); … … 324 327 } 325 328 $data = get_post_meta($post->ID, '_tilda', true); 329 if (empty($data['project_id'])) { 330 $data['project_id'] = (!empty($data['current_page']->projectid)) ? $data['current_page']->projectid : null; 331 } 326 332 327 333 $key_id = Tilda::get_key_for_project_id($data['project_id']); -
tilda-publishing/trunk/readme.txt
r2643950 r2645866 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.9.6 7 Stable tag: 0.3.0 27 Stable tag: 0.3.03 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 62 62 63 63 == Changelog == 64 65 = 0.3.03 = 66 * Update 0.3.03 - minor fix warning on post meta without project_id 64 67 65 68 = 0.3.02 = -
tilda-publishing/trunk/tilda-wordpress-plugin.php
r2643950 r2645866 3 3 Plugin Name: Tilda Publishing 4 4 Description: Tilda позволяет делать яркую подачу материала, качественную верстку и эффектную типографику, близкую к журнальной. Каким бы ни был ваш контент — Tilda знает, как его показать. С чего начать: 1) Нажмите ссылку «Активировать» слева от этого описания; 2) <a href="http://www.tilda.cc/" target="_blank">Зарегистрируйтесь</a>, чтобы получить API-ключ; 3) Перейдите на страницу настройки Tilda Publishing и введите свой API-ключ. Читайте подробную инструкцию по подключению. 5 Version: 0.3.0 25 Version: 0.3.03 6 6 Author: Tilda Publishing 7 7 License: GPLv2 or later 8 8 Text Domain: api tilda 9 10 Update 0.3.03 - fix warning on post meta without project_id 9 11 10 12 Update 0.3.02 - fix ZeroBlock's gallery import … … 88 90 } 89 91 90 define( 'TILDA_VERSION', '0.3.0 2' );92 define( 'TILDA_VERSION', '0.3.03' ); 91 93 define( 'TILDA_MINIMUM_WP_VERSION', '3.1' ); 92 94 define( 'TILDA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.