| [ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 #CMS - CMS Made Simple 3 #(c)2004 by Ted Kulp (wishy@users.sf.net) 4 #This project's homepage is: http://cmsmadesimple.sf.net 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 2 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 #You should have received a copy of the GNU General Public License 16 #along with this program; if not, write to the Free Software 17 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 # 19 #$Id: listtags.php 2772 2006-05-17 02:25:27Z wishy $ 20 21 $CMS_ADMIN_PAGE=1; 22 $CMS_LOAD_ALL_PLUGINS=1; 23 24 require_once ("../include.php"); 25 26 // function eventhandler_usertag_dropdown( $name, $selitem, $usertags ) 27 // { 28 // $text = '<select name="'.$name.'">'; 29 // foreach( $usertags as $key => $value ) 30 // { 31 // $text .= '<option value="'.$value.'"'; 32 // if( $selitem == $value ) 33 // { 34 // $text .= ' selected="selected"'; 35 // } 36 // $text .= '>'.$key; 37 // $text .= '</option>'; 38 // } 39 // $text .= '</select>'; 40 // return $text; 41 // } 42 43 $userid = get_userid(); 44 $access = check_permission($userid, "Modify Events"); 45 46 check_login(); 47 48 // here we'll handle setting $action based on _POST['action'] 49 $action = ""; 50 $module = ""; 51 $event = ""; 52 $modulefilter = ''; 53 if( isset( $_GET['action'] ) && $_GET['action'] != '' ) 54 { 55 $action = $_GET['action']; 56 } 57 if( isset( $_GET['module'] ) && $_GET['module'] != '' ) 58 { 59 $module = $_GET['module']; 60 } 61 if( isset( $_GET['event'] ) && $_GET['event'] != '' ) 62 { 63 $event = $_GET['event']; 64 } 65 if( isset( $_GET['modulefilter'] ) && $_GET['modulefilter'] != '' ) 66 { 67 $modulefilter = $_GET['modulefilter']; 68 } 69 70 // display the page 71 include_once ("header.php"); 72 73 $editImg = $themeObject->DisplayImage('icons/system/edit.gif', lang('edit'),'','','systemicon'); 74 $infoImg = $themeObject->DisplayImage('icons/system/info.gif', lang('help'),'','','systemicon'); 75 76 echo '<div class="pagecontainer">'; 77 echo '<div class="pageoverflow">'; 78 echo $themeObject->ShowHeader('eventhandlers'); 79 80 switch( $action ) 81 { 82 case 'showeventhelp': 83 { 84 if ($module == 'Core') 85 $text = Events::GetEventHelp($event); 86 else 87 $text = $gCms->modules[$module]['object']->GetEventHelp( $event ); 88 echo "<h3>$event</h3>"; 89 if( $text == "" ) 90 { 91 echo "No text returned"; 92 } 93 else 94 { 95 echo $text; 96 } 97 break; 98 } 99 100 default: 101 { 102 $events = Events::ListEvents(); 103 104 echo '<br /><p><form action="eventhandlers.php" method="get">'.lang('filterbymodule').': <select name="modulefilter">' . "\n"; 105 echo '<option value="">'.lang('showall').'</option>'; 106 $modlist = array(); 107 if( is_array($events) ) 108 { 109 foreach( $events as $oneevent ) 110 { 111 if (!in_array($oneevent['originator'], $modlist)) 112 $modlist[] = $oneevent['originator']; 113 } 114 } 115 if (count($modlist) > 0) 116 { 117 foreach($modlist as $onemod) 118 { 119 echo '<option value="'.$onemod.'"'; 120 if ($onemod == $modulefilter) 121 echo ' selected="selected"'; 122 echo '>'.$onemod.'</option>'; 123 } 124 } 125 echo "</select> <input type=\"submit\" value=\"submit\" /></form></p>\n\n"; 126 127 echo "<table cellspacing=\"0\" class=\"pagetable\">\n"; 128 echo "<thead>\n"; 129 echo " <tr>\n"; 130 echo " <th>".lang('originator')."</th>\n"; 131 echo " <th>".lang('event')."</th>\n"; 132 echo " <th width='50%'>".lang('description')."</th>\n"; 133 echo " <th class=\"pageicon\"> </th>\n"; 134 echo " <th class=\"pageicon\"> </th>\n"; 135 echo " </tr>\n"; 136 echo "</thead>\n"; 137 echo "<tbody>\n"; 138 139 if( is_array($events) ) 140 { 141 $curclass = 'row1'; 142 foreach( $events as $oneevent ) 143 { 144 if ($modulefilter == '' || $modulefilter == $oneevent['originator']) 145 { 146 echo "<tr class=\"".$curclass."\" onmouseover=\"this.className='".$curclass.'hover'."';\" onmouseout=\"this.className='".$curclass."';\">\n"; 147 148 $desctext = ''; 149 if ($oneevent['originator'] == 'Core') { 150 $desctext = Events::GetEventDescription($oneevent['event_name']); 151 echo " <td>".lang('core')."</td>\n"; 152 } 153 else if (isset($gCms->modules[$oneevent['originator']])) { 154 $objinstance =& $gCms->modules[$oneevent['originator']]['object']; 155 $desctext = $objinstance->GetEventDescription($oneevent['event_name']); 156 echo " <td>".$objinstance->GetFriendlyName()."</td>\n"; 157 } 158 echo " <td>"; 159 if ($access) 160 { 161 echo "<a href=\"editevent.php?action=edit&module=".$oneevent['originator']."&event=".$oneevent['event_name']."\">"; 162 } 163 echo $oneevent['event_name']; 164 if ($access) 165 { 166 echo "</a>"; 167 } 168 echo "</td>\n"; 169 echo " <td>".$desctext."</td>\n"; 170 echo " <td class=\"icons_wide\"><a href=\"eventhandlers.php?action=showeventhelp&module=".$oneevent['originator']."&event=".$oneevent['event_name']."\">".$infoImg."</a></td>\n"; 171 if ($access) 172 { 173 echo " <td class=\"icons_wide\"><a href=\"editevent.php?action=edit&module=".$oneevent['originator']."&event=".$oneevent['event_name']."\">".$editImg."</a></td>\n"; 174 } 175 echo " </tr>\n"; 176 ($curclass=="row1"?$curclass="row2":$curclass="row1"); 177 } 178 } 179 } 180 181 echo "</tbody>\n"; 182 echo "</table>\n"; 183 } // default action 184 185 } // switch 186 187 188 echo "<p class=\"pageback\"><a class=\"pageback\" href=\"".$themeObject->BackUrl()."\">« ".lang('back')."</a></p>\n"; 189 190 echo "</div>\n"; 191 echo "</div>\n"; 192 193 include_once ("footer.php"); 194 195 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |