From 4c4437cdc0a58cbc9cb1c727214ef2539a6fd0c0 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 11:54:05 +0900 Subject: [PATCH 01/34] =?UTF-8?q?=E6=8A=95=E7=A8=BF=E7=94=BB=E9=9D=A2=20-?= =?UTF-8?q?=20description=E3=83=95=E3=82=A3=E3=83=BC=E3=83=AB=E3=83=89?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0=E5=BD=A2=E5=BC=8F?= =?UTF-8?q?=E3=82=92textarea=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/plugins/managermanager/mm.inc.php | 2 +- manager/actions/mutate_content.dynamic.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/plugins/managermanager/mm.inc.php b/assets/plugins/managermanager/mm.inc.php index f66865fd04..0c015ad2c4 100644 --- a/assets/plugins/managermanager/mm.inc.php +++ b/assets/plugins/managermanager/mm.inc.php @@ -77,7 +77,7 @@ function run() // What are the fields we can change, and what types are they? $field['pagetitle'] = array('input', 'pagetitle', 'pagetitle'); $field['longtitle'] = array('input', 'longtitle', 'longtitle'); - $field['description'] = array('input', 'description', 'description'); + $field['description'] = array('textarea', 'description', 'description'); $field['alias'] = array('input', 'alias', 'alias'); $field['link_attributes'] = array('input', 'link_attributes', 'link_attributes'); $field['menutitle'] = array('input', 'menutitle','menutitle'); diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index e03ddad143..8f0139bd8a 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -472,7 +472,7 @@ function changeRTE() { $body .= tooltip($_lang['resource_long_title_help']); renderTr($_lang['long_title'],$body); -$body = input_text('description',to_safestr($content['description']),'spellcheck="true"'); +$body = ''; $body .= tooltip($_lang['resource_description_help']); renderTr($_lang['resource_description'],$body); From 7b2488f411f3ce1887b3943492858b19845f9f13 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 11:54:48 +0900 Subject: [PATCH 02/34] =?UTF-8?q?=E6=8A=95=E7=A8=BF=E7=94=BB=E9=9D=A2=20-?= =?UTF-8?q?=20introtext=E3=81=AE=E7=B8=A6=E5=B9=85=E3=82=92=E5=B0=91?= =?UTF-8?q?=E3=81=97=E7=8B=AD=E3=81=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/mutate_content.dynamic.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 8f0139bd8a..7f95622390 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -518,16 +518,10 @@ function changeRTE() { ' . to_safestr($content['introtext']) . ''; +$body .= tooltip($_lang['resource_summary_help']); +renderTr($_lang['resource_summary'],$body); ?> - - - - - - - - - From 7d48b755c7df6be0d7c83dab6c04365b783f57f3 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 12:01:38 +0900 Subject: [PATCH 03/34] =?UTF-8?q?=E6=8A=95=E7=A8=BF=E7=94=BB=E9=9D=A2=20-?= =?UTF-8?q?=20=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/mutate_content.dynamic.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 7f95622390..660367b0a4 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -474,7 +474,7 @@ function changeRTE() { $body = ''; $body .= tooltip($_lang['resource_description_help']); -renderTr($_lang['resource_description'],$body); +renderTr($_lang['resource_description'],$body,'vertical-align:top;'); $body = ''; if(isset($modx->config['suffix_mode']) && $modx->config['suffix_mode']==1) @@ -520,7 +520,7 @@ function changeRTE() { } $body = ''; $body .= tooltip($_lang['resource_summary_help']); -renderTr($_lang['resource_summary'],$body); +renderTr($_lang['resource_summary'],$body,'vertical-align:top;'); ?> @@ -1536,15 +1536,16 @@ function change_url_suffix() { return $scr; } -function renderTr($head, $body) +function renderTr($head, $body,$rowstyle='') { global $modx; $ph['head'] = $head; $ph['body'] = $body; + $ph['rowstyle'] = $rowstyle; $tpl =<<< EOT - + [+head+] From cd8236360bc7216069efcfda8bcde5d9a101dbbe Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 12:02:27 +0900 Subject: [PATCH 04/34] =?UTF-8?q?=E6=8A=95=E7=A8=BF=E7=94=BB=E9=9D=A2=20-?= =?UTF-8?q?=20=E3=83=AA=E3=83=B3=E3=82=AF=E5=B1=9E=E6=80=A7(link=5Fattribu?= =?UTF-8?q?tes)=E3=82=92=E3=83=9A=E3=83=BC=E3=82=B8=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=82=BF=E3=83=96=E3=81=AB=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/mutate_content.dynamic.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 660367b0a4..b4fdec2152 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -498,10 +498,6 @@ function changeRTE() { $body .= tooltip($_lang['resource_alias_help']); renderTr($_lang['resource_alias'],$body); -$body = input_text('link_attributes',to_safestr($content['link_attributes'])); -$body .= tooltip($_lang['link_attributes_help']); -renderTr($_lang['link_attributes'],$body); - if ($content['type'] == 'reference' || $_REQUEST['a'] == '72') { // Web Link specific ?> @@ -940,6 +936,11 @@ function changeRTE() { From f7da27372ad7fa1a7a3c3ed13e467a217537f4b2 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 12:19:29 +0900 Subject: [PATCH 05/34] =?UTF-8?q?=E6=8A=95=E7=A8=BF=E7=94=BB=E9=9D=A2=20-?= =?UTF-8?q?=20=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/mutate_content.dynamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index b4fdec2152..a0acbe3bfa 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -1547,7 +1547,7 @@ function renderTr($head, $body,$rowstyle='') $tpl =<<< EOT - + [+head+] From 78252543fcddef9b4a319a38aa2dd9cd44a87d83 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 12:22:10 +0900 Subject: [PATCH 06/34] =?UTF-8?q?QuickManager=20-=20=E7=84=A1=E5=8A=B9?= =?UTF-8?q?=E3=81=AA=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=8C=E6=B7=B7=E5=85=A5=E3=81=97=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=82=8B=E3=81=9F=E3=82=81=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/assets/plugins/qm.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/plugins/qm.tpl b/install/assets/plugins/qm.tpl index 5c349b1ba2..8582043363 100644 --- a/install/assets/plugins/qm.tpl +++ b/install/assets/plugins/qm.tpl @@ -7,7 +7,7 @@ * @category plugin * @version 1.5.5r6 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) - * @internal @properties &loadfrontendjq=Load jQuery in front-end;list;true,false;true &noconflictjq=jQuery noConflict mode in front-end;list;true,false;true &loadtb=Load modal box in front-end;list;true,false;true &tbwidth=Modal box window width;text;80% &tbheight=Modal box window height;text;90% &hidefields=Hide document fields from front-end editors;text;parent &hidetabs=Hide document tabs from front-end editors;text; &hidesections=Hide document sections from front-end editors;text; &addbutton=Show add document here button;list;true,false;true &tpltype=New document template type;list;config,parent,id,selected,sibling,system;config &tplid=New document template id;int; &custombutton=Custom buttons;textarea; &1=undefined;; &managerbutton=Show go to manager button;list;true,false;true &logout=Logout to;list;manager,front-end;manager &disabled=Plugin disabled on documents;text; &autohide=Autohide toolbar;list;true,false;true &editbuttons=Inline edit buttons;list;true,false;false &editbclass=Edit button CSS class;text;qm-edit &newbuttons=Inline new resource buttons;list;true,false;false &newbclass=New resource button CSS class;text;qm-new &tvbuttons=Inline template variable buttons;list;true,false;false &tvbclass=Template variable button CSS class;text;qm-tv + * @internal @properties &loadfrontendjq=Load jQuery in front-end;list;true,false;true &noconflictjq=jQuery noConflict mode in front-end;list;true,false;true &loadtb=Load modal box in front-end;list;true,false;true &tbwidth=Modal box window width;text;80% &tbheight=Modal box window height;text;90% &hidefields=Hide document fields from front-end editors;text;parent &hidetabs=Hide document tabs from front-end editors;text; &hidesections=Hide document sections from front-end editors;text; &addbutton=Show add document here button;list;true,false;true &tpltype=New document template type;list;config,parent,id,selected,sibling,system;config &tplid=New document template id;int; &custombutton=Custom buttons;textarea; &managerbutton=Show go to manager button;list;true,false;true &logout=Logout to;list;manager,front-end;manager &disabled=Plugin disabled on documents;text; &autohide=Autohide toolbar;list;true,false;true &editbuttons=Inline edit buttons;list;true,false;false &editbclass=Edit button CSS class;text;qm-edit &newbuttons=Inline new resource buttons;list;true,false;false &newbclass=New resource button CSS class;text;qm-new &tvbuttons=Inline template variable buttons;list;true,false;false &tvbclass=Template variable button CSS class;text;qm-tv * @internal @events OnParseDocument,OnWebPagePrerender,OnDocFormPrerender,OnDocFormSave,OnManagerLogout * @internal @modx_category Manager and Admin * @internal @legacy_names QM+,QuickEdit From 20e6310c89996f1a60770ddacbbc909097ab7a59 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 12:22:25 +0900 Subject: [PATCH 07/34] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/mutate_tmplvars.dynamic.php | 32 +++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 92f664c6b7..7f57542646 100644 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -37,6 +37,7 @@ exit; } +global $content; $content = array(); if(isset($_GET['id'])) { @@ -418,24 +419,31 @@ function decode(s){ " title="" alt="" class="tooltip" onclick="alert(this.alt);" style="cursor:help" /> + From d734c4b45d2f487fff5b2193dd33494645d77d8c Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 12:22:39 +0900 Subject: [PATCH 08/34] =?UTF-8?q?ToolTip=E3=83=87=E3=82=B6=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/includes/header.inc.php | 2 +- manager/media/script/jquery/jquery.powertip.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index 97b0e0de9b..445d31f9f7 100644 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -42,7 +42,7 @@ function document_onload() { $j(function(){ document_onload(); - $j('.tooltip').powerTip({'fadeInTime':'0','smartPlacement':true}); + $j('.tooltip').powerTip({'fadeInTime':'0','placement':'e'}); }); $j.bind('beforeunload', document_onunload()); diff --git a/manager/media/script/jquery/jquery.powertip.css b/manager/media/script/jquery/jquery.powertip.css index 0c476af1bb..1ce02646d8 100644 --- a/manager/media/script/jquery/jquery.powertip.css +++ b/manager/media/script/jquery/jquery.powertip.css @@ -9,7 +9,7 @@ padding: 10px; position: absolute; z-index: 1000; - width:300px; + width:180px; } #powerTip.n:before, #powerTip.e:before, #powerTip.s:before, #powerTip.w:before, #powerTip.ne:before, #powerTip.nw:before, #powerTip.se:before, #powerTip.sw:before { From e01166c1241a72c17dca7d41405fab88d0c545a4 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 13:33:58 +0900 Subject: [PATCH 09/34] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=83=AA=E3=82=BD=E3=83=BC=E3=82=B9=E3=83=84=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E3=83=81=E3=83=83=E3=83=97=E3=83=98=E3=83=AB=E3=83=97?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E7=A4=BA=E3=82=92=E6=94=B9=E5=96=84(?= =?UTF-8?q?=E8=A6=8B=E3=82=84=E3=81=99=E3=81=8F=E6=94=B9=E8=A1=8C=E3=82=92?= =?UTF-8?q?=E5=85=A5=E3=82=8C=E3=82=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/frames/nodes.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/frames/nodes.php b/manager/frames/nodes.php index 384c5645d1..80c201338e 100644 --- a/manager/frames/nodes.php +++ b/manager/frames/nodes.php @@ -180,10 +180,10 @@ function makeHTML($indent,$parent=0,$expandAll,$theme) $alt = "[{$id}] "; $alt .= !empty($alias) ? $_lang['alias'].": ".$alias : $_lang['alias'].": -"; - $alt .= " {$_lang['resource_opt_menu_index']}: {$menuindex}"; - $alt .= " {$_lang['resource_opt_show_menu']}: ".($hidemenu==1 ? $_lang['no']:$_lang['yes']); - $alt .= " {$_lang['page_data_web_access']}: ".($privateweb ? $_lang['private']:$_lang['public']); - $alt .= " {$_lang['page_data_mgr_access']}: ".($privatemgr ? $_lang['private']:$_lang['public']); + $alt .= "\n{$_lang['resource_opt_menu_index']}: {$menuindex}"; + $alt .= "\n{$_lang['resource_opt_show_menu']}: ".($hidemenu==1 ? $_lang['no']:$_lang['yes']); + $alt .= "\n{$_lang['page_data_web_access']}: ".($privateweb ? $_lang['private']:$_lang['public']); + $alt .= "\n{$_lang['page_data_mgr_access']}: ".($privatemgr ? $_lang['private']:$_lang['public']); $ph['id'] = $id; $alt = addslashes($alt); From 777cbbc292532ab510143f8b034f81a7c3d54ca0 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 13:34:58 +0900 Subject: [PATCH 10/34] =?UTF-8?q?=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/media/script/jquery/jquery.powertip.css | 4 ++-- manager/media/style/RevoStyle/style.css | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/media/script/jquery/jquery.powertip.css b/manager/media/script/jquery/jquery.powertip.css index 1ce02646d8..4124670ac7 100644 --- a/manager/media/script/jquery/jquery.powertip.css +++ b/manager/media/script/jquery/jquery.powertip.css @@ -8,8 +8,8 @@ display: none; padding: 10px; position: absolute; - z-index: 1000; - width:180px; + z-index: 500; + width:200px; } #powerTip.n:before, #powerTip.e:before, #powerTip.s:before, #powerTip.w:before, #powerTip.ne:before, #powerTip.nw:before, #powerTip.se:before, #powerTip.sw:before { diff --git a/manager/media/style/RevoStyle/style.css b/manager/media/style/RevoStyle/style.css index 3cc8770db0..f781ad3dde 100644 --- a/manager/media/style/RevoStyle/style.css +++ b/manager/media/style/RevoStyle/style.css @@ -417,6 +417,7 @@ form textarea { height: 78px; width: 350px; line-height:1.5; + overflow:auto; } .form legend { color: #04C; From cdbbc8341ac3b939c5ec80b919b8248afda7c5cb Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 13:35:12 +0900 Subject: [PATCH 11/34] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E6=9B=B4=E6=96=B0(b4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/includes/version.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/version.inc.php b/manager/includes/version.inc.php index 17cc4756ae..9fc67c077d 100644 --- a/manager/includes/version.inc.php +++ b/manager/includes/version.inc.php @@ -1,5 +1,5 @@ Date: Fri, 28 Sep 2012 14:45:34 +0900 Subject: [PATCH 12/34] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/actions/summary.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/install/actions/summary.php b/install/actions/summary.php index b5be3a10ba..4520a069ed 100644 --- a/install/actions/summary.php +++ b/install/actions/summary.php @@ -47,7 +47,6 @@ } else { echo echo_ok(); mkd("{$base_path}assets/cache/rss"); - if(is_dir("{$base_path}assets/cache/rss")) @file_put_contents("{$base_path}assets/cache/rss/index.html",''); } echo '

