Project

General

Profile

1
<?php
2

    
3
/**
4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19

    
20
/**
21
 * WbLink.php
22
 *
23
 * @category     Addons
24
 * @package      Addons_News
25
 * @copyright    Manuela v.d.Decken <manuela@isteam.de>
26
 * @author       Manuela v.d.Decken <manuela@isteam.de>
27
 * @license      http://www.gnu.org/licenses/gpl.html   GPL License
28
 * @version      0.0.1
29
 * @revision     $Revision: $
30
 * @link         $HeadURL: $
31
 * @lastmodified $Date: $
32
 * @since        File available since 04.11.2013
33
 * @description  This class implements an interface for i.e. the wblink-outputfilter
34
 *
35
 * @inherited WbDatabase $oDb
36
 * @inherited WbAdaptor  $oReg
37
 *
38
 */
39

    
40
class m_news_WbLink extends WbLinkAbstract
41
{
42
/* *** BEGIN define the environment of your addon! ************************************ */
43
/* (this section is a MUST and it MUST have all 8 consts defined!!)                     */
44
/**
45
 * name of the needed table
46
 * @description do NOT use the TablePrefix in this name!
47
 */
48
	const TABLE_NAME           = 'mod_news_posts';
49

    
50
/**
51
 * name of the field with the PageId
52
 */
53
	const FIELDNAME_PAGE_ID    = 'page_id';
54

    
55
/**
56
 * name of the field with the SectionId
57
 */
58
	const FIELDNAME_SECTION_ID = 'section_id';
59

    
60
/**
61
 * name of the field with the ItemId
62
 */
63
	const FIELDNAME_ITEM_ID    = 'post_id';
64

    
65
/**
66
 * name of the field with the needed link
67
 */
68
	const FIELDNAME_LINK       = 'link';
69

    
70
/**
71
 * name of the field with the needed title
72
 */
73
	const FIELDNAME_TITLE      = 'title';
74

    
75
/**
76
 * name of the field with the timestamp
77
 * @description define an empty string if no 'timestamp'-field is available or it's not needed!
78
 */
79
	const FIELDNAME_TIMESTAMP  = 'created_when';
80

    
81
/** name of the field with the active-flag
82
 * @description define an empty string if no 'active'-field is available or it's not needed!
83
 */
84
	const FIELDNAME_ACTIVE     = 'active';
85
/* *** END define the environment of your addon! ************************************** */
86

    
87
/**
88
 * makeLinkFromTag
89
 * @param type $aReplacement
90
 * @return string
91
 * @description this method is used by the output filter
92
 */
93
	public function makeLinkFromTag(array $aReplacement)
94
	{
95
/* *** Define here the full path where your links are based on! *********************** */
96

    
97
		$sBaseDir = $this->oReg->AppPath.$this->oReg->PagesDir;
98

    
99
/* *** Do NOT change the following request! ******************************************* */
100
		$sBaseDir = rtrim(str_replace('\\', '/', $sBaseDir), '/').'/';
101
		return $this->_makeLinkFromTag($sBaseDir, $aReplacement);
102
	}
103
/**
104
 * generateOptionsList
105
 * @return &array definition of a SelectBox
106
 * @description build a mulitdimensional Array with complete Option definitions for use in a Select Box
107
 */
108
	public function &generateOptionsList()
109
	{
110
		$aAddonItems =& $this->_executeListGeneration();
111
		return $aAddonItems;
112
	}
113
} // end of class m_news_WbLink
(2-2/34)