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 @@ - +
@@ -23,6 +23,16 @@ textarea.mce {width:95%;height:40px;display:block;}
[+mce_editor_skin_message+]
+ + + + + + ' . to_safestr($content['introtext']) . ''; +$body .= tooltip($_lang['resource_summary_help']); +renderTr($_lang['resource_summary'],$body,'vertical-align:top;'); ?> - - - - @@ -1542,16 +1537,17 @@ 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 - - + + + + + + + + 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'] .= '
この環境では日本語以外の文字(中国語・韓国語・一部の機種依存文字など)を入力できません。対応が必要な場合は、サーバ環境のUTF-8エンコードの扱いを整備したうえで、dbapi.mysql.class.inc.phpのescape関数の処理を書き換えてください。mb_convert_encodingの処理を行なっている行が2行ありますので、これを削除します。'; diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 1f4de59885..d54da546e9 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -54,7 +54,8 @@ class DocumentParser { var $cacheRefreshTime; 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); @@ -147,6 +148,8 @@ function executeParser() set_error_handler(array(& $this,'phpError')); } + $this->http_status_code = '200'; + if(!empty($_SERVER['QUERY_STRING'])) { $qs = $_GET; @@ -156,9 +159,19 @@ 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(!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'])); @@ -166,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 @@ -252,9 +268,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 +279,7 @@ function executeParser() } else { - $this->documentIdentifier= $this->getDocumentListing($this->documentIdentifier); + $this->documentIdentifier= $this->getIdFromAlias($this->documentIdentifier); } $this->documentMethod= 'id'; } @@ -277,7 +293,7 @@ function executeParser() case $this->config['unauthorized_page']: break; default: - if($this->getDocumentListing($alias)===false) $this->sendErrorPage(); + if($this->getIdFromAlias($alias)===false) $this->sendErrorPage(); } } @@ -304,7 +320,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 +328,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 +341,7 @@ function prepareResponse() // Doesn't have access to this document if (!$udperms->checkPermissions()) { - $this->sendErrorPage(); + if($this->http_status_code == '200') $this->sendErrorPage(); } } } @@ -371,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; } @@ -539,6 +558,21 @@ function postProcess() $filename = md5($_SERVER['REQUEST_URI']); break; } + + switch($this->http_status_code) + { + case '404': + case '403': + $filename = md5($this->makeUrl($docid)); + 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); } @@ -651,6 +685,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 +699,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'); } @@ -959,13 +995,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 +1776,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 @@ -2238,19 +2274,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 @@ -3807,7 +3858,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 +3873,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) 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!=='') 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/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文の実行などが可能なため、複数メンバーでサイトを運用する場合、当機能の運用には注意が必要です。'; 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() 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 @@ db->escape($_POST['fullname']); $genpassword = $_POST['newpassword']; $passwordgenmethod = $_POST['passwordgenmethod']; @@ -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; @@ -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,60 +102,64 @@ } // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array ( - "mode" => "new", - "id" => $id + $modx->invokeEvent('OnBeforeWUsrFormSave', array ( + 'mode' => 'new', + 'id' => $id )); // 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, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname + $modx->invokeEvent('OnWebSaveUser', array ( + 'mode' => 'new', + 'userid' => $internalKey, + 'username' => $newusername, + 'userpassword' => $newpassword, + 'useremail' => $email, + 'userfullname' => $fullname )); // invoke OnWUsrFormSave event - $modx->invokeEvent("OnWUsrFormSave", array ( - "mode" => "new", - "id" => $key + $modx->invokeEvent('OnWUsrFormSave', array ( + 'mode' => 'new', + '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; } @@ -167,27 +171,27 @@ 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 { 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"; + $stayUrl = 'index.php?a=99'; } - include_once "header.inc.php"; + include_once 'header.inc.php'; ?>

@@ -195,18 +199,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 +249,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,38 +263,23 @@ } // 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; } - $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; } @@ -299,28 +288,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 +317,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 +374,7 @@ } break; default : - webAlert("Unauthorized access"); + webAlert('Unauthorized access'); exit; } @@ -406,7 +395,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 +406,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 +432,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 +440,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)];

[+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(0db->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; -} - 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 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) { [*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+] diff --git a/install/actions/summary.php b/install/actions/summary.php index b5be3a10ba..961f86a68a 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 '

'; @@ -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"; - $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; -} 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 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); 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'); 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] = ''; $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)
+
+
+ +
" title="" alt="" class="tooltip" onclick="alert(this.alt);" style="cursor:help" />