'; @@ -87,6 +86,10 @@ } // cache writable? + $dir_images = "{$base_path}content/images"; + $dir_files = "{$base_path}content/files"; + $dir_flash = "{$base_path}content/flash"; + $dir_media = "{$base_path}content/media"; echo "

" . $_lang['checking_if_content_writable']; if (!is_writable("{$base_path}content")) { @@ -94,21 +97,16 @@ $errors += 1; } else { echo echo_ok(); - mkd("{$base_path}content/images"); - mkd("{$base_path}content/files"); - mkd("{$base_path}content/flash"); - mkd("{$base_path}content/media"); - - if(is_dir("{$base_path}content/images")) @file_put_contents("{$base_path}content/images/index.html",''); - if(is_dir("{$base_path}content/files")) @file_put_contents("{$base_path}content/files/index.html",''); - if(is_dir("{$base_path}content/flash")) @file_put_contents("{$base_path}content/flash/index.html",''); - if(is_dir("{$base_path}content/media")) @file_put_contents("{$base_path}content/media/index.html",''); + mkd($dir_images); + mkd($dir_files); + mkd($dir_flash); + mkd($dir_media); } echo '

'; if (is_writable("{$base_path}content")) { // File Browser directories exists? - if (!is_dir("{$base_path}content/images") || !is_dir("{$base_path}content/files") || !is_dir("{$base_path}content/flash") || !is_dir("{$base_path}content/media")) + if (!is_dir($dir_images) || !is_dir($dir_files) || !is_dir($dir_flash) || !is_dir($dir_media)) { echo "

".$_lang['checking_if_images_exist']; echo echo_failed(); @@ -119,7 +117,7 @@ { // File Browser directories writable? echo "

".$_lang['checking_if_images_writable']; - if (!is_writable("{$base_path}content/images") || !is_writable("{$base_path}content/files") || !is_writable("{$base_path}content/flash") || !is_writable("{$base_path}content/media")) + if (!is_writable($dir_images) || !is_writable($dir_files) || !is_writable($dir_flash) || !is_writable($dir_media)) { echo echo_failed(); $errors += 1; @@ -150,7 +148,6 @@ echo echo_ok(); mkd("{$base_path}temp/export"); mkd("{$base_path}temp/backup"); - if(is_dir("{$base_path}temp/export")) @file_put_contents("{$base_path}temp/export/index.html",''); if(is_dir("{$base_path}temp/backup")) @file_put_contents("{$base_path}temp/backup/.htaccess","order deny,allow\ndeny from all"); } echo '

