[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 <?php 2 /* +*********************************************************************************** 3 * The contents of this file are subject to the vtiger CRM Public License Version 1.0 4 * ("License"); You may not use this file except in compliance with the License 5 * The Original Code is: vtiger CRM Open Source 6 * The Initial Developer of the Original Code is vtiger. 7 * Portions created by vtiger are Copyright (C) vtiger. 8 * All Rights Reserved. 9 * *********************************************************************************** */ 10 11 class Rss_Module_Model extends Vtiger_Module_Model { 12 13 /** 14 * Function to get the Quick Links for the module 15 * @param <Array> $linkParams 16 * @return <Array> List of Vtiger_Link_Model instances 17 */ 18 public function getSideBarLinks($linkParams) { 19 $linkTypes = array('SIDEBARLINK', 'SIDEBARWIDGET'); 20 $links = Vtiger_Link_Model::getAllByType($this->getId(), $linkTypes, $linkParams); 21 22 $quickLinks = array( 23 array( 24 'linktype' => 'SIDEBARLINK', 25 'linklabel' => 'LBL_ADD_FEED_SOURCE', 26 'linkurl' => $this->getDefaultUrl(), 27 'linkicon' => '', 28 ) 29 ); 30 foreach($quickLinks as $quickLink) { 31 $links['SIDEBARLINK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink); 32 } 33 $quickWidgets = array( 34 array( 35 'linktype' => 'SIDEBARWIDGET', 36 'linklabel' => 'LBL_RSS_FEED_SOURCES', 37 'linkurl' => 'module='.$this->get('name').'&view=ViewTypes&mode=getRssWidget', 38 'linkicon' => '' 39 ), 40 ); 41 foreach($quickWidgets as $quickWidget) { 42 $links['SIDEBARWIDGET'][] = Vtiger_Link_Model::getInstanceFromValues($quickWidget); 43 } 44 45 return $links; 46 } 47 48 /** 49 * Function to get rss sources list 50 */ 51 public function getRssSources() { 52 $db = PearDatabase::getInstance(); 53 54 $sql = 'Select *from vtiger_rss'; 55 $result = $db->pquery($sql, array()); 56 $noOfRows = $db->num_rows($result); 57 58 $records = array(); 59 for($i=0; $i<$noOfRows; ++$i) { 60 $row = $db->query_result_rowdata($result, $i); 61 $row['id'] = $row['rssid']; 62 $records[$row['id']] = $this->getRecordFromArray($row); 63 } 64 return $records; 65 } 66 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |