Hello!
This is a problem I had with TinyMCE 2.0.8 but now when I upgraded to Evo1.0.0 and TinyMCE3.2.4.1 so it works no longer with the same changes.
View previous
topic. Sorry I forgot to write a reply in that topic. But it worked after the changes.
I want my user to have their own links in the list of links in TinyMCE. Some one who can help me with this, or help me in the right direction.
Have changed in tinymce.linklist.php
<?php
//-----------------------------------------
require_once ("../../../manager/includes/protect.inc.php");
//-----------------------------------------
include_once ("../../../manager/includes/config.inc.php");
//-----------------------------------------
include_once(MODX_BASE_PATH."manager/includes/document.parser.class.inc.php");
$modx = new DocumentParser;
startCMSSession();
//-----------------------------------------
$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 $database_type;
global $database_server;
global $database_user;
global $database_password;
global $dbase;
global $table_prefix;
//-----------------------------------------
global $modx;
$usid = $modx->getLoginUserID('mgr');
//-----------------------------------------
$tblsc = $dbase.".`".$table_prefix."site_content`";
$tbldg = $dbase.".`".$table_prefix."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)));
// Connecting, selecting database
$link = mysql_connect($database_server, $database_user, $database_password) or die('Could not connect: ' . mysql_error());
mysql_select_db(str_replace('`', '', $dbase)) or die('Could not select database');
@mysql_query("{$GLOBALS['database_connection_method']} {$GLOBALS['database_connection_charset']}");
// ------------------------------------------------------------
$sql = "SELECT DISTINCT $fields FROM $tblsc sc
LEFT JOIN $tbldg dg on dg.document = sc.id
WHERE sc.published=1 AND sc.deleted=0 AND sc.editedby ='$usid'
ORDER BY $sort $dir;";
//-----------------------------------------
/*
//
$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 = mysql_query($sql) or die('Query failed: ' . mysql_error());
$resourceArray = array();
for($i=0;$i<@mysql_num_rows($result);$i++) {
array_push($resourceArray,mysql_fetch_assoc($result));
}
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
sort($resourceArray);
return $resourceArray;
}
?>
rows between //----------------------------------------- are changed or added.
Would be very grateful if someone can help me with this.
// Peter