public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Removed xajax from editcontent.php

Signed-off-by: Ted Kulp <ted@cmsmadesimple.org>


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4323 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Thu Jan 31 20:46:03 -0800 2008
commit  480d1d87b250757831e67415787ee13969ffcaa2
tree    2a8498c6f6d8151336951699a6667e5c2836f12c
parent  cb5ab2d112f09296359b3e69ad9ebdd7df80e9fa
...
55
56
57
58
59
60
61
62
 
63
64
 
 
 
 
65
66
67
...
70
71
72
73
 
74
75
76
...
294
295
296
297
298
 
 
 
299
300
301
...
303
304
305
306
 
307
308
 
309
310
311
...
324
325
326
327
328
329
330
 
331
332
333
334
335
336
 
 
337
338
 
339
340
341
...
438
439
440
 
441
442
443
...
55
56
57
 
 
 
 
 
58
59
 
60
61
62
63
64
65
66
...
69
70
71
 
72
73
74
75
...
293
294
295
 
 
296
297
298
299
300
301
...
303
304
305
 
306
307
 
308
309
310
311
...
324
325
326
 
 
 
 
327
328
 
 
 
 
 
329
330
331
 
332
333
334
335
...
432
433
434
435
436
437
438
0
@@ -55,13 +55,12 @@ $apply = array_key_exists('applybutton', $_POST);
0
 
0
 $dateformat = get_preference(get_userid(),'date_format_string','%x %X');
0
 
0
-define('XAJAX_DEFAULT_CHAR_ENCODING', $config['admin_encoding']);
0
-require_once(dirname(dirname(__FILE__)) . '/lib/xajax/xajax.inc.php');
0
-$xajax = new xajax();
0
-$xajax->registerFunction('ajaxpreview');
0
-$xajax->registerFunction('change_block_type');
0
+$cms_ajax = new CmsAjax();
0
 
0
-$xajax->processRequests();
0
+$cms_ajax->register_function('ajaxpreview');
0
+$cms_ajax->register_function('change_block_type');
0
+
0
+$cms_ajax->process_requests();
0
 
0
 #See what kind of permissions we have
0
 $access = check_ownership($userid, $content_id) || check_permission($userid, 'Modify Any Page');
0
@@ -70,7 +69,7 @@ if (!$access)
0
   $access = check_authorship($userid, $content_id);
0
 
0
 require_once("header.php");
0
-CmsAdminTheme::inject_header_text($xajax->getJavascript('../lib/xajax')."\n");
0
+CmsAdminTheme::inject_header_text($cms_ajax->get_javascript()."\n");
0
 
0
 #No access? Just display an error and exit.
0
 if (!$access) {
0
@@ -294,8 +293,9 @@ function change_block_type($params, $block_id, $new_block_type)
0
   $div_id = 'content-form-' . $block_id;
0
   $page_object->$type_param = $new_block_type;
0
   
0
- $objResponse = new xajaxResponse();
0
- $objResponse->addAssign("serialized_content", "value", serialize_object($page_object));
0
+ $resp = new CmsAjaxResponse();
0
+
0
+ $resp->modify_attribute("#serialized_content", "value", serialize_object($page_object));
0
   
0
   $smarty->_compile_source('metadata template', $page_object->create_block_type($block_id), $_compiled);
0
   @ob_start();
0
@@ -303,9 +303,9 @@ function change_block_type($params, $block_id, $new_block_type)
0
   $result = @ob_get_contents();
0
   @ob_end_clean();
0
   
0
- $objResponse->addAssign($div_id, 'innerHTML', $result);
0
+ $resp->modify_html("#$div_id", $result);
0
   
0
- return $objResponse->getXML();
0
+ return $resp->get_result();
0
 }
0
 
0
 function ajaxpreview($params)
0
@@ -324,18 +324,12 @@ function ajaxpreview($params)
0
   $tmpfname = create_preview($page_object);
0
   $url = $config["root_url"] . '/index.php?tmpfile=' . urlencode(basename($tmpfname));
0
   
0
- $objResponse = new xajaxResponse();
0
- $objResponse->addAssign("previewframe", "src", $url);
0
- $objResponse->addAssign("serialized_content", "value", serialize_object($page_object));
0
- $count = 0;
0
+ $resp = new CmsAjaxResponse();
0
 
0
- foreach (array("content", "advanced") as $tabname)
0
- {
0
- $objResponse->addScript("Element.removeClassName('".$tabname."', 'active');Element.removeClassName('".$tabname."_c', 'active');$('".$tabname."_c').style.display = 'none';");
0
- }
0
- $objResponse->addScript("Element.addClassName('preview', 'active');Element.addClassName('preview_c', 'active');$('preview_c').style.display = '';");
0
+ $resp->modify_attribute("#previewframe", "src", $url);
0
+ $resp->modify_attribute("#serialized_content", "value", serialize_object($page_object));
0
 
0
- return $objResponse->getXML();
0
+ return $resp->get_result();
0
 }
0
 
0
 //Get a working page object
0
@@ -438,6 +432,7 @@ if ($page_object->preview)
0
       'class' => 'positive preview',
0
       'image' => '',
0
       'caption' => lang('preview'),
0
+ 'onclick' => "$('#page_tabs').tabsClick(4);return false;"
0
   );
0
 }
0
 
...
170
171
172
173
 
174
175
176
...
170
171
172
 
173
174
175
176
0
@@ -170,7 +170,7 @@ class Content extends CmsContentBase
0
           <div class="pageoverflow">
0
             <p class="pagetext">'.lang('blocktype').':</p>
0
             <p class="pageinput">
0
- <select name="content[property]['.$block['id'].'-block-type]" id="'.$block['id'].'-block-type" onchange="xajax_change_block_type(xajax.getFormValues(\'contentform\'), \''.$block['id'].'\', \'\' + $(\'#'.$block['id'].'-block-type\').val()); return false;">
0
+ <select name="content[property]['.$block['id'].'-block-type]" id="'.$block['id'].'-block-type" onchange="cms_ajax_change_block_type($(\'#contentform\').serializeForCmsAjax(), \''.$block['id'].'\', \'\' + $(\'#'.$block['id'].'-block-type\').val()); return false;">
0
                 '.$this->create_block_type_options($type).'
0
               </select>
0
             </p>

Comments

    No one has commented yet.