'; @@ -403,5 +400,10 @@ function mkd($path) $rs = @mkdir($path, true); if($rs) $rs = @chmod($path, 0777); + if($rs) @file_put_contents("{$path}/index.html",''); + if($rs) @chmod("{$path}/index.html", 0666); + + if(!$rs) echo echo_failed($path); + return $rs; } From 0b98d294ad29eaf040d8a4a009499f506ee486f2 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 14:49:41 +0900 Subject: [PATCH 13/34] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/includes/controls/datagrid.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/includes/controls/datagrid.class.php b/manager/includes/controls/datagrid.class.php index 5f1a18fcf9..368ddba755 100644 --- a/manager/includes/controls/datagrid.class.php +++ b/manager/includes/controls/datagrid.class.php @@ -143,10 +143,10 @@ function formatColumnValue($row,$value,$type,&$align){ case "date": if(!empty($value)) { - if($align=="") $align="right"; - if(!is_numeric($value)) $value = strtotime($value); - if(!$type_format) $type_format = "%A %d, %B %Y"; - $value = $modx->mb_strftime($type_format,$value); + if($align=="") $align="right"; + if(!is_numeric($value)) $value = strtotime($value); + if(!$type_format) $type_format = "%A %d, %B %Y"; + $value = $modx->mb_strftime($type_format,$value); } else { From 2fcdeaa45884effabfab99c5a10c5b3c8ca00951 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 14:50:24 +0900 Subject: [PATCH 14/34] =?UTF-8?q?DataGrid=20-=20$grid->fields=E3=81=8C?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E6=99=82=E3=81=AE=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/includes/controls/datagrid.class.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/manager/includes/controls/datagrid.class.php b/manager/includes/controls/datagrid.class.php index 368ddba755..e072688041 100644 --- a/manager/includes/controls/datagrid.class.php +++ b/manager/includes/controls/datagrid.class.php @@ -209,11 +209,22 @@ function render() $this->_isDataset = is_resource($this->ds); // if not dataset then treat as array if($this->_isDataset) { - $tblc = mysql_num_fields($this->ds); - for($i=0;$i<$tblc;$i++) + if(isset($this->fields)) { - $cinfo = mysql_fetch_field($this->ds,$i); - $this->_fieldnames[$i] = $cinfo->name; + $this->_fieldnames = explode(',', $this->fields); + foreach($this->_fieldnames as $i=>$v) + { + $this->_fieldnames[$i] = trim($v); + } + } + else + { + $tblc = mysql_num_fields($this->ds); + for($i=0;$i<$tblc;$i++) + { + $cinfo = mysql_fetch_field($this->ds,$i); + $this->_fieldnames[$i] = $cinfo->name; + } } } From 65ba9a19360adffe157144807185f9f167a01eb3 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 14:53:27 +0900 Subject: [PATCH 15/34] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processors/save_web_user.processor.php | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index 17a6ead766..2e8402adce 100644 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -7,7 +7,7 @@ $id = intval($_POST['id']); $oldusername = $_POST['oldusername']; -$newusername = !empty ($_POST['newusername']) ? trim($_POST['newusername']) : "New User"; +$newusername = !empty ($_POST['newusername']) ? trim($_POST['newusername']) : 'New User'; $fullname = $modx->db->escape($_POST['fullname']); $genpassword = $_POST['newpassword']; $passwordgenmethod = $_POST['passwordgenmethod']; @@ -33,8 +33,8 @@ $user_groups = $_POST['user_groups']; // verify password -if ($passwordgenmethod == "spec" && $_POST['specifiedpassword'] != $_POST['confirmpassword']) { - webAlert("Password typed is mismatched"); +if ($passwordgenmethod == 'spec' && $_POST['specifiedpassword'] != $_POST['confirmpassword']) { + webAlert('Password typed is mismatched'); exit; } @@ -51,7 +51,7 @@ switch ($_POST['mode']) { case '87' : // new user // check if this user name already exist - if (!$rs = $modx->db->select('id',$tbl_web_users,"username='$newusername'")) { + if (!$rs = $modx->db->select('id',$tbl_web_users,"username='{$newusername}'")) { webAlert("An error occurred while attempting to retrieve all users with username {$newusername}."); exit; } @@ -62,7 +62,7 @@ } // check if the email address already exist - if (!$rs = $modx->db->select('id',$tbl_web_user_attributes,"email='$email'")) + if (!$rs = $modx->db->select('id',$tbl_web_user_attributes,"email='{$email}'")) { webAlert("An error occurred while attempting to retrieve all users with email {$email}."); exit; @@ -77,11 +77,11 @@ } // generate a new password for this user - if ($specifiedpassword != "" && $passwordgenmethod == 'spec') + if ($specifiedpassword != '' && $passwordgenmethod == 'spec') { if (strlen($specifiedpassword) < 6) { - webAlert("Password is too short!"); + webAlert('Password is too short!'); exit; } else @@ -89,7 +89,7 @@ $newpassword = $specifiedpassword; } } - elseif ($specifiedpassword == "" && $passwordgenmethod == 'spec') + elseif ($specifiedpassword == '' && $passwordgenmethod == 'spec') { webAlert("You didn't specify a password for this user!"); exit; @@ -102,9 +102,9 @@ } // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array ( - "mode" => "new", - "id" => $id + $modx->invokeEvent('OnBeforeWUsrFormSave', array ( + 'mode' => 'new', + 'id' => $id )); // create the user account @@ -132,18 +132,18 @@ saveUserSettings($key); // invoke OnWebSaveUser event - $modx->invokeEvent("OnWebSaveUser", array ( - "mode" => "new", + $modx->invokeEvent('OnWebSaveUser', array ( + 'mode' => 'new', "userid" => $key, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname + 'username' => $newusername, + 'userpassword' => $newpassword, + 'useremail' => $email, + 'userfullname' => $fullname )); // invoke OnWUsrFormSave event - $modx->invokeEvent("OnWUsrFormSave", array ( - "mode" => "new", + $modx->invokeEvent('OnWUsrFormSave', array ( + 'mode' => 'new', "id" => $key )); @@ -167,10 +167,10 @@ if ($passwordnotifymethod == 'e') { sendMailMessage($email, $newusername, $newpassword, $fullname); if ($_POST['stay'] != '') { - $a = ($_POST['stay'] == '2') ? "88&id=$id" : "87"; + $a = ($_POST['stay'] == '2') ? "88&id={$id}" : '87'; $header = "Location: index.php?a={$a}&stay=" . $_POST['stay']; } else { - $header = "Location: index.php?a=99"; + $header = 'Location: index.php?a=99'; } header($header); } else { @@ -178,16 +178,16 @@ $a = ($_POST['stay'] == '2') ? "88&id=$key" : "87"; $stayUrl = "index.php?a={$a}&stay=" . $_POST['stay']; } else { - $stayUrl = "index.php?a=99"; + $stayUrl = 'index.php?a=99'; } - include_once "header.inc.php"; + include_once 'header.inc.php'; ?>

@@ -195,18 +195,18 @@

- +

