[Vtigercrm-commits] [vtiger-commits] r4966 - in /vtigercrm/trunk/modules/Rss: ListView.php Rss.js Rss.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 6 13:16:58 EDT 2006


Author: don
Date: Thu Apr  6 11:16:52 2006
New Revision: 4966

Log:
changes made to integrate new UI for Rss

Modified:
    vtigercrm/trunk/modules/Rss/ListView.php
    vtigercrm/trunk/modules/Rss/Rss.js
    vtigercrm/trunk/modules/Rss/Rss.php

Modified: vtigercrm/trunk/modules/Rss/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Rss/ListView.php (original)
+++ vtigercrm/trunk/modules/Rss/ListView.php Thu Apr  6 11:16:52 2006
@@ -8,8 +8,8 @@
  * All Rights Reserved.
 *
  ********************************************************************************/
-require_once('XTemplate/xtpl.php');
 require_once("data/Tracker.php");
+require_once('Smarty_setup.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/logging.php');
 require_once('include/ListView/ListView.php');
@@ -35,7 +35,7 @@
 	$recordid = $_REQUEST[record];
 }
 
-$rss_form=new XTemplate ('modules/Rss/ListView.html');
+$rss_form = new vtigerCRM_Smarty;
 $rss_form->assign("MOD", $mod_strings);
 $rss_form->assign("APP", $app_strings);
 $rss_form->assign("IMAGEPATH",$image_path);
@@ -46,7 +46,7 @@
 $oRss = new vtigerRSS();
 if(isset($_REQUEST[record]))
 {
-        $recordid = $_REQUEST[record];
+    $recordid = $_REQUEST[record];
 	$url = $oRss->getRssUrlfromId($recordid);
 	if($oRss->setRSSUrl($url))
 	{
@@ -55,6 +55,7 @@
 	{
         	$rss_html = "<strong>No RSS Feeds are selected</strong>";
 	}
+	$rss_form->assign("TITLE",gerRssTitle($recordid));
 }else
 {
 	$rss_html = $oRss->getStarredRssHTML();
@@ -64,29 +65,23 @@
 	require_once("modules/".$currentModule."/Forms.php");
 	if (function_exists('get_rssfeeds_form'))
 	{
-		$rss_form->assign("RSSFEEDS_TITLE","<br><div style='float:left'><a href='javascript:openPopUp(\"addRssFeedIns\",this,\"index.php?action=Popup&module=Rss\",\"addRssFeedWin\",350,150,\"menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes\");' title='".$app_strings['LBL_ADD_RSS_FEEDS']."'>Add<img src='".$image_path."/addrss.gif' border=0 align=absmiddle></a>&nbsp;</div>");
+		$rss_form->assign("RSSFEEDS_TITLE","<img src='".$image_path."rssroot.gif' align='absmiddle'/>&nbsp;<a href='javascript:openPopUp(\"addRssFeedIns\",this,\"index.php?action=Popup&module=Rss\",\"addRssFeedWin\",350,150,\"menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes\");' title='".$app_strings['LBL_ADD_RSS_FEEDS']."'>Add RSS Feed</a>");
 		$rss_form->assign("RSSFEEDS", get_rssfeeds_form());
 	}
 }
 
 
-
-//$all_rss_html = $oRss->getAllRssFeeds();
-//$stared_rss_html = $oRss->getStaredRssFeeds();
-//$crm_rss_html = $oRss->getCRMRssFeeds();
-//$category_rss_html = $oRss->getRSSCategoryHTML();
-//$top_stared_rss_html = $oRss->getTopStarredRSSFeeds();
-//print_r($rss_hdr_html);
-//$rss_form->assign("TOPSTARSSFEEDS",$top_stared_rss_html);
-//$rss_form->assign("RSSHEADERDETAILS",$rss_hdr_html);
 $rss_form->assign("RSSDETAILS",$rss_html);
-//$rss_form->assign("ALLRSSFEEDS",$all_rss_html);
-//$rss_form->assign("STAREDFEEDS",$stared_rss_html);
-//$rss_form->assign("CRMRSSFEEDS",$crm_rss_html);
-//$rss_form->assign("CATEGORYFEEDS",$category_rss_html);
 //<<<<<<<<<<<<<<lastrss>>>>>>>>>>>>>>>>>>//
 
-$rss_form->parse("main");
-$rss_form->out("main");
-
+$rss_form->display("Rss.tpl");
+function gerRssTitle($id)
+{
+	global $adb;
+	$query = 'select * from rss where rssid ='.$id;	 
+	$result = $adb->query($query);	
+	$title = $adb->query_result($result,0,'rsstitle');
+	return $title;
+	
+}
 ?>

Modified: vtigercrm/trunk/modules/Rss/Rss.js
==============================================================================
--- vtigercrm/trunk/modules/Rss/Rss.js (original)
+++ vtigercrm/trunk/modules/Rss/Rss.js Thu Apr  6 11:16:52 2006
@@ -53,4 +53,8 @@
         }
         return true;
 }
