Project

General

Profile

Bug #3293 » 3293.patch

krileon, 20 February 2012 17:20

View differences:

components/com_comprofiler/plugin/user/plug_pms_mypmspro/pms.mypmspro.php
* @return mixed array of string {"caption" => menu-text ,"url" => NON-cbSef relative url-link, "tooltip" => description} or false and errorMSG
*/
function getPMSlink($toid, $fromid, $subject, $message, $kind) {
global $_CB_database;
global $_CB_framework, $_CB_database;
$params = $this->params;
$pmsType = $params->get('pmsType', '1');
......
$pmsurlBase="index.php?option=com_pms";
$pmsurlSend=$pmsurlBase."&page=new&id=".urlencode($rowTo->username);
$pmsurlInbox=$pmsurlBase."&page=index";
$query_pms_link = "SELECT id FROM #__menu WHERE published>=0 AND link LIKE '%com_pms%'";
break;
case 2: //PMS Pro
$rowTo = new moscomprofilerUser( $_CB_database );
......
$pmsurlOutbox=$pmsurlBase."&task=sent";
$pmsurlTrashbox=$pmsurlBase."&task=trash";
$pmsurlOptions=$pmsurlBase."&task=editprofile";
$query_pms_link = "SELECT id FROM #__menu WHERE published>=0 AND link LIKE '%com_mypms%'";
break;
case 3: //UddeIM 0.4
$pmsurlBase="index.php?option=com_uddeim";
......
$pmsurlInbox=$pmsurlBase."&task=inbox";
$pmsurlOutbox=$pmsurlBase."&task=outbox";
$pmsurlTrashbox=$pmsurlBase."&task=trashcan";
$query_pms_link = "SELECT id FROM #__menu WHERE published>=0 AND link LIKE '%com_uddeim%'";
break;
case 4: //UddeIM 1.0
$pmsurlBase="index.php?option=com_uddeim";
......
$pmsurlOutbox=$pmsurlBase."&task=outbox";
$pmsurlTrashbox=$pmsurlBase."&task=trashcan";
$pmsurlOptions=$pmsurlBase."&task=settings";
$query_pms_link = "SELECT id FROM #__menu WHERE published>=0 AND link LIKE '%com_uddeim%'";
break;
case 5: //PMS enhanced 2.x by Stefan Klingner
$rowTo = new moscomprofilerUser( $_CB_database );
......
$pmsurlOutbox=$pmsurlBase."&page=sent_items";
$pmsurlTrashbox=$pmsurlBase."&page=trash";
$pmsurlOptions=$pmsurlBase."&page=settings";
$query_pms_link = "SELECT id FROM #__menu WHERE published>=0 AND link LIKE '%com_pms%'";
break;
case 6: //JIM 1.0.1
$rowTo = new moscomprofilerUser( $_CB_database );
......
$pmsurlBase="index.php?option=com_jim";
$pmsurlSend=$pmsurlBase."&page=new&id=".urlencode($rowTo->username);
$pmsurlInbox=$pmsurlBase."&page=index";
$query_pms_link = "SELECT id FROM #__menu WHERE published>=0 AND link LIKE '%com_jim%'";
break;
default:
$this->_setErrorMSG("Incorrect PMS type");
return false;
break;
}
$_CB_database->setQuery( $query_pms_link );
$pms_id = $_CB_database->loadResult();
$query = 'SELECT ' . $_CB_database->NameQuote( 'id' )
. "\n FROM " . $_CB_database->NameQuote( '#__menu' )
. "\n WHERE " . $_CB_database->NameQuote( 'link' ) . " LIKE " . $_CB_database->Quote( $pmsurlBase . '%', false )
. "\n AND " . $_CB_database->NameQuote( 'published' ) . " = 1"
. "\n AND " . $_CB_database->NameQuote( 'access' ) . " IN ( " . implode( ',', cbArrayToInts( CBuser::getMyInstance()->getAuthorisedViewLevelsIds( ( checkJversion() >= 2 ? false : true ) ) ) ) . " )"
. ( checkJversion() >= 2 ? "\n AND " . $_CB_database->NameQuote( 'language' ) . " IN ( " . $_CB_database->Quote( $_CB_framework->getCfg( 'lang_tag' ) ) . ", '*', '' )" : null );
$_CB_database->setQuery( $query );
$pms_id = $_CB_database->loadResult();
if ($pms_id) {
$pmsitemid = "&Itemid=".$pms_id;
} else {
(1-1/2)