db->select('id',$tbl_web_users,"username='$newusername'")) { + if (!$rs = $modx->db->select('id',$tbl_web_users,"username='{$newusername}'")) { webAlert("An error occurred while attempting to retrieve all users with username $newusername."); exit; } @@ -245,7 +245,7 @@ } // check if the email address already exists - if (!$rs = $modx->db->select('internalKey',$tbl_web_user_attributes,"email='$email'")) { + if (!$rs = $modx->db->select('internalKey',$tbl_web_user_attributes,"email='{$email}'")) { webAlert("An error occurred while attempting to retrieve all users with email $email."); exit; } @@ -259,13 +259,13 @@ } // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array ( - "mode" => "upd", - "id" => $id + $modx->invokeEvent('OnBeforeWUsrFormSave', array ( + 'mode' => 'upd', + 'id' => $id )); // update user name and password - $sql = "UPDATE $tbl_web_users SET username='$newusername'" . $updatepasswordsql . " WHERE id=$id"; + $sql = "UPDATE {$tbl_web_users} SET username='{$newusername}'" . $updatepasswordsql . " WHERE id='{$id}'"; if (!$rs = $modx->db->query($sql)) { webAlert("An error occurred while attempting to update the user's data."); exit; @@ -299,28 +299,28 @@ saveUserSettings($id); // invoke OnWebSaveUser event - $modx->invokeEvent("OnWebSaveUser", array ( - "mode" => "upd", - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "oldusername" => (($oldusername != $newusername - ) ? $oldusername : ""), "olduseremail" => (($oldemail != $email) ? $oldemail : ""))); + $modx->invokeEvent('OnWebSaveUser', array ( + 'mode' => 'upd', + 'userid' => $id, + 'username' => $newusername, + 'userpassword' => $newpassword, + 'useremail' => $email, + 'userfullname' => $fullname, + 'oldusername' => (($oldusername != $newusername + ) ? $oldusername : ''), 'olduseremail' => (($oldemail != $email) ? $oldemail : ''))); // invoke OnWebChangePassword event if ($updatepasswordsql) - $modx->invokeEvent("OnWebChangePassword", array ( - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword + $modx->invokeEvent('OnWebChangePassword', array ( + 'userid' => $id, + 'username' => $newusername, + 'userpassword' => $newpassword )); // invoke OnWUsrFormSave event - $modx->invokeEvent("OnWUsrFormSave", array ( - "mode" => "upd", - "id" => $id + $modx->invokeEvent('OnWUsrFormSave', array ( + 'mode' => 'upd', + 'id' => $id )); /*******************************************************************************/ @@ -328,7 +328,7 @@ // first, check that up_perms are switched on! if ($use_udperms == 1) { // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $rs = $modx->db->delete($tbl_web_groups,"webuser={$id}"); + $rs = $modx->db->delete($tbl_web_groups,"webuser='{$id}'"); if (!$rs) { webAlert("An error occurred while attempting to delete previous user_groups entries."); exit; @@ -385,7 +385,7 @@ } break; default : - webAlert("Unauthorized access"); + webAlert('Unauthorized access'); exit; } @@ -406,7 +406,7 @@ function sendMailMessage($email, $uid, $pwd, $ufn) { $message = $modx->parsePlaceholder($message,$ph); if ($modx->sendmail($email,$message) === false) //ignore mail errors in this cas { - webAlert("Error while sending mail to $email"); + webAlert("Error while sending mail to {$email}"); exit; } } @@ -417,12 +417,12 @@ function saveUserSettings($id) { $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); - $modx->db->delete($tbl_web_user_settings, "webuser='$id'"); + $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); $settings = array ( - "login_home", - "allowed_ip", - "allowed_days" + 'login_home', + 'allowed_ip', + 'allowed_days' ); foreach($settings as $name) @@ -443,7 +443,7 @@ function saveUserSettings($id) { // converts date format dd-mm-yyyy to php date function ConvertDate($date) { global $modx; - if ($date == "") {return "0";} + if ($date == '') {return '0';} else {} {return $modx->toTimeStamp($date);} } @@ -451,19 +451,19 @@ function ConvertDate($date) { function webAlert($msg) { global $id, $modx; $mode = $_POST['mode']; - $url = "index.php?a=$mode" . ($mode == '88' ? "&id={$id}" : ''); + $url = "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : ''); $modx->manager->saveFormValues($mode); - include_once "header.inc.php"; + include_once 'header.inc.php'; $modx->webAlert($msg, $url); - include_once "footer.inc.php"; + include_once 'footer.inc.php'; } // Generate password function generate_password($length = 10) { - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $allowable_characters = 'abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'; $ps_len = strlen($allowable_characters); mt_srand((double) microtime() * 1000000); - $pass = ""; + $pass = ''; for ($i = 0; $i < $length; $i++) { $pass .= $allowable_characters[mt_rand(0, $ps_len -1)]; From 39b1e714ae8387e154f25c6a424cebf20ff22e0b Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 14:53:57 +0900 Subject: [PATCH 16/34] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processors/save_web_user.processor.php | 77 ++++++++----------- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index 2e8402adce..c99f380497 100644 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -25,7 +25,7 @@ $gender = !empty($_POST['gender']) ? $_POST['gender'] : 0; $photo = $modx->db->escape($_POST['photo']); $comment = $modx->db->escape($_POST['comment']); -$roleid = !empty($_POST['role']) ? $_POST['role'] : 0; +$role = !empty($_POST['role']) ? $_POST['role'] : 0; $failedlogincount = !empty($_POST['failedlogincount']) ? $_POST['failedlogincount'] : 0; $blocked = !empty($_POST['blocked']) ? $_POST['blocked'] : 0; $blockeduntil = !empty($_POST['blockeduntil']) ? ConvertDate($_POST['blockeduntil']) : 0; @@ -108,33 +108,31 @@ )); // create the user account - $sql = "INSERT INTO $tbl_web_users (username, password) - VALUES('" . $newusername . "', md5('" . $newpassword . "'));"; - $rs = $modx->db->query($sql); - if (!$rs) { + $fields = array(); + $fields['username'] = $newusername; + $fields['password'] = md5($newpassword); + $internalKey = $modx->db->insert($fields, $tbl_web_users); + if (!$internalKey) { webAlert("An error occurred while attempting to save the user."); exit; } - // now get the id - if (!$key = $modx->db->->getInsertId()) { - //get the key by sql - } - - $sql = "INSERT INTO $tbl_web_user_attributes (internalKey, fullname, role, email, phone, mobilephone, fax, zip, state, country, gender, dob, photo, comment, blocked, blockeduntil, blockedafter) - VALUES($key, '$fullname', '$roleid', '$email', '$phone', '$mobilephone', '$fax', '$zip', '$state', '$country', '$gender', '$dob', '$photo', '$comment', '$blocked', '$blockeduntil', '$blockedafter');"; - $rs = $modx->db->query($sql); - if (!$rs) { + + $fields = array(); + $fields = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $rs = $modx->db->insert($fields,$tbl_web_user_attributes); + if (!$rs) + { webAlert("An error occurred while attempting to save the user's attributes."); exit; } // Save User Settings - saveUserSettings($key); + saveUserSettings($internalKey); // invoke OnWebSaveUser event $modx->invokeEvent('OnWebSaveUser', array ( 'mode' => 'new', - "userid" => $key, + 'userid' => $internalKey, 'username' => $newusername, 'userpassword' => $newpassword, 'useremail' => $email, @@ -144,18 +142,24 @@ // invoke OnWUsrFormSave event $modx->invokeEvent('OnWUsrFormSave', array ( 'mode' => 'new', - "id" => $key + 'id' => $internalKey )); /*******************************************************************************/ // put the user in the user_groups he/ she should be in // first, check that up_perms are switched on! - if ($use_udperms == 1) { - if (count($user_groups) > 0) { - for ($i = 0; $i < count($user_groups); $i++) { - $sql = "INSERT INTO $tbl_web_groups (webgroup, webuser) values('" . intval($user_groups[$i]) . "', '" . $key . "')"; - $rs = $modx->db->query($sql); - if (!$rs) { + if ($use_udperms == 1) + { + if (count($user_groups) > 0) + { + $field = array(); + foreach($user_groups as $user_group) + { + $field['webgroup'] = intval($user_group); + $field['webuser'] = $internalKey; + $rs = $modx->db->insert($field,$tbl_web_groups); + if (!$rs) + { webAlert("An error occurred while attempting to add the user to a web group."); exit; } @@ -175,7 +179,7 @@ header($header); } else { if ($_POST['stay'] != '') { - $a = ($_POST['stay'] == '2') ? "88&id=$key" : "87"; + $a = ($_POST['stay'] == '2') ? "88&id={$internalKey}" : '87'; $stayUrl = "index.php?a={$a}&stay=" . $_POST['stay']; } else { $stayUrl = 'index.php?a=99'; @@ -271,26 +275,11 @@ exit; } - $sql = "UPDATE $tbl_web_user_attributes SET - fullname='" . $fullname . "', - role='$roleid', - email='$email', - phone='$phone', - mobilephone='$mobilephone', - fax='$fax', - zip='$zip' , - state='$state', - country='$country', - gender='$gender', - dob='$dob', - photo='$photo', - comment='$comment', - failedlogincount='$failedlogincount', - blocked=$blocked, - blockeduntil='$blockeduntil', - blockedafter='$blockedafter' - WHERE internalKey=$id"; - if (!$rs = $modx->db->query($sql)) { + $fields = array(); + $fields = compact('fullname','role','email','phone','mobilephone','fax','zip','state','country', + 'gender','dob','photo','comment','failedlogincount','blocked','blockeduntil','blockedafter'); + if (!$rs = $modx->db->update($fields,$tbl_web_user_attributes,"internalKey='{$id}'")) + { webAlert("An error occurred while attempting to update the user's attributes."); exit; } From 32af2a2b995197a764d966f4035c208676fd314d Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 18:04:22 +0900 Subject: [PATCH 17/34] =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89?= =?UTF-8?q?=E5=90=8D=E3=82=92=E5=87=A6=E7=90=86=E5=86=85=E5=AE=B9=E3=81=AB?= =?UTF-8?q?=E5=90=88=E3=81=A3=E3=81=9F=E3=82=82=E3=81=AE=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=20$modx->getDocumentListing()=20=E2=86=92=20$modx->ge?= =?UTF-8?q?tIdFromAlias()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/import_site.static.php | 2 +- manager/actions/search.static.php | 2 +- .../includes/document.parser.class.inc.php | 29 +++++++++++-------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/manager/actions/import_site.static.php b/manager/actions/import_site.static.php index 114046a406..f638070e04 100644 --- a/manager/actions/import_site.static.php +++ b/manager/actions/import_site.static.php @@ -436,7 +436,7 @@ function convertLink() $_ = trim($_,'./'); if(strpos($_,'/')!==false) $_ = substr($_,strrpos($_,'/')); $_ = $dir . str_replace('.html','',$_); - if(!isset($target[$_])) $target[$_] = $modx->getDocumentListing($_); + if(!isset($target[$_])) $target[$_] = $modx->getIdFromAlias($_); $target[$_] = trim($target[$_]); if(!empty($target[$_])) $href = '[~' . $target[$_] . '~]'; $array[$c] = 'getDocumentListing($url); + $searchid = $modx->getIdFromAlias($url); if (empty($searchid)) $searchid = 'x'; } diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 1f4de59885..7f85deb015 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -252,9 +252,9 @@ function executeParser() $alias = $this->virtualDir . '/' . $alias; } - if ($this->getDocumentListing($alias)!==false) + if ($this->getIdFromAlias($alias)!==false) { - $this->documentIdentifier= $this->getDocumentListing($alias); + $this->documentIdentifier= $this->getIdFromAlias($alias); } else { @@ -263,7 +263,7 @@ function executeParser() } else { - $this->documentIdentifier= $this->getDocumentListing($this->documentIdentifier); + $this->documentIdentifier= $this->getIdFromAlias($this->documentIdentifier); } $this->documentMethod= 'id'; } @@ -277,7 +277,7 @@ function executeParser() case $this->config['unauthorized_page']: break; default: - if($this->getDocumentListing($alias)===false) $this->sendErrorPage(); + if($this->getIdFromAlias($alias)===false) $this->sendErrorPage(); } } @@ -959,13 +959,13 @@ function cleanDocumentIdentifier($qOrig) $vdir = $this->virtualDir; if ( ( - ($vdir != '' && !$this->getDocumentListing("{$vdir}/{$q}")) + ($vdir != '' && !$this->getIdFromAlias("{$vdir}/{$q}")) || - ($vdir == '' && !$this->getDocumentListing($q)) + ($vdir == '' && !$this->getIdFromAlias($q)) ) && ( - ($vdir != '' && in_array($q, $this->getChildIds($this->getDocumentListing($vdir), 1))) + ($vdir != '' && in_array($q, $this->getChildIds($this->getIdFromAlias($vdir), 1))) || ($vdir == '' && in_array($q, $this->getChildIds(0, 1))) )) @@ -1740,9 +1740,9 @@ function getDocumentObject($method='id', $identifier='') $identifier = $this->cleanDocumentIdentifier($identifier); $method = $this->documentMethod; } - if($method == 'alias' && $this->config['use_alias_path'] && $this->getDocumentListing($identifier)!==false) + if($method == 'alias' && $this->config['use_alias_path'] && $this->getIdFromAlias($identifier)!==false) { - $identifier = $this->getDocumentListing($identifier); + $identifier = $this->getIdFromAlias($identifier); $method = 'id'; } // get document groups for current user @@ -3807,7 +3807,12 @@ function getProcessCache($key) function getDocumentListing($str) { - $cacheKey = md5(__FUNCTION__ . $str); + return $this->getIdFromAlias($str); + } + + function getIdFromAlias($alias) + { + $cacheKey = md5(__FUNCTION__ . $alias); $result = $this->getProcessCache($cacheKey); if($result!==false) return $result; @@ -3817,8 +3822,8 @@ function getDocumentListing($str) if($this->config['use_alias_path']==1) { - if(strpos($str,'/')!==false) $_a = explode('/', $str); - else $_a[] = $str; + if(strpos($alias,'/')!==false) $_a = explode('/', $alias); + else $_a[] = $alias; $id= 0; foreach($_a as $alias) From 7db9e64b0787549b260e86d669e766e76fd21530 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 18:06:07 +0900 Subject: [PATCH 18/34] =?UTF-8?q?ManagerManager=20-=20mm=5Fdefault()?= =?UTF-8?q?=E3=81=AE=E5=80=A4=E3=81=A7=E3=82=B7=E3=83=B3=E3=82=B0=E3=83=AB?= =?UTF-8?q?=E3=82=AF=E3=82=A9=E3=83=BC=E3=83=88=E3=81=AA=E3=81=A9=E3=82=92?= =?UTF-8?q?=E4=BD=BF=E3=81=88=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B=20http://forum.modx.jp/viewtopic.php=3Fp=3D5046#p5046?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/plugins/managermanager/functions/fieldvalues.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/plugins/managermanager/functions/fieldvalues.inc.php b/assets/plugins/managermanager/functions/fieldvalues.inc.php index c9b9d20824..cf59f3ef82 100644 --- a/assets/plugins/managermanager/functions/fieldvalues.inc.php +++ b/assets/plugins/managermanager/functions/fieldvalues.inc.php @@ -26,6 +26,7 @@ function mm_default($field, $value='', $roles='', $templates='', $eval=false) { // What's the new value, and does it include PHP? $new_value = ($eval) ? eval($value) : $value; + $new_value = $modx->db->escape($new_value); $output = " // ----------- Change defaults -------------- \n"; From d7461f8eb329fc497aaf52d8fa87151c7f8b5450 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 18:07:06 +0900 Subject: [PATCH 19/34] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/snippets/ditto/classes/phx.parser.class.inc.php | 2 +- manager/includes/extenders/phx.parser.class.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/snippets/ditto/classes/phx.parser.class.inc.php b/assets/snippets/ditto/classes/phx.parser.class.inc.php index d8182d0cde..3f64425559 100644 --- a/assets/snippets/ditto/classes/phx.parser.class.inc.php +++ b/assets/snippets/ditto/classes/phx.parser.class.inc.php @@ -321,7 +321,7 @@ function Filter($input, $modifiers) $output = str_replace(array('[', ']', '`'),array('[', ']', '`'),$output); break; case 'strip': - $output = preg_replace("~([\n\r\t\s]+)~",' ',$output); break; + $output = str_replace(array("\n","\r","\t","\s"), ' ', $output); break; case 'notags': case 'strip_tags': if($modifier_value[$i]!=='') diff --git a/manager/includes/extenders/phx.parser.class.inc.php b/manager/includes/extenders/phx.parser.class.inc.php index 9de51c1c51..6116c20423 100644 --- a/manager/includes/extenders/phx.parser.class.inc.php +++ b/manager/includes/extenders/phx.parser.class.inc.php @@ -41,7 +41,7 @@ function Filter($key, $value, $cmd, $opt='') $value = str_replace(array('[', ']', '`'),array('[', ']', '`'),$value); break; case 'strip': - $value = preg_replace("~([\n\r\t\s]+)~",' ',$value); break; + $value = str_replace(array("\n","\r","\t","\s"), ' ', $value); break; case 'notags': case 'strip_tags': if($opt!=='') From afe7aad465d1932c934bc4e10cad8f3efc9561ec Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 18:09:35 +0900 Subject: [PATCH 20/34] =?UTF-8?q?Ditto=20-=20RSS=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AEdescription=E3=81=AB=E6=94=B9?= =?UTF-8?q?=E8=A1=8C=E3=81=8C=E5=85=A5=E3=82=89=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/snippets/ditto/formats/rss.format.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/snippets/ditto/formats/rss.format.inc.php b/assets/snippets/ditto/formats/rss.format.inc.php index a3e2ede4a0..8185fdc4f7 100644 --- a/assets/snippets/ditto/formats/rss.format.inc.php +++ b/assets/snippets/ditto/formats/rss.format.inc.php @@ -114,7 +114,7 @@ function rss_author($resource) { [*pagetitle*] [(site_url)] - [*description*] + [*description:strip*] [+rss_lang+] [+rss_copyright+] [+rss_ttl+] @@ -125,7 +125,7 @@ function rss_author($resource) { [+rss_pagetitle+] [(site_url)][~[+id+]~] - + [+rss_date+] [(site_url)][~[+id+]~] [+rss_author+] From 29f5d73228b93a6172c63b23da216c4f2febe638 Mon Sep 17 00:00:00 2001 From: yama Date: Fri, 28 Sep 2012 18:10:23 +0900 Subject: [PATCH 21/34] =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84=E8=AA=BF=E6=95=B4?= =?UTF-8?q?(RSS=E3=83=95=E3=82=A3=E3=83=BC=E3=83=89=E3=81=ABdescription?= =?UTF-8?q?=E3=82=92=E8=A8=AD=E5=AE=9A=E3=81=99=E3=82=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/sql/sample.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/sql/sample.sql b/install/sql/sample.sql index 7b340b549c..dda367e9d6 100644 --- a/install/sql/sample.sql +++ b/install/sql/sample.sql @@ -16,7 +16,7 @@ REPLACE INTO `{PREFIX}site_content` VALUES ('4','document','text/html','404 - Do REPLACE INTO `{PREFIX}site_content` VALUES ('5','document','text/html','新サービスのお知らせ','新サービスのお知らせ','','newservice','','1','0','0','2','0','','

