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"; 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/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 @@ -
[+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 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 8c0e13fe2b..a3377a323d 100644 --- a/assets/plugins/tinymce/lang/japanese-utf8.inc.php +++ b/assets/plugins/tinymce/lang/japanese-utf8.inc.php @@ -4,15 +4,15 @@ * 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'] = 'テーマ:'; $_lang['mce_editor_theme_message'] = 'テーマを選択し、ツールバーアイコンのセットおよびエディタのデザインを変更できます。'; $_lang['mce_editor_custom_plugins_title'] = 'カスタムテーマのプラグイン設定:'; -$_lang['mce_editor_custom_plugins_message'] = 'カスタムテーマを選択したときに利用するプラグインをカンマ(,)で区切って記述します。 デフォルト値 : visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen,advimage,paste,advlink,media,contextmenu,table'; +$_lang['mce_editor_custom_plugins_message'] = 'カスタムテーマを選択したときに利用するプラグインをカンマ(,)で区切って記述します。 デフォルト値 : template,visualblocks,autolink,inlinepopups,autosave,save,advlist,style,fullscreen, advimage,paste,advlink,media,contextmenu,table'; $_lang['mce_editor_custom_buttons_title'] = 'カスタムボタン:'; $_lang['mce_editor_custom_buttons_message'] = 'カスタムテーマを選択したときに利用するボタンをカンマ(,)で区切ってそれぞれの行に記述します。セパレータは「separator」または「|」と記述します。プラグインによって機能が提供されるボタンは、プラグイン指定も必要です。詳細についてはTinyMCE開発元の公式ドキュメントのControl referenceのページをご確認ください。'; $_lang['mce_editor_css_selectors_title'] = 'CSSスタイルセレクタ:'; @@ -38,5 +38,10 @@ $_lang['mce_schema_title'] = 'スキーマ'; $_lang['mce_schema_message'] = 'スキーマを選択します。'; -$_lang['mce_toolbar1_msg'] = 'デフォルト値 : undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,fontsizeselect,pastetext,pasteword,code,|, fullscreen,help'; -$_lang['mce_toolbar2_msg'] = 'デフォルト値 : image,media,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|, blockquote,outdent,indent,|,table,hr,|,visualblocks,styleprops,removeformat'; +$_lang['mce_toolbar1_msg'] = 'デフォルト値 : undo,redo,|,bold,forecolor,backcolor,strikethrough,formatselect,fontsizeselect, pastetext,pasteword,code,|,fullscreen,help'; +$_lang['mce_toolbar2_msg'] = 'デフォルト値 : image,media,link,unlink,anchor,|,justifyleft,justifycenter,justifyright,|,bullist, numlist,|,blockquote,outdent,indent,|,table,hr,|,template,visualblocks,styleprops,removeformat'; + +$_lang['mce_tpl_title'] = 'テンプレート挿入'; +$_lang['mce_tpl_msg'] = 'あらかじめ登録しておいたHTMLブロックをツールバーから挿入できます。HTMLブロックはリソースまたはチャンクとして作成し、カンマで区切って複数指定できます。'; +$_lang['mce_tpl_docid'] = 'リソースID'; +$_lang['mce_tpl_chunkname'] = 'チャンク名'; \ No newline at end of file diff --git a/assets/plugins/tinymce/settings/default_params.php b/assets/plugins/tinymce/settings/default_params.php index 3e9b1a1b15..b1a7fc57dc 100644 --- a/assets/plugins/tinymce/settings/default_params.php +++ b/assets/plugins/tinymce/settings/default_params.php @@ -9,6 +9,8 @@ $ph['custom_buttons2'] = $params['custom_buttons2']; $ph['custom_buttons3'] = $params['custom_buttons3']; $ph['custom_buttons4'] = $params['custom_buttons4']; + $ph['mce_template_docs'] = $params['mce_template_docs']; + $ph['mce_template_chunks'] = $params['mce_template_chunks']; $ph['css_selectors'] = (!isset($params['css_selectors'])) ? $css_selectors : $params['css_selectors']; $ph['mce_entermode'] = (empty($params['mce_entermode'])) ? 'p' : $params['mce_entermode']; $ph['mce_schema'] = (empty($params['mce_schema'])) ? 'html4' : $params['mce_schema']; 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/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) { " . $_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 ' '; @@ -401,7 +398,18 @@ function mkd($path) { // if(ini_get('safe_mode') !=0) return; - $rs = @mkdir($path, true); - if($rs) $rs = @chmod($path, 0777); + if(!is_dir($path)) + { + $rs = @mkdir($path, true); + if($rs) $rs = @chmod($path, 0777); + } + + 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; } 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','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'); 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/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] = '' . to_safestr($content['description']) . ''; $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) @@ -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 ?> @@ -518,16 +514,10 @@ function changeRTE() { | ||
| - - | -- - - | -||
| @@ -946,6 +936,11 @@ function changeRTE() { | |||
| + | |||
| [+head+] |
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)
|
||
| + |
+ + + + |
+||
|
|
|||
| diff --git a/manager/actions/search.static.php b/manager/actions/search.static.php index bfde1f8c5d..37189c017f 100644 --- a/manager/actions/search.static.php +++ b/manager/actions/search.static.php @@ -82,7 +82,7 @@ $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url); if($url[0]==='/') $url = preg_replace('@^' . $base_url . '@', '', $url); if(substr($url,0,4)==='http') $url = preg_replace('@^' . $site_url . '@', '', $url); - $searchid = $modx->getDocumentListing($url); + $searchid = $modx->getIdFromAlias($url); if (empty($searchid)) $searchid = 'x'; } 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); diff --git a/manager/includes/controls/datagrid.class.php b/manager/includes/controls/datagrid.class.php index 5f1a18fcf9..e072688041 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 { @@ -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)) + { + $this->_fieldnames = explode(',', $this->fields); + foreach($this->_fieldnames as $i=>$v) + { + $this->_fieldnames[$i] = trim($v); + } + } + else { - $cinfo = mysql_fetch_field($this->ds,$i); - $this->_fieldnames[$i] = $cinfo->name; + $tblc = mysql_num_fields($this->ds); + for($i=0;$i<$tblc;$i++) + { + $cinfo = mysql_fetch_field($this->ds,$i); + $this->_fieldnames[$i] = $cinfo->name; + } } } diff --git a/manager/includes/default.config.php b/manager/includes/default.config.php index 33a239b913..7258d44cfa 100644 --- a/manager/includes/default.config.php +++ b/manager/includes/default.config.php @@ -89,6 +89,8 @@ $default_config['websignupemail_message'] = $_lang['system_email_websignup']; $default_config['webpwdreminder_message'] = $_lang['system_email_webreminder']; +$default_config['enable_bindings'] = '0'; + if(!function_exists('mysql_set_charset')) { $_lang['settings_after_install'] .= ' | |||