-
+function display(url,list)
+{
+	document.getElementById('rsstitle').innerHTML = list;
+	document.getElementById('mysite').src = url;
+}

Modified: vtigercrm/trunk/modules/Rss/Rss.php
==============================================================================
--- vtigercrm/trunk/modules/Rss/Rss.php (original)
+++ vtigercrm/trunk/modules/Rss/Rss.php Thu Apr  6 11:16:52 2006
@@ -99,7 +99,7 @@
 			foreach($this->rss_object as $key=>$item)
                 	{
 			   $i = $i + 1;	   
-			   $shtml .= "<li><a href=\"$item[link]\" class=\"rssNews\" target=\"_blank\">$item[title]</a></li>";
+			   $shtml .= "<li><a href=\"javascript:display('".$item[link]."','".$item[title]."')\"; class=\"rssNews\">$item[title]</a></li>";
 			   if($i == 10)
 			   {
 				return $shtml;
@@ -320,7 +320,7 @@
 			   <table class=\"formOuterBorder\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\">			       <tr><td class=\"formSecHeader\">";    
 		$shtml .= "<img src=\"".$image_path."onstar.gif\" align=\"absmiddle\" onMouseOver=\"this.style.cursor='pointer'\" id=\"star-$allrssrow[rssid]\" onclick=\"star('$allrssrow[rssid]','0')\"> 
 			   <span style=\"font-weight:normal\">Today at</span>";
-                $shtml .= " <a href=\"$this->rss_link\" target=\"_blank\">".$allrssrow['rsstitle']."</a>";
+                $shtml .= " <a href=\"javascript:display('".$this->rss_link."',this)\";>".$allrssrow['rsstitle']."</a>";
 		$shtml .= "</td></tr>";
 		$shtml .= "<tr><td style=\"padding-top:10\"><ul>".$rss_html."</ul></td></tr>";
 		if(isset($this->rss_object))
@@ -328,7 +328,7 @@
 		 	if(count($this->rss_object) > 10)
 			{
 		  		$shtml .= "<tr><td align=\"right\">
-				  	   <a target=\"_BLANK\" href=\"$this->rss_link\">More...</a>
+				  	   <a href=\"javascript:display('".$this->rss_link."',this)\";>More...</a>
 		  		           </td></tr>";
 			}
 		 }
@@ -374,7 +374,7 @@
                 {
         $shtml .= "<img src=\"".$image_path."offstar.gif\" align=\"absmiddle\" onMouseOver=\"this.style.cursor='pointer'\" id=\"star-$allrssrow[rssid]\" onclick=\"star('$allrssrow[rssid]','1')\"> <span style=\"font-weight:normal\">Today at</span> ";
                 }
-		 $shtml .= " <a href=\"$this->rss_link\" target=\"_blank\">".$allrssrow['rsstitle']."</a>";
+		 $shtml .= " <a href=\"javascript:display('".$this->rss_link."',this)\";>".$allrssrow['rsstitle']."</a>";
 		 $shtml .= "</td></tr>";
 		 $shtml .= "<tr><td style=\"padding-top:10\"><ul>".$rss_html."</ul></td></tr>";
 		 }
@@ -383,7 +383,7 @@
                         if(count($this->rss_object) > 10)
                         {
                                 $shtml .= "<tr><td align=\"right\">
-                                           <a target=\"_BLANK\" href=\"$this->rss_link\">More...</a>
+                                           <a href=\"javascript:display('".$this->rss_link."',this)\";>More...</a>
                                            </td></tr>";
                         }
                  }





More information about the vtigercrm-commits mailing list