新サービスのお知らせです。

\n','1','2','0','1','1','1','1300505696','1','1300505697','0','0','0','1300505696','0','','0','0','0','0','0','0','1'); -REPLACE INTO `{PREFIX}site_content` VALUES ('6','document','application/rss+xml','RSS フィード','[(site_name)] RSSフィード','','feed.rss','','1','0','0','0','0','','[[Ditto?\n &parents=`2`\n &format=`rss`\n &display=`10`\n]]','0','0','11','0','1','1','1144904400','1','1160062859','0','0','0','1144904400','0','','0','0','0','0','0','0','1'); +REPLACE INTO `{PREFIX}site_content` VALUES ('6','document','application/rss+xml','RSS フィード','[(site_name)] RSSフィード','RSSフィードのサンプルです。','feed.rss','','1','0','0','0','0','','[[Ditto?\n &parents=`2`\n &format=`rss`\n &display=`10`\n]]','0','0','11','0','1','1','1144904400','1','1160062859','0','0','0','1144904400','0','','0','0','0','0','0','0','1'); REPLACE INTO `{PREFIX}site_content` VALUES ('7','document','text/html','サイトをオープンしました。','サイトをオープンしました','','begin','','1','0','0','2','0','','

サイトをオープンしました。MODXで作りました。

