Loading adminzone/pages/modules/admin_zones.php +17 −13 Changes for adminzone/pages/modules/admin_zones.php: 17 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -297,14 +297,16 @@ class Module_admin_zones // Page editing stuff $editor = array(); foreach (array('panel_left', $default_page, 'panel_right') as $i => $for) { $page_info = _request_page($for, $id, null, $lang); foreach (array('panel_left', 'start', 'panel_right') as $i => $for) { $_for = ($for == 'start') ? $default_page : $for; $page_info = _request_page($_for, $id, null, $lang); if ($page_info === false) { $page_info = array('COMCODE_CUSTOM', $id, $for, $lang); $page_info = array('COMCODE_CUSTOM', $id, $_for, $lang); } $is_comcode = false; $redirecting_to = null; $current_for = $for; $current_for = $_for; $pure = false; switch ($page_info[0]) { case 'COMCODE_CUSTOM_PURE': Loading Loading @@ -401,11 +403,11 @@ class Module_admin_zones } else { require_code('urls2'); list($old_get, $old_zone, $old_current_script) = set_execution_context( array('page' => $for), array('page' => $_for), $id ); $preview = request_page($for, false, $id, null, true); $preview = request_page($_for, false, $id, null, true); // Get things back to prior state set_execution_context( Loading Loading @@ -442,7 +444,7 @@ class Module_admin_zones $zone_list = null; } else { require_code('zones3'); $zone_list = ($for == $current_for) ? create_selection_list_zones($redirecting_to, array($id)) : new Tempcode(); // not simple so leave field out $zone_list = ($_for == $current_for) ? create_selection_list_zones($redirecting_to, array($id)) : new Tempcode(); // not simple so leave field out } $editor[$for] = static_evaluate_tempcode(do_template('ZONE_EDITOR_PANEL', array( Loading Loading @@ -475,7 +477,7 @@ class Module_admin_zones 'URL' => $post_url, 'LEFT_EDITOR' => $editor['panel_left'], 'RIGHT_EDITOR' => $editor['panel_right'], 'MIDDLE_EDITOR' => $editor[$default_page], 'MIDDLE_EDITOR' => $editor['start'], )); } Loading Loading @@ -535,16 +537,18 @@ class Module_admin_zones $comcode = post_param_string($for, null); if (!is_null($comcode)) { $_for = ($for == 'start') ? $default_page : $for; // Where to save to $full_path = zone_black_magic_filterer(get_custom_file_base() . (((is_null($redirect) ? $id : $redirect) == '') ? '' : '/') . (is_null($redirect) ? $id : $redirect) . '/pages/comcode_custom/' . $lang . '/' . $for . '.txt'); $full_path = zone_black_magic_filterer(get_custom_file_base() . (((is_null($redirect) ? $id : $redirect) == '') ? '' : '/') . (is_null($redirect) ? $id : $redirect) . '/pages/comcode_custom/' . $lang . '/' . $_for . '.txt'); // Store revision if (addon_installed('actionlog')) { require_code('revisions_engine_files'); $revision_engine = new RevisionEngineFiles(); list(, , $existing_path) = find_comcode_page($lang, $for, $id); list(, , $existing_path) = find_comcode_page($lang, $_for, $id); if ($existing_path != '') { $revision_engine->add_revision(dirname($existing_path), $for, 'txt', file_get_contents($existing_path), filemtime($existing_path)); $revision_engine->add_revision(dirname($full_path), $_for, 'txt', file_get_contents($existing_path), filemtime($existing_path)); } } Loading @@ -553,11 +557,11 @@ class Module_admin_zones cms_file_put_contents_safe($full_path, $comcode, FILE_WRITE_FIX_PERMISSIONS | FILE_WRITE_SYNC_FILE); // De-cache $caches = $GLOBALS['SITE_DB']->query_select('cached_comcode_pages', array('string_index'), array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $for)); $caches = $GLOBALS['SITE_DB']->query_select('cached_comcode_pages', array('string_index'), array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $_for)); foreach ($caches as $cache) { delete_lang($cache['string_index']); } $GLOBALS['SITE_DB']->query_delete('cached_comcode_pages', array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $for)); $GLOBALS['SITE_DB']->query_delete('cached_comcode_pages', array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $_for)); $GLOBALS['COMCODE_PAGE_RUNTIME_CACHE'] = array(); } } Loading themes/default/javascript/zone_editor.js +9 −9 Changes for themes/default/javascript/zone_editor.js: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ function set_edited_panel(object_ignore /* No longer used */,id) if (!store) { store=document.createElement('textarea'); store.name=object.name; store.name=id; store.id='store_'+id; document.getElementById('edit_field_store').appendChild(store); } Loading @@ -29,7 +29,7 @@ function set_edited_panel(object_ignore /* No longer used */,id) if (!store) { store=document.createElement('textarea'); store.name=object.name; store.name=id+'__is_wysiwyg'; store.id='wysiwyg_store_'+id; document.getElementById('edit_field_store').appendChild(store); } Loading @@ -45,7 +45,7 @@ function set_edited_panel(object_ignore /* No longer used */,id) if (!store) { store=document.createElement('textarea'); store.name=object.name; store.name='redirect_'+id; store.id='redirects_store_'+id; document.getElementById('edit_field_store').appendChild(store); } Loading @@ -55,11 +55,12 @@ function set_edited_panel(object_ignore /* No longer used */,id) function fetch_more_fields() { set_edited_panel(null,'panel_left'); set_edited_panel(null,'panel_right'); set_edited_panel(null,'panel_top'); set_edited_panel(null,'panel_bottom'); set_edited_panel(null,'start'); var places=['panel_left','panel_right','panel_top','panel_bottom','start']; for (var i=0;i<places.length;i++) { if (typeof CKEDITOR.instances['edit_'+places[i]+'_textarea']!='undefined') CKEDITOR.instances['edit_'+places[i]+'_textarea'].updateElement(); set_edited_panel(null,places[i]); } var form=document.getElementById('middle_fields'); var edit_field_store=document.getElementById('edit_field_store'); Loading @@ -80,7 +81,6 @@ function fetch_more_fields() } edit_field_store.appendChild(store); } // window.setTimeout(function() { form.submit(); } , 1000); } function select_ze_tab(id,tab) Loading themes/default/templates/ZONE_EDITOR_PANEL.tpl +1 −1 Changes for themes/default/templates/ZONE_EDITOR_PANEL.tpl: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ </div> {+END} <div class="constrain_field"> <textarea onchange="set_edited_panel(null,'{ID;*}');" rows="50" cols="20" class="{$?,{IS_PANEL},ze_textarea,ze_textarea_middle} textarea_scroll{CLASS*}" id="edit_{ID*}_textarea" name="{ID*}">{COMCODE*}</textarea> <textarea onchange="set_edited_panel(null,'{ID;*}');" rows="50" cols="20" class="{$?,{IS_PANEL},ze_textarea,ze_textarea_middle} textarea_scroll{CLASS*}" id="edit_{ID*}_textarea" name="edit_{ID*}_textarea">{COMCODE*}</textarea> {+START,IF,{$IN_STR,{CLASS},wysiwyg}} <script>// <![CDATA[ Loading Loading
adminzone/pages/modules/admin_zones.php +17 −13 Changes for adminzone/pages/modules/admin_zones.php: 17 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -297,14 +297,16 @@ class Module_admin_zones // Page editing stuff $editor = array(); foreach (array('panel_left', $default_page, 'panel_right') as $i => $for) { $page_info = _request_page($for, $id, null, $lang); foreach (array('panel_left', 'start', 'panel_right') as $i => $for) { $_for = ($for == 'start') ? $default_page : $for; $page_info = _request_page($_for, $id, null, $lang); if ($page_info === false) { $page_info = array('COMCODE_CUSTOM', $id, $for, $lang); $page_info = array('COMCODE_CUSTOM', $id, $_for, $lang); } $is_comcode = false; $redirecting_to = null; $current_for = $for; $current_for = $_for; $pure = false; switch ($page_info[0]) { case 'COMCODE_CUSTOM_PURE': Loading Loading @@ -401,11 +403,11 @@ class Module_admin_zones } else { require_code('urls2'); list($old_get, $old_zone, $old_current_script) = set_execution_context( array('page' => $for), array('page' => $_for), $id ); $preview = request_page($for, false, $id, null, true); $preview = request_page($_for, false, $id, null, true); // Get things back to prior state set_execution_context( Loading Loading @@ -442,7 +444,7 @@ class Module_admin_zones $zone_list = null; } else { require_code('zones3'); $zone_list = ($for == $current_for) ? create_selection_list_zones($redirecting_to, array($id)) : new Tempcode(); // not simple so leave field out $zone_list = ($_for == $current_for) ? create_selection_list_zones($redirecting_to, array($id)) : new Tempcode(); // not simple so leave field out } $editor[$for] = static_evaluate_tempcode(do_template('ZONE_EDITOR_PANEL', array( Loading Loading @@ -475,7 +477,7 @@ class Module_admin_zones 'URL' => $post_url, 'LEFT_EDITOR' => $editor['panel_left'], 'RIGHT_EDITOR' => $editor['panel_right'], 'MIDDLE_EDITOR' => $editor[$default_page], 'MIDDLE_EDITOR' => $editor['start'], )); } Loading Loading @@ -535,16 +537,18 @@ class Module_admin_zones $comcode = post_param_string($for, null); if (!is_null($comcode)) { $_for = ($for == 'start') ? $default_page : $for; // Where to save to $full_path = zone_black_magic_filterer(get_custom_file_base() . (((is_null($redirect) ? $id : $redirect) == '') ? '' : '/') . (is_null($redirect) ? $id : $redirect) . '/pages/comcode_custom/' . $lang . '/' . $for . '.txt'); $full_path = zone_black_magic_filterer(get_custom_file_base() . (((is_null($redirect) ? $id : $redirect) == '') ? '' : '/') . (is_null($redirect) ? $id : $redirect) . '/pages/comcode_custom/' . $lang . '/' . $_for . '.txt'); // Store revision if (addon_installed('actionlog')) { require_code('revisions_engine_files'); $revision_engine = new RevisionEngineFiles(); list(, , $existing_path) = find_comcode_page($lang, $for, $id); list(, , $existing_path) = find_comcode_page($lang, $_for, $id); if ($existing_path != '') { $revision_engine->add_revision(dirname($existing_path), $for, 'txt', file_get_contents($existing_path), filemtime($existing_path)); $revision_engine->add_revision(dirname($full_path), $_for, 'txt', file_get_contents($existing_path), filemtime($existing_path)); } } Loading @@ -553,11 +557,11 @@ class Module_admin_zones cms_file_put_contents_safe($full_path, $comcode, FILE_WRITE_FIX_PERMISSIONS | FILE_WRITE_SYNC_FILE); // De-cache $caches = $GLOBALS['SITE_DB']->query_select('cached_comcode_pages', array('string_index'), array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $for)); $caches = $GLOBALS['SITE_DB']->query_select('cached_comcode_pages', array('string_index'), array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $_for)); foreach ($caches as $cache) { delete_lang($cache['string_index']); } $GLOBALS['SITE_DB']->query_delete('cached_comcode_pages', array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $for)); $GLOBALS['SITE_DB']->query_delete('cached_comcode_pages', array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $_for)); $GLOBALS['COMCODE_PAGE_RUNTIME_CACHE'] = array(); } } Loading
themes/default/javascript/zone_editor.js +9 −9 Changes for themes/default/javascript/zone_editor.js: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ function set_edited_panel(object_ignore /* No longer used */,id) if (!store) { store=document.createElement('textarea'); store.name=object.name; store.name=id; store.id='store_'+id; document.getElementById('edit_field_store').appendChild(store); } Loading @@ -29,7 +29,7 @@ function set_edited_panel(object_ignore /* No longer used */,id) if (!store) { store=document.createElement('textarea'); store.name=object.name; store.name=id+'__is_wysiwyg'; store.id='wysiwyg_store_'+id; document.getElementById('edit_field_store').appendChild(store); } Loading @@ -45,7 +45,7 @@ function set_edited_panel(object_ignore /* No longer used */,id) if (!store) { store=document.createElement('textarea'); store.name=object.name; store.name='redirect_'+id; store.id='redirects_store_'+id; document.getElementById('edit_field_store').appendChild(store); } Loading @@ -55,11 +55,12 @@ function set_edited_panel(object_ignore /* No longer used */,id) function fetch_more_fields() { set_edited_panel(null,'panel_left'); set_edited_panel(null,'panel_right'); set_edited_panel(null,'panel_top'); set_edited_panel(null,'panel_bottom'); set_edited_panel(null,'start'); var places=['panel_left','panel_right','panel_top','panel_bottom','start']; for (var i=0;i<places.length;i++) { if (typeof CKEDITOR.instances['edit_'+places[i]+'_textarea']!='undefined') CKEDITOR.instances['edit_'+places[i]+'_textarea'].updateElement(); set_edited_panel(null,places[i]); } var form=document.getElementById('middle_fields'); var edit_field_store=document.getElementById('edit_field_store'); Loading @@ -80,7 +81,6 @@ function fetch_more_fields() } edit_field_store.appendChild(store); } // window.setTimeout(function() { form.submit(); } , 1000); } function select_ze_tab(id,tab) Loading
themes/default/templates/ZONE_EDITOR_PANEL.tpl +1 −1 Changes for themes/default/templates/ZONE_EDITOR_PANEL.tpl: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ </div> {+END} <div class="constrain_field"> <textarea onchange="set_edited_panel(null,'{ID;*}');" rows="50" cols="20" class="{$?,{IS_PANEL},ze_textarea,ze_textarea_middle} textarea_scroll{CLASS*}" id="edit_{ID*}_textarea" name="{ID*}">{COMCODE*}</textarea> <textarea onchange="set_edited_panel(null,'{ID;*}');" rows="50" cols="20" class="{$?,{IS_PANEL},ze_textarea,ze_textarea_middle} textarea_scroll{CLASS*}" id="edit_{ID*}_textarea" name="edit_{ID*}_textarea">{COMCODE*}</textarea> {+START,IF,{$IN_STR,{CLASS},wysiwyg}} <script>// <![CDATA[ Loading