diff --git a/assets/plugins/managermanager/mm.inc.php b/assets/plugins/managermanager/mm.inc.php index 71dc53cbb1..79782947c7 100755 --- a/assets/plugins/managermanager/mm.inc.php +++ b/assets/plugins/managermanager/mm.inc.php @@ -115,7 +115,7 @@ ); // Add in TVs to the list of available fields -$all_tvs = $modx->db->makeArray($modx->db->select('name,type,id', $modx->getFullTableName('site_tmplvars'), '', 'name ASC')); +$all_tvs = $modx->db->makeArray($modx->db->select('name,type,id', $modx->db->config['table_prefix'].'site_tmplvars', '', 'name ASC')); foreach ($all_tvs as $thisTv){ // What is the field name? $n = $thisTv['name']; @@ -210,13 +210,13 @@ function initJQddManagerManager(){ case 'OnPluginFormRender': // The ID of the plugin we're editing $plugin_id_editing = $e->params['id']; - $result = $modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$plugin_id_editing}'"); + $result = $modx->db->select('name', $modx->db->config['table_prefix'].'site_plugins', "id='{$plugin_id_editing}'"); $plugin_editing_name = $modx->db->getValue($result); // if it's the right plugin if (strtolower($plugin_editing_name) == 'managermanager'){ // Get all templates - $result = $modx->db->select('templatename, id, description', $modx->getFullTableName('site_templates'), '', 'templatename ASC'); + $result = $modx->db->select('templatename, id, description', $modx->db->config['table_prefix'].'site_templates', '', 'templatename ASC'); $all_templates = $modx->db->makeArray($result); $template_table = ''; @@ -235,7 +235,7 @@ function initJQddManagerManager(){ $template_table .= '
'; // Get all tvs - $result = $modx->db->select('name,caption,id', $modx->getFullTableName('site_tmplvars'), '', 'name ASC'); + $result = $modx->db->select('name,caption,id', $modx->db->config['table_prefix'].'site_tmplvars', '', 'name ASC'); $all_tvs = $modx->db->makeArray($result); $tvs_table = ''; $tvs_table .= ''; @@ -252,7 +252,7 @@ function initJQddManagerManager(){ $tvs_table .= '
TV nameTV captionID
'; // Get all roles - $result = $modx->db->select('name, id', $modx->getFullTableName('user_roles'), '', 'name ASC'); + $result = $modx->db->select('name, id', $modx->db->config['table_prefix'].'user_roles', '', 'name ASC'); $all_roles = $modx->db->makeArray($result); $roles_table = ''; diff --git a/assets/plugins/managermanager/modx.ddtools.class.php b/assets/plugins/managermanager/modx.ddtools.class.php index 6fc8e2aa77..9da24fb8b1 100755 --- a/assets/plugins/managermanager/modx.ddtools.class.php +++ b/assets/plugins/managermanager/modx.ddtools.class.php @@ -488,8 +488,8 @@ public static function getDocuments($ids = array(), $published = false, $deleted }else{ $limit = ($limit != "") ? "LIMIT $limit" : ""; // LIMIT capabilities - rad14701 // modify field names to use sc. table reference - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); - $sort = ($sort == "") ? "" : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); + $fields = 'sc.' . implode(',sc.', preg_replace("/^\s/i", "", explode(',', $fields))); + $sort = ($sort == "") ? "" : 'sc.' . implode(',sc.', preg_replace("/^\s/i", "", explode(',', $sort))); if ($where != ''){ $where = 'AND '.$where; @@ -592,8 +592,8 @@ public static function getTemplateVars($idnames = array(), $fields = "*", $docid } // get user defined template variables - $fields = ($fields == "") ? "tv.*" : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $fields)))); - $sort = ($sort == "") ? "" : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $sort)))); + $fields = ($fields == "") ? "tv.*" : 'tv.'.implode(',tv.', preg_replace("/^\s/i", "", explode(',', $fields))); + $sort = ($sort == "") ? "" : 'tv.'.implode(',tv.', preg_replace("/^\s/i", "", explode(',', $sort))); if ($idnames == "*"){ $query = "tv.id<>0"; @@ -716,8 +716,8 @@ public static function getDocumentChildren($parentid = 0, $published = 1, $delet } // modify field names to use sc. table reference - $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); - $sortBy = ($sortBy == "") ? "" : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sortBy)))); + $fields = 'sc.'.implode(',sc.', preg_replace("/^\s/i", "", explode(',', $fields))); + $sortBy = ($sortBy == "") ? "" : 'sc.'.implode(',sc.', preg_replace("/^\s/i", "", explode(',', $sortBy))); // get document groups for current user if ($docgrp = $modx->getUserDocGroups()){ diff --git a/assets/plugins/managermanager/widgets/showimagetvs/showimagetvs.php b/assets/plugins/managermanager/widgets/showimagetvs/showimagetvs.php index c7ba1f7e55..8146faf4c5 100755 --- a/assets/plugins/managermanager/widgets/showimagetvs/showimagetvs.php +++ b/assets/plugins/managermanager/widgets/showimagetvs/showimagetvs.php @@ -65,9 +65,8 @@ function mm_widget_showimagetvs($tvs = '', $w = 300, $h = 100, $thumbnailerUrl = '; // If we have a PHPThumb URL - $thumbnailerCode = ''; if (!empty($thumbnailerUrl)){ - $thumbnailerCode = 'url = "'.$thumbnailerUrl.'?src="+escape(url)+"&w='.$w.'&h='.$h.'"; ' . "\n"; + $output .= 'url = "'.$thumbnailerUrl.'?src="+escape(url)+"&w='.$w.'&h='.$h.'"; ' . "\n"; } $output .= ' @@ -76,7 +75,6 @@ function mm_widget_showimagetvs($tvs = '', $w = 300, $h = 100, $thumbnailerUrl = if (url != ""){ // Create a new preview - '.$thumbnailerCode.' $j("#tv'.$tv['id'].'").parents("td").append("
"); // Attach a browse event to the picture, so it can trigger too diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index e87ded7eda..7be6d2778c 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -2303,7 +2303,7 @@ function makeUrl($id, $alias= '', $args= '', $scheme= '') { $f_url_prefix = $this->config['friendly_url_prefix']; $f_url_suffix = $this->config['friendly_url_suffix']; if (!is_numeric($id)) { - $this->messageQuit('`{$id}` is not numeric and may not be passed to makeUrl().'); + $this->messageQuit('`' . $id . '` is not numeric and may not be passed to makeUrl()'); } if ($args != '' && $this->config['friendly_urls'] == 1) { // add ? to $args if missing @@ -2766,8 +2766,8 @@ function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $publis "{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id - LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'" - "{$query} AND tvtpl.templateid = '{$docRow['template']}'", + LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}' + {$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : "") ); diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php index 8249f5abda..4b9a3da0e8 100755 --- a/manager/includes/tmplvars.inc.php +++ b/manager/includes/tmplvars.inc.php @@ -316,7 +316,7 @@ function ParseIntputOptions($v) { $a = array(); if(is_array($v)) return $v; else if(is_resource($v)) { - $a = $modx->db->makeArray($v); + while ($cols = $modx->db->getRow($v,'num')) $a[] = $cols; } else $a = explode("||", $v); return $a;