\n','1','2','2','1','1','1','1299728096','1','1299728097','0','0','0','1299728096','0','','0','0','0','0','0','0','1'); From 87bb64af2b5c9b65d77796360a4626ed91dbb603 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 29 Sep 2012 11:45:10 +0900 Subject: [PATCH 22/34] =?UTF-8?q?$modx->['enable=5Fbindings']=E3=82=92?= =?UTF-8?q?=E3=82=B3=E3=82=A2=E6=A9=9F=E8=83=BD=E3=81=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?=E7=B5=84=E3=81=BF=E8=BE=BC=E3=82=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/mutate_settings.dynamic.php | 10 ++++++++++ manager/includes/default.config.php | 2 ++ manager/includes/upgrades.php | 11 +++++++++++ 3 files changed, 23 insertions(+) diff --git a/manager/actions/mutate_settings.dynamic.php b/manager/actions/mutate_settings.dynamic.php index efeadd2063..03c860e154 100644 --- a/manager/actions/mutate_settings.dynamic.php +++ b/manager/actions/mutate_settings.dynamic.php @@ -752,6 +752,16 @@ function confirmLangChange(el, lkey, elupd)
+ + + + +
+
+ + + + この環境では日本語以外の文字(中国語・韓国語・一部の機種依存文字など)を入力できません。対応が必要な場合は、サーバ環境のUTF-8エンコードの扱いを整備したうえで、dbapi.mysql.class.inc.phpのescape関数の処理を書き換えてください。mb_convert_encodingの処理を行なっている行が2行ありますので、これを削除します。'; diff --git a/manager/includes/upgrades.php b/manager/includes/upgrades.php index 9cba3c59b7..3368bdc712 100644 --- a/manager/includes/upgrades.php +++ b/manager/includes/upgrades.php @@ -45,6 +45,17 @@ function run_update($version) if(104 < $version) { delete_actionphp(); } + if(104 < $version && $version < 107) { + disableEnaBindings(); // jp only + } +} + +function disableEnaBindings() +{ + global $modx; + $tbl_site_plugins = $modx->getFullTableName('site_plugins'); + + $modx->db->update("`disabled`='1'",$tbl_site_plugins,"`name`='Bindings機能の有効無効'"); // jp only } function update_config_custom_contenttype() From 499fb29958c4a0fe495a1cc46a2aae8619ed8618 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 29 Sep 2012 11:47:42 +0900 Subject: [PATCH 23/34] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=83=BB=E3=82=A8=E3=83=B3=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E8=BF=BD=E5=8A=A0(enable=5Fbindings)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/includes/lang/japanese-utf8.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/includes/lang/japanese-utf8.inc.php b/manager/includes/lang/japanese-utf8.inc.php index 5d784d7839..f53e7909f2 100644 --- a/manager/includes/lang/japanese-utf8.inc.php +++ b/manager/includes/lang/japanese-utf8.inc.php @@ -1212,3 +1212,6 @@ $_lang["a17_image_limit_width_title"] = '画像の横幅の最大値'; $_lang["a17_image_limit_width_message"] = 'アップロードする画像の横幅を自動的に縮小します。空白にすると処理しません。'; + +$_lang["enable_bindings_title"] = '@Bindingsを有効にする'; +$_lang['enable_bindings_message'] = '
@Bindings機能を有効にします。この機能は、投稿画面上の入力フィールド(テンプレート変数)に任意のコマンドを記述し、実行するものです。PHP文の実行などが可能なため、複数メンバーでサイトを運用する場合、当機能の運用には注意が必要です。'; From b4bd8094657c55fca84a67f025b4e9eb10addb12 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 29 Sep 2012 21:05:04 +0900 Subject: [PATCH 24/34] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=BC=E3=83=A9=20-=20=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=AA=E7=94=9F=E6=88=90=E5=87=A6=E7=90=86=E3=82=92?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/actions/summary.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/install/actions/summary.php b/install/actions/summary.php index 4520a069ed..961f86a68a 100644 --- a/install/actions/summary.php +++ b/install/actions/summary.php @@ -398,12 +398,18 @@ function mkd($path) { // if(ini_get('safe_mode') !=0) return; - $rs = @mkdir($path, true); - if($rs) $rs = @chmod($path, 0777); - if($rs) @file_put_contents("{$path}/index.html",''); - if($rs) @chmod("{$path}/index.html", 0666); + if(!is_dir($path)) + { + $rs = @mkdir($path, true); + if($rs) $rs = @chmod($path, 0777); + } - if(!$rs) echo echo_failed($path); + if(!is_file("{$path}/index.html")) + { + $rs = @file_put_contents("{$path}/index.html",''); + if($rs) @chmod("{$path}/index.html", 0666); + if(!is_writable("{$path}/index.html")) echo echo_failed($path); + } return $rs; } From f116efa9a349d55283748ca7c7cd07b1a0204096 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 29 Sep 2012 21:05:26 +0900 Subject: [PATCH 25/34] =?UTF-8?q?enable-bindings.tpl=E5=89=8A=E9=99=A4(?= =?UTF-8?q?=E3=82=B3=E3=82=A2=E3=81=AB=E6=A9=9F=E8=83=BD=E3=82=92=E7=B5=B1?= =?UTF-8?q?=E5=90=88=E3=81=97=E3=81=9F=E3=81=9F=E3=82=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/assets/plugins/enable-bindings.tpl | 38 ---------------------- 1 file changed, 38 deletions(-) delete mode 100644 install/assets/plugins/enable-bindings.tpl diff --git a/install/assets/plugins/enable-bindings.tpl b/install/assets/plugins/enable-bindings.tpl deleted file mode 100644 index e8c3124a7f..0000000000 --- a/install/assets/plugins/enable-bindings.tpl +++ /dev/null @@ -1,38 +0,0 @@ -//event; -global $settings; -$action = $modx->manager->action; -if($action!==17) return; -$enable_bindings = (is_null($settings['enable_bindings'])) ? '1' : $settings['enable_bindings']; -$html = render_html($enable_bindings); -$e->output($html); - -function render_html($enable_bindings) -{ - global $_lang; - $str = '

@Bindingsの設定

' . "\n"; - $str .= ' ' . "\n"; - $str .= ' ' . "\n"; - $str .= ' ' . "\n"; - $str .= ' ' . "\n"; - $str .= '
@Bindingsを有効にする' . "\n"; - $str .= $_lang["yes"] . '
' . "\n"; - $str .= ' ' . "\n"; - $str .= $_lang["no"] . '
@Bindings機能を有効にします。この機能は、投稿画面上の入力フィールド(テンプレート変数)に任意のコマンドを記述し、実行するものです。PHP文の実行などが可能なため、複数メンバーでサイトを運用する場合、当機能の運用には注意が必要です。
' . "\n"; - return $str; -} From 6341f1e2eb11a892a9bda8a5e15b7894f319f5b2 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 29 Sep 2012 21:38:53 +0900 Subject: [PATCH 26/34] =?UTF-8?q?TinyMCE=20-=20=E3=83=86=E3=83=B3=E3=83=97?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=83=88=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/plugins/tinymce/functions.php | 6 +- assets/plugins/tinymce/inc/gsettings.html.inc | 12 +- assets/plugins/tinymce/js/get_template.php | 118 ++++++++++++++++++ assets/plugins/tinymce/js/mce_init.js.inc | 3 + .../tinymce/lang/japanese-utf8.inc.php | 11 +- .../tinymce/settings/default_params.php | 2 + 6 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 assets/plugins/tinymce/js/get_template.php diff --git a/assets/plugins/tinymce/functions.php b/assets/plugins/tinymce/functions.php index dead8c735b..d66a21f7d3 100644 --- a/assets/plugins/tinymce/functions.php +++ b/assets/plugins/tinymce/functions.php @@ -194,9 +194,9 @@ function get_mce_script($params) $buttons4 = $params['custom_buttons4']; break; default: - $plugins = 'visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table'; + $plugins = 'template,visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table'; $buttons1 = 'undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,fontsizeselect,pastetext,pasteword,code,|,fullscreen,help'; - $buttons2 = 'image,media,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,blockquote,outdent,indent,|,table,hr,|,visualblocks,styleprops,removeformat'; + $buttons2 = 'image,media,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,blockquote,outdent,indent,|,table,hr,|,template,visualblocks,styleprops,removeformat'; $buttons3 = ''; $buttons4 = ''; if(is_dir($params['mce_path'] . 'jscripts/tiny_mce/plugins/quickupload')) @@ -326,6 +326,8 @@ function build_mce_init($params,$plugins,$buttons1,$buttons2,$buttons3,$buttons4 } $ph['content_css'] = join(',', $content_css); $ph['link_list'] = ($params['link_list']=='enabled') ? "'{$params['mce_url']}js/tinymce.linklist.php'" : 'false'; + + $ph['tpl_list'] = $params['mce_url'] . 'js/get_template.php'; $mce_init = file_get_contents($params['mce_path'] . 'js/mce_init.js.inc'); diff --git a/assets/plugins/tinymce/inc/gsettings.html.inc b/assets/plugins/tinymce/inc/gsettings.html.inc index d3295e100a..deb788d90b 100644 --- a/assets/plugins/tinymce/inc/gsettings.html.inc +++ b/assets/plugins/tinymce/inc/gsettings.html.inc @@ -1,7 +1,7 @@ - +
@@ -23,6 +23,16 @@ textarea.mce {width:95%;height:40px;display:block;}
[+mce_editor_skin_message+]
+ + + + + +

[+mce_settings+]

[+mce_tpl_title+] +
+
+
[+mce_tpl_msg+]
+
[+mce_editor_entermode_title+] diff --git a/assets/plugins/tinymce/js/get_template.php b/assets/plugins/tinymce/js/get_template.php new file mode 100644 index 0000000000..eeabe74edf --- /dev/null +++ b/assets/plugins/tinymce/js/get_template.php @@ -0,0 +1,118 @@ +db->connect(); + +/* only display if manager user is logged in */ +if ($modx->getLoginUserType() !== 'manager') +{ + // Make output a real JavaScript file! + header('Content-type: text/javascript'); + header('pragma: no-cache'); + header('expires: 0'); + + echo 'var mceTemplateList = Array();'; + exit(); +} + +$modx->getSettings(); + +$ids = $modx->config['mce_template_docs']; +$chunks = $modx->config['mce_template_chunks']; + +$output = false; + +if(isset($_GET['docid']) && preg_match('@^[0-9]+$@',$_GET['docid'])) +{ + $doc = $modx->getDocument($_GET['docid']); + if($doc) $output = $doc['content']; +} +elseif(isset($_GET['chunk']) && preg_match('@^[0-9]+$@',$_GET['chunk'])) +{ + $tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); + $cid = $_GET['chunk']; + $rs = $modx->db->select('snippet', $tbl_site_htmlsnippets, "`id`='{$cid}' AND published=1"); + $content = $modx->db->getValue($rs); + if($content) $output = $content; +} +else +{ + $list = array(); + $tpl = "['[+title+]', '[+site_url+]assets/plugins/tinymce/js/get_template.php?[+target+]', '[+description+]']"; + + if(isset($ids) && !empty($ids)) + { + $docs = $modx->getDocuments($ids, 1, 0, $fields= 'id,pagetitle,menutitle,description,content'); + + $ph['site_url'] = $modx->config['site_url']; + foreach($docs as $i=>$a) + { + $ph['title'] = ($docs[$i]['menutitle']!=='') ? $docs[$i]['menutitle'] : $docs[$i]['pagetitle']; + $ph['target'] = 'docid=' . $docs[$i]['id']; + $ph['description'] = $docs[$i]['description']; + $list[] = $modx->parsePlaceholder($tpl,$ph); + } + } + + if(isset($chunks) && !empty($chunks)) + { + $tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); + if(strpos($chunks,',')!==false) + { + $chunks = explode(',', $chunks); + foreach($chunks as $i=>$v) + { + $chunks[$i] = $modx->db->escape(trim($v)); + } + $chunks = join("','", $chunks); + $where = "`name` IN ('{$chunks}')"; + } + else + { + $where = "`name`='{$chunks}'"; + } + + $rs = $modx->db->select('id,name,description', $tbl_site_htmlsnippets, $where); + + while($row = $modx->db->getRow($rs)) + { + $ph['title'] = $row['name']; + $ph['target'] = 'chunk=' . $row['id']; + $ph['description'] = $row['description']; + $list[] = $modx->parsePlaceholder($tpl,$ph); + } + } + + if(0 Date: Sat, 29 Sep 2012 21:39:47 +0900 Subject: [PATCH 27/34] =?UTF-8?q?tinymce.linklist.flat.php=20=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tinymce/js/tinymce.linklist.flat.php | 57 ------------------- 1 file changed, 57 deletions(-) delete mode 100644 assets/plugins/tinymce/js/tinymce.linklist.flat.php diff --git a/assets/plugins/tinymce/js/tinymce.linklist.flat.php b/assets/plugins/tinymce/js/tinymce.linklist.flat.php deleted file mode 100644 index 8511d7b84b..0000000000 --- a/assets/plugins/tinymce/js/tinymce.linklist.flat.php +++ /dev/null @@ -1,57 +0,0 @@ -db->connect(); - -/* only display if manager user is logged in */ -if ($modx->getLoginUserType() !== 'manager') { - // Make output a real JavaScript file! - header('Content-type: text/javascript'); // browser will now recognize the file as a valid JS file - - // prevent browser from caching - header('pragma: no-cache'); - header('expires: 0'); // i.e. contents have already expired - - echo "var tinyMCELinkList = new Array();"; - exit(); -} - -$allpages = getAllPages(); -foreach($allpages as $page){ - $caption = ($page['pagetitle'])?htmlspecialchars($page['pagetitle'],ENT_QUOTES):htmlspecialchars($page['menutitle'],ENT_QUOTES); - $list .=($list!='')?",\n":"\n"; - $list.= "[\"".$caption." (".$page['id'].")"."\", \"[\"+\"~".$page['id']."~\"+\"]\"]"; -} -$output = "var tinyMCELinkList = new Array(\n". $list .");"; - -echo $output; - - -function getAllPages($id=0, $sort='menuindex', $dir='ASC', $fields='pagetitle, id, menutitle') { - global $modx, $table_prefix; - - $tblsc = $modx->getFullTableName("site_content"); - $tbldg = $modx->getFullTableName("document_groups"); - - // modify field names to use sc. table reference - $fields = 'sc.'.implode(',sc.',preg_replace("/^\s/i","",explode(',',$fields))); - $sort = 'sc.'.implode(',sc.',preg_replace("/^\s/i","",explode(',',$sort))); - - $sql = "SELECT DISTINCT $fields FROM $tblsc sc - LEFT JOIN $tbldg dg on dg.document = sc.id - WHERE sc.published=1 AND sc.deleted=0 - ORDER BY $sort $dir;"; - - $result = $modx->db->query($sql) or die('Query failed: ' . $modx->db->getLastError()); - $resourceArray = array(); - for($i=0;$i<@$modx->db->getRecordCount($result);$i++) { - array_push($resourceArray,$modx->db->getRow($result)); - } - - sort($resourceArray); - - return $resourceArray; -} - From be7cf467f777e220a3742b6e63e53fe95cf5f451 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 29 Sep 2012 21:41:15 +0900 Subject: [PATCH 28/34] =?UTF-8?q?TinyMCE=20-=20template=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/assets/plugins/tinymce.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/assets/plugins/tinymce.tpl b/install/assets/plugins/tinymce.tpl index 2892e328ca..647fc2500d 100644 --- a/install/assets/plugins/tinymce.tpl +++ b/install/assets/plugins/tinymce.tpl @@ -122,6 +122,8 @@ switch ($e->name) $params['custom_buttons2'] = $mce_settings['tinymce_custom_buttons2']; $params['custom_buttons3'] = $mce_settings['tinymce_custom_buttons3']; $params['custom_buttons4'] = $mce_settings['tinymce_custom_buttons4']; + $params['mce_template_docs'] = $mce_settings['mce_template_docs']; + $params['mce_template_chunks']= $mce_settings['mce_template_chunks']; $html = $mce->get_mce_settings($params); $e->output($html); From b60ee1978f222a818f2438fa81137b753f923085 Mon Sep 17 00:00:00 2001 From: yama Date: Sat, 29 Sep 2012 21:51:51 +0900 Subject: [PATCH 29/34] Update - TinyMCE 3.5.7 language files (Japanese and English) --- assets/plugins/tinymce/lang/english.inc.php | 16 ++++++++++++---- .../plugins/tinymce/lang/japanese-utf8.inc.php | 6 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/assets/plugins/tinymce/lang/english.inc.php b/assets/plugins/tinymce/lang/english.inc.php index e94eb5458a..6790954226 100644 --- a/assets/plugins/tinymce/lang/english.inc.php +++ b/assets/plugins/tinymce/lang/english.inc.php @@ -4,15 +4,15 @@ * Function: English language file for TinyMCE * Encoding: ISO-Latin-1 * Author: Jeff Whitfield and yama - * Date: 2012/03/10 - * Version: 3.3 - * MODx version: 0.9.5-1.0.6 + * Date: 2012/09/29 + * Version: 3.5.7 + * MODX version: 0.9.5-1.0.6 */ $_lang['mce_editor_theme_title'] = 'Theme:'; $_lang['mce_editor_theme_message'] = 'Here you can select which theme or skin to use with the editor.'; $_lang['mce_editor_custom_plugins_title'] = 'Custom Plugins:'; -$_lang['mce_editor_custom_plugins_message'] = "Enter the plugins to use for the 'custom' theme as a comma separated list."; +$_lang['mce_editor_custom_plugins_message'] = "Enter the plugins to use for the 'custom' theme as a comma separated list.
Default : template,visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen, advimage,paste,advlink,media,contextmenu,table"; $_lang['mce_editor_custom_buttons_title'] = 'Custom Buttons:'; $_lang['mce_editor_custom_buttons_message'] = "Enter the buttons to use for the 'custom' theme as a comma separated list for each row. Be sure that each button has the required plugin enabled in the 'Custom Plugins' setting."; $_lang['mce_editor_css_selectors_title'] = 'CSS selectors:'; @@ -37,3 +37,11 @@ $_lang['mce_element_format_message'] = 'This option enables control if elements should be in html or xhtml mode. xhtml is the default state for this option. This means that for example <br /> will be <br> if you set this option to "html".'; $_lang['mce_schema_title'] = 'Schema'; $_lang['mce_schema_message'] = 'The schema option enables you to switch between the HTML4 and HTML5 schema. This controls the valid elements and attributes that can be placed in the HTML. This value can either be the default html4 or html5.'; + +$_lang['mce_toolbar1_msg'] = 'Default : undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,fontsizeselect, pastetext,pasteword,code,|,fullscreen,help'; +$_lang['mce_toolbar2_msg'] = 'Default : image,media,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist, numlist,|,blockquote,outdent,indent,|,table,hr,|,template,visualblocks,styleprops,removeformat'; + +$_lang['mce_tpl_title'] = 'Template button'; +$_lang['mce_tpl_msg'] = 'You can insert the HTML block which you registered beforehand from toolbar. You make HTML block as resource or a chunk, and can appoint plural number with a comma.'; +$_lang['mce_tpl_docid'] = 'Resource IDs'; +$_lang['mce_tpl_chunkname'] = 'Chunk names'; \ No newline at end of file diff --git a/assets/plugins/tinymce/lang/japanese-utf8.inc.php b/assets/plugins/tinymce/lang/japanese-utf8.inc.php index 8b65d5873b..a3377a323d 100644 --- a/assets/plugins/tinymce/lang/japanese-utf8.inc.php +++ b/assets/plugins/tinymce/lang/japanese-utf8.inc.php @@ -4,9 +4,9 @@ * Function: Japanese language file for TinyMCE. * Encoding: UTF-8 * Author: yama - * Date: 2010/07/29 - * Version: 2.1.1 - * MODx version: 0.9.5-1.0.5 + * Date: 2012/09/29 + * Version: 3.5.7 + * MODX version: 0.9.5-1.0.6 */ $_lang['mce_editor_theme_title'] = 'テーマ:'; From 07976a3949b30db68120d23a301ed593658ef469 Mon Sep 17 00:00:00 2001 From: yama Date: Sun, 30 Sep 2012 18:12:22 +0900 Subject: [PATCH 30/34] =?UTF-8?q?$modx->getDocuments()=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../includes/document.parser.class.inc.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 7f85deb015..db16caf746 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -2238,19 +2238,34 @@ function getDocumentChildren($parentid= 0, $published= 1, $deleted= 0, $fields= return $resourceArray; } - function getDocuments($ids= array (), $published= 1, $deleted= 0, $fields= '*', $where= '', $sort= 'menuindex', $dir= 'ASC', $limit= '') + function getDocuments($ids= array(), $published= 1, $deleted= 0, $fields= '*', $where= '', $sort= 'menuindex', $dir= 'ASC', $limit= '') { - if (count($ids) == 0) + if (count($ids) == 0 || empty($ids)) { return false; } else { + if(is_string($ids)) + { + $ids = explode(',', $ids); + foreach($ids as $i=>$id) + { + $ids[$i] = trim($id); + } + } + $tbl_site_content= $this->getFullTableName('site_content'); $tbl_document_groups= $this->getFullTableName('document_groups'); // modify field names to use sc. table reference - $fields= 'sc.' . implode(',sc.', preg_replace("/^\s/i", '', explode(',', $fields))); + $fields = explode(',',$fields); + foreach($fields as $i=>$field) + { + $fields[$i] = 'sc.' . trim($field); + } + $fields = join(',',$fields); + if($sort !== '') $sort = 'sc.' . implode(',sc.', preg_replace("/^\s/i", '', explode(',', $sort))); if ($where != '') $where= "AND {$where}"; // get document groups for current user From 350fd8e5443e1bd859715cdfb3b02e56bc4b0a48 Mon Sep 17 00:00:00 2001 From: yama Date: Sun, 30 Sep 2012 18:19:34 +0900 Subject: [PATCH 31/34] =?UTF-8?q?404=E3=83=9A=E3=83=BC=E3=82=B8=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E6=99=82=E3=81=ABURL=E3=81=AE=E6=95=B0=E3=81=A0?= =?UTF-8?q?=E3=81=91=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7=E3=83=A5=E3=82=92?= =?UTF-8?q?=E7=94=9F=E6=88=90=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../includes/document.parser.class.inc.php | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index db16caf746..a305a6d786 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -54,7 +54,7 @@ class DocumentParser { var $cacheRefreshTime; var $error_reporting; var $processCache; - + var $http_status_code; // constructor function DocumentParser() @@ -147,6 +147,8 @@ function executeParser() set_error_handler(array(& $this,'phpError')); } + $this->http_status_code = '200'; + if(!empty($_SERVER['QUERY_STRING'])) { $qs = $_GET; @@ -304,7 +306,7 @@ function prepareResponse() // validation routines if ($this->documentObject['deleted'] == 1) { - $this->sendErrorPage(); + if($this->http_status_code == '200') $this->sendErrorPage(); } // && !$this->checkPreview() if ($this->documentObject['published'] == 0) @@ -312,7 +314,7 @@ function prepareResponse() // Can't view unpublished pages if (!$this->hasPermission('view_unpublished')) { - $this->sendErrorPage(); + if($this->http_status_code == '200') $this->sendErrorPage(); } else { @@ -325,7 +327,7 @@ function prepareResponse() // Doesn't have access to this document if (!$udperms->checkPermissions()) { - $this->sendErrorPage(); + if($this->http_status_code == '200') $this->sendErrorPage(); } } } @@ -539,6 +541,15 @@ function postProcess() $filename = md5($_SERVER['REQUEST_URI']); break; } + + switch($this->http_status_code) + { + case '404': + case '403': + $filename = md5($this->makeUrl($docid)); + break; + } + $page_cache_path = "{$base_path}assets/cache/{$filename}.pageCache.php"; file_put_contents($page_cache_path, $cacheContent, LOCK_EX); } @@ -651,6 +662,7 @@ function sendErrorPage() if($this->config['error_page']) $dist = $this->config['error_page']; else $dist = $this->config['site_start']; + $this->http_status_code = '404'; $this->sendForward($dist, 'HTTP/1.0 404 Not Found'); } @@ -664,6 +676,7 @@ function sendUnauthorizedPage() elseif($this->config['error_page']) $dist = $this->config['error_page']; else $dist = $this->config['site_start']; + $this->http_status_code = '403'; $this->sendForward($dist , 'HTTP/1.1 403 Forbidden'); } From 46bc50f9366a0588e0ccae0614183670a2369171 Mon Sep 17 00:00:00 2001 From: yama Date: Sun, 30 Sep 2012 18:20:41 +0900 Subject: [PATCH 32/34] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=97=E3=82=92=E6=8A=91?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/includes/document.parser.class.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index a305a6d786..83ba99dd1d 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -158,9 +158,9 @@ function executeParser() } // get the settings - $this->db->connect(); - $this->getSettings(); - $this->initProcessCache(); + if(!$this->db->conn) $this->db->connect(); + if(!isset($this->config)) $this->getSettings(); + if(!$this->processCache) $this->initProcessCache(); if(!isset($_REQUEST['id'])) { $_REQUEST['q'] = substr($_SERVER['REQUEST_URI'],strlen($this->config['base_url'])); From f32130864402dae3f2fbc90b3f60b681656f3aa7 Mon Sep 17 00:00:00 2001 From: yama Date: Sun, 30 Sep 2012 18:21:47 +0900 Subject: [PATCH 33/34] =?UTF-8?q?=E3=82=AD=E3=83=A3=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE=E6=95=B0?= =?UTF-8?q?=E3=81=8C1000=E4=BB=A5=E4=B8=8A=E3=81=AB=E5=A2=97=E3=81=88?= =?UTF-8?q?=E3=81=9F=E5=A0=B4=E5=90=88=E3=80=81=E3=83=AA=E3=82=AF=E3=82=A8?= =?UTF-8?q?=E3=82=B9=E3=83=88=E6=95=B0100=E5=9B=9E=E3=81=AB5=E5=9B=9E?= =?UTF-8?q?=E3=81=AE=E7=A2=BA=E7=8E=87=E3=81=A7=E3=82=AD=E3=83=A3=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E3=82=92=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/includes/document.parser.class.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 83ba99dd1d..7e770f9ee0 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -550,6 +550,12 @@ function postProcess() break; } + if(mt_rand(0,99) < 5) + { + $file_count = count(glob($this->config['base_path'].'assets/cache/*.php')); + if(1000 < $file_count) $this->clearCache(); + } + $page_cache_path = "{$base_path}assets/cache/{$filename}.pageCache.php"; file_put_contents($page_cache_path, $cacheContent, LOCK_EX); } From 55ba2d0e9447b4a31aebdb9c2a93f9da7022fe93 Mon Sep 17 00:00:00 2001 From: yama Date: Sun, 30 Sep 2012 18:22:48 +0900 Subject: [PATCH 34/34] =?UTF-8?q?=E3=82=A8=E3=82=AF=E3=82=B9=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=88=E5=87=A6=E7=90=86=E3=82=92=E9=AB=98=E9=80=9F?= =?UTF-8?q?=E5=8C=96(6=EF=BD=9E7=E5=80=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/export_site.static.php | 11 ++++- .../includes/document.parser.class.inc.php | 43 +++++++++++++------ 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/manager/actions/export_site.static.php b/manager/actions/export_site.static.php index cd0589c52f..4322a0144b 100644 --- a/manager/actions/export_site.static.php +++ b/manager/actions/export_site.static.php @@ -164,7 +164,10 @@ $filename = $prefix.$alias.$tsuffix; } // get the file - $somecontent = @file_get_contents(MODX_SITE_URL . "index.php?id={$id}"); + $back_lang = $_lang; + $somecontent = $modx->executeParser($id); + $_lang = $back_lang; + if($somecontent !== false) { // save it @@ -243,7 +246,11 @@ function writeAPage($docid, $filepath) { global $modx,$_lang; - $src = @file_get_contents(MODX_SITE_URL . "index.php?id={$docid}"); + $back_lang = $_lang; + $src = $modx->executeParser($docid); + $modx->postProcess(); + $_lang = $back_lang; + if($src !== false) { $repl_before = $_POST['repl_before']; diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 7e770f9ee0..d54da546e9 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -55,6 +55,7 @@ class DocumentParser { var $error_reporting; var $processCache; var $http_status_code; + var $directParse; // constructor function DocumentParser() @@ -134,7 +135,7 @@ function loadExtension($extname) } } - function executeParser() + function executeParser($id='') { ob_start(); //error_reporting(0); @@ -161,6 +162,16 @@ function executeParser() if(!$this->db->conn) $this->db->connect(); if(!isset($this->config)) $this->getSettings(); if(!$this->processCache) $this->initProcessCache(); + + if(!empty($id)) + { + $_REQUEST['id'] = $id; + $_GET['id'] = $id; + $_SERVER['REQUEST_URI'] = $this->config['base_url'] . 'index.php?id=' . $id; + $this->directParse = 1; + } + else $this->directParse = 0; + if(!isset($_REQUEST['id'])) { $_REQUEST['q'] = substr($_SERVER['REQUEST_URI'],strlen($this->config['base_url'])); @@ -168,16 +179,19 @@ function executeParser() } if($_REQUEST['q']=='index.php') $_REQUEST['q'] = ''; - if(0 < count($_POST)) $this->config['cache_type'] = 0; + if(0 < count($_POST) && empty($id)) $this->config['cache_type'] = 0; - $this->documentOutput = $this->get_static_pages(); - if(!empty($this->documentOutput)) + if(empty($id)) { - $this->documentOutput = $this->parseDocumentSource($this->documentOutput); - $this->invokeEvent('OnWebPagePrerender'); - echo $this->documentOutput; - $this->invokeEvent('OnWebPageComplete'); - exit; + $this->documentOutput = $this->get_static_pages(); + if(!empty($this->documentOutput)) + { + $this->documentOutput = $this->parseDocumentSource($this->documentOutput); + $this->invokeEvent('OnWebPagePrerender'); + echo $this->documentOutput; + $this->invokeEvent('OnWebPageComplete'); + exit; + } } // IIS friendly url fix @@ -373,10 +387,13 @@ function prepareResponse() // Parse document source $this->documentContent= $this->parseDocumentSource($this->documentContent); } - register_shutdown_function(array ( - & $this, - 'postProcess' - )); // tell PHP to call postProcess when it shuts down + if($this->directParse==0) + { + register_shutdown_function(array ( + & $this, + 'postProcess' + )); // tell PHP to call postProcess when it shuts down + } $result = $this->outputContent(); return $result; }