[ Index ] |
|
Code source de GeekLog 1.4.1 |
1 <?php 2 3 /* Reminder: always indent with 4 spaces (no tabs). */ 4 // +---------------------------------------------------------------------------+ 5 // | Geeklog 1.4 | 6 // +---------------------------------------------------------------------------+ 7 // | plugin.class.php | 8 // | | 9 // | Geeklog plugin class. | 10 // +---------------------------------------------------------------------------+ 11 // | Copyright (C) 2000-2006 by the following authors: | 12 // | | 13 // | Authors: Tony Bibbs, tony AT tonybibbs DOT com | 14 // +---------------------------------------------------------------------------+ 15 // | | 16 // | This program is free software; you can redistribute it and/or | 17 // | modify it under the terms of the GNU General Public License | 18 // | as published by the Free Software Foundation; either version 2 | 19 // | of the License, or (at your option) any later version. | 20 // | | 21 // | This program is distributed in the hope that it will be useful, | 22 // | but WITHOUT ANY WARRANTY; without even the implied warranty of | 23 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 24 // | GNU General Public License for more details. | 25 // | | 26 // | You should have received a copy of the GNU General Public License | 27 // | along with this program; if not, write to the Free Software Foundation, | 28 // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 29 // | | 30 // +---------------------------------------------------------------------------+ 31 // 32 // $Id: plugin.class.php,v 1.10 2006/07/09 13:45:54 dhaun Exp $ 33 34 /** 35 * This is a poorly thought out class that is used pretty much as a structure 36 * when we need to pass plugin data back and forth 37 * 38 * @author Tony Bibbs <tony AT tonybibbs DOT com> 39 * 40 */ 41 class Plugin { 42 43 // PRIVATE PROPERTIES 44 45 // PUBLIC PROPERTIES 46 var $adminlabel = ''; 47 var $adminurl = ''; 48 var $plugin_image = ''; 49 var $plugin_name = ''; 50 51 // Search properties 52 var $searchlabel = ''; 53 var $num_searchresults = 0; 54 var $searchheading = array(); 55 var $searchresults = array(); 56 var $num_itemssearched = 0; 57 var $num_searchheadings = 0; 58 /** 59 * @access private 60 * @var boolean 61 */ 62 var $_expandedSearchSupport = false; 63 64 // Submission properties 65 var $num_submissions = 0; 66 var $submissionlabel = ''; 67 var $submissionhelpfile = ''; 68 var $getsubmissionssql = ''; 69 var $submissionheading = array(); 70 71 72 // PUBLIC METHODS 73 74 /** 75 * Constructor 76 * 77 * This initializes the plugin 78 * 79 */ 80 function Plugin() 81 { 82 $this->reset(); 83 } 84 85 /** 86 * Resets the object 87 * 88 */ 89 function reset() 90 { 91 $this->adminlabel = ''; 92 $this->adminurl = ''; 93 $this->plugin_image = ''; 94 $this->num_submissions = 0; 95 $this->plugin_name = ''; 96 $this->searchlabel = ''; 97 $this->searchheading = array(); 98 $this->num_searchresults = 0; 99 $this->searchresults = array(); 100 $this->num_itemssearched = 0; 101 $this->num_searchheadings = 0; 102 $this->submissionlabel = ''; 103 $this->submissionhelpfile = ''; 104 $this->getsubmissionssql = ''; 105 $this->submissionheading = array(); 106 $this->supports_paging = false; 107 } 108 109 /** 110 * Adds a header that will be used in outputing search results for this 111 * plugin 112 * 113 * @param string $heading Heading label 114 * 115 */ 116 function addSearchHeading($heading) 117 { 118 $this->num_searchheadings = $this->num_searchheadings + 1; 119 $this->searchheading[$this->num_searchheadings] = $heading; 120 } 121 122 /** 123 * Adds a search result to the result array. 124 * 125 * @param string $result_string Holds coma delimited set of data 126 * 127 */ 128 function addSearchResult($result_string) 129 { 130 $this->searchresults[] = $result_string; 131 } 132 133 /** 134 * Hrm, can't remember what this does exactly 135 * 136 * @param string $heading string for heading 137 * 138 */ 139 function addSubmissionHeading($heading) 140 { 141 $this->submissionheading[$this->num_submissions] = $heading; 142 $this->num_submissions = $this->num_submissions + 1; 143 } 144 145 /** 146 * Sets whether or not the plugin supports expanded search 147 * results 148 * 149 * @author Tony Bibbs <tony AT geeklog DOT net> 150 * @access public 151 * @param boolean $switch True if expanded search is supported otherwise false 152 * 153 */ 154 function setExpandedSearchSupport($switch) 155 { 156 if (!is_bool($switch)) { 157 $switch = false; 158 } 159 160 $this->_expandedSearchSupport = $switch; 161 } 162 163 /** 164 * Returns if plugin supports expanded searches 165 * 166 * @author Tony Bibbs <tony AT geeklog DOT net> 167 * @access public 168 * @return boolean True if expanded search is supported otherwise false 169 * 170 */ 171 function supportsExpandedSearch() 172 { 173 return $this->_expandedSearchSupport; 174 } 175 } 176 177 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 12:27:40 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |