本文整理汇总了PHP中Vtiger_Link_Model::getAllByType方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Link_Model::getAllByType方法的具体用法?PHP Vtiger_Link_Model::getAllByType怎么用?PHP Vtiger_Link_Model::getAllByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Link_Model
的用法示例。
在下文中一共展示了Vtiger_Link_Model::getAllByType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDetailViewLinks
public function getDetailViewLinks($linkParams)
{
$linkTypes = array('DETAILVIEWBASIC', 'DETAILVIEW');
$moduleModel = $this->getModule();
$recordModel = $this->getRecord();
$recordId = $recordModel->getId();
$linkModelListDetails = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
//Mark all detail view basic links as detail view links.
//Since ui will be look ugly if you need many basic links
$detailViewBasiclinks = $linkModelListDetails['DETAILVIEWBASIC'];
unset($linkModelListDetails['DETAILVIEWBASIC']);
/*
if(Users_Privileges_Model::isPermitted($moduleName, 'Delete', $recordId) && $recordPermissionToEditView) {
$deletelinkModel = array(
'linktype' => 'DETAILVIEW',
'linklabel' => sprintf("%s %s", getTranslatedString('LBL_DELETE', $moduleName), vtranslate('SINGLE_'. $moduleName, $moduleName)),
'linkurl' => 'javascript:Vtiger_Detail_Js.deleteRecord("'.$recordModel->getDeleteUrl().'")',
'linkicon' => ''
);
$linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($deletelinkModel);
}
*/
if (!empty($detailViewBasiclinks)) {
foreach ($detailViewBasiclinks as $linkModel) {
// Remove view history, needed in vtiger5 to see history but not in vtiger6
if ($linkModel->linklabel == 'View History') {
continue;
}
$linkModelList['DETAILVIEW'][] = $linkModel;
}
}
return $linkModelList;
}
示例2: getListViewLinks
/**
* Function to get the list of listview links for the module
* @param <Array> $linkParams
* @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances
*/
public function getListViewLinks($linkParams)
{
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$moduleModel = $this->getModule();
$linkTypes = array('LISTVIEWBASIC', 'LISTVIEW', 'LISTVIEWSETTING');
$links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
$basicLinks = array();
$createPermission = Users_Privileges_Model::isPermitted($moduleModel->getName(), 'EditView');
if ($createPermission) {
$basicLinks[] = array('linktype' => 'LISTVIEWBASIC', 'linklabel' => 'LBL_ADD_RECORD', 'linkurl' => $moduleModel->getCreateRecordUrl(), 'linkicon' => '');
}
foreach ($basicLinks as $basicLink) {
$links['LISTVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink);
}
$advancedLinks = array();
foreach ($advancedLinks as $advancedLink) {
$links['LISTVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($advancedLink);
}
if ($currentUserModel->isAdminUser()) {
$settingsLinks = $this->getSettingLinks();
foreach ($settingsLinks as $settingsLink) {
$links['LISTVIEWSETTING'][] = Vtiger_Link_Model::getInstanceFromValues($settingsLink);
}
}
return $links;
}
示例3: getListViewMassActions
/**
* Function to get the list of Mass actions for the module
* @param <Array> $linkParams
* @return <Array> - Associative array of Link type to List of Vtiger_Link_Model instances for Mass Actions
*/
public function getListViewMassActions($linkParams)
{
$currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$moduleModel = $this->getModule();
$linkTypes = array('LISTVIEWMASSACTION');
$links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
//Opensource fix to make documents module mass editable
$massActionLinks = [];
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassEdit')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_EDIT', 'linkurl' => 'javascript:Vtiger_List_Js.triggerMassEdit("index.php?module=' . $moduleModel->get('name') . '&view=MassActionAjax&mode=showMassEditForm");', 'linkicon' => '');
}
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassDelete')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_DELETE', 'linkurl' => 'javascript:Vtiger_List_Js.massDeleteRecords("index.php?module=' . $moduleModel->getName() . '&action=MassDelete");', 'linkicon' => '');
}
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassMoveDocuments')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MOVE', 'linkurl' => 'javascript:Documents_List_Js.massMove("index.php?module=' . $moduleModel->getName() . '&view=MoveDocuments");', 'linkicon' => '');
}
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassTransferOwnership')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_TRANSFER_OWNERSHIP', 'linkurl' => 'javascript:Vtiger_List_Js.triggerTransferOwnership("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=transferOwnership")', 'linkicon' => '');
}
foreach ($massActionLinks as $massActionLink) {
$links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
}
return $links;
}
示例4: getEditViewLinks
/**
* Function to get the list of listview links for the module
* @param <Array> $linkParams
* @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances
*/
public function getEditViewLinks($linkParams)
{
global $log;
$log->debug("Entering ./models/EditView.php::getEditViewLinks");
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$linkTypes = array('LISTVIEWQUICK', 'LISTVIEWQUICKWIDGET', 'LISTVIEWBASIC', 'LISTVIEW', 'LISTVIEWSETTING');
$links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), $linkTypes, $linkParams);
$quickLinks = array(array('linktype' => 'LISTVIEWQUICK', 'linklabel' => 'Dashboard', 'linkurl' => $this->getModule()->getDefaultUrl(), 'linkicon' => ''), array('linktype' => 'LISTVIEWQUICK', 'linklabel' => $this->getModule()->get('label') . ' List', 'linkurl' => $this->getModule()->getDefaultUrl(), 'linkicon' => ''));
foreach ($quickLinks as $quickLink) {
$links['LISTVIEWQUICK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);
}
$quickWidgets = array(array('linktype' => 'LISTVIEWQUICKWIDGET', 'linklabel' => 'Active ' . $this->getModule()->get('label'), 'linkurl' => 'module=' . $this->getModule()->get('name') . '&view=List&mode=showActiveRecords', 'linkicon' => ''));
foreach ($quickWidgets as $quickWidget) {
$links['LISTVIEWQUICKWIDGET'][] = Vtiger_Link_Model::getInstanceFromValues($quickWidget);
}
$basicLinks = array(array('linktype' => 'LISTVIEWBASIC', 'linklabel' => 'Add ' . $this->getModule()->get('name'), 'linkurl' => $this->getModule()->getCreateRecordUrl(), 'linkicon' => ''));
foreach ($basicLinks as $basicLink) {
$links['LISTVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink);
}
$advancedLinks = array(array('linktype' => 'LISTVIEW', 'linklabel' => 'Import', 'linkurl' => $this->getModule()->getImportUrl(), 'linkicon' => ''), array('linktype' => 'LISTVIEW', 'linklabel' => 'Export', 'linkurl' => $this->getModule()->getExportUrl(), 'linkicon' => ''), array('linktype' => 'LISTVIEW', 'linklabel' => 'Find Duplicates', 'linkurl' => $this->getModule()->getFindDuplicatesUrl(), 'linkicon' => ''));
foreach ($advancedLinks as $advancedLink) {
$links['LISTVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($advancedLink);
}
if ($currentUserModel->isAdminUser()) {
$settingsLinks = array(array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'Edit Fields', 'linkurl' => $this->getModule()->getSettingsUrl('LayoutEditor'), 'linkicon' => ''), array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'Edit Workflows', 'linkurl' => $this->getModule()->getSettingsUrl('EditWorkflows'), 'linkicon' => ''), array('linktype' => 'LISTVIEWSETTING', 'linklabel' => 'Edit Picklist Values', 'linkurl' => $this->getModule()->getSettingsUrl('PicklistEditor'), 'linkicon' => ''));
foreach ($settingsLinks as $settingsLink) {
$links['LISTVIEWSETTING'][] = Vtiger_Link_Model::getInstanceFromValues($settingsLink);
}
}
return $links;
}
示例5: getListViewMassActions
/**
* Function to get the list of Mass actions for the module
* @param <Array> $linkParams
* @return <Array> - Associative array of Link type to List of Vtiger_Link_Model instances for Mass Actions
*/
public function getListViewMassActions($linkParams)
{
$currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$moduleModel = $this->getModule();
$linkTypes = array('LISTVIEWMASSACTION');
$links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
$massActionLinks = [];
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassEdit')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MASS_EDIT', 'linkurl' => 'javascript:Vtiger_List_Js.triggerMassEdit("index.php?module=' . $moduleModel->get('name') . '&view=MassActionAjax&mode=showMassEditForm");', 'linkicon' => '');
}
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassDelete')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MASS_DELETE', 'linkurl' => 'javascript:Vtiger_List_Js.massDeleteRecords("index.php?module=' . $moduleModel->get('name') . '&action=MassDelete");', 'linkicon' => '');
}
$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
if ($moduleModel->isCommentEnabled() && $modCommentsModel->isPermitted('EditView') && $currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassAddComment')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MASS_ADD_COMMENT', 'linkurl' => 'index.php?module=' . $moduleModel->get('name') . '&view=MassActionAjax&mode=showAddCommentForm', 'linkicon' => '');
}
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'MassTransferOwnership')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_TRANSFER_OWNERSHIP', 'linkurl' => 'javascript:Vtiger_List_Js.triggerTransferOwnership("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=transferOwnership")', 'linkicon' => '');
}
if ($linkParams['MODULE'] == 'Users' && $linkParams['ACTION'] == 'List' && is_admin($currentUserModel)) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_MASS_PWD_EDIT', 'linkurl' => 'javascript:Settings_Users_List_Js.triggerEditPasswords("index.php?module=Users&view=EditAjax&mode=editPasswords", "' . $linkParams['MODULE'] . '")', 'linkicon' => '');
}
foreach ($massActionLinks as $massActionLink) {
$links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
}
return $links;
}
示例6: getListViewMassActions
/**
* Overrided to remove Mass Edit Option
*/
public function getListViewMassActions($linkParams)
{
$currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$moduleModel = $this->getModule();
$linkTypes = array('LISTVIEWMASSACTION');
$links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
return $links;
}
示例7: getSideBarLinks
/**
* Function to get the Quick Links for the module
* @param <Array> $linkParams
* @return <Array> List of Vtiger_Link_Model instances
*/
public function getSideBarLinks($linkParams)
{
$linkTypes = array('SIDEBARLINK', 'SIDEBARWIDGET');
$links = Vtiger_Link_Model::getAllByType($this->getId(), $linkTypes, $linkParams);
$quickLinks = array(array('linktype' => 'SIDEBARLINK', 'linklabel' => 'LBL_RECORDS_LIST', 'linkurl' => $this->getDefaultUrl(), 'linkicon' => ''));
foreach ($quickLinks as $quickLink) {
$links['SIDEBARLINK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);
}
return $links;
}
示例8: getListViewLinks
/**
* Function to get the list of listview links for the module
* @param <Array> $linkParams
* @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances
*/
public function getListViewLinks($linkParams)
{
$linkTypes = array('LISTVIEWBASIC', 'LISTVIEW', 'LISTVIEWSETTING');
$links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), $linkTypes, $linkParams);
$basicLinks = array(array('linktype' => 'LISTVIEWBASIC', 'linklabel' => 'LBL_ADD_RECORD', 'linkurl' => $this->getModule()->getCreateRecordUrl(), 'linkicon' => ''));
foreach ($basicLinks as $basicLink) {
$links['LISTVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink);
}
return $links;
}
示例9: getListViewMassActions
/**
* Overrided to remove Mass Edit Option
*/
public function getListViewMassActions($linkParams)
{
$currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$moduleModel = $this->getModule();
$linkTypes = array('LISTVIEWMASSACTION');
$links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'Delete')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_DELETE', 'linkurl' => 'javascript:Vtiger_List_Js.massDeleteRecords("index.php?module=' . $moduleModel->get('name') . '&action=MassDelete");', 'linkicon' => '');
foreach ($massActionLinks as $massActionLink) {
$links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
}
}
return $links;
}
示例10: getSideBarLinks
/**
* Function to get the Quick Links for the module
* @param <Array> $linkParams
* @return <Array> List of Vtiger_Link_Model instances
*/
public function getSideBarLinks($linkParams)
{
$linkTypes = array('SIDEBARLINK', 'SIDEBARWIDGET');
$links = Vtiger_Link_Model::getAllByType($this->getId(), $linkTypes, $linkParams);
$quickLinks = array(array('linktype' => 'SIDEBARLINK', 'linklabel' => 'LBL_ADD_FEED_SOURCE', 'linkurl' => $this->getDefaultUrl(), 'linkicon' => ''));
foreach ($quickLinks as $quickLink) {
$links['SIDEBARLINK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);
}
$quickWidgets = array(array('linktype' => 'SIDEBARWIDGET', 'linklabel' => 'LBL_RSS_FEED_SOURCES', 'linkurl' => 'module=' . $this->get('name') . '&view=ViewTypes&mode=getRssWidget', 'linkicon' => ''));
foreach ($quickWidgets as $quickWidget) {
$links['SIDEBARWIDGET'][] = Vtiger_Link_Model::getInstanceFromValues($quickWidget);
}
return $links;
}
示例11: getSideBarLinks
/**
* Function to get the Quick Links for the Detail view of the module
* @param <Array> $linkParams
* @return <Array> List of Vtiger_Link_Model instances
*/
public function getSideBarLinks($linkParams)
{
$linkTypes = array('SIDEBARLINK', 'SIDEBARWIDGET');
$moduleLinks = $this->getModule()->getSideBarLinks($linkTypes);
$listLinkTypes = array('DETAILVIEWSIDEBARLINK', 'DETAILVIEWSIDEBARWIDGET');
$listLinks = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), $listLinkTypes);
if ($listLinks['DETAILVIEWSIDEBARLINK']) {
foreach ($listLinks['DETAILVIEWSIDEBARLINK'] as $link) {
$link->linkurl = $link->linkurl . '&record=' . $this->getRecord()->getId() . '&source_module=' . $this->getModule()->getName();
$moduleLinks['SIDEBARLINK'][] = $link;
}
}
if ($listLinks['DETAILVIEWSIDEBARWIDGET']) {
foreach ($listLinks['DETAILVIEWSIDEBARWIDGET'] as $link) {
$link->linkurl = $link->linkurl . '&record=' . $this->getRecord()->getId() . '&source_module=' . $this->getModule()->getName();
$moduleLinks['SIDEBARWIDGET'][] = $link;
}
}
return $moduleLinks;
}
示例12: getDetailViewLinks
/**
* Function to get the detail view links (links and widgets)
* @param <array> $linkParams - parameters which will be used to calicaulate the params
* @return <array> - array of link models in the format as below
* array('linktype'=>list of link models);
*/
public function getDetailViewLinks($linkParams) {
$linkTypes = array('DETAILVIEWBASIC','DETAILVIEW');
$moduleModel = $this->getModule();
$recordModel = $this->getRecord();
$moduleName = $moduleModel->getName();
$recordId = $recordModel->getId();
$detailViewLink = array();
$detailViewLinks[] = array(
'linktype' => 'DETAILVIEWBASIC',
'linklabel' => 'LBL_EDIT',
'linkurl' => $recordModel->getEditViewUrl(),
'linkicon' => ''
);
foreach ($detailViewLinks as $detailViewLink) {
$linkModelList['DETAILVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($detailViewLink);
}
$linkModelListDetails = Vtiger_Link_Model::getAllByType($moduleModel->getId(),$linkTypes,$linkParams);
$detailViewBasiclinks = $linkModelListDetails['DETAILVIEWBASIC'];
unset($linkModelListDetails['DETAILVIEWBASIC']);
$deletelinkModel = array(
'linktype' => 'DETAILVIEW',
'linklabel' => 'LBL_DELETE',
'linkurl' => 'javascript:Vtiger_Detail_Js.deleteRecord("'.$recordModel->getDeleteUrl().'")',
'linkicon' => ''
);
$linkModelList['DETAILVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($deletelinkModel);
if(!empty($detailViewBasiclinks)) {
foreach($detailViewBasiclinks as $linkModel) {
$linkModelList['DETAILVIEW'][] = $linkModel;
}
}
return $linkModelList;
}
示例13: getListViewMassActions
/**
* Function to get the list of Mass actions for the module
* @param <Array> $linkParams
* @return <Array> - Associative array of Link type to List of Vtiger_Link_Model instances for Mass Actions
*/
public function getListViewMassActions($linkParams)
{
$currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
$moduleModel = $this->getModule();
$linkTypes = array('LISTVIEWMASSACTION');
$links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
$massActionLinks = array();
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'EditView')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_EDIT', 'linkurl' => 'javascript:Vtiger_List_Js.triggerMassEdit("index.php?module=' . $moduleModel->get('name') . '&view=MassActionAjax&mode=showMassEditForm");', 'linkicon' => '');
}
if ($currentUserModel->hasModuleActionPermission($moduleModel->getId(), 'Delete')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_DELETE', 'linkurl' => 'javascript:Vtiger_List_Js.massDeleteRecords("index.php?module=' . $moduleModel->get('name') . '&action=MassDelete");', 'linkicon' => '');
}
$modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
if ($moduleModel->isCommentEnabled() && $modCommentsModel->isPermitted('EditView')) {
$massActionLinks[] = array('linktype' => 'LISTVIEWMASSACTION', 'linklabel' => 'LBL_ADD_COMMENT', 'linkurl' => 'index.php?module=' . $moduleModel->get('name') . '&view=MassActionAjax&mode=showAddCommentForm', 'linkicon' => '');
}
foreach ($massActionLinks as $massActionLink) {
$links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
}
return $links;
}
示例14: getSideBarLinks
/**
* Function returns quick links for the module
* @return <Array of Vtiger_Link_Model>
*/
public function getSideBarLinks($linkParams)
{
$request = new Vtiger_Request($_REQUEST, $_REQUEST);
$currentUserModel = Users_Record_Model::getCurrentUserModel();
//ini_set('display_errors',1);error_reporting(63);
$linkTypes = array('SIDEBARLINK', 'SIDEBARWIDGET');
$links = Vtiger_Link_Model::getAllByType($this->getId(), $linkTypes, $linkParams);
$quickLinks = array(array('linktype' => 'SIDEBARLINK', 'linklabel' => 'LBL_REPORTS', 'linkurl' => $this->getListViewUrl(), 'linkicon' => ''));
foreach ($quickLinks as $quickLink) {
$links['SIDEBARLINK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);
}
if ($currentUserModel->isAdminUser()) {
if ($request->get('view') == "IndexAjax") {
$quickS2Links = array('linktype' => "SIDEBARWIDGET", 'linklabel' => "LBL_SETTINGS", 'linkurl' => "index.php?module=ITS4YouReports&view=License", 'linkicon' => '');
$links['SIDEBARWIDGET'][] = Vtiger_Link_Model::getInstanceFromValues($quickS2Links);
} else {
$quickS2Links = array('linktype' => "SIDEBARWIDGET", 'linklabel' => "LBL_SETTINGS", 'linkurl' => "module=ITS4YouReports&view=IndexAjax&mode=showSettingsList&pview=" . $linkParams["ACTION"], 'linkicon' => '');
$links['SIDEBARWIDGET'][] = Vtiger_Link_Model::getInstanceFromValues($quickS2Links);
}
}
//echo "<pre><br><br><br><br><br><br><br><br><br><br>";
//print_r($links);echo "</pre>";
return $links;
}
示例15: getSideBarLinks
/**
* Function to get the Quick Links for the module
* @param <Array> $linkParams
* @return <Array> List of Vtiger_Link_Model instances
*/
public function getSideBarLinks($linkParams)
{
$linkTypes = array('SIDEBARLINK', 'SIDEBARWIDGET');
$links = Vtiger_Link_Model::getAllByType($this->getId(), $linkTypes, $linkParams);
$quickLinks = array(array('linktype' => 'SIDEBARLINK', 'linklabel' => 'LBL_RECORDS_LIST', 'linkurl' => $this->getListViewUrl(), 'linkicon' => ''));
foreach ($quickLinks as $quickLink) {
$links['SIDEBARLINK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);
}
$quickWidgets = array(array('linktype' => 'SIDEBARWIDGET', 'linklabel' => 'LBL_RECENTLY_MODIFIED', 'linkurl' => 'module=' . $this->get('name') . '&view=IndexAjax&mode=showActiveRecords', 'linkicon' => ''));
foreach ($quickWidgets as $quickWidget) {
$links['SIDEBARWIDGET'][] = Vtiger_Link_Model::getInstanceFromValues($quickWidget);
}
return $links;
}